Edit File by line
/home/barbar84/www/wp-inclu.../js/dist
File: components.js
for (var _i2 = 0, _Object$entries2 = Object.entries(bindings); _i2 < _Object$entries2.length; _i2++) {
[16000] Fix | Delete
var _Object$entries2$_i = _Object$entries2[_i2],
[16001] Fix | Delete
event = _Object$entries2$_i[0],
[16002] Fix | Delete
fns = _Object$entries2$_i[1];
[16003] Fix | Delete
var fnsArray = Array.isArray(fns) ? fns : [fns];
[16004] Fix | Delete
var key = event + captureString;
[16005] Fix | Delete
props[key] = chainFns.apply(void 0, fnsArray);
[16006] Fix | Delete
}
[16007] Fix | Delete
[16008] Fix | Delete
return props;
[16009] Fix | Delete
}
[16010] Fix | Delete
[16011] Fix | Delete
function takeAll(array) {
[16012] Fix | Delete
if (array === void 0) {
[16013] Fix | Delete
array = [];
[16014] Fix | Delete
}
[16015] Fix | Delete
[16016] Fix | Delete
return array.splice(0, array.length);
[16017] Fix | Delete
}
[16018] Fix | Delete
[16019] Fix | Delete
function getDomTargetFromConfig(_ref5) {
[16020] Fix | Delete
var domTarget = _ref5.domTarget;
[16021] Fix | Delete
return domTarget && 'current' in domTarget ? domTarget.current : domTarget;
[16022] Fix | Delete
}
[16023] Fix | Delete
/**
[16024] Fix | Delete
* bindings is an object which keys match ReactEventHandlerKeys.
[16025] Fix | Delete
* Since a recognizer might want to bind a handler function to an event key already used by a previously
[16026] Fix | Delete
* added recognizer, we need to make sure that each event key is an array of all the functions mapped for
[16027] Fix | Delete
* that key.
[16028] Fix | Delete
*/
[16029] Fix | Delete
[16030] Fix | Delete
[16031] Fix | Delete
function addBindings(bindings, name, fn) {
[16032] Fix | Delete
if (!bindings[name]) bindings[name] = [];
[16033] Fix | Delete
bindings[name].push(fn);
[16034] Fix | Delete
}
[16035] Fix | Delete
[16036] Fix | Delete
function addListeners(el, listeners, options) {
[16037] Fix | Delete
if (listeners === void 0) {
[16038] Fix | Delete
listeners = [];
[16039] Fix | Delete
}
[16040] Fix | Delete
[16041] Fix | Delete
if (options === void 0) {
[16042] Fix | Delete
options = {};
[16043] Fix | Delete
}
[16044] Fix | Delete
[16045] Fix | Delete
for (var _iterator2 = _createForOfIteratorHelperLoose(listeners), _step2; !(_step2 = _iterator2()).done;) {
[16046] Fix | Delete
var _step2$value = _step2.value,
[16047] Fix | Delete
eventName = _step2$value[0],
[16048] Fix | Delete
eventHandler = _step2$value[1];
[16049] Fix | Delete
el.addEventListener(eventName, eventHandler, options);
[16050] Fix | Delete
}
[16051] Fix | Delete
}
[16052] Fix | Delete
[16053] Fix | Delete
function removeListeners(el, listeners, options) {
[16054] Fix | Delete
if (listeners === void 0) {
[16055] Fix | Delete
listeners = [];
[16056] Fix | Delete
}
[16057] Fix | Delete
[16058] Fix | Delete
if (options === void 0) {
[16059] Fix | Delete
options = {};
[16060] Fix | Delete
}
[16061] Fix | Delete
[16062] Fix | Delete
for (var _iterator3 = _createForOfIteratorHelperLoose(listeners), _step3; !(_step3 = _iterator3()).done;) {
[16063] Fix | Delete
var _step3$value = _step3.value,
[16064] Fix | Delete
eventName = _step3$value[0],
[16065] Fix | Delete
eventHandler = _step3$value[1];
[16066] Fix | Delete
el.removeEventListener(eventName, eventHandler, options);
[16067] Fix | Delete
}
[16068] Fix | Delete
}
[16069] Fix | Delete
[16070] Fix | Delete
/* eslint-disable react-hooks/exhaustive-deps */
[16071] Fix | Delete
/**
[16072] Fix | Delete
* Utility hook called by all gesture hooks and that will be responsible for the internals.
[16073] Fix | Delete
*
[16074] Fix | Delete
* @param handlers
[16075] Fix | Delete
* @param classes
[16076] Fix | Delete
* @param config
[16077] Fix | Delete
* @param nativeHandlers - native handlers such as onClick, onMouseDown, etc.
[16078] Fix | Delete
*/
[16079] Fix | Delete
[16080] Fix | Delete
function useRecognizers(handlers, config, nativeHandlers) {
[16081] Fix | Delete
if (nativeHandlers === void 0) {
[16082] Fix | Delete
nativeHandlers = {};
[16083] Fix | Delete
}
[16084] Fix | Delete
[16085] Fix | Delete
var classes = resolveClasses(handlers);
[16086] Fix | Delete
var controller = external_React_default.a.useMemo(function () {
[16087] Fix | Delete
return new Controller(classes);
[16088] Fix | Delete
}, []);
[16089] Fix | Delete
controller.config = config;
[16090] Fix | Delete
controller.handlers = handlers;
[16091] Fix | Delete
controller.nativeRefs = nativeHandlers;
[16092] Fix | Delete
external_React_default.a.useEffect(controller.effect, []); // @ts-ignore
[16093] Fix | Delete
[16094] Fix | Delete
if (controller.config.domTarget) return deprecationNoticeForDomTarget; // @ts-ignore
[16095] Fix | Delete
[16096] Fix | Delete
return controller.bind;
[16097] Fix | Delete
}
[16098] Fix | Delete
[16099] Fix | Delete
function deprecationNoticeForDomTarget() {
[16100] Fix | Delete
if (false) {}
[16101] Fix | Delete
}
[16102] Fix | Delete
[16103] Fix | Delete
function resolveClasses(internalHandlers) {
[16104] Fix | Delete
var classes = new Set();
[16105] Fix | Delete
if (internalHandlers.drag) classes.add(RecognizersMap.get('drag'));
[16106] Fix | Delete
if (internalHandlers.wheel) classes.add(RecognizersMap.get('wheel'));
[16107] Fix | Delete
if (internalHandlers.scroll) classes.add(RecognizersMap.get('scroll'));
[16108] Fix | Delete
if (internalHandlers.move) classes.add(RecognizersMap.get('move'));
[16109] Fix | Delete
if (internalHandlers.pinch) classes.add(RecognizersMap.get('pinch'));
[16110] Fix | Delete
if (internalHandlers.hover) classes.add(RecognizersMap.get('hover'));
[16111] Fix | Delete
return classes;
[16112] Fix | Delete
}
[16113] Fix | Delete
[16114] Fix | Delete
/**
[16115] Fix | Delete
* @private
[16116] Fix | Delete
* Abstract class for coordinates-based gesture recongizers
[16117] Fix | Delete
*/
[16118] Fix | Delete
[16119] Fix | Delete
var CoordinatesRecognizer = /*#__PURE__*/function (_Recognizer) {
[16120] Fix | Delete
_inheritsLoose(CoordinatesRecognizer, _Recognizer);
[16121] Fix | Delete
[16122] Fix | Delete
function CoordinatesRecognizer() {
[16123] Fix | Delete
return _Recognizer.apply(this, arguments) || this;
[16124] Fix | Delete
}
[16125] Fix | Delete
[16126] Fix | Delete
var _proto = CoordinatesRecognizer.prototype;
[16127] Fix | Delete
[16128] Fix | Delete
/**
[16129] Fix | Delete
* Returns the real movement (without taking intentionality into account)
[16130] Fix | Delete
*/
[16131] Fix | Delete
_proto.getInternalMovement = function getInternalMovement(values, state) {
[16132] Fix | Delete
return subV(values, state.initial);
[16133] Fix | Delete
}
[16134] Fix | Delete
/**
[16135] Fix | Delete
* In coordinates-based gesture, this function will detect the first intentional axis,
[16136] Fix | Delete
* lock the gesture axis if lockDirection is specified in the config, block the gesture
[16137] Fix | Delete
* if the first intentional axis doesn't match the specified axis in config.
[16138] Fix | Delete
*/
[16139] Fix | Delete
;
[16140] Fix | Delete
[16141] Fix | Delete
_proto.checkIntentionality = function checkIntentionality(_intentional, _movement) {
[16142] Fix | Delete
if (_intentional[0] === false && _intentional[1] === false) {
[16143] Fix | Delete
return {
[16144] Fix | Delete
_intentional: _intentional,
[16145] Fix | Delete
axis: this.state.axis
[16146] Fix | Delete
};
[16147] Fix | Delete
}
[16148] Fix | Delete
[16149] Fix | Delete
var _movement$map = _movement.map(Math.abs),
[16150] Fix | Delete
absX = _movement$map[0],
[16151] Fix | Delete
absY = _movement$map[1];
[16152] Fix | Delete
[16153] Fix | Delete
var axis = this.state.axis || (absX > absY ? 'x' : absX < absY ? 'y' : undefined);
[16154] Fix | Delete
if (!this.config.axis && !this.config.lockDirection) return {
[16155] Fix | Delete
_intentional: _intentional,
[16156] Fix | Delete
_blocked: false,
[16157] Fix | Delete
axis: axis
[16158] Fix | Delete
};
[16159] Fix | Delete
if (!axis) return {
[16160] Fix | Delete
_intentional: [false, false],
[16161] Fix | Delete
_blocked: false,
[16162] Fix | Delete
axis: axis
[16163] Fix | Delete
};
[16164] Fix | Delete
if (!!this.config.axis && axis !== this.config.axis) return {
[16165] Fix | Delete
_intentional: _intentional,
[16166] Fix | Delete
_blocked: true,
[16167] Fix | Delete
axis: axis
[16168] Fix | Delete
};
[16169] Fix | Delete
_intentional[axis === 'x' ? 1 : 0] = false;
[16170] Fix | Delete
return {
[16171] Fix | Delete
_intentional: _intentional,
[16172] Fix | Delete
_blocked: false,
[16173] Fix | Delete
axis: axis
[16174] Fix | Delete
};
[16175] Fix | Delete
};
[16176] Fix | Delete
[16177] Fix | Delete
_proto.getKinematics = function getKinematics(values, event) {
[16178] Fix | Delete
var state = this.getMovement(values);
[16179] Fix | Delete
[16180] Fix | Delete
if (!state._blocked) {
[16181] Fix | Delete
var dt = event.timeStamp - this.state.timeStamp;
[16182] Fix | Delete
Object.assign(state, calculateAllKinematics(state.movement, state.delta, dt));
[16183] Fix | Delete
}
[16184] Fix | Delete
[16185] Fix | Delete
return state;
[16186] Fix | Delete
};
[16187] Fix | Delete
[16188] Fix | Delete
_proto.mapStateValues = function mapStateValues(state) {
[16189] Fix | Delete
return {
[16190] Fix | Delete
xy: state.values,
[16191] Fix | Delete
vxvy: state.velocities
[16192] Fix | Delete
};
[16193] Fix | Delete
};
[16194] Fix | Delete
[16195] Fix | Delete
return CoordinatesRecognizer;
[16196] Fix | Delete
}(Recognizer);
[16197] Fix | Delete
[16198] Fix | Delete
var TAP_DISTANCE_THRESHOLD = 3;
[16199] Fix | Delete
[16200] Fix | Delete
function persistEvent(event) {
[16201] Fix | Delete
'persist' in event && typeof event.persist === 'function' && event.persist();
[16202] Fix | Delete
}
[16203] Fix | Delete
[16204] Fix | Delete
var DragRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
[16205] Fix | Delete
_inheritsLoose(DragRecognizer, _CoordinatesRecognize);
[16206] Fix | Delete
[16207] Fix | Delete
function DragRecognizer() {
[16208] Fix | Delete
var _this;
[16209] Fix | Delete
[16210] Fix | Delete
_this = _CoordinatesRecognize.apply(this, arguments) || this;
[16211] Fix | Delete
_this.ingKey = 'dragging';
[16212] Fix | Delete
_this.stateKey = 'drag'; // TODO add back when setPointerCapture is widely wupported
[16213] Fix | Delete
// https://caniuse.com/#search=setPointerCapture
[16214] Fix | Delete
[16215] Fix | Delete
_this.setPointerCapture = function (event) {
[16216] Fix | Delete
// don't perform pointere capture when user wants to use touch events or
[16217] Fix | Delete
// when a pointerLockElement exists as this would throw an error
[16218] Fix | Delete
if (_this.config.useTouch || document.pointerLockElement) return;
[16219] Fix | Delete
var target = event.target,
[16220] Fix | Delete
pointerId = event.pointerId;
[16221] Fix | Delete
[16222] Fix | Delete
if (target && 'setPointerCapture' in target) {
[16223] Fix | Delete
// this would work in the DOM but doesn't with react three fiber
[16224] Fix | Delete
// target.addEventListener('pointermove', this.onDragChange, this.controller.config.eventOptions)
[16225] Fix | Delete
// @ts-expect-error
[16226] Fix | Delete
target.setPointerCapture(pointerId);
[16227] Fix | Delete
}
[16228] Fix | Delete
[16229] Fix | Delete
_this.updateGestureState({
[16230] Fix | Delete
_dragTarget: target,
[16231] Fix | Delete
_dragPointerId: pointerId
[16232] Fix | Delete
});
[16233] Fix | Delete
};
[16234] Fix | Delete
[16235] Fix | Delete
_this.releasePointerCapture = function () {
[16236] Fix | Delete
if (_this.config.useTouch || document.pointerLockElement) return;
[16237] Fix | Delete
var _this$state = _this.state,
[16238] Fix | Delete
_dragTarget = _this$state._dragTarget,
[16239] Fix | Delete
_dragPointerId = _this$state._dragPointerId;
[16240] Fix | Delete
[16241] Fix | Delete
if (_dragPointerId && _dragTarget && 'releasePointerCapture' in _dragTarget) {
[16242] Fix | Delete
// this would work in the DOM but doesn't with react three fiber
[16243] Fix | Delete
// target.removeEventListener('pointermove', this.onDragChange, this.controller.config.eventOptions)
[16244] Fix | Delete
if (!('hasPointerCapture' in _dragTarget) || _dragTarget.hasPointerCapture(_dragPointerId)) try {
[16245] Fix | Delete
_dragTarget.releasePointerCapture(_dragPointerId);
[16246] Fix | Delete
} catch (e) {}
[16247] Fix | Delete
}
[16248] Fix | Delete
};
[16249] Fix | Delete
[16250] Fix | Delete
_this.preventScroll = function (event) {
[16251] Fix | Delete
if (_this.state._dragPreventScroll && event.cancelable) {
[16252] Fix | Delete
event.preventDefault();
[16253] Fix | Delete
}
[16254] Fix | Delete
};
[16255] Fix | Delete
[16256] Fix | Delete
_this.getEventId = function (event) {
[16257] Fix | Delete
if (_this.config.useTouch) return event.changedTouches[0].identifier;
[16258] Fix | Delete
return event.pointerId;
[16259] Fix | Delete
};
[16260] Fix | Delete
[16261] Fix | Delete
_this.isValidEvent = function (event) {
[16262] Fix | Delete
// if we were using pointer events only event.isPrimary === 1 would suffice
[16263] Fix | Delete
return _this.state._pointerId === _this.getEventId(event);
[16264] Fix | Delete
};
[16265] Fix | Delete
[16266] Fix | Delete
_this.shouldPreventWindowScrollY = _this.config.experimental_preventWindowScrollY && _this.controller.supportsTouchEvents;
[16267] Fix | Delete
[16268] Fix | Delete
_this.setUpWindowScrollDetection = function (event) {
[16269] Fix | Delete
persistEvent(event); // we add window listeners that will prevent the scroll when the user has started dragging
[16270] Fix | Delete
[16271] Fix | Delete
updateWindowListeners(_this.controller, _this.stateKey, [['touchmove', _this.preventScroll], ['touchend', _this.clean.bind(_assertThisInitialized(_this))], ['touchcancel', _this.clean.bind(_assertThisInitialized(_this))]], {
[16272] Fix | Delete
passive: false
[16273] Fix | Delete
});
[16274] Fix | Delete
[16275] Fix | Delete
_this.setTimeout(_this.startDrag.bind(_assertThisInitialized(_this)), 250, event);
[16276] Fix | Delete
};
[16277] Fix | Delete
[16278] Fix | Delete
_this.setUpDelayedDragTrigger = function (event) {
[16279] Fix | Delete
_this.state._dragDelayed = true;
[16280] Fix | Delete
persistEvent(event);
[16281] Fix | Delete
[16282] Fix | Delete
_this.setTimeout(_this.startDrag.bind(_assertThisInitialized(_this)), _this.config.delay, event);
[16283] Fix | Delete
};
[16284] Fix | Delete
[16285] Fix | Delete
_this.setStartState = function (event) {
[16286] Fix | Delete
var values = getPointerEventValues(event, _this.transform);
[16287] Fix | Delete
[16288] Fix | Delete
_this.updateSharedState(getGenericEventData(event));
[16289] Fix | Delete
[16290] Fix | Delete
_this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true), {
[16291] Fix | Delete
_pointerId: _this.getEventId(event)
[16292] Fix | Delete
}));
[16293] Fix | Delete
[16294] Fix | Delete
_this.updateGestureState(_this.getMovement(values));
[16295] Fix | Delete
};
[16296] Fix | Delete
[16297] Fix | Delete
_this.onDragStart = function (event) {
[16298] Fix | Delete
addEventIds(_this.controller, event);
[16299] Fix | Delete
if (!_this.enabled || _this.state._active) return;
[16300] Fix | Delete
[16301] Fix | Delete
_this.setStartState(event);
[16302] Fix | Delete
[16303] Fix | Delete
_this.setPointerCapture(event);
[16304] Fix | Delete
[16305] Fix | Delete
if (_this.shouldPreventWindowScrollY) _this.setUpWindowScrollDetection(event);else if (_this.config.delay > 0) _this.setUpDelayedDragTrigger(event);else _this.startDrag(event, true); // we pass the values to the startDrag event
[16306] Fix | Delete
};
[16307] Fix | Delete
[16308] Fix | Delete
_this.onDragChange = function (event) {
[16309] Fix | Delete
if ( // if the gesture was canceled or
[16310] Fix | Delete
_this.state.canceled || // if onDragStart wasn't fired or
[16311] Fix | Delete
!_this.state._active || // if the event pointerId doesn't match the one that initiated the drag
[16312] Fix | Delete
!_this.isValidEvent(event) || // if the event has the same timestamp as the previous event
[16313] Fix | Delete
// note that checking type equality is ONLY for tests ¯\_(ツ)_/¯
[16314] Fix | Delete
_this.state._lastEventType === event.type && event.timeStamp === _this.state.timeStamp) return;
[16315] Fix | Delete
var values;
[16316] Fix | Delete
[16317] Fix | Delete
if (document.pointerLockElement) {
[16318] Fix | Delete
var movementX = event.movementX,
[16319] Fix | Delete
movementY = event.movementY;
[16320] Fix | Delete
values = addV(_this.transform([movementX, movementY]), _this.state.values);
[16321] Fix | Delete
} else values = getPointerEventValues(event, _this.transform);
[16322] Fix | Delete
[16323] Fix | Delete
var kinematics = _this.getKinematics(values, event); // if startDrag hasn't fired
[16324] Fix | Delete
[16325] Fix | Delete
[16326] Fix | Delete
if (!_this.state._dragStarted) {
[16327] Fix | Delete
// If the gesture isn't active then respond to the event only if
[16328] Fix | Delete
// it's been delayed via the `delay` option, in which case start
[16329] Fix | Delete
// the gesture immediately.
[16330] Fix | Delete
if (_this.state._dragDelayed) {
[16331] Fix | Delete
_this.startDrag(event);
[16332] Fix | Delete
[16333] Fix | Delete
return;
[16334] Fix | Delete
} // if the user wants to prevent vertical window scroll when user starts dragging
[16335] Fix | Delete
[16336] Fix | Delete
[16337] Fix | Delete
if (_this.shouldPreventWindowScrollY) {
[16338] Fix | Delete
if (!_this.state._dragPreventScroll && kinematics.axis) {
[16339] Fix | Delete
// if the user is dragging horizontally then we should allow the drag
[16340] Fix | Delete
if (kinematics.axis === 'x') {
[16341] Fix | Delete
_this.startDrag(event);
[16342] Fix | Delete
} else {
[16343] Fix | Delete
_this.state._active = false;
[16344] Fix | Delete
return;
[16345] Fix | Delete
}
[16346] Fix | Delete
} else return;
[16347] Fix | Delete
} else return;
[16348] Fix | Delete
}
[16349] Fix | Delete
[16350] Fix | Delete
var genericEventData = getGenericEventData(event);
[16351] Fix | Delete
[16352] Fix | Delete
_this.updateSharedState(genericEventData);
[16353] Fix | Delete
[16354] Fix | Delete
var genericPayload = getGenericPayload(_assertThisInitialized(_this), event); // This verifies if the drag can be assimilated to a tap by checking
[16355] Fix | Delete
// if the real distance of the drag (ie not accounting for the threshold) is
[16356] Fix | Delete
// greater than the TAP_DISTANCE_THRESHOLD.
[16357] Fix | Delete
[16358] Fix | Delete
var realDistance = calculateDistance(kinematics._movement);
[16359] Fix | Delete
var _dragIsTap = _this.state._dragIsTap;
[16360] Fix | Delete
if (_dragIsTap && realDistance >= TAP_DISTANCE_THRESHOLD) _dragIsTap = false;
[16361] Fix | Delete
[16362] Fix | Delete
_this.updateGestureState(_extends({}, genericPayload, kinematics, {
[16363] Fix | Delete
_dragIsTap: _dragIsTap
[16364] Fix | Delete
}));
[16365] Fix | Delete
[16366] Fix | Delete
_this.fireGestureHandler();
[16367] Fix | Delete
};
[16368] Fix | Delete
[16369] Fix | Delete
_this.onDragEnd = function (event) {
[16370] Fix | Delete
removeEventIds(_this.controller, event); // if the event pointerId doesn't match the one that initiated the drag
[16371] Fix | Delete
// we don't want to end the drag
[16372] Fix | Delete
[16373] Fix | Delete
if (!_this.isValidEvent(event)) return;
[16374] Fix | Delete
[16375] Fix | Delete
_this.clean(); // if the gesture is no longer active (ie canceled)
[16376] Fix | Delete
// don't do anything
[16377] Fix | Delete
[16378] Fix | Delete
[16379] Fix | Delete
if (!_this.state._active) return;
[16380] Fix | Delete
_this.state._active = false;
[16381] Fix | Delete
var tap = _this.state._dragIsTap;
[16382] Fix | Delete
var _this$state$velocitie = _this.state.velocities,
[16383] Fix | Delete
vx = _this$state$velocitie[0],
[16384] Fix | Delete
vy = _this$state$velocitie[1];
[16385] Fix | Delete
var _this$state$movement = _this.state.movement,
[16386] Fix | Delete
mx = _this$state$movement[0],
[16387] Fix | Delete
my = _this$state$movement[1];
[16388] Fix | Delete
var _this$state$_intentio = _this.state._intentional,
[16389] Fix | Delete
ix = _this$state$_intentio[0],
[16390] Fix | Delete
iy = _this$state$_intentio[1];
[16391] Fix | Delete
var _this$config$swipeVel = _this.config.swipeVelocity,
[16392] Fix | Delete
svx = _this$config$swipeVel[0],
[16393] Fix | Delete
svy = _this$config$swipeVel[1];
[16394] Fix | Delete
var _this$config$swipeDis = _this.config.swipeDistance,
[16395] Fix | Delete
sx = _this$config$swipeDis[0],
[16396] Fix | Delete
sy = _this$config$swipeDis[1];
[16397] Fix | Delete
var sd = _this.config.swipeDuration;
[16398] Fix | Delete
[16399] Fix | Delete
var endState = _extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getMovement(_this.state.values));
[16400] Fix | Delete
[16401] Fix | Delete
var swipe = [0, 0];
[16402] Fix | Delete
[16403] Fix | Delete
if (endState.elapsedTime < sd) {
[16404] Fix | Delete
if (ix !== false && Math.abs(vx) > svx && Math.abs(mx) > sx) swipe[0] = sign(vx);
[16405] Fix | Delete
if (iy !== false && Math.abs(vy) > svy && Math.abs(my) > sy) swipe[1] = sign(vy);
[16406] Fix | Delete
}
[16407] Fix | Delete
[16408] Fix | Delete
_this.updateSharedState({
[16409] Fix | Delete
buttons: 0
[16410] Fix | Delete
});
[16411] Fix | Delete
[16412] Fix | Delete
_this.updateGestureState(_extends({}, endState, {
[16413] Fix | Delete
tap: tap,
[16414] Fix | Delete
swipe: swipe
[16415] Fix | Delete
}));
[16416] Fix | Delete
[16417] Fix | Delete
_this.fireGestureHandler(_this.config.filterTaps && tap === true);
[16418] Fix | Delete
};
[16419] Fix | Delete
[16420] Fix | Delete
_this.clean = function () {
[16421] Fix | Delete
_CoordinatesRecognize.prototype.clean.call(_assertThisInitialized(_this));
[16422] Fix | Delete
[16423] Fix | Delete
_this.state._dragStarted = false;
[16424] Fix | Delete
[16425] Fix | Delete
_this.releasePointerCapture();
[16426] Fix | Delete
[16427] Fix | Delete
clearWindowListeners(_this.controller, _this.stateKey);
[16428] Fix | Delete
};
[16429] Fix | Delete
[16430] Fix | Delete
_this.onCancel = function () {
[16431] Fix | Delete
if (_this.state.canceled) return;
[16432] Fix | Delete
[16433] Fix | Delete
_this.updateGestureState({
[16434] Fix | Delete
canceled: true,
[16435] Fix | Delete
_active: false
[16436] Fix | Delete
});
[16437] Fix | Delete
[16438] Fix | Delete
_this.updateSharedState({
[16439] Fix | Delete
buttons: 0
[16440] Fix | Delete
});
[16441] Fix | Delete
[16442] Fix | Delete
setTimeout(function () {
[16443] Fix | Delete
return _this.fireGestureHandler();
[16444] Fix | Delete
}, 0);
[16445] Fix | Delete
};
[16446] Fix | Delete
[16447] Fix | Delete
_this.onClick = function (event) {
[16448] Fix | Delete
if (!_this.state._dragIsTap) event.stopPropagation();
[16449] Fix | Delete
};
[16450] Fix | Delete
[16451] Fix | Delete
return _this;
[16452] Fix | Delete
}
[16453] Fix | Delete
[16454] Fix | Delete
var _proto = DragRecognizer.prototype;
[16455] Fix | Delete
[16456] Fix | Delete
_proto.startDrag = function startDrag(event, onDragIsStart) {
[16457] Fix | Delete
if (onDragIsStart === void 0) {
[16458] Fix | Delete
onDragIsStart = false;
[16459] Fix | Delete
}
[16460] Fix | Delete
[16461] Fix | Delete
// startDrag can happen after a timeout, so we need to check if the gesture is still active
[16462] Fix | Delete
// as the user might have lift up the pointer in between.
[16463] Fix | Delete
if ( // if the gesture isn't active (probably means)
[16464] Fix | Delete
!this.state._active || // if the drag has already started we should ignore subsequent attempts
[16465] Fix | Delete
this.state._dragStarted) return;
[16466] Fix | Delete
if (!onDragIsStart) this.setStartState(event);
[16467] Fix | Delete
this.updateGestureState({
[16468] Fix | Delete
_dragStarted: true,
[16469] Fix | Delete
_dragPreventScroll: true,
[16470] Fix | Delete
cancel: this.onCancel
[16471] Fix | Delete
});
[16472] Fix | Delete
this.clearTimeout();
[16473] Fix | Delete
this.fireGestureHandler();
[16474] Fix | Delete
};
[16475] Fix | Delete
[16476] Fix | Delete
_proto.addBindings = function addBindings$1(bindings) {
[16477] Fix | Delete
if (this.config.useTouch) {
[16478] Fix | Delete
addBindings(bindings, 'onTouchStart', this.onDragStart);
[16479] Fix | Delete
[16480] Fix | Delete
addBindings(bindings, 'onTouchMove', this.onDragChange); // this is needed for react-three-fiber
[16481] Fix | Delete
[16482] Fix | Delete
[16483] Fix | Delete
addBindings(bindings, 'onTouchEnd', this.onDragEnd);
[16484] Fix | Delete
[16485] Fix | Delete
addBindings(bindings, 'onTouchCancel', this.onDragEnd);
[16486] Fix | Delete
} else {
[16487] Fix | Delete
addBindings(bindings, 'onPointerDown', this.onDragStart);
[16488] Fix | Delete
[16489] Fix | Delete
addBindings(bindings, 'onPointerMove', this.onDragChange); // this is needed for react-three-fiber
[16490] Fix | Delete
[16491] Fix | Delete
[16492] Fix | Delete
addBindings(bindings, 'onPointerUp', this.onDragEnd);
[16493] Fix | Delete
[16494] Fix | Delete
addBindings(bindings, 'onPointerCancel', this.onDragEnd);
[16495] Fix | Delete
}
[16496] Fix | Delete
[16497] Fix | Delete
if (this.config.filterTaps) {
[16498] Fix | Delete
var handler = this.controller.config.eventOptions.capture ? 'onClick' : 'onClickCapture';
[16499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function