Comparing version 0.6.1 to 0.7.0
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class DoubletapOptions extends Options { | ||
@@ -12,4 +12,4 @@ timeThreshold: number; | ||
unbind(): number; | ||
tapEnd(evt: Event, data: Data): number; | ||
tapEnd(args: DefaultListenerArgs): number; | ||
} | ||
export declare function registerDoubletap(oribella: OribellaApi): void; |
@@ -36,3 +36,3 @@ define(["require", "exports", "tslib", "oribella-framework", "./tap"], function (require, exports, tslib_1, oribella_framework_1, tap_1) { | ||
}; | ||
Doubletap.prototype.tapEnd = function (evt, data) { | ||
Doubletap.prototype.tapEnd = function (args) { | ||
var _this = this; | ||
@@ -48,3 +48,3 @@ ++this.count; | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -51,0 +51,0 @@ return oribella_framework_1.RETURN_FLAG.IDLE; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class LongtapSwipeOptions extends Options { | ||
@@ -13,8 +13,8 @@ timeThreshold: number; | ||
longtapTimeEnd(): number; | ||
swipeDown(evt: Event, data: Data): number; | ||
swipeStart(evt: Event, data: Data): number; | ||
swipeUpdate(evt: Event, data: Data): number; | ||
swipeEnd(evt: Event, data: Data): number; | ||
swipeDown(args: DefaultListenerArgs): number; | ||
swipeStart(args: DefaultListenerArgs): number; | ||
swipeUpdate(args: DefaultListenerArgs): number; | ||
swipeEnd(args: DefaultListenerArgs): number; | ||
swipeCancel(): number; | ||
} | ||
export declare function registerLongtapSwipe(oribella: OribellaApi): void; |
@@ -31,6 +31,6 @@ define(["require", "exports", "tslib", "oribella-framework", "./longtap", "./swipe"], function (require, exports, tslib_1, oribella_framework_1, longtap_1, swipe_1) { | ||
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); }, | ||
down: function (args) { return _this.swipeDown(args); }, | ||
start: function (args) { return _this.swipeStart(args); }, | ||
update: function (args) { return _this.swipeUpdate(args); }, | ||
end: function (args) { return _this.swipeEnd(args); }, | ||
cancel: function () { return _this.swipeCancel(); } | ||
@@ -48,6 +48,6 @@ }); | ||
}; | ||
LongtapSwipe.prototype.swipeDown = function (evt, data) { | ||
return this.listener.down(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeDown = function (args) { | ||
return this.listener.down(args); | ||
}; | ||
LongtapSwipe.prototype.swipeStart = function (evt, data) { | ||
LongtapSwipe.prototype.swipeStart = function (args) { | ||
if (!this.allowSwipe) { | ||
@@ -57,9 +57,9 @@ this.remove(); | ||
} | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
}; | ||
LongtapSwipe.prototype.swipeUpdate = function (evt, data) { | ||
return this.listener.update(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeUpdate = function (args) { | ||
return this.listener.update(args); | ||
}; | ||
LongtapSwipe.prototype.swipeEnd = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeEnd = function (args) { | ||
return this.listener.end(args); | ||
}; | ||
@@ -66,0 +66,0 @@ LongtapSwipe.prototype.swipeCancel = function () { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class LongtapOptions extends Options { | ||
@@ -16,7 +16,7 @@ radiusThreshold: number; | ||
timeEndEmitted: boolean; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
end(args: DefaultListenerArgs): number; | ||
cancel(): number; | ||
} | ||
export declare function registerLongtap(oribella: OribellaApi): void; |
@@ -36,5 +36,6 @@ define(["require", "exports", "tslib", "oribella-framework"], function (require, exports, tslib_1, oribella_framework_1) { | ||
} | ||
Longtap.prototype.start = function (evt, data) { | ||
Longtap.prototype.start = function (args) { | ||
var _this = this; | ||
this.startPoint = data.pointers[0].page; | ||
var p0 = args.data.pointers[0].page; | ||
this.startPoint = p0; | ||
this.timeoutId = window.setTimeout(function () { | ||
@@ -44,7 +45,7 @@ _this.listener.timeEnd(); | ||
}, this.listener.options.timeThreshold); | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
}; | ||
Longtap.prototype.update = function (_, data) { | ||
var p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
Longtap.prototype.update = function (_a) { | ||
var page = _a.data.pointers[0].page; | ||
if (page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.REMOVE; | ||
@@ -54,3 +55,3 @@ } | ||
}; | ||
Longtap.prototype.end = function (evt, data) { | ||
Longtap.prototype.end = function (args) { | ||
window.clearTimeout(this.timeoutId); | ||
@@ -60,3 +61,3 @@ if (!this.timeEndEmitted) { | ||
} | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
}; | ||
@@ -63,0 +64,0 @@ Longtap.prototype.cancel = function () { |
@@ -0,0 +0,0 @@ import { OribellaApi } from 'oribella-framework'; |
@@ -0,0 +0,0 @@ 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) { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class PinchOptions extends Options { | ||
@@ -22,7 +22,5 @@ pointers: number; | ||
setData(data: PinchData): void; | ||
start(evt: Event, data: PinchData): number; | ||
update(evt: Event, data: PinchData): number; | ||
end(evt: Event, data: PinchData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<PinchData>): number; | ||
update(args: ListenerArgs<PinchData>): number; | ||
} | ||
export declare function registerPinch(oribella: OribellaApi): void; |
@@ -55,8 +55,10 @@ define(["require", "exports", "tslib", "oribella-framework"], function (require, exports, tslib_1, oribella_framework_1) { | ||
}; | ||
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.start = function (args) { | ||
var _a = args.data.pointers, p0 = _a[0].page, p1 = _a[1].page; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
}; | ||
Pinch.prototype.update = function (evt, data) { | ||
Pinch.prototype.update = function (args) { | ||
var data = args.data; | ||
this.setData(data); | ||
@@ -66,13 +68,6 @@ if (Math.abs(data.distance) < this.listener.options.pinchThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
}; | ||
Pinch.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Pinch.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Pinch; | ||
@@ -79,0 +74,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class RotateOptions extends Options { | ||
@@ -16,7 +16,5 @@ pointers: number; | ||
setData(data: RotateData): void; | ||
start(evt: Event, data: RotateData): number; | ||
update(evt: Event, data: RotateData): number; | ||
end(evt: Event, data: RotateData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<RotateData>): number; | ||
update(args: ListenerArgs<RotateData>): number; | ||
} | ||
export declare function registerRotate(oribella: OribellaApi): void; |
@@ -39,8 +39,10 @@ define(["require", "exports", "tslib", "oribella-framework"], function (require, exports, tslib_1, oribella_framework_1) { | ||
}; | ||
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.start = function (args) { | ||
var _a = args.data.pointers, p0 = _a[0].page, p1 = _a[1].page; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
}; | ||
Rotate.prototype.update = function (evt, data) { | ||
Rotate.prototype.update = function (args) { | ||
var data = args.data; | ||
this.setData(data); | ||
@@ -50,13 +52,6 @@ if (Math.abs(data.rotation) < this.listener.options.rotationThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
}; | ||
Rotate.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Rotate.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Rotate; | ||
@@ -63,0 +58,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class Observation { | ||
@@ -18,7 +18,6 @@ point: Point; | ||
startPoint: Point; | ||
start(evt: Event, data: SwipeData): number; | ||
update(evt: Event, data: SwipeData): number; | ||
end(evt: Event, data: SwipeData): number; | ||
cancel(): number; | ||
start({data, evt}: ListenerArgs<SwipeData>): number; | ||
update(args: ListenerArgs<SwipeData>): number; | ||
end(args: ListenerArgs<SwipeData>): number; | ||
} | ||
export declare function registerSwipe(oribella: OribellaApi): void; |
@@ -44,26 +44,27 @@ define(["require", "exports", "tslib", "oribella-framework"], function (require, exports, tslib_1, oribella_framework_1) { | ||
} | ||
Swipe.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
Swipe.prototype.start = function (_a) { | ||
var data = _a.data, evt = _a.evt; | ||
var page = data.pointers[0].page; | ||
this.startPoint = page; | ||
data.add(this.startPoint, evt.timeStamp); | ||
return this.listener.down(evt, data, this.target); | ||
return this.listener.down(this.args); | ||
}; | ||
Swipe.prototype.update = function (evt, data) { | ||
var currentPoint = data.pointers[0].page; | ||
if (currentPoint.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
Swipe.prototype.update = function (args) { | ||
var data = args.data, evt = args.evt; | ||
var page = data.pointers[0].page; | ||
if (page.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.IDLE; | ||
} | ||
data.add(currentPoint, evt.timeStamp); | ||
data.add(page, evt.timeStamp); | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return this.listener.update(args); | ||
}; | ||
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.end = function (args) { | ||
var data = args.data, evt = args.evt; | ||
var page = data.pointers[0].page; | ||
data.add(page, evt.timeStamp); | ||
return this.listener.end(args); | ||
}; | ||
Swipe.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Swipe; | ||
@@ -70,0 +71,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class TapOptions extends Options { | ||
@@ -7,7 +7,5 @@ radiusThreshold: number; | ||
startPoint: Point; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
cancel(): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
} | ||
export declare function registerTap(oribella: OribellaApi): void; |
@@ -18,19 +18,13 @@ define(["require", "exports", "tslib", "oribella-framework"], function (require, exports, tslib_1, oribella_framework_1) { | ||
} | ||
Tap.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
return this.listener.start(evt, data, this.target); | ||
Tap.prototype.start = function (args) { | ||
var page = args.data.pointers[0].page; | ||
this.startPoint = page; | ||
return this.listener.start(args); | ||
}; | ||
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.update = function (_a) { | ||
var page = _a.data.pointers[0].page; | ||
return page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold ? | ||
oribella_framework_1.RETURN_FLAG.REMOVE : | ||
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; | ||
@@ -37,0 +31,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class DoubletapOptions extends Options { | ||
@@ -12,4 +12,4 @@ timeThreshold: number; | ||
unbind(): number; | ||
tapEnd(evt: Event, data: Data): number; | ||
tapEnd(args: DefaultListenerArgs): number; | ||
} | ||
export declare function registerDoubletap(oribella: OribellaApi): void; |
@@ -38,3 +38,3 @@ "use strict"; | ||
}; | ||
Doubletap.prototype.tapEnd = function (evt, data) { | ||
Doubletap.prototype.tapEnd = function (args) { | ||
var _this = this; | ||
@@ -50,3 +50,3 @@ ++this.count; | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -53,0 +53,0 @@ return oribella_framework_1.RETURN_FLAG.IDLE; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class LongtapSwipeOptions extends Options { | ||
@@ -13,8 +13,8 @@ timeThreshold: number; | ||
longtapTimeEnd(): number; | ||
swipeDown(evt: Event, data: Data): number; | ||
swipeStart(evt: Event, data: Data): number; | ||
swipeUpdate(evt: Event, data: Data): number; | ||
swipeEnd(evt: Event, data: Data): number; | ||
swipeDown(args: DefaultListenerArgs): number; | ||
swipeStart(args: DefaultListenerArgs): number; | ||
swipeUpdate(args: DefaultListenerArgs): number; | ||
swipeEnd(args: DefaultListenerArgs): number; | ||
swipeCancel(): number; | ||
} | ||
export declare function registerLongtapSwipe(oribella: OribellaApi): void; |
@@ -34,6 +34,6 @@ "use strict"; | ||
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); }, | ||
down: function (args) { return _this.swipeDown(args); }, | ||
start: function (args) { return _this.swipeStart(args); }, | ||
update: function (args) { return _this.swipeUpdate(args); }, | ||
end: function (args) { return _this.swipeEnd(args); }, | ||
cancel: function () { return _this.swipeCancel(); } | ||
@@ -51,6 +51,6 @@ }); | ||
}; | ||
LongtapSwipe.prototype.swipeDown = function (evt, data) { | ||
return this.listener.down(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeDown = function (args) { | ||
return this.listener.down(args); | ||
}; | ||
LongtapSwipe.prototype.swipeStart = function (evt, data) { | ||
LongtapSwipe.prototype.swipeStart = function (args) { | ||
if (!this.allowSwipe) { | ||
@@ -60,9 +60,9 @@ this.remove(); | ||
} | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
}; | ||
LongtapSwipe.prototype.swipeUpdate = function (evt, data) { | ||
return this.listener.update(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeUpdate = function (args) { | ||
return this.listener.update(args); | ||
}; | ||
LongtapSwipe.prototype.swipeEnd = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeEnd = function (args) { | ||
return this.listener.end(args); | ||
}; | ||
@@ -69,0 +69,0 @@ LongtapSwipe.prototype.swipeCancel = function () { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class LongtapOptions extends Options { | ||
@@ -16,7 +16,7 @@ radiusThreshold: number; | ||
timeEndEmitted: boolean; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
end(args: DefaultListenerArgs): number; | ||
cancel(): number; | ||
} | ||
export declare function registerLongtap(oribella: OribellaApi): void; |
@@ -37,5 +37,6 @@ "use strict"; | ||
} | ||
Longtap.prototype.start = function (evt, data) { | ||
Longtap.prototype.start = function (args) { | ||
var _this = this; | ||
this.startPoint = data.pointers[0].page; | ||
var p0 = args.data.pointers[0].page; | ||
this.startPoint = p0; | ||
this.timeoutId = window.setTimeout(function () { | ||
@@ -45,7 +46,7 @@ _this.listener.timeEnd(); | ||
}, this.listener.options.timeThreshold); | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
}; | ||
Longtap.prototype.update = function (_, data) { | ||
var p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
Longtap.prototype.update = function (_a) { | ||
var page = _a.data.pointers[0].page; | ||
if (page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.REMOVE; | ||
@@ -55,3 +56,3 @@ } | ||
}; | ||
Longtap.prototype.end = function (evt, data) { | ||
Longtap.prototype.end = function (args) { | ||
window.clearTimeout(this.timeoutId); | ||
@@ -61,3 +62,3 @@ if (!this.timeEndEmitted) { | ||
} | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
}; | ||
@@ -64,0 +65,0 @@ Longtap.prototype.cancel = function () { |
@@ -0,0 +0,0 @@ import { OribellaApi } from 'oribella-framework'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class PinchOptions extends Options { | ||
@@ -22,7 +22,5 @@ pointers: number; | ||
setData(data: PinchData): void; | ||
start(evt: Event, data: PinchData): number; | ||
update(evt: Event, data: PinchData): number; | ||
end(evt: Event, data: PinchData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<PinchData>): number; | ||
update(args: ListenerArgs<PinchData>): number; | ||
} | ||
export declare function registerPinch(oribella: OribellaApi): void; |
@@ -56,8 +56,10 @@ "use strict"; | ||
}; | ||
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.start = function (args) { | ||
var _a = args.data.pointers, p0 = _a[0].page, p1 = _a[1].page; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
}; | ||
Pinch.prototype.update = function (evt, data) { | ||
Pinch.prototype.update = function (args) { | ||
var data = args.data; | ||
this.setData(data); | ||
@@ -67,13 +69,6 @@ if (Math.abs(data.distance) < this.listener.options.pinchThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
}; | ||
Pinch.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Pinch.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Pinch; | ||
@@ -80,0 +75,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class RotateOptions extends Options { | ||
@@ -16,7 +16,5 @@ pointers: number; | ||
setData(data: RotateData): void; | ||
start(evt: Event, data: RotateData): number; | ||
update(evt: Event, data: RotateData): number; | ||
end(evt: Event, data: RotateData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<RotateData>): number; | ||
update(args: ListenerArgs<RotateData>): number; | ||
} | ||
export declare function registerRotate(oribella: OribellaApi): void; |
@@ -40,8 +40,10 @@ "use strict"; | ||
}; | ||
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.start = function (args) { | ||
var _a = args.data.pointers, p0 = _a[0].page, p1 = _a[1].page; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
}; | ||
Rotate.prototype.update = function (evt, data) { | ||
Rotate.prototype.update = function (args) { | ||
var data = args.data; | ||
this.setData(data); | ||
@@ -51,13 +53,6 @@ if (Math.abs(data.rotation) < this.listener.options.rotationThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
}; | ||
Rotate.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Rotate.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Rotate; | ||
@@ -64,0 +59,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class Observation { | ||
@@ -18,7 +18,6 @@ point: Point; | ||
startPoint: Point; | ||
start(evt: Event, data: SwipeData): number; | ||
update(evt: Event, data: SwipeData): number; | ||
end(evt: Event, data: SwipeData): number; | ||
cancel(): number; | ||
start({data, evt}: ListenerArgs<SwipeData>): number; | ||
update(args: ListenerArgs<SwipeData>): number; | ||
end(args: ListenerArgs<SwipeData>): number; | ||
} | ||
export declare function registerSwipe(oribella: OribellaApi): void; |
@@ -45,26 +45,27 @@ "use strict"; | ||
} | ||
Swipe.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
Swipe.prototype.start = function (_a) { | ||
var data = _a.data, evt = _a.evt; | ||
var page = data.pointers[0].page; | ||
this.startPoint = page; | ||
data.add(this.startPoint, evt.timeStamp); | ||
return this.listener.down(evt, data, this.target); | ||
return this.listener.down(this.args); | ||
}; | ||
Swipe.prototype.update = function (evt, data) { | ||
var currentPoint = data.pointers[0].page; | ||
if (currentPoint.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
Swipe.prototype.update = function (args) { | ||
var data = args.data, evt = args.evt; | ||
var page = data.pointers[0].page; | ||
if (page.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.IDLE; | ||
} | ||
data.add(currentPoint, evt.timeStamp); | ||
data.add(page, evt.timeStamp); | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return this.listener.update(args); | ||
}; | ||
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.end = function (args) { | ||
var data = args.data, evt = args.evt; | ||
var page = data.pointers[0].page; | ||
data.add(page, evt.timeStamp); | ||
return this.listener.end(args); | ||
}; | ||
Swipe.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Swipe; | ||
@@ -71,0 +72,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class TapOptions extends Options { | ||
@@ -7,7 +7,5 @@ radiusThreshold: number; | ||
startPoint: Point; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
cancel(): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
} | ||
export declare function registerTap(oribella: OribellaApi): void; |
@@ -19,19 +19,13 @@ "use strict"; | ||
} | ||
Tap.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
return this.listener.start(evt, data, this.target); | ||
Tap.prototype.start = function (args) { | ||
var page = args.data.pointers[0].page; | ||
this.startPoint = page; | ||
return this.listener.start(args); | ||
}; | ||
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.update = function (_a) { | ||
var page = _a.data.pointers[0].page; | ||
return page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold ? | ||
oribella_framework_1.RETURN_FLAG.REMOVE : | ||
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; | ||
@@ -38,0 +32,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class DoubletapOptions extends Options { | ||
@@ -12,4 +12,4 @@ timeThreshold: number; | ||
unbind(): number; | ||
tapEnd(evt: Event, data: Data): number; | ||
tapEnd(args: DefaultListenerArgs): number; | ||
} | ||
export declare function registerDoubletap(oribella: OribellaApi): void; |
@@ -30,3 +30,3 @@ import { Options, RETURN_FLAG, Gesture } from 'oribella-framework'; | ||
} | ||
tapEnd(evt, data) { | ||
tapEnd(args) { | ||
++this.count; | ||
@@ -41,3 +41,3 @@ if (this.count === 1) { | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -44,0 +44,0 @@ return RETURN_FLAG.IDLE; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class LongtapSwipeOptions extends Options { | ||
@@ -13,8 +13,8 @@ timeThreshold: number; | ||
longtapTimeEnd(): number; | ||
swipeDown(evt: Event, data: Data): number; | ||
swipeStart(evt: Event, data: Data): number; | ||
swipeUpdate(evt: Event, data: Data): number; | ||
swipeEnd(evt: Event, data: Data): number; | ||
swipeDown(args: DefaultListenerArgs): number; | ||
swipeStart(args: DefaultListenerArgs): number; | ||
swipeUpdate(args: DefaultListenerArgs): number; | ||
swipeEnd(args: DefaultListenerArgs): number; | ||
swipeCancel(): number; | ||
} | ||
export declare function registerLongtapSwipe(oribella: OribellaApi): void; |
@@ -25,6 +25,6 @@ import { Options, RETURN_FLAG, Gesture } from 'oribella-framework'; | ||
options: this.listener.options, | ||
down: (evt, data) => this.swipeDown(evt, data), | ||
start: (evt, data) => this.swipeStart(evt, data), | ||
update: (evt, data) => this.swipeUpdate(evt, data), | ||
end: (evt, data) => this.swipeEnd(evt, data), | ||
down: (args) => this.swipeDown(args), | ||
start: (args) => this.swipeStart(args), | ||
update: (args) => this.swipeUpdate(args), | ||
end: (args) => this.swipeEnd(args), | ||
cancel: () => this.swipeCancel() | ||
@@ -42,6 +42,6 @@ }); | ||
} | ||
swipeDown(evt, data) { | ||
return this.listener.down(evt, data, this.target); | ||
swipeDown(args) { | ||
return this.listener.down(args); | ||
} | ||
swipeStart(evt, data) { | ||
swipeStart(args) { | ||
if (!this.allowSwipe) { | ||
@@ -51,9 +51,9 @@ this.remove(); | ||
} | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
swipeUpdate(evt, data) { | ||
return this.listener.update(evt, data, this.target); | ||
swipeUpdate(args) { | ||
return this.listener.update(args); | ||
} | ||
swipeEnd(evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
swipeEnd(args) { | ||
return this.listener.end(args); | ||
} | ||
@@ -60,0 +60,0 @@ swipeCancel() { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class LongtapOptions extends Options { | ||
@@ -16,7 +16,7 @@ radiusThreshold: number; | ||
timeEndEmitted: boolean; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
end(args: DefaultListenerArgs): number; | ||
cancel(): number; | ||
} | ||
export declare function registerLongtap(oribella: OribellaApi): void; |
@@ -25,4 +25,5 @@ import { Options, RETURN_FLAG, Gesture, Listener, ensureProperties } from 'oribella-framework'; | ||
} | ||
start(evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
start(args) { | ||
const { data: { pointers: [{ page: p0 }] } } = args; | ||
this.startPoint = p0; | ||
this.timeoutId = window.setTimeout(() => { | ||
@@ -32,7 +33,6 @@ this.listener.timeEnd(); | ||
}, this.listener.options.timeThreshold); | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
update(_, data) { | ||
const p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
update({ data: { pointers: [{ page }] } }) { | ||
if (page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return RETURN_FLAG.REMOVE; | ||
@@ -42,3 +42,3 @@ } | ||
} | ||
end(evt, data) { | ||
end(args) { | ||
window.clearTimeout(this.timeoutId); | ||
@@ -48,3 +48,3 @@ if (!this.timeEndEmitted) { | ||
} | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -51,0 +51,0 @@ cancel() { |
@@ -0,0 +0,0 @@ import { OribellaApi } from 'oribella-framework'; |
@@ -0,0 +0,0 @@ import { OribellaApi } from 'oribella-framework'; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class PinchOptions extends Options { | ||
@@ -22,7 +22,5 @@ pointers: number; | ||
setData(data: PinchData): void; | ||
start(evt: Event, data: PinchData): number; | ||
update(evt: Event, data: PinchData): number; | ||
end(evt: Event, data: PinchData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<PinchData>): number; | ||
update(args: ListenerArgs<PinchData>): number; | ||
} | ||
export declare function registerPinch(oribella: OribellaApi): void; |
@@ -44,8 +44,10 @@ import { Options, Data, RETURN_FLAG, Gesture, Point } from 'oribella-framework'; | ||
} | ||
start(evt, data) { | ||
this.startPoint0 = data.pointers[0].page; | ||
this.startPoint1 = data.pointers[1].page; | ||
return this.listener.down(evt, data, this.target); | ||
start(args) { | ||
const { data: { pointers: [{ page: p0 }, { page: p1 }] } } = args; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
} | ||
update(evt, data) { | ||
update(args) { | ||
const { data } = args; | ||
this.setData(data); | ||
@@ -55,13 +57,6 @@ if (Math.abs(data.distance) < this.listener.options.pinchThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
} | ||
end(evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -68,0 +63,0 @@ export function registerPinch(oribella) { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class RotateOptions extends Options { | ||
@@ -16,7 +16,5 @@ pointers: number; | ||
setData(data: RotateData): void; | ||
start(evt: Event, data: RotateData): number; | ||
update(evt: Event, data: RotateData): number; | ||
end(evt: Event, data: RotateData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<RotateData>): number; | ||
update(args: ListenerArgs<RotateData>): number; | ||
} | ||
export declare function registerRotate(oribella: OribellaApi): void; |
@@ -26,8 +26,10 @@ import { Options, Data, RETURN_FLAG, Gesture } from 'oribella-framework'; | ||
} | ||
start(evt, data) { | ||
this.startPoint0 = data.pointers[0].page; | ||
this.startPoint1 = data.pointers[1].page; | ||
return this.listener.down(evt, data, this.target); | ||
start(args) { | ||
const { data: { pointers: [{ page: p0 }, { page: p1 }] } } = args; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
} | ||
update(evt, data) { | ||
update(args) { | ||
const { data } = args; | ||
this.setData(data); | ||
@@ -37,13 +39,6 @@ if (Math.abs(data.rotation) < this.listener.options.rotationThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
} | ||
end(evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -50,0 +45,0 @@ export function registerRotate(oribella) { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class Observation { | ||
@@ -18,7 +18,6 @@ point: Point; | ||
startPoint: Point; | ||
start(evt: Event, data: SwipeData): number; | ||
update(evt: Event, data: SwipeData): number; | ||
end(evt: Event, data: SwipeData): number; | ||
cancel(): number; | ||
start({data, evt}: ListenerArgs<SwipeData>): number; | ||
update(args: ListenerArgs<SwipeData>): number; | ||
end(args: ListenerArgs<SwipeData>): number; | ||
} | ||
export declare function registerSwipe(oribella: OribellaApi): void; |
@@ -28,26 +28,26 @@ import { Options, Data, RETURN_FLAG, Gesture } from 'oribella-framework'; | ||
export class Swipe extends Gesture { | ||
start(evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
start({ data, evt }) { | ||
const { pointers: [{ page }] } = data; | ||
this.startPoint = page; | ||
data.add(this.startPoint, evt.timeStamp); | ||
return this.listener.down(evt, data, this.target); | ||
return this.listener.down(this.args); | ||
} | ||
update(evt, data) { | ||
const currentPoint = data.pointers[0].page; | ||
if (currentPoint.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
update(args) { | ||
const { data, evt } = args; | ||
const { pointers: [{ page }] } = data; | ||
if (page.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
return RETURN_FLAG.IDLE; | ||
} | ||
data.add(currentPoint, evt.timeStamp); | ||
data.add(page, evt.timeStamp); | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return this.listener.update(args); | ||
} | ||
end(evt, data) { | ||
const currentPoint = data.pointers[0].page; | ||
data.add(currentPoint, evt.timeStamp); | ||
return this.listener.end(evt, data, this.target); | ||
end(args) { | ||
const { data, evt } = args; | ||
const { pointers: [{ page }] } = data; | ||
data.add(page, evt.timeStamp); | ||
return this.listener.end(args); | ||
} | ||
cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -54,0 +54,0 @@ export function registerSwipe(oribella) { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class TapOptions extends Options { | ||
@@ -7,7 +7,5 @@ radiusThreshold: number; | ||
startPoint: Point; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
cancel(): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
} | ||
export declare function registerTap(oribella: OribellaApi): void; |
@@ -9,19 +9,12 @@ import { Options, RETURN_FLAG, Gesture } from 'oribella-framework'; | ||
export class Tap extends Gesture { | ||
start(evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
return this.listener.start(evt, data, this.target); | ||
start(args) { | ||
const { data: { pointers: [{ page }] } } = args; | ||
this.startPoint = page; | ||
return this.listener.start(args); | ||
} | ||
update(_, data) { | ||
const p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return RETURN_FLAG.REMOVE; | ||
} | ||
return RETURN_FLAG.IDLE; | ||
update({ data: { pointers: [{ page }] } }) { | ||
return page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold ? | ||
RETURN_FLAG.REMOVE : | ||
RETURN_FLAG.IDLE; | ||
} | ||
end(evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -28,0 +21,0 @@ export function registerTap(oribella) { |
@@ -1,2 +0,2 @@ | ||
define("oribella",[],function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},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=22)}([function(t,e,n){"use strict";function i(t,e){function n(){this.constructor=t}p(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function r(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&(n[i[r]]=t[i[r]]);return n}function o(t,e,n,i){var r,o=arguments.length,s=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var u=t.length-1;u>=0;u--)(r=t[u])&&(s=(o<3?r(s):o>3?r(e,n,s):r(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function s(t,e){return function(n,i){e(n,i,t)}}function u(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function a(t,e,n,i){return new(n||(n=Promise))(function(r,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){t.done?r(t.value):new n(function(e){e(t.value)}).then(s,u)}a((i=i.apply(t,e||[])).next())})}function c(t,e){function n(t){return function(e){return i([t,e])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){u.label=n[1];break}if(6===n[0]&&u.label<s[1]){u.label=s[1],s=n;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(n);break}s[2]&&u.ops.pop(),u.trys.pop();continue}n=e.call(t,u)}catch(t){n=[6,t],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return{next:n(0),throw:n(1),return:n(2)}}Object.defineProperty(e,"__esModule",{value:!0}),e.__extends=i,n.d(e,"__assign",function(){return h}),e.__rest=r,e.__decorate=o,e.__param=s,e.__metadata=u,e.__awaiter=a,e.__generator=c;/*! ***************************************************************************** | ||
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=22)}([function(t,e,n){"use strict";function r(t,e){function n(){this.constructor=t}y(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function i(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]]);return n}function o(t,e,n,r){var i,o=arguments.length,s=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(o<3?i(s):o>3?i(e,n,s):i(e,n))||s);return o>3&&s&&Object.defineProperty(e,n,s),s}function s(t,e){return function(n,r){e(n,r,t)}}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function u(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(s,a)}u((r=r.apply(t,e||[])).next())})}function c(t,e){function n(t){return function(e){return r([t,e])}}function r(n){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return u.label++,{value:n[1],done:!1};case 5:u.label++,o=n[1],n=[0];continue;case 7:n=u.ops.pop(),u.trys.pop();continue;default:if(s=u.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){u=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){u.label=n[1];break}if(6===n[0]&&u.label<s[1]){u.label=s[1],s=n;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(n);break}s[2]&&u.ops.pop(),u.trys.pop();continue}n=e.call(t,u)}catch(t){n=[6,t],o=0}finally{i=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var i,o,s,a,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}function p(t,e){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}function l(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function h(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function f(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(h(arguments[e]));return t}function d(t,e,n){function r(t){return function(e){return new Promise(function(n,r){d.push([t,e,n,r]),i()})}}function i(){!l&&d.length&&o((l=d.shift())[0],l[1])}function o(t,e){try{s(f[t](e))}catch(t){p(l[3],t)}}function s(t){t.done?p(l[2],t):"yield"===t.value[0]?p(l[2],{value:t.value[1],done:!1}):Promise.resolve(t.value[1]).then("delegate"===t.value[0]?a:u,c)}function a(t){s(t.done?t:{value:["yield",t.value],done:!1})}function u(t){o("next",t)}function c(t){o("throw",t)}function p(t,e){l=void 0,t(e),i()}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l,h,f=n.apply(t,e||[]),d=[];return h={next:r("next"),throw:r("throw"),return:r("return")},h[Symbol.asyncIterator]=function(){return this},h}function g(t){function e(e,n){return function(r){return{value:["delegate",(t[e]||n).call(t,r)],done:!1}}}var n={next:e("next"),throw:e("throw",function(t){throw t}),return:e("return",function(t){return{value:t,done:!0}})};return t=v(t),n[Symbol.iterator]=function(){return this},n}function v(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof l?l(t):t[Symbol.iterator]()}Object.defineProperty(e,"__esModule",{value:!0}),e.__extends=r,n.d(e,"__assign",function(){return w}),e.__rest=i,e.__decorate=o,e.__param=s,e.__metadata=a,e.__awaiter=u,e.__generator=c,e.__exportStar=p,e.__values=l,e.__read=h,e.__spread=f,e.__asyncGenerator=d,e.__asyncDelegator=g,e.__asyncValues=v;/*! ***************************************************************************** | ||
Copyright (c) Microsoft Corporation. All rights reserved. | ||
@@ -15,3 +15,3 @@ Licensed under the Apache License, Version 2.0 (the "License"); you may not use | ||
***************************************************************************** */ | ||
var p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},h=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}i(n(8)),i(n(2)),i(n(7)),i(n(18)),i(n(20))},function(t,e,n){"use strict";function i(t,n){return void 0===n&&(n=e.SUPPORTS),!(!n.msPointerEnabled||t.pointerType!==t.MSPOINTER_TYPE_MOUSE)||(!(!n.pointerEnabled||"mouse"!==t.pointerType)||t.type.indexOf("mouse")!==-1)}function r(t,e){var n=t.button,i=t.which,r=i||void 0===n?i:1&n?1:2&n?3:4&n?2:0;return Array.isArray(e)?e.some(function(t){return r===t}):r===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=n(0);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.SUPPORTS={get touchEnabled(){return"ontouchstart"in window},get pointerEnabled(){return window&&window.navigator.pointerEnabled},get msPointerEnabled(){return window&&window.navigator.msPointerEnabled}},e.isMouse=i,e.isValidMouseButton=r,e.matchesSelector=o;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u.__extends(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 i(t){t.registerGesture(a,s,u)}var r=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e.timeThreshold=500,e}return r.__extends(e,t),e}(o.Options);e.LongtapOptions=s;var u=function(t){function e(e,n){var i=t.call(this,e,n)||this;return i.options=e,i.listener=o.ensureProperties(n,{timeEnd:function(){}}),i}return r.__extends(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 r.__extends(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=i},function(t,e,n){"use strict";function i(t){t.registerGesture(c,a,void 0,u)}var r=n(0),o=n(1),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 r.__extends(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 r.__extends(e,t),e}(o.Options);e.SwipeOptions=a;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(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=i},function(t,e,n){"use strict";function i(t){t.registerGesture(u,s)}var r=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e}return r.__extends(e,t),e}(o.Options);e.TapOptions=s;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(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=i},function(t,e,n){"use strict";var i=n(0),r=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 i=this.listenerMap.get(t)||[];return i.forEach(function(t){return t.apply(null,e)}),!0},t}();e.EventEmitter=r;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 i=t.call(this)||this;return i.element=e,i.startListen=[],i.continueListen=[],i.removeListeners=[],i.allPointers=new Map,i.changedPointers=new Map,i.pointers={all:i.allPointers,changed:i.changedPointers},i.config=n,i}return i.__extends(e,t),e.prototype.proxy=function(t,e){this.setPointers(e),t(e)},e.prototype.addDOMEventListener=function(t,e,n){var i=this.proxy.bind(this,n);return t.addEventListener(e,i,!1),this.removeDOMEventListener.bind(this,t,e,i)},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}(r);e.Flow=s},function(t,e,n){"use strict";var i=n(0),r=n(2),o=function(){function t(t,e){void 0===e&&(e={}),this.options=t,this.selector="",this.listener=r.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 r.RETURN_FLAG.map(this.listener.down(t,e,n))},t.prototype.start=function(t,e,n){var i=r.RETURN_FLAG.map(this.listener.start(t,e,n));return i&r.RETURN_FLAG.START_EMITTED||(i+=r.RETURN_FLAG.START_EMITTED),i},t.prototype.update=function(t,e,n){return r.RETURN_FLAG.map(this.listener.update(t,e,n))},t.prototype.end=function(t,e,n){return r.RETURN_FLAG.map(this.listener.end(t,e,n))},t.prototype.cancel=function(){return r.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 i.__extends(e,t),e}(o);e.DefaultListener=s},function(t,e,n){"use strict";var i=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,i=Math.sqrt(e*e+n*n);return i},t.prototype.deltaAngleTo=function(t){var e=t.x-this.x,n=t.y-this.y,i=Math.atan2(n,e),r=180*i/Math.PI;return r},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Point=i},function(t,e,n){"use strict";function i(t){t.registerGesture(a,u)}var r=n(0),o=n(1),s=n(5),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeThreshold=250,e}return r.__extends(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 r.__extends(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=i},function(t,e,n){"use strict";function i(t){t.registerGesture(c,a)}var r=n(0),o=n(1),s=n(3),u=n(4),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeThreshold=500,e}return r.__extends(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 r.__extends(e,t),e.prototype.bind=function(t,e,n){var i=this;this.unregisterLongtap=e(s.Longtap,t,{selector:this.listener.selector,options:this.listener.options,down:function(){return i.longtapDown()},timeEnd:function(){return i.longtapTimeEnd()}}),this.unregisterSwipe=e(u.Swipe,t,{selector:this.listener.selector,options:this.listener.options,down:function(t,e){return i.swipeDown(t,e)},start:function(t,e){return i.swipeStart(t,e)},update:function(t,e){return i.swipeUpdate(t,e)},end:function(t,e){return i.swipeEnd(t,e)},cancel:function(){return i.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=i},function(t,e,n){"use strict";function i(t){t.registerGesture(a,s,void 0,u)}var r=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pointers=2,e.pinchThreshold=10,e}return r.__extends(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 r.__extends(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 r.__extends(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(),i=Math.abs(e-n);t.distance=i,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=i},function(t,e,n){"use strict";function i(t){t.registerGesture(a,s,void 0,u)}var r=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pointers=2,e.rotationThreshold=10,e}return r.__extends(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 r.__extends(e,t),e}(o.Data);e.RotateData=u;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e.prototype.calculateRotation=function(t,e,n,i){var r=t.deltaAngleTo(e),o=n.deltaAngleTo(i);return o-r},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=i},function(t,e,n){"use strict";var i=n(0),r=n(6),o=n(8);e.PointerConfig={start:new r.EventConfig("pointerdown"),update:new r.EventConfig("pointermove"),end:new r.EventConfig("pointerup"),cancel:new r.EventConfig("pointercancel","dragstart")};var s=function(t){function n(n,i){return void 0===i&&(i=e.PointerConfig),t.call(this,n,i)||this}return i.__extends(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),i=t.pointerId,r={page:e,client:n};switch(this.changedPointers.set(i,r),t.type){case"pointerdown":case"pointermove":this.allPointers.set(i,r);break;default:this.allPointers.delete(i)}},n}(r.Flow);e.PointerFlow=s},function(t,e,n){"use strict";var i=n(21),r=n(7),o=n(2),s=n(19),u=function(){function t(t,e){void 0===e&&(e=new i.Registry),this.element=t,this.registry=e,this.flows=[],this.activeFlow=null,this.handles=[],this.gestures=[],this.composedGestures=[]}return t.prototype.registerGesture=function(t,e,n,i){void 0===e&&(e=o.Options),void 0===n&&(n=r.Listener),void 0===i&&(i=o.Data),this.registry.register(t,e,n,i)},t.prototype.registerFlow=function(t){var e=this;this.flows.push(t),t.on("start",function(n,i){return e.onStart(t,n,i)}),t.on("update",function(n,i){return e.onUpdate(t,n,i)}),t.on("end",function(n,i){return e.onEnd(t,n,i)}),t.on("cancel",function(n,i){return e.onCancel(t,n,i)}),t.on("stop",function(){return e.onStop()})},t.prototype.registerListener=function(t,e,n){var i=this,r=new s.ListenerHandle(t,e,n);return this.handles.push(r),function(){var t=i.handles.indexOf(r);t!==-1&&i.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,i){if(o.isMouse(t)&&!o.isValidMouseButton(t,i))return{all:-1,changed:-1};var r=e.all.size-n,s=e.changed.size-n;return{all:r,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 i;i=e.shift();){var r=i.indexOf(t);r!==-1&&i.splice(r,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 i=this.gestures.slice(),r=void 0;r=i.shift();)e!==r&&this.removeGesture(r,t,this.gestures,this.composedGestures)},t.prototype.whileGestures=function(t,e,n,i){for(var r;r=e.shift();){var s=r.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(r,this.gestures,this.composedGestures);else{var h=i({evt:t,gestures:e,gesture:r,pointers:n,pointersDelta:p});this.evaluateStrategyReturnFlag(e,r,h)}}},t.prototype.addPointerId=function(t,e){t.__POINTERIDS__.push(e)},t.prototype.removePointerIds=function(t,e,n){for(var i,r=this.getPointerIds(e);i=n.shift();){var o=r.indexOf(i);if(o!==-1){var s=r.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,i){return e.addPointerId(t.gesture,i)}),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,e)).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):t.stop();this.gestures.length=0,this.activeFlow=null},t.prototype.addGesture=function(t,e,n,i){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),i),r},t.prototype.composeGesture=function(t,e,n,i){for(var r;(r=this.composedGestures.shift())&&r.listener!==n.listener;);return r||(r=this.addGesture(t,e,n,i)),r},t.prototype.matchesHandle=function(t,e){var n=e.element,i=e.listener.selector;return!!n.contains(t)&&((!i||n!==t)&&(!(i&&!o.matchesSelector(t,i))&&!(!i&&t!==n)))},t.prototype.matchHandle=function(t,e,n,i){if(this.matchesHandle(e,n))return this.composeGesture(t,e,n,i)},t.prototype.matchHandles=function(t,e,n){for(var i=0,r=this.handles;i<r.length;i++){var o=r[i],s=this.matchHandle(o.Type,t,o,n);s&&e.push(s)}return e},t.prototype.match=function(t,e){for(var n=[],i=t;i&&1===i.nodeType&&i!==this.element;i=i.parentNode)this.matchHandles(i,n,e);return n},t}();e.Engine=u},function(t,e,n){"use strict";var i=n(0),r=n(6),o=n(8);e.MouseConfig={start:new r.EventConfig("mousedown"),update:new r.EventConfig("mousemove"),end:new r.EventConfig("mouseup"),cancel:new r.EventConfig("dragstart","contextmenu")};var s=function(t){function n(n){return t.call(this,n,e.MouseConfig)||this}return i.__extends(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}(r.Flow);e.MouseFlow=s},function(t,e,n){"use strict";var i=n(0),r=n(6),o=n(13);e.MSPointerConfig={start:new r.EventConfig("MSPointerDown"),update:new r.EventConfig("MSPointerMove"),end:new r.EventConfig("MSPointerUp"),cancel:new r.EventConfig("MSPointerCancel","dragstart")};var s=function(t){function n(n){return t.call(this,n,e.MSPointerConfig)||this}return i.__extends(n,t),n}(o.PointerFlow);e.MSPointerFlow=s},function(t,e,n){"use strict";var i=n(0),r=n(6),o=n(8);e.TouchConfig={start:new r.EventConfig("touchstart"),update:new r.EventConfig("touchmove"),end:new r.EventConfig("touchend"),cancel:new r.EventConfig("touchcancel","dragstart")};var s=function(t){function n(n){return t.call(this,n,e.TouchConfig)||this}return i.__extends(n,t),n.prototype.setPointerMapFromList=function(t,e){var n,i=t.length;for(n=0;n<i;++n){var r=t[n],s=new o.Point(r.pageX,r.pageY),u=new o.Point(r.clientX,r.clientY),a=r.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}(r.Flow);e.TouchFlow=s},function(t,e,n){"use strict";var i=n(0),r=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.prototype.stop=function(){},t}();e.Gesture=r;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e}(r);e.DefaultGesture=o},function(t,e,n){"use strict";var i=function(){function t(t,e,n){this.Type=t,this.element=e,this.listener=n}return t}();e.ListenerHandle=i},function(t,e,n){"use strict";var i=n(14),r=n(16),o=n(13),s=n(17),u=n(15),a=n(7),c=n(2),p=function(){function t(t){void 0===t&&(t=window&&window.document),this.element=t,this.deactivateFlows=null,this.engine=new i.Engine(this.element)}return t.prototype.registerDefaultFlowStrategy=function(t){void 0===t&&(t=c.SUPPORTS),t.msPointerEnabled&&this.engine.registerFlow(new r.MSPointerFlow(this.element)),t.pointerEnabled&&this.engine.registerFlow(new o.PointerFlow(this.element)),t.touchEnabled&&this.engine.registerFlow(new s.TouchFlow(this.element)),this.engine.registerFlow(new u.MouseFlow(this.element))},t.prototype.registerGesture=function(t,e,n,i){void 0===e&&(e=c.Options),void 0===n&&(n=a.Listener),void 0===i&&(i=c.Data),this.engine.registerGesture(t,e,n,i)},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 i=n(7),r=n(2),o=function(){function t(){this.gestures=new Map}return t.prototype.register=function(t,e,n,o){void 0===e&&(e=r.Options),void 0===n&&(n=i.Listener),void 0===o&&(o=r.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 i=this.gestures.get(t);if(!i)throw new Error("The type "+typeof t+" has not been registered");var r=Object.assign(new i.GestureOptions,n.options);return new i.Gesture(new i.GestureListener(r,n),new i.GestureData,e)},t}();e.Registry=o},function(t,e,n){"use strict";function i(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}var r=n(1),o=n(5),s=n(9),u=n(3),a=n(4),c=n(10),p=n(12),h=n(11);i(n(1)),e.oribella=new r.OribellaApi,i(n(5)),i(n(9)),i(n(3)),i(n(4)),i(n(10)),i(n(12)),i(n(11)),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)}])}); | ||
var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])},w=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t}},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(8)),r(n(2)),r(n(7)),r(n(18)),r(n(20))},function(t,e,n){"use strict";function r(t,n){return void 0===n&&(n=e.SUPPORTS),!(!n.msPointerEnabled||t.pointerType!==t.MSPOINTER_TYPE_MOUSE)||(!(!n.pointerEnabled||"mouse"!==t.pointerType)||t.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 a=n(0);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.SUPPORTS={get touchEnabled(){return"ontouchstart"in window},get pointerEnabled(){return window&&window.navigator.pointerEnabled},get msPointerEnabled(){return window&&window.navigator.msPointerEnabled}},e.isMouse=r,e.isValidMouseButton=i,e.matchesSelector=o;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return a.__extends(e,t),e}(Map);e.PointerDataMap=u;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(u,s,a)}var i=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e.timeThreshold=500,e}return i.__extends(e,t),e}(o.Options);e.LongtapOptions=s;var a=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.options=e,r.listener=o.ensureProperties(n,{timeEnd:function(){}}),r}return i.__extends(e,t),e.prototype.timeEnd=function(){return o.RETURN_FLAG.map(this.listener.timeEnd())},e}(o.Listener);e.LongtapListener=a;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeoutId=0,e.timeEndEmitted=!1,e}return i.__extends(e,t),e.prototype.start=function(t){var e=this,n=t.data.pointers[0].page;return this.startPoint=n,this.timeoutId=window.setTimeout(function(){e.listener.timeEnd(),e.timeEndEmitted=!0},this.listener.options.timeThreshold),this.listener.start(t)},e.prototype.update=function(t){var e=t.data.pointers[0].page;return e.distanceTo(this.startPoint)>this.listener.options.radiusThreshold?o.RETURN_FLAG.REMOVE:o.RETURN_FLAG.IDLE},e.prototype.end=function(t){return window.clearTimeout(this.timeoutId),this.timeEndEmitted?this.listener.end(t):o.RETURN_FLAG.REMOVE},e.prototype.cancel=function(){return window.clearTimeout(this.timeoutId),this.listener.cancel()},e}(o.Gesture);e.Longtap=u,e.registerLongtap=r},function(t,e,n){"use strict";function r(t){t.registerGesture(c,u,void 0,a)}var i=n(0),o=n(1),s=function(){function t(t,e){this.point=t,this.timeStamp=e}return t}();e.Observation=s;var a=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.__extends(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=a;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e}return i.__extends(e,t),e}(o.Options);e.SwipeOptions=u;var c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.start=function(t){var e=t.data,n=t.evt,r=e.pointers[0].page;return this.startPoint=r,e.add(this.startPoint,n.timeStamp),this.listener.down(this.args)},e.prototype.update=function(t){var e=t.data,n=t.evt,r=e.pointers[0].page;return r.distanceTo(this.startPoint)<this.listener.options.radiusThreshold?o.RETURN_FLAG.IDLE:(e.add(r,n.timeStamp),this.startEmitted?this.listener.update(t):this.listener.start(t))},e.prototype.end=function(t){var e=t.data,n=t.evt,r=e.pointers[0].page;return e.add(r,n.timeStamp),this.listener.end(t)},e}(o.Gesture);e.Swipe=c,e.registerSwipe=r},function(t,e,n){"use strict";function r(t){t.registerGesture(a,s)}var i=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.radiusThreshold=2,e}return i.__extends(e,t),e}(o.Options);e.TapOptions=s;var a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(e,t),e.prototype.start=function(t){var e=t.data.pointers[0].page;return this.startPoint=e,this.listener.start(t)},e.prototype.update=function(t){var e=t.data.pointers[0].page;return e.distanceTo(this.startPoint)>this.listener.options.radiusThreshold?o.RETURN_FLAG.REMOVE:o.RETURN_FLAG.IDLE},e}(o.Gesture);e.Tap=a,e.registerTap=r},function(t,e,n){"use strict";var r=n(0),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.__extends(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=n(0),i=n(2),o=function(){function t(){}return t}();e.ListenerArgs=o;var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(o);e.DefaultListenerArgs=s;var a=function(){function t(t,e){void 0===e&&(e={}),this.options=t,this.selector="",this.listener=i.ensureProperties(e,{selector:"",down:function(t){},start:function(t){},update:function(t){},end:function(t){},cancel:function(){},stop:function(){}})}return t.prototype.down=function(t){return i.RETURN_FLAG.map(this.listener.down(t))},t.prototype.start=function(t){var e=i.RETURN_FLAG.map(this.listener.start(t));return e&i.RETURN_FLAG.START_EMITTED||(e+=i.RETURN_FLAG.START_EMITTED),e},t.prototype.update=function(t){return i.RETURN_FLAG.map(this.listener.update(t))},t.prototype.end=function(t){return i.RETURN_FLAG.map(this.listener.end(t))},t.prototype.cancel=function(){return i.RETURN_FLAG.map(this.listener.cancel())},t.prototype.stop=function(){this.listener.stop()},t}();e.Listener=a;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(e,t),e}(a);e.DefaultListener=u},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(u,a)}var i=n(0),o=n(1),s=n(5),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeThreshold=250,e}return i.__extends(e,t),e}(o.Options);e.DoubletapOptions=a;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeoutId=0,e.count=0,e}return i.__extends(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){var e=this;if(++this.count,1===this.count)this.timeoutId=window.setTimeout(function(){e.remove(),e.unregisterTap()},this.listener.options.timeThreshold);else if(2===this.count)return window.clearTimeout(this.timeoutId),this.listener.end(t);return o.RETURN_FLAG.IDLE},e}(o.Gesture);e.Doubletap=u,e.registerDoubletap=r},function(t,e,n){"use strict";function r(t){t.registerGesture(c,u)}var i=n(0),o=n(1),s=n(3),a=n(4),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.timeThreshold=500,e}return i.__extends(e,t),e}(o.Options);e.LongtapSwipeOptions=u;var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allowSwipe=!1,e}return i.__extends(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(a.Swipe,t,{selector:this.listener.selector,options:this.listener.options,down:function(t){return r.swipeDown(t)},start:function(t){return r.swipeStart(t)},update:function(t){return r.swipeUpdate(t)},end:function(t){return r.swipeEnd(t)},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){return this.listener.down(t)},e.prototype.swipeStart=function(t){return this.allowSwipe?this.listener.start(t):(this.remove(),o.RETURN_FLAG.REMOVE)},e.prototype.swipeUpdate=function(t){return this.listener.update(t)},e.prototype.swipeEnd=function(t){return this.listener.end(t)},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(u,s,void 0,a)}var i=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pointers=2,e.pinchThreshold=10,e}return i.__extends(e,t),e}(o.Options);e.PinchOptions=s;var a=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.__extends(e,t),e}(o.Data);e.PinchData=a;var u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.startDistance=0,e}return i.__extends(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){var e=t.data.pointers,n=e[0].page,r=e[1].page;return this.startPoint0=n,this.startPoint1=r,this.listener.down(t)},e.prototype.update=function(t){var e=t.data;return this.setData(e),Math.abs(e.distance)<this.listener.options.pinchThreshold?o.RETURN_FLAG.IDLE:this.startEmitted?this.listener.update(t):this.listener.start(t)},e}(o.Gesture);e.Pinch=u,e.registerPinch=r},function(t,e,n){"use strict";function r(t){t.registerGesture(u,s,void 0,a)}var i=n(0),o=n(1),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pointers=2,e.rotationThreshold=10,e}return i.__extends(e,t),e}(o.Options);e.RotateOptions=s;var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rotation=0,e}return i.__extends(e,t),e}(o.Data);e.RotateData=a;var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(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){var e=t.data.pointers,n=e[0].page,r=e[1].page;return this.startPoint0=n,this.startPoint1=r,this.listener.down(t)},e.prototype.update=function(t){var e=t.data;return this.setData(e),Math.abs(e.rotation)<this.listener.options.rotationThreshold?o.RETURN_FLAG.IDLE:this.startEmitted?this.listener.update(t):this.listener.start(t)},e}(o.Gesture);e.Rotate=u,e.registerRotate=r},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(8);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.__extends(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(21),i=n(7),o=n(2),s=n(19),a=function(){function t(t,e){void 0===e&&(e=new r.Registry),this.element=t,this.registry=e,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(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){if(e&o.RETURN_FLAG.START_EMITTED&&(t.startEmitted=!0),e&o.RETURN_FLAG.REMOVE&&this.removeGesture(t,this.gestures,this.composedGestures),e&o.RETURN_FLAG.REMOVE_OTHERS)for(var n=this.gestures.slice(),r=void 0;r=n.shift();)t!==r&&this.removeGesture(r,this.gestures,this.composedGestures)},t.prototype.whileGestures=function(t,e,n,r){for(var i;i=e.shift();){var s=i.listener.options,a=s.pointers,u=s.which,c=s.strategy,p=this.getPointersDelta(t,n,a,u);if(p.all>0&&c===o.GESTURE_STRATEGY_FLAG.REMOVE_IF_POINTERS_GT)this.removeGesture(i,this.gestures,this.composedGestures);else{var l=r({evt:t,gestures:e,gesture:i,pointers:n,pointersDelta:p});this.evaluateStrategyReturnFlag(i,l)}}},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],a=this.getPointer(t,s);e.__REMOVED_POINTERS__.push(a)}}},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.args.data.pointers=this.getPointers(t.pointers.all,this.getPointerIds(t.gesture)),t.gesture.args.evt=t.evt,t.gesture.start(t.gesture.args))},t.prototype.updateStrategy=function(t){return this.isLockedPointers(t.gesture,t.pointers.all)?(t.gesture.args.data.pointers=this.getPointers(t.pointers.all,this.getPointerIds(t.gesture)),t.gesture.args.evt=t.evt,t.gesture.update(t.gesture.args)):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.args.data.pointers=this.getRemovedPointers(t.gesture),t.gesture.args.evt=t.evt,t.gesture.end(t.gesture.args))):(t.gesture.stop(),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,e)).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):t.stop();this.gestures.length=0,this.activeFlow=null},t.prototype.addGesture=function(t,e,n,r){var i=this.registry.create(t,e,n.listener);return i.bind(n.element,this.registerListener.bind(this),this.removeGesture.bind(this,i,this.gestures,this.composedGestures),r),i},t.prototype.composeGesture=function(t,e,n,r){for(var i;(i=this.composedGestures.shift())&&i.listener!==n.listener;);return i||(i=this.addGesture(t,e,n,r)),i},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,r){if(this.matchesHandle(e,n))return this.composeGesture(t,e,n,r)},t.prototype.matchHandles=function(t,e,n){for(var r=0,i=this.handles;r<i.length;r++){var o=i[r],s=this.matchHandle(o.Type,t,o,n);s&&e.push(s)}return e},t.prototype.match=function(t,e){for(var n=[],r=t;r&&1===r.nodeType&&r!==this.element;r=r.parentNode)this.matchHandles(r,n,e);return n},t}();e.Engine=a},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(8);e.MouseConfig={start:new i.EventConfig("mousedown"),update:new i.EventConfig("mousemove"),end:new i.EventConfig("mouseup"),cancel:new i.EventConfig("dragstart")};var s=function(t){function n(n){return t.call(this,n,e.MouseConfig)||this}return r.__extends(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=n(0),i=n(6),o=n(13);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.__extends(n,t),n}(o.PointerFlow);e.MSPointerFlow=s},function(t,e,n){"use strict";var r=n(0),i=n(6),o=n(8);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.__extends(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),a=new o.Point(i.clientX,i.clientY),u=i.identifier,c={page:s,client:a};e.set(u,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=n(0),i=function(){function t(t,e,n){this.listener=t,this.data=e,this.target=n,this.__POINTERIDS__=[],this.__REMOVED_POINTERS__=[],this.startEmitted=!1,this.args={},this.args.data=e,this.args.target=n}return t.prototype.bind=function(){},t.prototype.unbind=function(){return 0},t.prototype.start=function(t){return this.listener.start(t)},t.prototype.update=function(t){return this.listener.update(t)},t.prototype.end=function(t){return this.listener.end(t)},t.prototype.cancel=function(){return this.listener.cancel()},t.prototype.stop=function(){this.listener.stop()},t}();e.Gesture=i;var o=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.__extends(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(14),i=n(16),o=n(13),s=n(17),a=n(15),u=n(7),c=n(2),p=function(){function t(t){void 0===t&&(t=window&&window.document),this.element=t,this.deactivateFlows=null,this.engine=new r.Engine(this.element)}return t.prototype.registerDefaultFlowStrategy=function(t){void 0===t&&(t=c.SUPPORTS),t.msPointerEnabled&&this.engine.registerFlow(new i.MSPointerFlow(this.element)),t.pointerEnabled&&this.engine.registerFlow(new o.PointerFlow(this.element)),t.touchEnabled&&this.engine.registerFlow(new s.TouchFlow(this.element)),this.engine.registerFlow(new a.MouseFlow(this.element))},t.prototype.registerGesture=function(t,e,n,r){void 0===e&&(e=c.Options),void 0===n&&(n=u.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(7),i=n(2),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(1),o=n(5),s=n(9),a=n(3),u=n(4),c=n(10),p=n(12),l=n(11);r(n(1)),e.oribella=new i.OribellaApi,r(n(5)),r(n(9)),r(n(3)),r(n(4)),r(n(10)),r(n(12)),r(n(11)),e.oribella.registerDefaultFlowStrategy(),e.oribella.activate(),o.registerTap(e.oribella),s.registerDoubletap(e.oribella),a.registerLongtap(e.oribella),u.registerSwipe(e.oribella),c.registerLongtapSwipe(e.oribella),p.registerRotate(e.oribella),l.registerPinch(e.oribella)}])}); | ||
//# sourceMappingURL=oribella.js.map |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class DoubletapOptions extends Options { | ||
@@ -12,4 +12,4 @@ timeThreshold: number; | ||
unbind(): number; | ||
tapEnd(evt: Event, data: Data): number; | ||
tapEnd(args: DefaultListenerArgs): number; | ||
} | ||
export declare function registerDoubletap(oribella: OribellaApi): void; |
@@ -55,3 +55,3 @@ System.register(["tslib", "oribella-framework", "./tap"], function (exports_1, context_1) { | ||
}; | ||
Doubletap.prototype.tapEnd = function (evt, data) { | ||
Doubletap.prototype.tapEnd = function (args) { | ||
var _this = this; | ||
@@ -67,3 +67,3 @@ ++this.count; | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -70,0 +70,0 @@ return oribella_framework_1.RETURN_FLAG.IDLE; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
export declare class LongtapSwipeOptions extends Options { | ||
@@ -13,8 +13,8 @@ timeThreshold: number; | ||
longtapTimeEnd(): number; | ||
swipeDown(evt: Event, data: Data): number; | ||
swipeStart(evt: Event, data: Data): number; | ||
swipeUpdate(evt: Event, data: Data): number; | ||
swipeEnd(evt: Event, data: Data): number; | ||
swipeDown(args: DefaultListenerArgs): number; | ||
swipeStart(args: DefaultListenerArgs): number; | ||
swipeUpdate(args: DefaultListenerArgs): number; | ||
swipeEnd(args: DefaultListenerArgs): number; | ||
swipeCancel(): number; | ||
} | ||
export declare function registerLongtapSwipe(oribella: OribellaApi): void; |
@@ -53,6 +53,6 @@ System.register(["tslib", "oribella-framework", "./longtap", "./swipe"], function (exports_1, context_1) { | ||
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); }, | ||
down: function (args) { return _this.swipeDown(args); }, | ||
start: function (args) { return _this.swipeStart(args); }, | ||
update: function (args) { return _this.swipeUpdate(args); }, | ||
end: function (args) { return _this.swipeEnd(args); }, | ||
cancel: function () { return _this.swipeCancel(); } | ||
@@ -70,6 +70,6 @@ }); | ||
}; | ||
LongtapSwipe.prototype.swipeDown = function (evt, data) { | ||
return this.listener.down(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeDown = function (args) { | ||
return this.listener.down(args); | ||
}; | ||
LongtapSwipe.prototype.swipeStart = function (evt, data) { | ||
LongtapSwipe.prototype.swipeStart = function (args) { | ||
if (!this.allowSwipe) { | ||
@@ -79,9 +79,9 @@ this.remove(); | ||
} | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
}; | ||
LongtapSwipe.prototype.swipeUpdate = function (evt, data) { | ||
return this.listener.update(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeUpdate = function (args) { | ||
return this.listener.update(args); | ||
}; | ||
LongtapSwipe.prototype.swipeEnd = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
LongtapSwipe.prototype.swipeEnd = function (args) { | ||
return this.listener.end(args); | ||
}; | ||
@@ -88,0 +88,0 @@ LongtapSwipe.prototype.swipeCancel = function () { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class LongtapOptions extends Options { | ||
@@ -16,7 +16,7 @@ radiusThreshold: number; | ||
timeEndEmitted: boolean; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
end(args: DefaultListenerArgs): number; | ||
cancel(): number; | ||
} | ||
export declare function registerLongtap(oribella: OribellaApi): void; |
@@ -52,5 +52,6 @@ System.register(["tslib", "oribella-framework"], function (exports_1, context_1) { | ||
} | ||
Longtap.prototype.start = function (evt, data) { | ||
Longtap.prototype.start = function (args) { | ||
var _this = this; | ||
this.startPoint = data.pointers[0].page; | ||
var p0 = args.data.pointers[0].page; | ||
this.startPoint = p0; | ||
this.timeoutId = window.setTimeout(function () { | ||
@@ -60,7 +61,7 @@ _this.listener.timeEnd(); | ||
}, this.listener.options.timeThreshold); | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
}; | ||
Longtap.prototype.update = function (_, data) { | ||
var p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
Longtap.prototype.update = function (_a) { | ||
var page = _a.data.pointers[0].page; | ||
if (page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.REMOVE; | ||
@@ -70,3 +71,3 @@ } | ||
}; | ||
Longtap.prototype.end = function (evt, data) { | ||
Longtap.prototype.end = function (args) { | ||
window.clearTimeout(this.timeoutId); | ||
@@ -76,3 +77,3 @@ if (!this.timeEndEmitted) { | ||
} | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
}; | ||
@@ -79,0 +80,0 @@ Longtap.prototype.cancel = function () { |
@@ -0,0 +0,0 @@ import { OribellaApi } from 'oribella-framework'; |
@@ -0,0 +0,0 @@ System.register(["oribella-framework", "./tap", "./doubletap", "./longtap", "./swipe", "./longtap-swipe", "./rotate", "./pinch"], function (exports_1, context_1) { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class PinchOptions extends Options { | ||
@@ -22,7 +22,5 @@ pointers: number; | ||
setData(data: PinchData): void; | ||
start(evt: Event, data: PinchData): number; | ||
update(evt: Event, data: PinchData): number; | ||
end(evt: Event, data: PinchData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<PinchData>): number; | ||
update(args: ListenerArgs<PinchData>): number; | ||
} | ||
export declare function registerPinch(oribella: OribellaApi): void; |
@@ -71,8 +71,10 @@ System.register(["tslib", "oribella-framework"], function (exports_1, context_1) { | ||
}; | ||
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.start = function (args) { | ||
var _a = args.data.pointers, p0 = _a[0].page, p1 = _a[1].page; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
}; | ||
Pinch.prototype.update = function (evt, data) { | ||
Pinch.prototype.update = function (args) { | ||
var data = args.data; | ||
this.setData(data); | ||
@@ -82,13 +84,6 @@ if (Math.abs(data.distance) < this.listener.options.pinchThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
}; | ||
Pinch.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Pinch.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Pinch; | ||
@@ -95,0 +90,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class RotateOptions extends Options { | ||
@@ -16,7 +16,5 @@ pointers: number; | ||
setData(data: RotateData): void; | ||
start(evt: Event, data: RotateData): number; | ||
update(evt: Event, data: RotateData): number; | ||
end(evt: Event, data: RotateData): number; | ||
cancel(): number; | ||
start(args: ListenerArgs<RotateData>): number; | ||
update(args: ListenerArgs<RotateData>): number; | ||
} | ||
export declare function registerRotate(oribella: OribellaApi): void; |
@@ -55,8 +55,10 @@ System.register(["tslib", "oribella-framework"], function (exports_1, context_1) { | ||
}; | ||
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.start = function (args) { | ||
var _a = args.data.pointers, p0 = _a[0].page, p1 = _a[1].page; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
}; | ||
Rotate.prototype.update = function (evt, data) { | ||
Rotate.prototype.update = function (args) { | ||
var data = args.data; | ||
this.setData(data); | ||
@@ -66,13 +68,6 @@ if (Math.abs(data.rotation) < this.listener.options.rotationThreshold) { | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
}; | ||
Rotate.prototype.end = function (evt, data) { | ||
return this.listener.end(evt, data, this.target); | ||
}; | ||
Rotate.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Rotate; | ||
@@ -79,0 +74,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
export declare class Observation { | ||
@@ -18,7 +18,6 @@ point: Point; | ||
startPoint: Point; | ||
start(evt: Event, data: SwipeData): number; | ||
update(evt: Event, data: SwipeData): number; | ||
end(evt: Event, data: SwipeData): number; | ||
cancel(): number; | ||
start({data, evt}: ListenerArgs<SwipeData>): number; | ||
update(args: ListenerArgs<SwipeData>): number; | ||
end(args: ListenerArgs<SwipeData>): number; | ||
} | ||
export declare function registerSwipe(oribella: OribellaApi): void; |
@@ -60,26 +60,27 @@ System.register(["tslib", "oribella-framework"], function (exports_1, context_1) { | ||
} | ||
Swipe.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
Swipe.prototype.start = function (_a) { | ||
var data = _a.data, evt = _a.evt; | ||
var page = data.pointers[0].page; | ||
this.startPoint = page; | ||
data.add(this.startPoint, evt.timeStamp); | ||
return this.listener.down(evt, data, this.target); | ||
return this.listener.down(this.args); | ||
}; | ||
Swipe.prototype.update = function (evt, data) { | ||
var currentPoint = data.pointers[0].page; | ||
if (currentPoint.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
Swipe.prototype.update = function (args) { | ||
var data = args.data, evt = args.evt; | ||
var page = data.pointers[0].page; | ||
if (page.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
return oribella_framework_1.RETURN_FLAG.IDLE; | ||
} | ||
data.add(currentPoint, evt.timeStamp); | ||
data.add(page, evt.timeStamp); | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return this.listener.update(args); | ||
}; | ||
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.end = function (args) { | ||
var data = args.data, evt = args.evt; | ||
var page = data.pointers[0].page; | ||
data.add(page, evt.timeStamp); | ||
return this.listener.end(args); | ||
}; | ||
Swipe.prototype.cancel = function () { | ||
return this.listener.cancel(); | ||
}; | ||
return Swipe; | ||
@@ -86,0 +87,0 @@ }(oribella_framework_1.Gesture)); |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
export declare class TapOptions extends Options { | ||
@@ -7,7 +7,5 @@ radiusThreshold: number; | ||
startPoint: Point; | ||
start(evt: Event, data: Data): number; | ||
update(_: Event, data: Data): number; | ||
end(evt: Event, data: Data): number; | ||
cancel(): number; | ||
start(args: DefaultListenerArgs): number; | ||
update({data: {pointers: [{page}]}}: DefaultListenerArgs): number; | ||
} | ||
export declare function registerTap(oribella: OribellaApi): void; |
@@ -34,19 +34,13 @@ System.register(["tslib", "oribella-framework"], function (exports_1, context_1) { | ||
} | ||
Tap.prototype.start = function (evt, data) { | ||
this.startPoint = data.pointers[0].page; | ||
return this.listener.start(evt, data, this.target); | ||
Tap.prototype.start = function (args) { | ||
var page = args.data.pointers[0].page; | ||
this.startPoint = page; | ||
return this.listener.start(args); | ||
}; | ||
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.update = function (_a) { | ||
var page = _a.data.pointers[0].page; | ||
return page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold ? | ||
oribella_framework_1.RETURN_FLAG.REMOVE : | ||
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; | ||
@@ -53,0 +47,0 @@ }(oribella_framework_1.Gesture)); |
{ | ||
"name": "oribella", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"description": "A set of preconfigured gestures like tap, longtap, doubletap, swipe, longtap-swipe, pinch, rotate", | ||
@@ -68,3 +68,3 @@ "repository": { | ||
"dependencies": { | ||
"oribella-framework": "^0.8.1" | ||
"oribella-framework": "^0.9.0" | ||
}, | ||
@@ -71,0 +71,0 @@ "nyc": { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
import { Tap } from './tap'; | ||
@@ -29,3 +29,3 @@ | ||
} | ||
public tapEnd(evt: Event, data: Data) { | ||
public tapEnd(args: DefaultListenerArgs) { | ||
++this.count; | ||
@@ -39,3 +39,3 @@ if (this.count === 1) { | ||
window.clearTimeout(this.timeoutId); | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -42,0 +42,0 @@ return RETURN_FLAG.IDLE; |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, DefaultListener } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, DefaultListener, DefaultListenerArgs } from 'oribella-framework'; | ||
import { Longtap, LongtapOptions, LongtapListener } from './longtap'; | ||
@@ -25,6 +25,6 @@ import { Swipe } from './swipe'; | ||
options: this.listener.options, | ||
down: (evt: Event, data: Data) => this.swipeDown(evt, data), | ||
start: (evt: Event, data: Data) => this.swipeStart(evt, data), | ||
update: (evt: Event, data: Data) => this.swipeUpdate(evt, data), | ||
end: (evt: Event, data: Data) => this.swipeEnd(evt, data), | ||
down: (args: DefaultListenerArgs) => this.swipeDown(args), | ||
start: (args: DefaultListenerArgs) => this.swipeStart(args), | ||
update: (args: DefaultListenerArgs) => this.swipeUpdate(args), | ||
end: (args: DefaultListenerArgs) => this.swipeEnd(args), | ||
cancel: () => this.swipeCancel() | ||
@@ -42,6 +42,6 @@ }); | ||
} | ||
public swipeDown(evt: Event, data: Data) { | ||
return this.listener.down(evt, data, this.target); | ||
public swipeDown(args: DefaultListenerArgs) { | ||
return this.listener.down(args); | ||
} | ||
public swipeStart(evt: Event, data: Data) { | ||
public swipeStart(args: DefaultListenerArgs) { | ||
if (!this.allowSwipe) { | ||
@@ -51,9 +51,9 @@ this.remove(); | ||
} | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
public swipeUpdate(evt: Event, data: Data) { | ||
return this.listener.update(evt, data, this.target); | ||
public swipeUpdate(args: DefaultListenerArgs) { | ||
return this.listener.update(args); | ||
} | ||
public swipeEnd(evt: Event, data: Data) { | ||
return this.listener.end(evt, data, this.target); | ||
public swipeEnd(args: DefaultListenerArgs) { | ||
return this.listener.end(args); | ||
} | ||
@@ -60,0 +60,0 @@ public swipeCancel() { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, Point, ensureProperties } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, DefaultListenerArgs, Point, ensureProperties } from 'oribella-framework'; | ||
@@ -24,4 +24,5 @@ export class LongtapOptions extends Options { | ||
public start(evt: Event, data: Data): number { | ||
this.startPoint = data.pointers[0].page; | ||
public start(args: DefaultListenerArgs): number { | ||
const { data: { pointers: [{ page: p0 }] } } = args; | ||
this.startPoint = p0; | ||
this.timeoutId = window.setTimeout(() => { | ||
@@ -31,7 +32,6 @@ this.listener.timeEnd(); | ||
}, this.listener.options.timeThreshold); | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
public update(_: Event, data: Data): number { | ||
const p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
public update({ data: { pointers: [{ page }] } }: DefaultListenerArgs): number { | ||
if (page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return RETURN_FLAG.REMOVE; | ||
@@ -41,3 +41,3 @@ } | ||
} | ||
public end(evt: Event, data: Data): number { | ||
public end(args: DefaultListenerArgs): number { | ||
window.clearTimeout(this.timeoutId); | ||
@@ -47,3 +47,3 @@ if (!this.timeEndEmitted) { | ||
} | ||
return this.listener.end(evt, data, this.target); | ||
return this.listener.end(args); | ||
} | ||
@@ -50,0 +50,0 @@ public cancel() { |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
@@ -45,8 +45,10 @@ export class PinchOptions extends Options { | ||
} | ||
public start(evt: Event, data: PinchData): number { | ||
this.startPoint0 = data.pointers[0].page; | ||
this.startPoint1 = data.pointers[1].page; | ||
return this.listener.down(evt, data, this.target); | ||
public start(args: ListenerArgs<PinchData>): number { | ||
const { data: { pointers: [{ page: p0 }, { page: p1 }] } } = args; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
} | ||
public update(evt: Event, data: PinchData): number { | ||
public update(args: ListenerArgs<PinchData>): number { | ||
const { data } = args; | ||
this.setData(data); | ||
@@ -57,13 +59,6 @@ | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
} | ||
public end(evt: Event, data: PinchData): number { | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
public cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -70,0 +65,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
@@ -28,8 +28,10 @@ export class RotateOptions extends Options { | ||
} | ||
public start(evt: Event, data: RotateData): number { | ||
this.startPoint0 = data.pointers[0].page; | ||
this.startPoint1 = data.pointers[1].page; | ||
return this.listener.down(evt, data, this.target); | ||
public start(args: ListenerArgs<RotateData>): number { | ||
const { data: { pointers: [{ page: p0 }, { page: p1 }] } } = args; | ||
this.startPoint0 = p0; | ||
this.startPoint1 = p1; | ||
return this.listener.down(args); | ||
} | ||
public update(evt: Event, data: RotateData): number { | ||
public update(args: ListenerArgs<RotateData>): number { | ||
const { data } = args; | ||
this.setData(data); | ||
@@ -40,13 +42,6 @@ | ||
} | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return !this.startEmitted ? | ||
this.listener.start(args) : | ||
this.listener.update(args); | ||
} | ||
public end(evt: Event, data: RotateData): number { | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
public cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -53,0 +48,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, ListenerArgs, Point } from 'oribella-framework'; | ||
@@ -26,27 +26,26 @@ export class Observation { | ||
public startPoint: Point; | ||
public start(evt: Event, data: SwipeData): number { | ||
this.startPoint = data.pointers[0].page; | ||
public start({ data, evt }: ListenerArgs<SwipeData>): number { | ||
const { pointers: [{ page }] } = data; | ||
this.startPoint = page; | ||
data.add(this.startPoint, evt.timeStamp); | ||
return this.listener.down(evt, data, this.target); | ||
return this.listener.down(this.args); | ||
} | ||
public update(evt: Event, data: SwipeData): number { | ||
const currentPoint = data.pointers[0].page; | ||
if (currentPoint.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
public update(args: ListenerArgs<SwipeData>): number { | ||
const { data, evt } = args; | ||
const { pointers: [{ page }] } = data; | ||
if (page.distanceTo(this.startPoint) < this.listener.options.radiusThreshold) { | ||
return RETURN_FLAG.IDLE; | ||
} | ||
data.add(currentPoint, evt.timeStamp); | ||
data.add(page, evt.timeStamp); | ||
if (!this.startEmitted) { | ||
return this.listener.start(evt, data, this.target); | ||
return this.listener.start(args); | ||
} | ||
return this.listener.update(evt, data, this.target); | ||
return this.listener.update(args); | ||
} | ||
public end(evt: Event, data: SwipeData): number { | ||
const currentPoint = data.pointers[0].page; | ||
data.add(currentPoint, evt.timeStamp); | ||
return this.listener.end(evt, data, this.target); | ||
public end(args: ListenerArgs<SwipeData>): number { | ||
const { data, evt } = args; | ||
const { pointers: [{ page }] } = data; | ||
data.add(page, evt.timeStamp); | ||
return this.listener.end(args); | ||
} | ||
public cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -53,0 +52,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, Point } from 'oribella-framework'; | ||
import { OribellaApi, Options, Data, RETURN_FLAG, Gesture, Listener, DefaultListenerArgs, Point } from 'oribella-framework'; | ||
@@ -9,20 +9,12 @@ export class TapOptions extends Options { | ||
public startPoint: Point; | ||
public start(evt: Event, data: Data): number { | ||
this.startPoint = data.pointers[0].page; | ||
return this.listener.start(evt, data, this.target); | ||
public start(args: DefaultListenerArgs): number { | ||
const { data: { pointers: [{ page }] } } = args; | ||
this.startPoint = page; | ||
return this.listener.start(args); | ||
} | ||
public update(_: Event, data: Data): number { | ||
const p = data.pointers[0].page; | ||
if (p.distanceTo(this.startPoint) > this.listener.options.radiusThreshold) { | ||
return RETURN_FLAG.REMOVE; | ||
} | ||
return RETURN_FLAG.IDLE; | ||
public update({ data: { pointers: [{ page }] } }: DefaultListenerArgs): number { | ||
return page.distanceTo(this.startPoint) > this.listener.options.radiusThreshold ? | ||
RETURN_FLAG.REMOVE : | ||
RETURN_FLAG.IDLE; | ||
} | ||
public end(evt: Event, data: Data): number { | ||
return this.listener.end(evt, data, this.target); | ||
} | ||
public cancel() { | ||
return this.listener.cancel(); | ||
} | ||
} | ||
@@ -29,0 +21,0 @@ |
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 too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
736680
3136
+ Addedoribella-framework@0.9.0(transitive)
- Removedoribella-framework@0.8.3(transitive)
Updatedoribella-framework@^0.9.0