Comparing version 0.5.0 to 0.5.1
@@ -11,3 +11,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function DoubletapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 250; | ||
@@ -22,3 +22,3 @@ return _this; | ||
function Doubletap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
@@ -25,0 +25,0 @@ _this.count = 0; |
@@ -11,3 +11,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function LongtapSwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 500; | ||
@@ -22,3 +22,3 @@ return _this; | ||
function LongtapSwipe() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.allowSwipe = false; | ||
@@ -25,0 +25,0 @@ return _this; |
@@ -11,3 +11,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function LongtapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -37,3 +37,3 @@ _this.timeThreshold = 500; | ||
function Longtap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
@@ -40,0 +40,0 @@ _this.timeEndEmitted = false; |
import { OribellaApi } from 'oribella-framework'; | ||
export * from 'oribella-framework'; | ||
export declare const oribella: OribellaApi; | ||
@@ -3,0 +4,0 @@ export * from './tap'; |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "oribella-framework", "./tap", "./doubletap", "./longtap", "./swipe", "./longtap-swipe", "./rotate", "./pinch", "./tap", "./doubletap", "./longtap", "./swipe", "./longtap-swipe", "./rotate", "./pinch"], function (require, exports, oribella_framework_1, tap_1, doubletap_1, longtap_1, swipe_1, longtap_swipe_1, rotate_1, pinch_1, tap_2, doubletap_2, longtap_2, swipe_2, longtap_swipe_2, rotate_2, pinch_2) { | ||
define(["require", "exports", "oribella-framework", "./tap", "./doubletap", "./longtap", "./swipe", "./longtap-swipe", "./rotate", "./pinch", "oribella-framework", "./tap", "./doubletap", "./longtap", "./swipe", "./longtap-swipe", "./rotate", "./pinch"], function (require, exports, oribella_framework_1, tap_1, doubletap_1, longtap_1, swipe_1, longtap_swipe_1, rotate_1, pinch_1, oribella_framework_2, tap_2, doubletap_2, longtap_2, swipe_2, longtap_swipe_2, rotate_2, pinch_2) { | ||
"use strict"; | ||
@@ -6,2 +6,3 @@ function __export(m) { | ||
} | ||
__export(oribella_framework_2); | ||
exports.oribella = new oribella_framework_1.OribellaApi(); | ||
@@ -8,0 +9,0 @@ __export(tap_2); |
@@ -11,3 +11,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function PinchOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
@@ -23,3 +23,3 @@ _this.pinchThreshold = 10; | ||
function PinchData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.distance = 0; | ||
@@ -37,3 +37,3 @@ _this.scale = 0; | ||
function Pinch() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.startDistance = 0; | ||
@@ -40,0 +40,0 @@ return _this; |
@@ -11,3 +11,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function RotateOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
@@ -23,3 +23,3 @@ _this.rotationThreshold = 10; | ||
function RotateData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rotation = 0; | ||
@@ -34,3 +34,3 @@ return _this; | ||
function Rotate() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -37,0 +37,0 @@ Rotate.prototype.calculateRotation = function (p0, p1, p2, p3) { |
@@ -37,3 +37,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function SwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -48,3 +48,3 @@ return _this; | ||
function Swipe() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -51,0 +51,0 @@ Swipe.prototype.start = function (evt, data) { |
@@ -11,3 +11,3 @@ var __extends = (this && this.__extends) || function (d, b) { | ||
function TapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -22,3 +22,3 @@ return _this; | ||
function Tap() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -25,0 +25,0 @@ Tap.prototype.start = function (evt, data) { |
@@ -12,3 +12,3 @@ "use strict"; | ||
function DoubletapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 250; | ||
@@ -23,3 +23,3 @@ return _this; | ||
function Doubletap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
@@ -26,0 +26,0 @@ _this.count = 0; |
@@ -13,3 +13,3 @@ "use strict"; | ||
function LongtapSwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 500; | ||
@@ -24,3 +24,3 @@ return _this; | ||
function LongtapSwipe() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.allowSwipe = false; | ||
@@ -27,0 +27,0 @@ return _this; |
@@ -11,3 +11,3 @@ "use strict"; | ||
function LongtapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -37,3 +37,3 @@ _this.timeThreshold = 500; | ||
function Longtap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
@@ -40,0 +40,0 @@ _this.timeEndEmitted = false; |
import { OribellaApi } from 'oribella-framework'; | ||
export * from 'oribella-framework'; | ||
export declare const oribella: OribellaApi; | ||
@@ -3,0 +4,0 @@ export * from './tap'; |
@@ -13,2 +13,3 @@ "use strict"; | ||
var pinch_1 = require("./pinch"); | ||
__export(require("oribella-framework")); | ||
exports.oribella = new oribella_framework_1.OribellaApi(); | ||
@@ -15,0 +16,0 @@ __export(require("./tap")); |
@@ -11,3 +11,3 @@ "use strict"; | ||
function PinchOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
@@ -23,3 +23,3 @@ _this.pinchThreshold = 10; | ||
function PinchData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.distance = 0; | ||
@@ -37,3 +37,3 @@ _this.scale = 0; | ||
function Pinch() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.startDistance = 0; | ||
@@ -40,0 +40,0 @@ return _this; |
@@ -11,3 +11,3 @@ "use strict"; | ||
function RotateOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
@@ -23,3 +23,3 @@ _this.rotationThreshold = 10; | ||
function RotateData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rotation = 0; | ||
@@ -34,3 +34,3 @@ return _this; | ||
function Rotate() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -37,0 +37,0 @@ Rotate.prototype.calculateRotation = function (p0, p1, p2, p3) { |
@@ -37,3 +37,3 @@ "use strict"; | ||
function SwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -48,3 +48,3 @@ return _this; | ||
function Swipe() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -51,0 +51,0 @@ Swipe.prototype.start = function (evt, data) { |
@@ -11,3 +11,3 @@ "use strict"; | ||
function TapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -22,3 +22,3 @@ return _this; | ||
function Tap() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -25,0 +25,0 @@ Tap.prototype.start = function (evt, data) { |
import { OribellaApi } from 'oribella-framework'; | ||
export * from 'oribella-framework'; | ||
export declare const oribella: OribellaApi; | ||
@@ -3,0 +4,0 @@ export * from './tap'; |
@@ -9,2 +9,3 @@ import { OribellaApi } from 'oribella-framework'; | ||
import { registerPinch } from './pinch'; | ||
export * from 'oribella-framework'; | ||
export const oribella = new OribellaApi(); | ||
@@ -11,0 +12,0 @@ export * from './tap'; |
@@ -1,497 +0,2 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
define("tap", ["require", "exports", "oribella-framework"], function (require, exports, oribella_framework_1) { | ||
"use strict"; | ||
var TapOptions = (function (_super) { | ||
__extends(TapOptions, _super); | ||
function TapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
return _this; | ||
} | ||
return TapOptions; | ||
}(oribella_framework_1.Options)); | ||
exports.TapOptions = TapOptions; | ||
var Tap = (function (_super) { | ||
__extends(Tap, _super); | ||
function Tap() { | ||
return _super.apply(this, arguments) || this; | ||
} | ||
Tap.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
return this.listener.start(evt, data, this.target); | ||
}; | ||
Tap.prototype.update = function (_, data) { | ||
var p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.REMOVE; | ||
} | ||
return oribella_framework_1.RETURN_FLAG.IDLE; | ||
}; | ||
Tap.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Tap.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Tap; | ||
}(oribella_framework_1.Gesture)); | ||
exports.Tap = Tap; | ||
function registerTap(oribella) { | ||
oribella.registerGesture(Tap, TapOptions); | ||
} | ||
exports.registerTap = registerTap; | ||
}); | ||
define("doubletap", ["require", "exports", "oribella-framework", "tap"], function (require, exports, oribella_framework_2, tap_1) { | ||
"use strict"; | ||
var DoubletapOptions = (function (_super) { | ||
__extends(DoubletapOptions, _super); | ||
function DoubletapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 250; | ||
return _this; | ||
} | ||
return DoubletapOptions; | ||
}(oribella_framework_2.Options)); | ||
exports.DoubletapOptions = DoubletapOptions; | ||
var Doubletap = (function (_super) { | ||
__extends(Doubletap, _super); | ||
function Doubletap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
_this.count = 0; | ||
return _this; | ||
} | ||
Doubletap.prototype.bind = function (target, registerListener, remove) { | ||
this.unregisterTap = registerListener(tap_1.Tap, target, { | ||
selector: this.listener.selector, | ||
options: this.listener.options, | ||
end: this.tapEnd.bind(this) | ||
}); | ||
this.remove = remove; | ||
}; | ||
Doubletap.prototype.unbind = function () { | ||
if (this.count > 1) { | ||
this.unregisterTap(); | ||
return oribella_framework_2.RETURN_FLAG.REMOVE; | ||
} | ||
return oribella_framework_2.RETURN_FLAG.COMPOSE; | ||
}; | ||
Doubletap.prototype.tapEnd = function (evt, data) { | ||
var _this = this; | ||
++this.count; | ||
if (this.count === 1) { | ||
this.timeoutId = window.setTimeout(function () { | ||
_this.remove(); | ||
_this.unregisterTap(); | ||
}, this.listener.options.timeThreshold); | ||
} | ||
else if (this.count === 2) { | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
return oribella_framework_2.RETURN_FLAG.IDLE; | ||
}; | ||
return Doubletap; | ||
}(oribella_framework_2.Gesture)); | ||
exports.Doubletap = Doubletap; | ||
function registerDoubletap(oribella) { | ||
oribella.registerGesture(Doubletap, DoubletapOptions); | ||
} | ||
exports.registerDoubletap = registerDoubletap; | ||
}); | ||
define("longtap", ["require", "exports", "oribella-framework"], function (require, exports, oribella_framework_3) { | ||
"use strict"; | ||
var LongtapOptions = (function (_super) { | ||
__extends(LongtapOptions, _super); | ||
function LongtapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
_this.timeThreshold = 500; | ||
return _this; | ||
} | ||
return LongtapOptions; | ||
}(oribella_framework_3.Options)); | ||
exports.LongtapOptions = LongtapOptions; | ||
var LongtapListener = (function (_super) { | ||
__extends(LongtapListener, _super); | ||
function LongtapListener(options, listener) { | ||
var _this = _super.call(this, options, listener) || this; | ||
_this.options = options; | ||
_this.listener = Object.assign({ | ||
timeEnd: function () { } | ||
}, _this.listener); | ||
return _this; | ||
} | ||
LongtapListener.prototype.timeEnd = function () { return oribella_framework_3.RETURN_FLAG.map(this.listener.timeEnd()); }; | ||
return LongtapListener; | ||
}(oribella_framework_3.Listener)); | ||
exports.LongtapListener = LongtapListener; | ||
var Longtap = (function (_super) { | ||
__extends(Longtap, _super); | ||
function Longtap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
_this.timeEndEmitted = false; | ||
return _this; | ||
} | ||
Longtap.prototype.start = function (evt, data) { | ||
var _this = this; | ||
this.startPoint = data.pointers[0].page; | ||
this.timeoutId = window.setTimeout(function () { | ||
_this.listener.timeEnd(); | ||
_this.timeEndEmitted = true; | ||
}, this.listener.options.timeThreshold); | ||
return this.listener.start(evt, data, this.target); | ||
}; | ||
Longtap.prototype.update = function (_, data) { | ||
var p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return oribella_framework_3.RETURN_FLAG.REMOVE; | ||
} | ||
return oribella_framework_3.RETURN_FLAG.IDLE; | ||
}; | ||
Longtap.prototype.end = function (evt, data) { | ||
window.clearTimeout(this.timeoutId); | ||
if (!this.timeEndEmitted) { | ||
return oribella_framework_3.RETURN_FLAG.REMOVE; | ||
} | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Longtap.prototype.cancel = function () { | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.cancel(); | ||
}; | ||
return Longtap; | ||
}(oribella_framework_3.Gesture)); | ||
exports.Longtap = Longtap; | ||
function registerLongtap(oribella) { | ||
oribella.registerGesture(Longtap, LongtapOptions, LongtapListener); | ||
} | ||
exports.registerLongtap = registerLongtap; | ||
}); | ||
define("swipe", ["require", "exports", "oribella-framework"], function (require, exports, oribella_framework_4) { | ||
"use strict"; | ||
var Observation = (function () { | ||
function Observation(point, timeStamp) { | ||
this.point = point; | ||
this.timeStamp = timeStamp; | ||
} | ||
return Observation; | ||
}()); | ||
exports.Observation = Observation; | ||
var SwipeData = (function (_super) { | ||
__extends(SwipeData, _super); | ||
function SwipeData(maxObservations) { | ||
if (maxObservations === void 0) { maxObservations = 5; } | ||
var _this = _super.call(this) || this; | ||
_this.maxObservations = maxObservations; | ||
_this.timeSeries = []; | ||
return _this; | ||
} | ||
SwipeData.prototype.add = function (point, timeStamp) { | ||
if (this.timeSeries.length === this.maxObservations) { | ||
this.timeSeries.shift(); | ||
} | ||
this.timeSeries.push(new Observation(point, timeStamp)); | ||
}; | ||
return SwipeData; | ||
}(oribella_framework_4.Data)); | ||
exports.SwipeData = SwipeData; | ||
var SwipeOptions = (function (_super) { | ||
__extends(SwipeOptions, _super); | ||
function SwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
return _this; | ||
} | ||
return SwipeOptions; | ||
}(oribella_framework_4.Options)); | ||
exports.SwipeOptions = SwipeOptions; | ||
var Swipe = (function (_super) { | ||
__extends(Swipe, _super); | ||
function Swipe() { | ||
return _super.apply(this, arguments) || this; | ||
} | ||
Swipe.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
data.add(this.startPoint, evt.timeStamp); | ||
return this.listener.down(evt, data, this.target); | ||
}; | ||
Swipe.prototype.update = function (evt, data) { | ||
var currentPoint = data.pointers[0].page; | ||
if (currentPoint.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
return oribella_framework_4.RETURN_FLAG.IDLE; | ||
} | ||
data.add(currentPoint, evt.timeStamp); | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
}; | ||
Swipe.prototype.end = function (evt, data) { | ||
var currentPoint = data.pointers[0].page; | ||
data.add(currentPoint, evt.timeStamp); | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Swipe.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Swipe; | ||
}(oribella_framework_4.Gesture)); | ||
exports.Swipe = Swipe; | ||
function registerSwipe(oribella) { | ||
oribella.registerGesture(Swipe, SwipeOptions, undefined, SwipeData); | ||
} | ||
exports.registerSwipe = registerSwipe; | ||
}); | ||
define("longtap-swipe", ["require", "exports", "oribella-framework", "longtap", "swipe"], function (require, exports, oribella_framework_5, longtap_1, swipe_1) { | ||
"use strict"; | ||
var LongtapSwipeOptions = (function (_super) { | ||
__extends(LongtapSwipeOptions, _super); | ||
function LongtapSwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 500; | ||
return _this; | ||
} | ||
return LongtapSwipeOptions; | ||
}(oribella_framework_5.Options)); | ||
exports.LongtapSwipeOptions = LongtapSwipeOptions; | ||
var LongtapSwipe = (function (_super) { | ||
__extends(LongtapSwipe, _super); | ||
function LongtapSwipe() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.allowSwipe = false; | ||
return _this; | ||
} | ||
LongtapSwipe.prototype.bind = function (target, registerListener, remove) { | ||
var _this = this; | ||
this.unregisterLongtap = registerListener(longtap_1.Longtap, target, { | ||
selector: this.listener.selector, | ||
options: this.listener.options, | ||
down: function () { return _this.longtapDown(); }, | ||
timeEnd: function () { return _this.longtapTimeEnd(); } | ||
}); | ||
this.unregisterSwipe = registerListener(swipe_1.Swipe, target, { | ||
selector: this.listener.selector, | ||
options: this.listener.options, | ||
down: function (evt, data) { return _this.swipeDown(evt, data); }, | ||
start: function (evt, data) { return _this.swipeStart(evt, data); }, | ||
update: function (evt, data) { return _this.swipeUpdate(evt, data); }, | ||
end: function (evt, data) { return _this.swipeEnd(evt, data); }, | ||
cancel: function () { return _this.swipeCancel(); } | ||
}); | ||
this.remove = remove; | ||
}; | ||
LongtapSwipe.prototype.longtapDown = function () { | ||
this.allowSwipe = false; | ||
return oribella_framework_5.RETURN_FLAG.IDLE; | ||
}; | ||
LongtapSwipe.prototype.longtapTimeEnd = function () { | ||
this.allowSwipe = true; | ||
return oribella_framework_5.RETURN_FLAG.IDLE; | ||
}; | ||
LongtapSwipe.prototype.swipeDown = function (evt, data) { | ||
return this.listener.down(evt, data, this.target); | ||
}; | ||
LongtapSwipe.prototype.swipeStart = function (evt, data) { | ||
if (!this.allowSwipe) { | ||
this.remove(); | ||
return oribella_framework_5.RETURN_FLAG.REMOVE; | ||
} | ||
return this.listener.start(evt, data, this.target); | ||
}; | ||
LongtapSwipe.prototype.swipeUpdate = function (evt, data) { | ||
return this.listener.update(evt, data, this.target); | ||
}; | ||
LongtapSwipe.prototype.swipeEnd = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
LongtapSwipe.prototype.swipeCancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return LongtapSwipe; | ||
}(oribella_framework_5.Gesture)); | ||
exports.LongtapSwipe = LongtapSwipe; | ||
function registerLongtapSwipe(oribella) { | ||
oribella.registerGesture(LongtapSwipe, LongtapSwipeOptions); | ||
} | ||
exports.registerLongtapSwipe = registerLongtapSwipe; | ||
}); | ||
define("rotate", ["require", "exports", "oribella-framework"], function (require, exports, oribella_framework_6) { | ||
"use strict"; | ||
var RotateOptions = (function (_super) { | ||
__extends(RotateOptions, _super); | ||
function RotateOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
_this.rotationThreshold = 10; | ||
return _this; | ||
} | ||
return RotateOptions; | ||
}(oribella_framework_6.Options)); | ||
exports.RotateOptions = RotateOptions; | ||
var RotateData = (function (_super) { | ||
__extends(RotateData, _super); | ||
function RotateData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.rotation = 0; | ||
return _this; | ||
} | ||
return RotateData; | ||
}(oribella_framework_6.Data)); | ||
exports.RotateData = RotateData; | ||
var Rotate = (function (_super) { | ||
__extends(Rotate, _super); | ||
function Rotate() { | ||
return _super.apply(this, arguments) || this; | ||
} | ||
Rotate.prototype.calculateRotation = function (p0, p1, p2, p3) { | ||
var a0 = p0.deltaAngleTo(p1); | ||
var a1 = p2.deltaAngleTo(p3); | ||
return a1 - a0; | ||
}; | ||
Rotate.prototype.setData = function (data) { | ||
this.currentPoint0 = data.pointers[0].page; | ||
this.currentPoint1 = data.pointers[1].page; | ||
data.rotation = this.calculateRotation(this.startPoint0, this.startPoint1, this.currentPoint0, this.currentPoint1); | ||
}; | ||
Rotate.prototype.start = function (evt, data) { | ||
this.startPoint0 = data.pointers[0].page; | ||
this.startPoint1 = data.pointers[1].page; | ||
return this.listener.down(evt, data, this.target); | ||
}; | ||
Rotate.prototype.update = function (evt, data) { | ||
this.setData(data); | ||
if (Math.abs(data.rotation) < this.listener.options.rotationThreshold) { | ||
return oribella_framework_6.RETURN_FLAG.IDLE; | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
}; | ||
Rotate.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Rotate.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Rotate; | ||
}(oribella_framework_6.Gesture)); | ||
exports.Rotate = Rotate; | ||
function registerRotate(oribella) { | ||
oribella.registerGesture(Rotate, RotateOptions, undefined, RotateData); | ||
} | ||
exports.registerRotate = registerRotate; | ||
}); | ||
define("pinch", ["require", "exports", "oribella-framework"], function (require, exports, oribella_framework_7) { | ||
"use strict"; | ||
var PinchOptions = (function (_super) { | ||
__extends(PinchOptions, _super); | ||
function PinchOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
_this.pinchThreshold = 10; | ||
return _this; | ||
} | ||
return PinchOptions; | ||
}(oribella_framework_7.Options)); | ||
exports.PinchOptions = PinchOptions; | ||
var PinchData = (function (_super) { | ||
__extends(PinchData, _super); | ||
function PinchData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.distance = 0; | ||
_this.scale = 0; | ||
_this.delta = 0; | ||
_this.centerPoint = new oribella_framework_7.Point(0, 0); | ||
return _this; | ||
} | ||
return PinchData; | ||
}(oribella_framework_7.Data)); | ||
exports.PinchData = PinchData; | ||
var Pinch = (function (_super) { | ||
__extends(Pinch, _super); | ||
function Pinch() { | ||
var _this = _super.apply(this, arguments) || this; | ||
_this.startDistance = 0; | ||
return _this; | ||
} | ||
Pinch.prototype.calculateDistance = function (p0, p1) { | ||
return p1.distanceTo(p0); | ||
}; | ||
Pinch.prototype.calculateStartDistance = function () { | ||
return this.startDistance || (this.startDistance = this.calculateDistance(this.startPoint0, this.startPoint1)); | ||
}; | ||
Pinch.prototype.calculateCurrentDistance = function () { | ||
return this.calculateDistance(this.currentPoint0, this.currentPoint1); | ||
}; | ||
Pinch.prototype.setData = function (data) { | ||
this.currentPoint0 = data.pointers[0].page; | ||
this.currentPoint1 = data.pointers[1].page; | ||
var startDistance = this.calculateStartDistance(); | ||
var currentDistance = this.calculateCurrentDistance(); | ||
var distance = Math.abs(startDistance - currentDistance); | ||
data.distance = distance; | ||
data.scale = currentDistance / startDistance; | ||
data.delta = currentDistance - startDistance; | ||
data.centerPoint.x = (this.currentPoint0.x + this.currentPoint1.x) / 2; | ||
data.centerPoint.y = (this.currentPoint0.y + this.currentPoint1.y) / 2; | ||
}; | ||
Pinch.prototype.start = function (evt, data) { | ||
this.startPoint0 = data.pointers[0].page; | ||
this.startPoint1 = data.pointers[1].page; | ||
return this.listener.down(evt, data, this.target); | ||
}; | ||
Pinch.prototype.update = function (evt, data) { | ||
this.setData(data); | ||
if (Math.abs(data.distance) < this.listener.options.pinchThreshold) { | ||
return oribella_framework_7.RETURN_FLAG.IDLE; | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
}; | ||
Pinch.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Pinch.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Pinch; | ||
}(oribella_framework_7.Gesture)); | ||
exports.Pinch = Pinch; | ||
function registerPinch(oribella) { | ||
oribella.registerGesture(Pinch, PinchOptions, undefined, PinchData); | ||
} | ||
exports.registerPinch = registerPinch; | ||
}); | ||
define("oribella", ["require", "exports", "oribella-framework", "tap", "doubletap", "longtap", "swipe", "longtap-swipe", "rotate", "pinch", "tap", "doubletap", "longtap", "swipe", "longtap-swipe", "rotate", "pinch"], function (require, exports, oribella_framework_8, tap_2, doubletap_1, longtap_2, swipe_2, longtap_swipe_1, rotate_1, pinch_1, tap_3, doubletap_2, longtap_3, swipe_3, longtap_swipe_2, rotate_2, pinch_2) { | ||
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
} | ||
exports.oribella = new oribella_framework_8.OribellaApi(); | ||
__export(tap_3); | ||
__export(doubletap_2); | ||
__export(longtap_3); | ||
__export(swipe_3); | ||
__export(longtap_swipe_2); | ||
__export(rotate_2); | ||
__export(pinch_2); | ||
exports.oribella.registerDefaultFlowStrategy(); | ||
exports.oribella.activate(); | ||
tap_2.registerTap(exports.oribella); | ||
doubletap_1.registerDoubletap(exports.oribella); | ||
longtap_2.registerLongtap(exports.oribella); | ||
swipe_2.registerSwipe(exports.oribella); | ||
longtap_swipe_1.registerLongtapSwipe(exports.oribella); | ||
rotate_1.registerRotate(exports.oribella); | ||
pinch_1.registerPinch(exports.oribella); | ||
}); | ||
define("oribella",[],function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=21)}([function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(7)),r(n(1)),r(n(6)),r(n(17)),r(n(19))},function(t,e,n){"use strict";function r(t,e){return!(!t.msPointerEnabled||e.pointerType!==e.MSPOINTER_TYPE_MOUSE)||(!(!t.pointerEnabled||"mouse"!==e.pointerType)||e.type.indexOf("mouse")!==-1)}function i(t,e){var n=t.button,r=t.which,i=r||void 0===n?r:1&n?1:2&n?3:4&n?2:0;return Array.isArray(e)?e.some(function(t){return i===t}):i===e}function o(t,e){return(t.matchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector).call(t,e)}function s(t,e){for(var n in e)e[n]&&!t[n]&&(t[n]=e[n]);return t}var u=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)};e.GESTURE_STRATEGY_FLAG={KEEP:0,REMOVE_IF_POINTERS_GT:1},e.RETURN_FLAG={map:function(t){switch(t){case!0:t=this.REMOVE_OTHERS;break;case!1:t=this.REMOVE;break;case 1:case 2:case 4:break;default:t=0}return t},IDLE:0,START_EMITTED:1,REMOVE:2,REMOVE_OTHERS:4,REMOVE_AND_CONTINUE:8,COMPOSE:16},e.isMouse=r,e.isValidMouseButton=i,e.matchesSelector=o;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e}(Map);e.PointerDataMap=a;var c=function(){function t(){this.pointers=1,this.which=1,this.prio=100,this.strategy=e.GESTURE_STRATEGY_FLAG.KEEP}return t}();e.Options=c;var p=function(){function t(){}return t}();e.Data=p,e.ensureProperties=s},function(t,e,n){"use strict";function r(t){t.registerGesture(a,s,u)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e.timeThreshold=500,e}return i(e,t),e}(o.Options);e.LongtapOptions=s;var u=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.options=e,r.listener=Object.assign({timeEnd:function(){}},r.listener),r}return i(e,t),e.prototype.timeEnd=function(){return o.RETURN_FLAG.map(this.listener.timeEnd())},e}(o.Listener);e.LongtapListener=u;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeoutId=0,e.timeEndEmitted=!1,e}return i(e,t),e.prototype.start=function(t,e){var n=this;return this.startPoint=e.pointers[0].page,this.timeoutId=window.setTimeout(function(){n.listener.timeEnd(),n.timeEndEmitted=!0},this.listener.options.timeThreshold),this.listener.start(t,e,this.target)},e.prototype.update=function(t,e){var n=e.pointers[0].page;return n.distanceTo(this.startPoint)>this.listener.options.radiusThreshold?o.RETURN_FLAG.REMOVE:o.RETURN_FLAG.IDLE},e.prototype.end=function(t,e){return window.clearTimeout(this.timeoutId),this.timeEndEmitted?this.listener.end(t,e,this.target):o.RETURN_FLAG.REMOVE},e.prototype.cancel=function(){return window.clearTimeout(this.timeoutId),this.listener.cancel()},e}(o.Gesture);e.Longtap=a,e.registerLongtap=r},function(t,e,n){"use strict";function r(t){t.registerGesture(c,a,void 0,u)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=function(){function t(t,e){this.point=t,this.timeStamp=e}return t}();e.Observation=s;var u=function(t){function e(e){void 0===e&&(e=5);var n=t.call(this)||this;return n.maxObservations=e,n.timeSeries=[],n}return i(e,t),e.prototype.add=function(t,e){this.timeSeries.length===this.maxObservations&&this.timeSeries.shift(),this.timeSeries.push(new s(t,e))},e}(o.Data);e.SwipeData=u;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e}return i(e,t),e}(o.Options);e.SwipeOptions=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.start=function(t,e){return this.startPoint=e.pointers[0].page,e.add(this.startPoint,t.timeStamp),this.listener.down(t,e,this.target)},e.prototype.update=function(t,e){var n=e.pointers[0].page;return n.distanceTo(this.startPoint)<this.listener.options.radiusThreshold?o.RETURN_FLAG.IDLE:(e.add(n,t.timeStamp),this.startEmitted?this.listener.update(t,e,this.target):this.listener.start(t,e,this.target))},e.prototype.end=function(t,e){var n=e.pointers[0].page;return e.add(n,t.timeStamp),this.listener.end(t,e,this.target)},e.prototype.cancel=function(){return this.listener.cancel()},e}(o.Gesture);e.Swipe=c,e.registerSwipe=r},function(t,e,n){"use strict";function r(t){t.registerGesture(u,s)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e}return i(e,t),e}(o.Options);e.TapOptions=s;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.start=function(t,e){return this.startPoint=e.pointers[0].page,this.listener.start(t,e,this.target)},e.prototype.update=function(t,e){var n=e.pointers[0].page;return n.distanceTo(this.startPoint)>this.listener.options.radiusThreshold?o.RETURN_FLAG.REMOVE:o.RETURN_FLAG.IDLE},e.prototype.end=function(t,e){return this.listener.end(t,e,this.target)},e.prototype.cancel=function(){return this.listener.cancel()},e}(o.Gesture);e.Tap=u,e.registerTap=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(){function t(){this.listenerMap=new Map}return t.prototype.on=function(t,e){var n=this.listenerMap.get(t)||[];return n.push(e),this.listenerMap.set(t,n),this},t.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=this.listenerMap.get(t)||[];return r.forEach(function(t){return t.apply(null,e)}),!0},t}();e.EventEmitter=i;var o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.events=t}return t.prototype.getEvents=function(){return this.events},t}();e.EventConfig=o;var s=function(t){function e(e,n){var r=t.call(this)||this;return r.element=e,r.startListen=[],r.continueListen=[],r.removeListeners=[],r.allPointers=new Map,r.changedPointers=new Map,r.pointers={all:r.allPointers,changed:r.changedPointers},r.config=n,r}return r(e,t),e.prototype.proxy=function(t,e){this.setPointers(e),t(e)},e.prototype.addDOMEventListener=function(t,e,n){var r=this.proxy.bind(this,n);return t.addEventListener(e,r,!1),this.removeDOMEventListener.bind(this,t,e,r)},e.prototype.removeDOMEventListener=function(t,e,n){t.removeEventListener(e,n,!1)},e.prototype.bind=function(t){var e=this;return this.startListen=t.start.getEvents().map(function(t){return e.addDOMEventListener.bind(e,e.element,t,e.start.bind(e))}),this.continueListen=t.update.getEvents().map(function(t){return e.addDOMEventListener.bind(e,e.element,t,e.update.bind(e))}),this.continueListen.push.apply(this.continueListen,t.end.getEvents().map(function(t){return e.addDOMEventListener.bind(e,e.element,t,e.end.bind(e))})),this.continueListen.push.apply(this.continueListen,t.cancel.getEvents().map(function(t){return e.addDOMEventListener.bind(e,e.element,t,e.cancel.bind(e))})),{startListen:this.startListen,continueListen:this.continueListen}},e.prototype.activate=function(){return this.bind(this.config).startListen.map(function(t){return t()})},e.prototype.setPointers=function(t){},e.prototype.start=function(t){this.emit("start",t,this.pointers)},e.prototype.update=function(t){this.emit("update",t,this.pointers)},e.prototype.end=function(t){this.emit("end",t,this.pointers),0===this.allPointers.size&&this.stop()},e.prototype.cancel=function(t){this.emit("cancel",t,this.pointers),this.stop()},e.prototype.continue=function(){this.removeListeners=this.continueListen.map(function(t){return t()})},e.prototype.stop=function(){this.removeListeners.forEach(function(t){return t()}),this.removeListeners=[],this.emit("stop")},e}(i);e.Flow=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(1),o=function(){function t(t,e){void 0===e&&(e={}),this.options=t,this.selector="",this.listener=i.ensureProperties(e,{selector:"",down:function(t,e,n){},start:function(t,e,n){},update:function(t,e,n){},end:function(t,e,n){},cancel:function(){}})}return t.prototype.down=function(t,e,n){return i.RETURN_FLAG.map(this.listener.down(t,e,n))},t.prototype.start=function(t,e,n){var r=i.RETURN_FLAG.map(this.listener.start(t,e,n));return r&i.RETURN_FLAG.START_EMITTED||(r+=i.RETURN_FLAG.START_EMITTED),r},t.prototype.update=function(t,e,n){return i.RETURN_FLAG.map(this.listener.update(t,e,n))},t.prototype.end=function(t,e,n){return i.RETURN_FLAG.map(this.listener.end(t,e,n))},t.prototype.cancel=function(){return i.RETURN_FLAG.map(this.listener.cancel())},t}();e.Listener=o;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(o);e.DefaultListener=s},function(t,e,n){"use strict";var r=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.distanceTo=function(t){var e=this.x-t.x,n=this.y-t.y,r=Math.sqrt(e*e+n*n);return r},t.prototype.deltaAngleTo=function(t){var e=t.x-this.x,n=t.y-this.y,r=Math.atan2(n,e),i=180*r/Math.PI;return i},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Point=r},function(t,e,n){"use strict";function r(t){t.registerGesture(a,u)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=n(4),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeThreshold=250,e}return i(e,t),e}(o.Options);e.DoubletapOptions=u;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeoutId=0,e.count=0,e}return i(e,t),e.prototype.bind=function(t,e,n){this.unregisterTap=e(s.Tap,t,{selector:this.listener.selector,options:this.listener.options,end:this.tapEnd.bind(this)}),this.remove=n},e.prototype.unbind=function(){return this.count>1?(this.unregisterTap(),o.RETURN_FLAG.REMOVE):o.RETURN_FLAG.COMPOSE},e.prototype.tapEnd=function(t,e){var n=this;if(++this.count,1===this.count)this.timeoutId=window.setTimeout(function(){n.remove(),n.unregisterTap()},this.listener.options.timeThreshold);else if(2===this.count)return window.clearTimeout(this.timeoutId),this.listener.end(t,e,this.target);return o.RETURN_FLAG.IDLE},e}(o.Gesture);e.Doubletap=a,e.registerDoubletap=r},function(t,e,n){"use strict";function r(t){t.registerGesture(c,a)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=n(2),u=n(3),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeThreshold=500,e}return i(e,t),e}(o.Options);e.LongtapSwipeOptions=a;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allowSwipe=!1,e}return i(e,t),e.prototype.bind=function(t,e,n){var r=this;this.unregisterLongtap=e(s.Longtap,t,{selector:this.listener.selector,options:this.listener.options,down:function(){return r.longtapDown()},timeEnd:function(){return r.longtapTimeEnd()}}),this.unregisterSwipe=e(u.Swipe,t,{selector:this.listener.selector,options:this.listener.options,down:function(t,e){return r.swipeDown(t,e)},start:function(t,e){return r.swipeStart(t,e)},update:function(t,e){return r.swipeUpdate(t,e)},end:function(t,e){return r.swipeEnd(t,e)},cancel:function(){return r.swipeCancel()}}),this.remove=n},e.prototype.longtapDown=function(){return this.allowSwipe=!1,o.RETURN_FLAG.IDLE},e.prototype.longtapTimeEnd=function(){return this.allowSwipe=!0,o.RETURN_FLAG.IDLE},e.prototype.swipeDown=function(t,e){return this.listener.down(t,e,this.target)},e.prototype.swipeStart=function(t,e){return this.allowSwipe?this.listener.start(t,e,this.target):(this.remove(),o.RETURN_FLAG.REMOVE)},e.prototype.swipeUpdate=function(t,e){return this.listener.update(t,e,this.target)},e.prototype.swipeEnd=function(t,e){return this.listener.end(t,e,this.target)},e.prototype.swipeCancel=function(){return this.listener.cancel()},e}(o.Gesture);e.LongtapSwipe=c,e.registerLongtapSwipe=r},function(t,e,n){"use strict";function r(t){t.registerGesture(a,s,void 0,u)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pointers=2,e.pinchThreshold=10,e}return i(e,t),e}(o.Options);e.PinchOptions=s;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.distance=0,e.scale=0,e.delta=0,e.centerPoint=new o.Point(0,0),e}return i(e,t),e}(o.Data);e.PinchData=u;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startDistance=0,e}return i(e,t),e.prototype.calculateDistance=function(t,e){return e.distanceTo(t)},e.prototype.calculateStartDistance=function(){return this.startDistance||(this.startDistance=this.calculateDistance(this.startPoint0,this.startPoint1))},e.prototype.calculateCurrentDistance=function(){return this.calculateDistance(this.currentPoint0,this.currentPoint1)},e.prototype.setData=function(t){this.currentPoint0=t.pointers[0].page,this.currentPoint1=t.pointers[1].page;var e=this.calculateStartDistance(),n=this.calculateCurrentDistance(),r=Math.abs(e-n);t.distance=r,t.scale=n/e,t.delta=n-e,t.centerPoint.x=(this.currentPoint0.x+this.currentPoint1.x)/2,t.centerPoint.y=(this.currentPoint0.y+this.currentPoint1.y)/2},e.prototype.start=function(t,e){return this.startPoint0=e.pointers[0].page,this.startPoint1=e.pointers[1].page,this.listener.down(t,e,this.target)},e.prototype.update=function(t,e){return this.setData(e),Math.abs(e.distance)<this.listener.options.pinchThreshold?o.RETURN_FLAG.IDLE:this.startEmitted?this.listener.update(t,e,this.target):this.listener.start(t,e,this.target)},e.prototype.end=function(t,e){return this.listener.end(t,e,this.target)},e.prototype.cancel=function(){return this.listener.cancel()},e}(o.Gesture);e.Pinch=a,e.registerPinch=r},function(t,e,n){"use strict";function r(t){t.registerGesture(a,s,void 0,u)}var i=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},o=n(0),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pointers=2,e.rotationThreshold=10,e}return i(e,t),e}(o.Options);e.RotateOptions=s;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rotation=0,e}return i(e,t),e}(o.Data);e.RotateData=u;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.calculateRotation=function(t,e,n,r){var i=t.deltaAngleTo(e),o=n.deltaAngleTo(r);return o-i},e.prototype.setData=function(t){this.currentPoint0=t.pointers[0].page,this.currentPoint1=t.pointers[1].page,t.rotation=this.calculateRotation(this.startPoint0,this.startPoint1,this.currentPoint0,this.currentPoint1)},e.prototype.start=function(t,e){return this.startPoint0=e.pointers[0].page,this.startPoint1=e.pointers[1].page,this.listener.down(t,e,this.target)},e.prototype.update=function(t,e){return this.setData(e),Math.abs(e.rotation)<this.listener.options.rotationThreshold?o.RETURN_FLAG.IDLE:this.startEmitted?this.listener.update(t,e,this.target):this.listener.start(t,e,this.target)},e.prototype.end=function(t,e){return this.listener.end(t,e,this.target)},e.prototype.cancel=function(){return this.listener.cancel()},e}(o.Gesture);e.Rotate=a,e.registerRotate=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(5),o=n(7);e.PointerConfig={start:new i.EventConfig("pointerdown"),update:new i.EventConfig("pointermove"),end:new i.EventConfig("pointerup"),cancel:new i.EventConfig("pointercancel","dragstart")};var s=function(t){function n(n,r){return void 0===r&&(r=e.PointerConfig),t.call(this,n,r)||this}return r(n,t),n.prototype.setPointers=function(t){this.changedPointers.clear();var e=new o.Point(t.pageX,t.pageY),n=new o.Point(t.clientX,t.clientY),r=t.pointerId,i={page:e,client:n};switch(this.changedPointers.set(r,i),t.type){case"pointerdown":case"pointermove":this.allPointers.set(r,i);break;default:this.allPointers.delete(r)}},n}(i.Flow);e.PointerFlow=s},function(t,e,n){"use strict";var r=n(20),i=n(6),o=n(1),s=n(18),u=function(){function t(t,e,n){void 0===n&&(n=new r.Registry),this.element=t,this.supports=e,this.registry=n,this.flows=[],this.activeFlow=null,this.handles=[],this.gestures=[],this.composedGestures=[]}return t.prototype.registerGesture=function(t,e,n,r){void 0===e&&(e=o.Options),void 0===n&&(n=i.Listener),void 0===r&&(r=o.Data),this.registry.register(t,e,n,r)},t.prototype.registerFlow=function(t){var e=this;this.flows.push(t),t.on("start",function(n,r){return e.onStart(t,n,r)}),t.on("update",function(n,r){return e.onUpdate(t,n,r)}),t.on("end",function(n,r){return e.onEnd(t,n,r)}),t.on("cancel",function(n,r){return e.onCancel(t,n,r)}),t.on("stop",function(){return e.onStop()})},t.prototype.registerListener=function(t,e,n){var r=this,i=new s.ListenerHandle(t,e,n);return this.handles.push(i),function(){var t=r.handles.indexOf(i);t!==-1&&r.handles.splice(t,1)}},t.prototype.activate=function(){return this.flows.map(function(t){return t.activate()})},t.prototype.canActivateFlow=function(t){return null===this.activeFlow||this.activeFlow===t},t.prototype.getPointersDelta=function(t,e,n,r){if(o.isMouse(this.supports,t)&&!o.isValidMouseButton(t,r))return{all:-1,changed:-1};var i=e.all.size-n,s=e.changed.size-n;return{all:i,changed:s}},t.prototype.removeGesture=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];t.startEmitted&&t.cancel(),t.unbind();for(var r;r=e.shift();){var i=r.indexOf(t);i!==-1&&r.splice(i,1)}},t.prototype.evaluateStrategyReturnFlag=function(t,e,n){if(n&o.RETURN_FLAG.START_EMITTED&&(e.startEmitted=!0),n&o.RETURN_FLAG.REMOVE&&this.removeGesture(e,this.gestures,this.composedGestures),n&o.RETURN_FLAG.REMOVE_OTHERS)for(var r=this.gestures.slice(),i=void 0;i=r.shift();)e!==i&&this.removeGesture(i,t,this.gestures,this.composedGestures)},t.prototype.whileGestures=function(t,e,n,r){for(var i;i=e.shift();){var s=i.listener.options,u=s.pointers,a=s.which,c=s.strategy,p=this.getPointersDelta(t,n,u,a);if(p.all>0&&c===o.GESTURE_STRATEGY_FLAG.REMOVE_IF_POINTERS_GT)this.removeGesture(i,this.gestures,this.composedGestures);else{var h=r({evt:t,gestures:e,gesture:i,pointers:n,pointersDelta:p});this.evaluateStrategyReturnFlag(e,i,h)}}},t.prototype.addPointerId=function(t,e){t.__POINTERIDS__.push(e)},t.prototype.removePointerIds=function(t,e,n){for(var r,i=this.getPointerIds(e);r=n.shift();){var o=i.indexOf(r);if(o!==-1){var s=i.splice(o,1)[0],u=this.getPointer(t,s);e.__REMOVED_POINTERS__.push(u)}}},t.prototype.getPointerIds=function(t){return t.__POINTERIDS__},t.prototype.getRemovedPointers=function(t){return t.__REMOVED_POINTERS__},t.prototype.getPointer=function(t,e){return t.get(e)},t.prototype.getPointers=function(t,e){var n=this;return e.map(function(e){return n.getPointer(t,e)})},t.prototype.isLockedPointers=function(t,e){var n=this.getPointerIds(t);return n.filter(function(t){return e.has(t)}).length===e.size},t.prototype.startStrategy=function(t){var e=this;return 0!==t.pointersDelta.all?o.RETURN_FLAG.IDLE:(t.pointers.all.forEach(function(n,r){return e.addPointerId(t.gesture,r)}),t.gesture.data.pointers=this.getPointers(t.pointers.all,this.getPointerIds(t.gesture)),t.gesture.start(t.evt,t.gesture.data))},t.prototype.updateStrategy=function(t){return this.isLockedPointers(t.gesture,t.pointers.all)?(t.gesture.data.pointers=this.getPointers(t.pointers.all,this.getPointerIds(t.gesture)),t.gesture.update(t.evt,t.gesture.data)):o.RETURN_FLAG.IDLE},t.prototype.endStrategy=function(t){return t.gesture.startEmitted?(this.removePointerIds(t.pointers.changed,t.gesture,Array.from(t.pointers.changed.keys())),0!==this.getPointerIds(t.gesture).length?o.RETURN_FLAG.IDLE:(t.gesture.data.pointers=this.getRemovedPointers(t.gesture),t.gesture.end(t.evt,t.gesture.data))):o.RETURN_FLAG.REMOVE},t.prototype.cancelStrategy=function(t){return t.gesture.cancel()},t.prototype.onStart=function(t,e,n){return!!this.canActivateFlow(t)&&(this.activeFlow=t,this.activeFlow.continue(),this.gestures=this.gestures.concat(this.match(e.target)).sort(function(t,e){return t.listener.options.prio-e.listener.options.prio}),!!this.gestures.length&&(this.whileGestures(e,this.gestures.slice(),n,this.startStrategy.bind(this)),!0))},t.prototype.onUpdate=function(t,e,n){this.activeFlow===t&&this.whileGestures(e,this.gestures.slice(),n,this.updateStrategy.bind(this))},t.prototype.onEnd=function(t,e,n){this.activeFlow===t&&this.whileGestures(e,this.gestures.slice(),n,this.endStrategy.bind(this))},t.prototype.onCancel=function(t,e,n){this.activeFlow===t&&this.whileGestures(e,this.gestures.slice(),n,this.cancelStrategy.bind(this))},t.prototype.onStop=function(){for(var t,e=this.gestures.slice();t=e.shift();)o.RETURN_FLAG.COMPOSE===t.unbind()&&this.composedGestures.push(t);this.gestures.length=0,this.activeFlow=null},t.prototype.addGesture=function(t,e,n){var r=this.registry.create(t,e,n.listener);return r.bind(n.element,this.registerListener.bind(this),this.removeGesture.bind(this,r,this.gestures,this.composedGestures)),r},t.prototype.composeGesture=function(t,e,n){for(var r;(r=this.composedGestures.shift())&&r.listener!==n.listener;);return r||(r=this.addGesture(t,e,n)),r},t.prototype.matchesHandle=function(t,e){var n=e.element,r=e.listener.selector;return!!n.contains(t)&&((!r||n!==t)&&(!(r&&!o.matchesSelector(t,r))&&!(!r&&t!==n)))},t.prototype.matchHandle=function(t,e,n){if(this.matchesHandle(e,n))return this.composeGesture(t,e,n)},t.prototype.matchHandles=function(t,e){for(var n=0,r=this.handles;n<r.length;n++){var i=r[n],o=this.matchHandle(i.Type,t,i);o&&e.push(o)}return e},t.prototype.match=function(t){for(var e=[],n=t;n&&1===n.nodeType&&n!==this.element;n=n.parentNode)this.matchHandles(n,e);return e},t}();e.Engine=u},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(5),o=n(7);e.MouseConfig={start:new i.EventConfig("mousedown"),update:new i.EventConfig("mousemove"),end:new i.EventConfig("mouseup"),cancel:new i.EventConfig("dragstart","contextmenu")};var s=function(t){function n(n){return t.call(this,n,e.MouseConfig)||this}return r(n,t),n.prototype.setPointers=function(t){var e=new o.Point(t.pageX,t.pageY),n=new o.Point(t.clientX,t.clientY);switch(this.changedPointers.set(1,{page:e,client:n}),t.type){case"mousedown":case"mousemove":this.allPointers.set(1,{page:e,client:n});break;default:this.allPointers.clear()}},n}(i.Flow);e.MouseFlow=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(5),o=n(12);e.MSPointerConfig={start:new i.EventConfig("MSPointerDown"),update:new i.EventConfig("MSPointerMove"),end:new i.EventConfig("MSPointerUp"),cancel:new i.EventConfig("MSPointerCancel","dragstart")};var s=function(t){function n(n){return t.call(this,n,e.MSPointerConfig)||this}return r(n,t),n}(o.PointerFlow);e.MSPointerFlow=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(5),o=n(7);e.TouchConfig={start:new i.EventConfig("touchstart"),update:new i.EventConfig("touchmove"),end:new i.EventConfig("touchend"),cancel:new i.EventConfig("touchcancel","dragstart")};var s=function(t){function n(n){return t.call(this,n,e.TouchConfig)||this}return r(n,t),n.prototype.setPointerMapFromList=function(t,e){var n,r=t.length;for(n=0;n<r;++n){var i=t[n],s=new o.Point(i.pageX,i.pageY),u=new o.Point(i.clientX,i.clientY),a=i.identifier,c={page:s,client:u};e.set(a,c)}},n.prototype.setPointers=function(t){this.allPointers.clear(),this.changedPointers.clear(),this.setPointerMapFromList(t.touches,this.allPointers),this.setPointerMapFromList(t.changedTouches,this.changedPointers)},n}(i.Flow);e.TouchFlow=s},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=function(){function t(t,e,n){this.listener=t,this.data=e,this.target=n,this.__POINTERIDS__=[],this.__REMOVED_POINTERS__=[],this.startEmitted=!1}return t.prototype.bind=function(){},t.prototype.unbind=function(){return 0},t.prototype.start=function(){return 0},t.prototype.update=function(){return 0},t.prototype.end=function(){return 0},t.prototype.cancel=function(){return 0},t}();e.Gesture=i;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e}(i);e.DefaultGesture=o},function(t,e,n){"use strict";var r=function(){function t(t,e,n){this.Type=t,this.element=e,this.listener=n}return t}();e.ListenerHandle=r},function(t,e,n){"use strict";var r=n(13),i=n(15),o=n(12),s=n(16),u=n(14),a=n(6),c=n(1),p=function(){function t(t,e){void 0===t&&(t=window&&window.document),void 0===e&&(e={touchEnabled:"ontouchstart"in window,pointerEnabled:window&&window.navigator.pointerEnabled,msPointerEnabled:window&&window.navigator.msPointerEnabled}),this.element=t,this.supports=e,this.deactivateFlows=null,this.engine=new r.Engine(this.element,this.supports)}return t.prototype.registerDefaultFlowStrategy=function(){this.supports.msPointerEnabled&&this.engine.registerFlow(new i.MSPointerFlow(this.element)),this.supports.pointerEnabled&&this.engine.registerFlow(new o.PointerFlow(this.element)),this.supports.touchEnabled&&this.engine.registerFlow(new s.TouchFlow(this.element)),this.engine.registerFlow(new u.MouseFlow(this.element))},t.prototype.registerGesture=function(t,e,n,r){void 0===e&&(e=c.Options),void 0===n&&(n=a.Listener),void 0===r&&(r=c.Data),this.engine.registerGesture(t,e,n,r)},t.prototype.activate=function(){this.deactivateFlows=this.engine.activate()},t.prototype.deactivate=function(){this.deactivateFlows&&(this.deactivateFlows.forEach(function(t){return t.forEach(function(t){return t()})}),this.deactivateFlows=null)},t.prototype.on=function(t,e,n){return this.engine.registerListener(t,e,n)},t}();e.OribellaApi=p},function(t,e,n){"use strict";var r=n(6),i=n(1),o=function(){function t(){this.gestures=new Map}return t.prototype.register=function(t,e,n,o){void 0===e&&(e=i.Options),void 0===n&&(n=r.Listener),void 0===o&&(o=i.Data),this.gestures.set(t,{Gesture:t,GestureOptions:e,GestureListener:n,GestureData:o})},t.prototype.getTypes=function(){return Array.from(this.gestures.keys())},t.prototype.create=function(t,e,n){var r=this.gestures.get(t);if(!r)throw new Error("The type "+typeof t+" has not been registered");var i=Object.assign(new r.GestureOptions,n.options);return new r.Gesture(new r.GestureListener(i,n),new r.GestureData,e)},t}();e.Registry=o},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var i=n(0),o=n(4),s=n(8),u=n(2),a=n(3),c=n(9),p=n(11),h=n(10);r(n(0)),e.oribella=new i.OribellaApi,r(n(4)),r(n(8)),r(n(2)),r(n(3)),r(n(9)),r(n(11)),r(n(10)),e.oribella.registerDefaultFlowStrategy(),e.oribella.activate(),o.registerTap(e.oribella),s.registerDoubletap(e.oribella),u.registerLongtap(e.oribella),a.registerSwipe(e.oribella),c.registerLongtapSwipe(e.oribella),p.registerRotate(e.oribella),h.registerPinch(e.oribella)}])}); | ||
//# sourceMappingURL=oribella.js.map |
@@ -27,3 +27,3 @@ System.register(["oribella-framework", "./tap"], function (exports_1, context_1) { | ||
function DoubletapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 250; | ||
@@ -38,3 +38,3 @@ return _this; | ||
function Doubletap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
@@ -41,0 +41,0 @@ _this.count = 0; |
@@ -30,3 +30,3 @@ System.register(["oribella-framework", "./longtap", "./swipe"], function (exports_1, context_1) { | ||
function LongtapSwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeThreshold = 500; | ||
@@ -41,3 +41,3 @@ return _this; | ||
function LongtapSwipe() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.allowSwipe = false; | ||
@@ -44,0 +44,0 @@ return _this; |
@@ -24,3 +24,3 @@ System.register(["oribella-framework"], function (exports_1, context_1) { | ||
function LongtapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -50,3 +50,3 @@ _this.timeThreshold = 500; | ||
function Longtap() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.timeoutId = 0; | ||
@@ -53,0 +53,0 @@ _this.timeEndEmitted = false; |
import { OribellaApi } from 'oribella-framework'; | ||
export * from 'oribella-framework'; | ||
export declare const oribella: OribellaApi; | ||
@@ -3,0 +4,0 @@ export * from './tap'; |
@@ -11,4 +11,3 @@ System.register(["oribella-framework", "./tap", "./doubletap", "./longtap", "./swipe", "./longtap-swipe", "./rotate", "./pinch"], function (exports_1, context_1) { | ||
for (var n in m) { | ||
if (n !== "default" && !exportedNames_1.hasOwnProperty(n)) | ||
exports[n] = m[n]; | ||
if (n !== "default" && !exportedNames_1.hasOwnProperty(n)) exports[n] = m[n]; | ||
} | ||
@@ -21,2 +20,3 @@ exports_1(exports); | ||
oribella_framework_1 = oribella_framework_1_1; | ||
exportStar_1(oribella_framework_1_1); | ||
}, | ||
@@ -23,0 +23,0 @@ function (tap_1_1) { |
@@ -24,3 +24,3 @@ System.register(["oribella-framework"], function (exports_1, context_1) { | ||
function PinchOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
@@ -36,3 +36,3 @@ _this.pinchThreshold = 10; | ||
function PinchData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.distance = 0; | ||
@@ -50,3 +50,3 @@ _this.scale = 0; | ||
function Pinch() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.startDistance = 0; | ||
@@ -53,0 +53,0 @@ return _this; |
@@ -24,3 +24,3 @@ System.register(["oribella-framework"], function (exports_1, context_1) { | ||
function RotateOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.pointers = 2; | ||
@@ -36,3 +36,3 @@ _this.rotationThreshold = 10; | ||
function RotateData() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.rotation = 0; | ||
@@ -47,3 +47,3 @@ return _this; | ||
function Rotate() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -50,0 +50,0 @@ Rotate.prototype.calculateRotation = function (p0, p1, p2, p3) { |
@@ -50,3 +50,3 @@ System.register(["oribella-framework"], function (exports_1, context_1) { | ||
function SwipeOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -61,3 +61,3 @@ return _this; | ||
function Swipe() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -64,0 +64,0 @@ Swipe.prototype.start = function (evt, data) { |
@@ -24,3 +24,3 @@ System.register(["oribella-framework"], function (exports_1, context_1) { | ||
function TapOptions() { | ||
var _this = _super.apply(this, arguments) || this; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.radiusThreshold = 2; | ||
@@ -35,3 +35,3 @@ return _this; | ||
function Tap() { | ||
return _super.apply(this, arguments) || this; | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
@@ -38,0 +38,0 @@ Tap.prototype.start = function (evt, data) { |
{ | ||
"name": "oribella", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "A set of preconfigured gestures like tap, longtap, doubletap, swipe, longtap-swipe, pinch, rotate", | ||
@@ -20,6 +20,7 @@ "repository": { | ||
"amd": "npm run compile -- --module amd --outDir dist/amd", | ||
"amd-bundled": "npm run compile -- --module amd --outFile dist/oribella.js", | ||
"amd-bundled": "webpack -p", | ||
"amd-bundled-inline-source-map": "webpack -p --devtool=inline-source-map --output-filename=./dist/oribella-inline-source-map.js", | ||
"system": "npm run compile -- --module system --outDir dist/system", | ||
"es2015": "npm run compile -- --module es2015 --outDir dist/es2015 --target es2015", | ||
"build": "npm-run-all -n clean --parallel commonjs amd amd-bundled system es2015" | ||
"build": "npm-run-all -n clean --parallel commonjs amd amd-bundled amd-bundled-inline-source-map system es2015" | ||
}, | ||
@@ -41,9 +42,10 @@ "author": "Christoffer Åström", | ||
"peerDependencies": { | ||
"oribella-framework": "^0.6.3" | ||
"oribella-framework": "^0.7.0" | ||
}, | ||
"dependencies": { | ||
"oribella-framework": "^0.6.3" | ||
"oribella-framework": "^0.7.0" | ||
} | ||
}, | ||
"devDependencies": { | ||
"awesome-typescript-loader": "^3.0.0-beta.18", | ||
"chai": "^3.5.0", | ||
@@ -58,6 +60,8 @@ "coveralls": "^2.11.15", | ||
"sinon-chai": "^2.8.0", | ||
"source-map-loader": "^0.1.6", | ||
"ts-node": "^1.7.0", | ||
"tslint": "^4.0.2", | ||
"typescript": "^2.1.4", | ||
"typings": "^2.0.0" | ||
"typescript": "^2.1.5", | ||
"typings": "^2.0.0", | ||
"webpack": "^2.2.0-rc.4" | ||
}, | ||
@@ -64,0 +68,0 @@ "dependencies": { |
@@ -10,2 +10,3 @@ import { OribellaApi } from 'oribella-framework'; | ||
export * from 'oribella-framework'; | ||
export const oribella = new OribellaApi(); | ||
@@ -12,0 +13,0 @@ export * from './tap'; |
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
588386
16
3277