pixi-viewport
Advanced tools
Comparing version 5.0.2 to 5.1.0
import type { FederatedEvent } from '@pixi/events'; | ||
import type { Point } from '@pixi/math'; | ||
import type { Viewport } from './Viewport'; | ||
export type DragEvent = { | ||
export declare type DragEvent = { | ||
event: FederatedEvent; | ||
@@ -10,4 +10,4 @@ screen: Point; | ||
}; | ||
export type ClickedEvent = DragEvent; | ||
export type MovedEvent = { | ||
export declare type ClickedEvent = DragEvent; | ||
export declare type MovedEvent = { | ||
viewport: Viewport; | ||
@@ -17,3 +17,3 @@ type: 'wheel' | 'pinch' | 'animate' | 'ensureVisible' | 'snap' | 'mouse-edges' | 'follow' | 'drag' | 'decelerate' | 'clamp-x' | 'clamp-y' | 'bounce-x' | 'bounce-y'; | ||
}; | ||
export type ZoomedEvent = { | ||
export declare type ZoomedEvent = { | ||
viewport: Viewport; | ||
@@ -24,7 +24,7 @@ type: 'wheel' | 'pinch' | 'animate' | 'ensureVisible' | 'clamp-zoom'; | ||
}; | ||
export type WheelStartEvent = { | ||
export declare type WheelStartEvent = { | ||
event: WheelEvent; | ||
viewport: Viewport; | ||
}; | ||
export type Events = { | ||
export declare type Events = { | ||
wheel: [ | ||
@@ -31,0 +31,0 @@ { |
@@ -16,3 +16,2 @@ import { Container } from '@pixi/display'; | ||
stopPropagation?: boolean; | ||
allowPreserveDragOutside?: boolean; | ||
forceHitArea?: Rectangle | null; | ||
@@ -19,0 +18,0 @@ noTicker?: boolean; |
{ | ||
"name": "pixi-viewport", | ||
"version": "5.0.2", | ||
"version": "5.1.0", | ||
"description": "A highly configurable viewport/2D camera designed to work with pixi.js. Features include dragging, pinch-to-zoom, mouse wheel zooming, decelerated dragging, follow target, snap to point, snap to zoom, clamping, bouncing on edges, and move on mouse edges.", | ||
"main": "./dist/pixi_viewport.umd.cjs", | ||
"module": "./dist/pixi_viewport.js", | ||
"type": "module", | ||
"types": "./dist/index.d.ts", | ||
"main": "dist/cjs/viewport.js", | ||
"module": "dist/esm/viewport.es.js", | ||
"bundle": "dist/viewport.min.js", | ||
"types": "index.d.ts", | ||
"directories": { | ||
@@ -13,18 +13,23 @@ "doc": "docs" | ||
"files": [ | ||
"dist" | ||
"dist", | ||
"index.d.ts", | ||
"src" | ||
], | ||
"scripts": { | ||
"dev": "vite dev", | ||
"start": "serve docs/", | ||
"dev": "rollup -w -c docs/sample/rollup.dev.js", | ||
"dev-original": "rollup -w -c docs/original/rollup.dev.js", | ||
"test": "floss --path test", | ||
"coverage": "nyc mocha", | ||
"build": "vite build --config vite.build.ts && node ./scripts/append-mixins.js", | ||
"docs": "vite build && rimraf ./js && tsc -p ./tsconfig-docs.json --outDir js && rimraf ./docs/dist/jsdoc/ && jsdoc -c .jsdoc.json && node ./scripts/copy", | ||
"docs:serve": "vite preview --outDir dist/", | ||
"build": "rollup -c && yarn build:types", | ||
"build:types": "rimraf ./compile && tsc -p ./tsconfig.json --outDir compile && api-extractor run", | ||
"docs": "rimraf ./js && tsc -p ./tsconfig-docs.json --outDir js && jsdoc -c .jsdoc.json", | ||
"upgrade": "yarn upgrade-interactive --latest", | ||
"prepublishOnly": "yarn build && yarn docs", | ||
"lint": "eslint . --ignore-path .gitignore", | ||
"lint:fix": "eslint . --ignore-path .gitignore --fix", | ||
"prepare": "husky install && yarn build", | ||
"pre-commit": "lint-staged", | ||
"prepack": "yarn build" | ||
"prepublishOnly": "yarn build && yarn builds && yarn build:types && yarn docs", | ||
"builds-rollup": "rollup -c docs/builds/rollup/rollup.config.js", | ||
"builds-browserify": "browserify docs/builds/browserify/code.js -o docs/builds/browserify/index.js", | ||
"builds-standalone": "node scripts/copy", | ||
"builds-typescript": "rollup -c docs/builds/ts/rollup.config.js", | ||
"builds-original": "rollup -c docs/original/rollup.config.js", | ||
"builds": "yarn builds-rollup && yarn builds-browserify && yarn builds-standalone && yarn builds-typescript && yarn builds-original" | ||
}, | ||
@@ -52,10 +57,30 @@ "repository": { | ||
"homepage": "https://github.com/davidfig/pixi-viewport#readme", | ||
"peerDependencies": { | ||
"@pixi/display": "^6.5.8", | ||
"@pixi/interaction": "^6.5.8", | ||
"@pixi/math": "^6.5.8", | ||
"@pixi/ticker": "^6.5.8" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@pixi/core": "^7.1.1", | ||
"@pixi/display": "^7.1.1", | ||
"@babel/core": "^7.16.0", | ||
"@babel/preset-env": "^7.16.4", | ||
"@joseph184/rollup-plugin-node-builtins": "^2.1.4", | ||
"@microsoft/api-extractor": "^7.18.19", | ||
"@pixi-build-tools/rollup-configurator": "^1.0.14", | ||
"@pixi/display": "^6.5.8", | ||
"@pixi/eslint-config": "^4.0.1", | ||
"@pixi/events": "^7.1.1", | ||
"@pixi/math": "^7.1.1", | ||
"@pixi/ticker": "^7.1.1", | ||
"@pixi/events": "^6.5.8", | ||
"@pixi/interaction": "^6.5.8", | ||
"@pixi/math": "^6.5.8", | ||
"@pixi/ticker": "^6.5.8", | ||
"@rollup/plugin-babel": "^5.3.0", | ||
"@rollup/plugin-commonjs": "^22.0.2", | ||
"@rollup/plugin-node-resolve": "^13.0.6", | ||
"@rollup/plugin-sucrase": "^4.0.1", | ||
"@rollup/plugin-typescript": "^8.3.0", | ||
"@types/offscreencanvas": "^2019.6.4", | ||
"@typescript-eslint/eslint-plugin": "^5.5.0", | ||
"@typescript-eslint/parser": "^5.5.0", | ||
"browserify": "^17.0.0", | ||
"chai": "^4.3.4", | ||
@@ -67,12 +92,16 @@ "clicked": "^4.0.3", | ||
"floss": "^5.0.1", | ||
"fork-me-github": "^1.2.0", | ||
"fs-extra": "^10.0.0", | ||
"husky": "^8.0.3", | ||
"jsdoc": "^3.6.3", | ||
"lint-staged": "^13.1.0", | ||
"pixi-ease": "^3.0.7", | ||
"pixi.js": "^7.1.1", | ||
"pixi.js": "^6.5.8", | ||
"raf": "^3.4.1", | ||
"rollup": "^2.60.2", | ||
"rollup-plugin-node-globals": "^1.4.0", | ||
"rollup-plugin-peer-deps-external": "^2.2.4", | ||
"rollup-plugin-serve": "^2.0.1", | ||
"serve": "^14.0.1", | ||
"settingspanel": "^2.0.0", | ||
"tslib": "^2.3.1", | ||
"typescript": "^4.5.2", | ||
"vite": "^3.2.4", | ||
"vite-plugin-dts": "^1.7.1", | ||
"yy-counter": "^2.1.0", | ||
@@ -79,0 +108,0 @@ "yy-fps": "^2.0.0", |
@@ -14,14 +14,2 @@ # pixi-viewport | ||
## v5+ | ||
Moves pixi-viewport to pixi.js v7 (thanks [@cuire](https://github.com/cuire)!). | ||
NOTE: there is a breaking change since pixi-viewport moved to pixi's new event system. `options.interaction` is removed and you need pass `options.events` to the viewport for it to work properly. The events object can be found at pixi's `renderer.events` or `app.renderer.events`. | ||
```js | ||
const viewport = new Viewport({ events: renderer.events }); | ||
// or | ||
// const viewport = new Viewport({ events: app.renderer.events }); | ||
``` | ||
## v4.30.0+ | ||
@@ -56,3 +44,3 @@ This project was migrated to Typescript (thanks [@ShukantPal](https://github.com/ShukantPal)!). All functionality should be the same. The live Example has been updated. | ||
events: app.renderer.events // the interaction module is important for wheel to work properly when renderer.view is placed or scaled | ||
interaction: app.renderer.plugins.interaction // the interaction module is important for wheel to work properly when renderer.view is placed or scaled | ||
}) | ||
@@ -95,2 +83,14 @@ | ||
## Build Examples | ||
I've included the following build examples in the docs/ directory: | ||
* [flems-io interactive demo](https://davidfig.github.io/pixi-viewport/) | ||
* [original demo built with rollup](https://github.com/davidfig/pixi-viewport/tree/master/docs/original) | ||
* [browserify](https://github.com/davidfig/pixi-viewport/tree/master/docs/builds/browserify) | ||
* [rollup](https://github.com/davidfig/pixi-viewport/tree/master/docs/builds/rollup) | ||
* [standalone (e.g., cdn)](https://github.com/davidfig/pixi-viewport/tree/master/docs/builds/standalone) | ||
* [typescript](https://github.com/davidfig/pixi-viewport/tree/master/docs/builds/ts). | ||
You can see the live demos at [https://davidfig.github.io/pixi-viewport/builds/](https://davidfig.github.io/pixi-viewport/builds/). | ||
## Migration from pixi-viewport v3 to v4 | ||
@@ -132,6 +132,9 @@ Viewport needs to be imported or required as follows: | ||
3. yarn dev | ||
4. open browser to http://localhost:5173 | ||
4. open browser to http://localhost:10001 | ||
PRs are more than welcome! | ||
## v4.30.0+ | ||
This project was migrated to Typescript (thanks [@sukantpal](https://github.com/SukantPal)!). All functionality should be the same. The live Example has been updated. | ||
## Other Libraries | ||
@@ -145,2 +148,2 @@ If you liked pixi-viewport, please try my other open source libraries: | ||
MIT License | ||
(c) 2023 [YOPEY YOPEY LLC](https://yopeyopey.com/) by David Figatner (david@yopeyopey.com) | ||
(c) 2021 [YOPEY YOPEY LLC](https://yopeyopey.com/) by David Figatner (david@yopeyopey.com) |
Sorry, the diff of this file is too big to display
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
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
2098443
55
22104
145
4
44
2
1
No