}, buildPinchConfig.current(config));
var WheelRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
_inheritsLoose(WheelRecognizer, _CoordinatesRecognize);
function WheelRecognizer() {
_this = _CoordinatesRecognize.apply(this, arguments) || this;
_this.ingKey = 'wheeling';
_this.stateKey = 'wheel';
_this.handleEvent = function (event) {
if (event.ctrlKey && 'pinch' in _this.controller.handlers) return;
if (!_this.enabled) return;
_this.setTimeout(_this.onEnd);
_this.updateSharedState(getGenericEventData(event));
var values = addV(getWheelEventValues(event, _this.transform), _this.state.values);
if (!_this.state._active) {
_this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true)));
var movement = _this.getMovement(values);
var geometry = calculateAllGeometry(movement.delta);
_this.updateGestureState(movement);
_this.updateGestureState(geometry);
_this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event)));
_this.fireGestureHandler();
_this.onEnd = function () {
if (!_this.state._active) return;
var movement = _this.getMovement(_this.state.values);
_this.updateGestureState(movement);
_this.updateGestureState({
_this.fireGestureHandler();
var _proto = WheelRecognizer.prototype;
_proto.addBindings = function addBindings$1(bindings) {
addBindings(bindings, 'onWheel', this.handleEvent);
}(CoordinatesRecognizer);
* @param handler - the function fired every time the wheel gesture updates
* @param the config object including generic options and wheel options
function useWheel(handler, config) {
RecognizersMap.set('wheel', WheelRecognizer);
var buildWheelConfig = Object(external_React_["useRef"])();
if (!buildWheelConfig.current) {
buildWheelConfig.current = memoizeOne(_buildWheelConfig, isEqual);
}, buildWheelConfig.current(config));
var MoveRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
_inheritsLoose(MoveRecognizer, _CoordinatesRecognize);
function MoveRecognizer() {
_this = _CoordinatesRecognize.apply(this, arguments) || this;
_this.onMove = function (event) {
if (!_this.enabled) return;
_this.setTimeout(_this.onMoveEnd);
if (!_this.state._active) _this.onMoveStart(event);else _this.onMoveChange(event);
_this.onMoveStart = function (event) {
_this.updateSharedState(getGenericEventData(event));
var values = getPointerEventValues(event, _this.transform);
_this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event), getGenericPayload(_assertThisInitialized(_this), event, true)));
_this.updateGestureState(_this.getMovement(values));
_this.fireGestureHandler();
_this.onMoveChange = function (event) {
_this.updateSharedState(getGenericEventData(event));
var values = getPointerEventValues(event, _this.transform);
_this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event)));
_this.fireGestureHandler();
_this.onMoveEnd = function () {
if (!_this.state._active) return;
var values = _this.state.values;
_this.updateGestureState(_this.getMovement(values));
_this.updateGestureState({
_this.fireGestureHandler();
_this.hoverTransform = function () {
return _this.controller.config.hover.transform || _this.controller.config.transform;
_this.onPointerEnter = function (event) {
_this.controller.state.shared.hovering = true;
if (!_this.controller.config.enabled) return;
if (_this.controller.config.hover.enabled) {
var values = getPointerEventValues(event, _this.hoverTransform());
var state = _extends({}, _this.controller.state.shared, _this.state, getGenericPayload(_assertThisInitialized(_this), event, true), {
_this.controller.handlers.hover(_extends({}, state, _this.mapStateValues(state)));
if ('move' in _this.controller.handlers) _this.onMoveStart(event);
_this.onPointerLeave = function (event) {
_this.controller.state.shared.hovering = false;
if ('move' in _this.controller.handlers) _this.onMoveEnd();
if (!_this.controller.config.hover.enabled) return;
var values = getPointerEventValues(event, _this.hoverTransform());
var state = _extends({}, _this.controller.state.shared, _this.state, getGenericPayload(_assertThisInitialized(_this), event), {
_this.controller.handlers.hover(_extends({}, state, _this.mapStateValues(state)));
var _proto = MoveRecognizer.prototype;
_proto.addBindings = function addBindings$1(bindings) {
if ('move' in this.controller.handlers) {
addBindings(bindings, 'onPointerMove', this.onMove);
if ('hover' in this.controller.handlers) {
addBindings(bindings, 'onPointerEnter', this.onPointerEnter);
addBindings(bindings, 'onPointerLeave', this.onPointerLeave);
}(CoordinatesRecognizer);
* @param handler - the function fired every time the move gesture updates
* @param [config={}] - the config object including generic options and move options
function useMove(handler, config) {
RecognizersMap.set('move', MoveRecognizer);
var buildMoveConfig = Object(external_React_["useRef"])();
if (!buildMoveConfig.current) {
buildMoveConfig.current = memoizeOne(_buildMoveConfig, isEqual);
}, buildMoveConfig.current(config));
* @param handler - the function fired every time the hover gesture updates
* @param [config={}] - the config object including generic options and hover options
function useHover(handler, config) {
RecognizersMap.set('hover', MoveRecognizer);
var buildHoverConfig = Object(external_React_["useRef"])();
if (!buildHoverConfig.current) {
buildHoverConfig.current = memoizeOne(_buildHoverConfig, isEqual);
}, buildHoverConfig.current(config));
var ScrollRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) {
_inheritsLoose(ScrollRecognizer, _CoordinatesRecognize);
function ScrollRecognizer() {
_this = _CoordinatesRecognize.apply(this, arguments) || this;
_this.ingKey = 'scrolling';
_this.stateKey = 'scroll';
_this.handleEvent = function (event) {
if (!_this.enabled) return;
_this.setTimeout(_this.onEnd);
var values = getScrollEventValues(event, _this.transform);
_this.updateSharedState(getGenericEventData(event));
if (!_this.state._active) {
_this.updateGestureState(_extends({}, getStartGestureState(_assertThisInitialized(_this), values, event, _this.state.values), getGenericPayload(_assertThisInitialized(_this), event, true)));
var movementDetection = _this.getMovement(values);
var geometry = calculateAllGeometry(movementDetection.delta);
_this.updateGestureState(movementDetection);
_this.updateGestureState(geometry);
_this.updateGestureState(_extends({}, getGenericPayload(_assertThisInitialized(_this), event), _this.getKinematics(values, event)));
_this.fireGestureHandler();
_this.onEnd = function () {
if (!_this.state._active) return;
_this.updateGestureState(_extends({}, _this.getMovement(_this.state.values), {
_this.fireGestureHandler();
var _proto = ScrollRecognizer.prototype;
_proto.addBindings = function addBindings$1(bindings) {
addBindings(bindings, 'onScroll', this.handleEvent);
}(CoordinatesRecognizer);
* @param handler - the function fired every time the scroll gesture updates
* @param [config={}] - the config object including generic options and scroll options
function useScroll(handler, config) {
RecognizersMap.set('scroll', ScrollRecognizer);
var buildScrollConfig = Object(external_React_["useRef"])();
if (!buildScrollConfig.current) {
buildScrollConfig.current = memoizeOne(_buildScrollConfig, isEqual);
}, buildScrollConfig.current(config));
var RE_NOT_NATIVE = /^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;
function sortHandlers(handlers) {
for (var key in handlers) {
if (RE_NOT_NATIVE.test(key)) {
actions.add(RegExp.lastMatch);
handle[key] = handlers[key];
_native[key] = handlers[key];
return [handle, _native, actions];
* The most complete gesture hook, allowing support for multiple gestures.
* @param {Handlers} handlers - an object with on[Gesture] keys containg gesture handlers
* @param {UseGestureConfig} [config={}] - the full config object
* @returns {(...args: any[]) => HookReturnType<Config>}
function useGesture(_handlers, config) {
var _sortHandlers = sortHandlers(_handlers),
handlers = _sortHandlers[0],
nativeHandlers = _sortHandlers[1],
actions = _sortHandlers[2];
RecognizersMap.set('drag', DragRecognizer);
RecognizersMap.set('hover', MoveRecognizer);
RecognizersMap.set('move', MoveRecognizer);
RecognizersMap.set('pinch', PinchRecognizer);
RecognizersMap.set('scroll', ScrollRecognizer);
RecognizersMap.set('wheel', WheelRecognizer);
var mergedConfig = buildComplexConfig(config, actions);
var internalHandlers = {};
if (actions.has('onDrag')) internalHandlers.drag = includeStartEndHandlers(handlers, 'onDrag');
if (actions.has('onWheel')) internalHandlers.wheel = includeStartEndHandlers(handlers, 'onWheel');
if (actions.has('onScroll')) internalHandlers.scroll = includeStartEndHandlers(handlers, 'onScroll');
if (actions.has('onMove')) internalHandlers.move = includeStartEndHandlers(handlers, 'onMove');
if (actions.has('onPinch')) internalHandlers.pinch = includeStartEndHandlers(handlers, 'onPinch');
if (actions.has('onHover')) internalHandlers.hover = handlers.onHover;
return useRecognizers(internalHandlers, mergedConfig, nativeHandlers);
function includeStartEndHandlers(handlers, handlerKey) {
var startKey = handlerKey + 'Start';
var endKey = handlerKey + 'End';
var fn = function fn(state) {
if (state.first && startKey in handlers) handlers[startKey](state);
if (handlerKey in handlers) memo = handlers[handlerKey](state);
if (state.last && endKey in handlers) handlers[endKey](state);
// EXTERNAL MODULE: external ["wp","keycodes"]
var external_wp_keycodes_ = __webpack_require__("RxS6");
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/utils.js
* Gets a CSS cursor value based on a drag direction.
* @param {string} dragDirection The drag direction.
* @return {string} The CSS cursor value.
function getDragCursor(dragDirection) {
var dragCursor = 'ns-resize';
dragCursor = 'ns-resize';
dragCursor = 'ew-resize';
* Custom hook that renders a drag cursor when dragging.
* @param {boolean} isDragging The dragging state.
* @param {string} dragDirection The drag direction.
* @return {string} The CSS cursor value.
function useDragCursor(isDragging, dragDirection) {
var dragCursor = getDragCursor(dragDirection);
Object(external_wp_element_["useEffect"])(function () {
document.documentElement.style.cursor = dragCursor;
document.documentElement.style.cursor = null;
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/state.js
function state_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function state_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { state_ownKeys(Object(source), true).forEach(function (key) { Object(esm_defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { state_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var initialStateReducer = function initialStateReducer(state) {