touchcontroller
Advanced tools
Comparing version 0.13.2 to 0.13.4
{ | ||
"name": "touchcontroller", | ||
"version": "0.13.2", | ||
"version": "0.13.4", | ||
"description": "Touch and mouse controller for web apps and games", | ||
@@ -10,5 +10,5 @@ "main": "./dist/touchcontroller.js", | ||
"build": "webpack --config webpack.production.config.js", | ||
"develop": "onchange \"src/**/*.{ts,tsx}\" --initial --kill --delay 500 -- webpack --config webpack.development.config.js", | ||
"build-watch": "onchange \"src/**/*.{ts,tsx}\" --initial --kill --delay 500 -- webpack --config webpack.development.config.js", | ||
"deploy": "npm publish", | ||
"expose": "node server.js", | ||
"server": "node server.js", | ||
"test": "", | ||
@@ -48,3 +48,6 @@ "prettier": "prettier --config .prettierrc --write \"{src,test,samples}/**/*.{ts,tsx,js,html,css}\" webpack.config.js", | ||
}, | ||
"dependencies": {} | ||
"dependencies": { | ||
"@heduapp/fake-window": "^1.0.0", | ||
"serve-index": "^1.9.1" | ||
} | ||
} |
const express = require('express') | ||
const serveStatic = require('serve-static') | ||
const serveIndex = require('serve-index') | ||
const staticBasePath = './'; | ||
const app = express() | ||
const port = 3000; | ||
const app = express(); | ||
app.use(serveStatic(staticBasePath, {'index': false})) | ||
app.listen(port); | ||
app.use(serveIndex(staticBasePath, {'icons': true})) | ||
app.listen(3000); | ||
console.log(`Static server listening on port ${port}.`); | ||
console.log(`Static server listening on port 3000.`); |
@@ -0,3 +1,3 @@ | ||
import { Transformation } from './Transformation'; | ||
import { Vector2 } from './Vector2'; | ||
import { Transformation } from './Transformation'; | ||
//todo to other my library - combine TC, Vire | ||
@@ -4,0 +4,0 @@ |
@@ -0,5 +1,5 @@ | ||
import { particleOptionsAverage } from '../tools/average'; | ||
import { Vector2 } from './../Vector2'; | ||
import { IParticleOptions, Particle } from './Particle'; | ||
import { Scene } from './Scene'; | ||
import { Particle, IParticleOptions } from './Particle'; | ||
import { particleOptionsAverage } from '../tools/average'; | ||
@@ -6,0 +6,0 @@ export class DrawController { |
@@ -0,4 +1,4 @@ | ||
import { createColoredCanvasFromSrc } from '../tools/imageTools'; | ||
import { sign } from '../tools/mathTools'; | ||
import { Vector2 } from './../Vector2'; | ||
import { sign } from '../tools/mathTools'; | ||
import { createColoredCanvasFromSrc } from '../tools/imageTools'; | ||
@@ -5,0 +5,0 @@ export interface IParticleOptions { |
@@ -0,0 +0,0 @@ import { Vector2 } from './../Vector2'; |
@@ -0,10 +1,7 @@ | ||
import { BoundingBox } from './BoundingBox'; | ||
import { DrawController } from './drawController/CanvasParticlesRenderer'; | ||
import { BoundingBox } from './BoundingBox'; | ||
import { Touch } from './Touch'; | ||
import { Transformation } from './Transformation'; | ||
import { createMouseListener } from './listeners/createMouseListener'; | ||
import { createTouchListener } from './listeners/createTouchListener'; | ||
import { MultiTouchController } from './MultiTouchController'; | ||
import { TouchController } from './TouchController'; | ||
import { multiTouchTransformations } from './multiTouchTransformations'; | ||
import { createMouseListener } from './listeners/createMouseListener'; | ||
import { createTouchListener } from './listeners/createTouchListener'; | ||
import { | ||
@@ -14,2 +11,5 @@ svgTransformationDecode, | ||
} from './tools/svgTools'; | ||
import { Touch } from './Touch'; | ||
import { TouchController } from './TouchController'; | ||
import { Transformation } from './Transformation'; | ||
import { Vector2 } from './Vector2'; | ||
@@ -16,0 +16,0 @@ |
@@ -0,0 +0,0 @@ export interface IEvent { |
@@ -0,3 +1,3 @@ | ||
import { Touch } from '../Touch'; | ||
import { TouchFrame } from '../TouchFrame'; | ||
import { Touch } from '../Touch'; | ||
@@ -4,0 +4,0 @@ export interface IListener { |
@@ -1,6 +0,6 @@ | ||
import { IEvent } from './../interfaces/IEvent'; | ||
import { TouchFrame } from './../TouchFrame'; | ||
import { IListener } from '../interfaces/IListener'; | ||
import { Touch } from '../Touch'; | ||
import { Vector2 } from '../Vector2'; | ||
import { IEvent } from './../interfaces/IEvent'; | ||
import { TouchFrame } from './../TouchFrame'; | ||
@@ -7,0 +7,0 @@ const MOUSE_LISTENER_OPTIONS = { |
@@ -1,6 +0,6 @@ | ||
import { IEvent } from './../interfaces/IEvent'; | ||
import { IListener } from '../interfaces/IListener'; | ||
import { Touch } from '../Touch'; | ||
import { TouchFrame } from '../TouchFrame'; | ||
import { Touch } from '../Touch'; | ||
import { Vector2 } from '../Vector2'; | ||
import { IEvent } from './../interfaces/IEvent'; | ||
@@ -7,0 +7,0 @@ const TOUCH_LISTENER_OPTIONS = { |
@@ -1,10 +0,10 @@ | ||
import { Transformation } from './Transformation'; | ||
import { BoundingBox } from './BoundingBox'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Subscription } from 'rxjs/Subscription'; | ||
import 'rxjs/add/operator/finally'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import { Observer } from 'rxjs/Observer'; | ||
import { Subscription } from 'rxjs/Subscription'; | ||
import { BoundingBox } from './BoundingBox'; | ||
import { multiTouchTransformations } from './multiTouchTransformations'; | ||
import { Touch } from './Touch'; | ||
import { Transformation } from './Transformation'; | ||
@@ -11,0 +11,0 @@ //todo multitouch should be extended from this |
@@ -1,7 +0,7 @@ | ||
import { TouchFrame } from './TouchFrame'; | ||
import { MultiTouch } from './MultiTouch'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observer } from 'rxjs/Observer'; | ||
import { MultiTouch } from './MultiTouch'; | ||
import { TouchController } from './TouchController'; | ||
import { TouchFrame } from './TouchFrame'; | ||
@@ -8,0 +8,0 @@ export class MultiTouchController<TElement> { |
@@ -1,2 +0,1 @@ | ||
import { MultiTouch } from './MultiTouch'; | ||
import { Observable } from 'rxjs/Observable'; | ||
@@ -6,4 +5,5 @@ import { Observer } from 'rxjs/Observer'; | ||
import { BoundingBox } from './BoundingBox'; | ||
import { MultiTouch } from './MultiTouch'; | ||
import { Touch } from './Touch'; | ||
import { Transformation } from './Transformation'; | ||
import { Touch } from './Touch'; | ||
import { Vector2 } from './Vector2'; | ||
@@ -10,0 +10,0 @@ |
@@ -1,2 +0,1 @@ | ||
import { Vector2 } from './../Vector2'; | ||
import { | ||
@@ -6,2 +5,3 @@ IParticleOptions, | ||
} from '../drawController/Particle'; | ||
import { Vector2 } from './../Vector2'; | ||
@@ -8,0 +8,0 @@ export type TAverageItems<T> = { value: T; weight: number }[]; |
@@ -0,0 +0,0 @@ export class SourceCache<TId, TSource> { |
@@ -0,0 +0,0 @@ import { SourceCache } from './Cache'; |
@@ -0,0 +0,0 @@ //todo maybe with polyfill |
@@ -0,0 +0,0 @@ import { Transformation } from '../Transformation'; |
@@ -1,8 +0,8 @@ | ||
import { Vector2 } from './Vector2'; | ||
import window from '@heduapp/fake-window'; | ||
import 'rxjs/add/observable/range'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observer } from 'rxjs/Observer'; | ||
import 'rxjs/add/observable/range'; | ||
import 'rxjs/add/operator/share'; | ||
import { TouchFrame } from './TouchFrame'; | ||
import { Vector2 } from './Vector2'; | ||
@@ -23,3 +23,3 @@ export class Touch { | ||
this.frames = Observable.create((observer: Observer<TouchFrame>) => { | ||
observer.next(firstFrame); //todo maybe setImmediate(()=> | ||
observer.next(firstFrame); //todo maybe window.setImmediate(()=> | ||
this._framesObserver = observer; | ||
@@ -42,3 +42,5 @@ }).share(); //todo share vs publish | ||
end() { | ||
this._framesObserver.complete(); | ||
if (this._framesObserver) { | ||
this._framesObserver.complete(); | ||
} | ||
} | ||
@@ -64,3 +66,3 @@ | ||
); | ||
setTimeout(() => { | ||
window.setTimeout(() => { | ||
touch.end(); | ||
@@ -67,0 +69,0 @@ }, 100); |
@@ -1,9 +0,10 @@ | ||
import { IListener } from './interfaces/IListener'; | ||
import window from '@heduapp/fake-window'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observable } from 'rxjs/Observable'; | ||
import 'rxjs/add/operator/share'; | ||
import { Observer } from 'rxjs/Observer'; | ||
import { TouchFrame } from './TouchFrame'; | ||
import { IListener } from './interfaces/IListener'; | ||
import { createMouseListener } from './listeners/createMouseListener'; | ||
import { createTouchListener } from './listeners/createTouchListener'; | ||
import { Touch } from './Touch'; | ||
import { TouchFrame } from './TouchFrame'; | ||
@@ -88,3 +89,3 @@ //todo multitouch should be extended from this | ||
emulateTouch(touch: Touch) { | ||
setImmediate(() => { | ||
window.setImmediate(() => { | ||
this._touchesObserver.next(touch); | ||
@@ -91,0 +92,0 @@ }); |
@@ -0,0 +0,0 @@ import { Vector2 } from './Vector2'; |
@@ -1,2 +0,1 @@ | ||
import { Vector2 } from './Vector2'; | ||
import { | ||
@@ -6,2 +5,3 @@ svgTransformationDecode, | ||
} from './tools/svgTools'; | ||
import { Vector2 } from './Vector2'; | ||
@@ -128,3 +128,3 @@ export class Transformation { | ||
/*setImmediate(() => { | ||
/*window.setImmediate(() => { | ||
const element = document.getElementsByTagName('g')[0]; | ||
@@ -131,0 +131,0 @@ const transformation = Transformation.rotate(0.2); |
@@ -0,0 +0,0 @@ //todo to other my library - combine TC, Vire |
import { expect } from 'chai'; | ||
import { BoundingBox } from '../src/BoundingBox'; | ||
import { Vector2 } from '../src/Vector2'; | ||
import { BoundingBox } from '../src/BoundingBox'; | ||
@@ -5,0 +5,0 @@ describe('BoundingBox', function() { |
console.log(1); |
@@ -0,0 +0,0 @@ /*import { expect } from "chai"; |
@@ -0,0 +0,0 @@ import { expect } from 'chai'; |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ const configs = []; |
@@ -0,0 +0,0 @@ const configs = []; |
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
151957
2
45
1802
+ Added@heduapp/fake-window@^1.0.0
+ Addedserve-index@^1.9.1
+ Added@heduapp/fake-window@1.0.0(transitive)
+ Addedaccepts@1.3.8(transitive)
+ Addedbatch@0.6.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddepd@1.1.2(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedhttp-errors@1.6.3(transitive)
+ Addedinherits@2.0.3(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedms@2.0.0(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedserve-index@1.9.1(transitive)
+ Addedsetprototypeof@1.1.0(transitive)
+ Addedstatuses@1.5.0(transitive)