diff --git a/README.md b/README.md index b858d7e78..d0eb67b93 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,7 @@ Add foundry-vtt-types to your types section in your `tsconfig.json`: "compilerOptions": { "types": ["@league-of-foundry-developers/foundry-vtt-types"], "moduleResolution": "node", + "esModuleInterop": true, "strictNullChecks": true } } diff --git a/index.d.ts b/index.d.ts index cd910c006..ba58578cd 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,3 @@ -import "pixi.js"; import "handlebars"; import "jquery"; import "showdown"; diff --git a/package-lock.json b/package-lock.json index 6074a039b..ccb4cd570 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,25 +9,29 @@ "version": "9.269.0", "license": "MIT", "dependencies": { - "@pixi/graphics-smooth": "^0.0.30", - "@pixi/particle-emitter": "^5.0.7", + "@pixi/graphics-smooth": "^1.1.0", + "@pixi/particle-emitter": "^5.0.8", "@types/jquery": "~3.5.22", "@types/showdown": "~2.0.2", "@types/simple-peer": "~9.11.1", "@types/youtube": "~0.0.48", "handlebars": "^4.7.7", - "pixi.js": "^5.3.11", + "pixi.js": "^7.2.4", "prosemirror-collab": "^1.3.0", - "prosemirror-commands": "^1.3.0", + "prosemirror-commands": "^1.5.1", + "prosemirror-dropcursor": "^1.8.0", + "prosemirror-gapcursor": "^1.3.1", + "prosemirror-history": "^1.3.0", "prosemirror-inputrules": "^1.2.0", - "prosemirror-keymap": "^1.2.0", - "prosemirror-model": "^1.18.1", - "prosemirror-schema-list": "^1.2.1", - "prosemirror-state": "^1.4.1", - "prosemirror-transform": "^1.7.0", - "prosemirror-view": "^1.27.2", - "socket.io-client": "^4.5.1", - "tinymce": "^6.7.0" + "prosemirror-keymap": "^1.2.1", + "prosemirror-model": "^1.19.0", + "prosemirror-schema-list": "^1.2.2", + "prosemirror-state": "^1.4.2", + "prosemirror-tables": "^1.3.2", + "prosemirror-transform": "^1.7.1", + "prosemirror-view": "^1.30.2", + "socket.io-client": "^4.6.1", + "tinymce": "^6.7.1" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^6.7.4", @@ -427,9 +431,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.3.tgz", - "integrity": "sha512-yZzuIG+jnVu6hNSzFEN07e8BxF3uAzYtQb6uDkaYZLo6oYZDCq454c5kB8zxnzfCYyP4MIuyBn10L0DqwujTmA==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -450,9 +454,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.54.0.tgz", - "integrity": "sha512-ut5V+D+fOoWPgGGNj83GGjnntO39xDy6DWxO0wb7Jp3DcMX0TfIqdzHF85VTQkerdyGmuuMD9AKAo5KiNlf/AQ==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.55.0.tgz", + "integrity": "sha512-qQfo2mxH5yVom1kacMtZZJFVdW+E70mqHMJvVg6WTLo+VBuQJ4TojZlfWBjK0ve5BdEeNAVxOsl/nvNMpJOaJA==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -556,1726 +560,147 @@ "node": ">= 8" } }, - "node_modules/@pixi/accessibility": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/accessibility/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/app": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12" - } - }, - "node_modules/@pixi/app/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/app/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/app/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/app/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/app/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/app/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/app/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", + "node_modules/@pixi/color": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/color/-/color-7.3.2.tgz", + "integrity": "sha512-jur5PvdOtUBEUTjmPudW5qdQq6yYGlVGsi3HyhasJw14bN+GKJwiCKgIsyrsiNL5HBUXmje4ICwQohf6BqKqxA==", "dependencies": { - "@pixi/settings": "5.3.12" + "@pixi/colord": "^2.9.6" } }, - "node_modules/@pixi/app/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } + "node_modules/@pixi/colord": { + "version": "2.9.6", + "resolved": "https://registry.npmjs.org/@pixi/colord/-/colord-2.9.6.tgz", + "integrity": "sha512-nezytU2pw587fQstUu1AsJZDVEynjskwOL+kibwcdxsMBFqPsFFNA7xl0ii/gXuDi6M0xj3mfRJj8pBSc2jCfA==" }, "node_modules/@pixi/constants": { - "version": "6.5.10", - "license": "MIT", - "peer": true - }, - "node_modules/@pixi/core": { - "version": "6.5.10", - "license": "MIT", - "peer": true, - "dependencies": { - "@types/offscreencanvas": "^2019.6.4" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - }, - "peerDependencies": { - "@pixi/constants": "6.5.10", - "@pixi/extensions": "6.5.10", - "@pixi/math": "6.5.10", - "@pixi/runner": "6.5.10", - "@pixi/settings": "6.5.10", - "@pixi/ticker": "6.5.10", - "@pixi/utils": "6.5.10" - } - }, - "node_modules/@pixi/display": { - "version": "6.5.10", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@pixi/constants": "6.5.10", - "@pixi/math": "6.5.10", - "@pixi/settings": "6.5.10", - "@pixi/utils": "6.5.10" - } - }, - "node_modules/@pixi/extensions": { - "version": "6.5.10", - "license": "MIT", - "peer": true - }, - "node_modules/@pixi/extract": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/extract/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/extract/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/extract/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/extract/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/extract/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/extract/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/extract/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/filter-alpha": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12" - } - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-alpha/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/filter-blur": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-blur/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/filter-color-matrix": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12" - } - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-color-matrix/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/filter-displacement": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/math": "5.3.12" - } - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-displacement/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/filter-fxaa": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12" - } - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-fxaa/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/filter-noise": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12" - } - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/filter-noise/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/graphics": { - "version": "6.5.10", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@pixi/constants": "6.5.10", - "@pixi/core": "6.5.10", - "@pixi/display": "6.5.10", - "@pixi/math": "6.5.10", - "@pixi/sprite": "6.5.10", - "@pixi/utils": "6.5.10" - } - }, - "node_modules/@pixi/graphics-smooth": { - "version": "0.0.30", - "license": "MIT", - "peerDependencies": { - "@pixi/constants": "^6.0.4", - "@pixi/core": "^6.0.4", - "@pixi/display": "^6.0.4", - "@pixi/graphics": "^6.0.4", - "@pixi/math": "^6.0.4", - "@pixi/utils": "^6.0.4" - } - }, - "node_modules/@pixi/interaction": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/interaction/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/interaction/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/interaction/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/interaction/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/interaction/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/interaction/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/interaction/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/interaction/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/loaders": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/utils": "5.3.12", - "resource-loader": "^3.0.1" - } - }, - "node_modules/@pixi/loaders/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/loaders/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/loaders/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/loaders/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/loaders/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/loaders/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/loaders/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/math": { - "version": "6.5.10", - "license": "MIT", - "peer": true - }, - "node_modules/@pixi/mesh": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mesh-extras": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/mesh": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/mesh-extras/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/mesh/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mesh/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/mesh/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mesh/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mesh/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mesh/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/mesh/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/mesh/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/sprite": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/mixin-cache-as-bitmap/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/mixin-get-child-by-name": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/display": "5.3.12" - } - }, - "node_modules/@pixi/mixin-get-child-by-name/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-get-child-by-name/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mixin-get-child-by-name/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-get-child-by-name/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/mixin-get-child-by-name/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/mixin-get-global-position": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12" - } - }, - "node_modules/@pixi/mixin-get-global-position/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-get-global-position/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/mixin-get-global-position/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/mixin-get-global-position/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/mixin-get-global-position/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/particle-emitter": { - "version": "5.0.8", - "license": "MIT", - "peerDependencies": { - "@pixi/constants": ">=6.0.4 <8.0.0", - "@pixi/core": ">=6.0.4 <8.0.0", - "@pixi/display": ">=6.0.4 <8.0.0", - "@pixi/math": ">=6.0.4 <8.0.0", - "@pixi/sprite": ">=6.0.4 <8.0.0", - "@pixi/ticker": ">=6.0.4 <8.0.0" - }, - "workspaces": { - "packages": [ - "./", - "test/pixi-v6-iife", - "test/pixi-v6-module" - ] - } - }, - "node_modules/@pixi/particles": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/particles/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/particles/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/particles/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/particles/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/particles/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/particles/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/particles/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/particles/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/polyfill": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "es6-promise-polyfill": "^1.2.0", - "object-assign": "^4.1.1" - } - }, - "node_modules/@pixi/prepare": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/graphics": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/text": "5.3.12", - "@pixi/ticker": "5.3.12" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/prepare/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/graphics": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/prepare/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/prepare/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/sprite": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/prepare/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/runner": { - "version": "6.5.10", - "license": "MIT", - "peer": true - }, - "node_modules/@pixi/settings": { - "version": "6.5.10", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@pixi/constants": "6.5.10" - } - }, - "node_modules/@pixi/sprite": { - "version": "6.5.10", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@pixi/constants": "6.5.10", - "@pixi/core": "6.5.10", - "@pixi/display": "6.5.10", - "@pixi/math": "6.5.10", - "@pixi/settings": "6.5.10", - "@pixi/utils": "6.5.10" - } - }, - "node_modules/@pixi/sprite-animated": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/ticker": "5.3.12" - } - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/sprite": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/sprite-animated/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/sprite-tiling": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/sprite": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/sprite-tiling/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/spritesheet": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/loaders": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/spritesheet/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/text": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/text-bitmap": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/loaders": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/mesh": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/text": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" - } - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" - } - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" - } - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" - } - }, - "node_modules/@pixi/text-bitmap/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" - } - }, - "node_modules/@pixi/text/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-7.3.2.tgz", + "integrity": "sha512-Q8W3ncsFxmfgC5EtokpG92qJZabd+Dl+pbQAdHwiPY3v+8UNq77u4VN2qtl1Z04864hCcg7AStIYEDrzqTLF6Q==" }, - "node_modules/@pixi/text/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" + "node_modules/@pixi/core": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-7.3.2.tgz", + "integrity": "sha512-Pta3ee8MtJ3yKxGXzglBWgwbEOKMB6Eth+FpLTjL0rgxiqTB550YX6jsNEQQAzcGjCBlO3rC/IF57UZ2go/X6w==", + "dependencies": { + "@pixi/color": "7.3.2", + "@pixi/constants": "7.3.2", + "@pixi/extensions": "7.3.2", + "@pixi/math": "7.3.2", + "@pixi/runner": "7.3.2", + "@pixi/settings": "7.3.2", + "@pixi/ticker": "7.3.2", + "@pixi/utils": "7.3.2", + "@types/offscreencanvas": "^2019.6.4" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/pixijs" } }, - "node_modules/@pixi/text/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" + "node_modules/@pixi/display": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-7.3.2.tgz", + "integrity": "sha512-cY5AnZ3TWt5GYGx4e5AQ2/2U9kP+RorBg/O30amJ+8e9bFk9rS8cjh/DDq/hc4lql96BkXAInTl40eHnAML5lQ==", + "peerDependencies": { + "@pixi/core": "7.3.2" } }, - "node_modules/@pixi/text/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" + "node_modules/@pixi/extensions": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/extensions/-/extensions-7.3.2.tgz", + "integrity": "sha512-Qw84ADfvmVu4Mwj+zTik/IEEK9lWS5n4trbrpQCcEZ+Mb8oRAXWvKz199mi1s7+LaZXDqeCY1yr2PHQaFf1KBA==" }, - "node_modules/@pixi/text/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" + "node_modules/@pixi/graphics": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-7.3.2.tgz", + "integrity": "sha512-PhU6j1yub4tH/s+/gqByzgZ3mLv1mfb6iGXbquycg3+WypcxHZn0opFtI/axsazaQ9SEaWxw1m3i40WG5ANH5g==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/sprite": "7.3.2" + } }, - "node_modules/@pixi/text/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" + "node_modules/@pixi/graphics-smooth": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@pixi/graphics-smooth/-/graphics-smooth-1.1.0.tgz", + "integrity": "sha512-jU6zFb+I3me6Z28qz7QOKPPBBUu1fafrlXSHBAidZZNl/PAr6mwygBZ+cFHrA2JHscUPRY60+H2EzJ+aiOHm7A==", + "peerDependencies": { + "@pixi/core": "^7.2.0", + "@pixi/display": "^7.2.0", + "@pixi/graphics": "^7.2.0" } }, - "node_modules/@pixi/text/node_modules/@pixi/sprite": { - "version": "5.3.12", + "node_modules/@pixi/math": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-7.3.2.tgz", + "integrity": "sha512-dutoZ0IVJ5ME7UtYNo2szu4D7qsgtJB7e3ylujBVu7BOP2e710BVtFwFSFV768N14h9H5roGnuzVoDiJac2u+w==" + }, + "node_modules/@pixi/particle-emitter": { + "version": "5.0.8", "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" + "peerDependencies": { + "@pixi/constants": ">=6.0.4 <8.0.0", + "@pixi/core": ">=6.0.4 <8.0.0", + "@pixi/display": ">=6.0.4 <8.0.0", + "@pixi/math": ">=6.0.4 <8.0.0", + "@pixi/sprite": ">=6.0.4 <8.0.0", + "@pixi/ticker": ">=6.0.4 <8.0.0" + }, + "workspaces": { + "packages": [ + "./", + "test/pixi-v6-iife", + "test/pixi-v6-module" + ] } }, - "node_modules/@pixi/text/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", + "node_modules/@pixi/runner": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-7.3.2.tgz", + "integrity": "sha512-maKotoKJCQiQGBJwfM+iYdQKjrPN/Tn9+72F4WIf706zp/5vKoxW688Rsktg5BX4Mcn7ZkZvcJYTxj2Mv87lFA==" + }, + "node_modules/@pixi/settings": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-7.3.2.tgz", + "integrity": "sha512-vtxzuARDTbFe0fRYSqB53B+mPpX7v+QjjnCUmVMVvZiWr3QcngMWVml6c6dQDln7IakWoKZRrNG4FpggvDgLVg==", "dependencies": { - "@pixi/settings": "5.3.12" + "@pixi/constants": "7.3.2", + "@types/css-font-loading-module": "^0.0.7", + "ismobilejs": "^1.1.0" } }, - "node_modules/@pixi/text/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" + "node_modules/@pixi/sprite": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-7.3.2.tgz", + "integrity": "sha512-IpWTKXExJNXVcY7ITopJ+JW48DahdbCo/81D2IYzBImq3jyiJM2Km5EoJgvAM5ZQ3Ev3KPPIBzYLD+HoPWcxdw==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2" } }, "node_modules/@pixi/ticker": { - "version": "6.5.10", - "license": "MIT", - "peer": true, - "peerDependencies": { - "@pixi/extensions": "6.5.10", - "@pixi/settings": "6.5.10" + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-7.3.2.tgz", + "integrity": "sha512-5kIPhBeXwDJohCzKzJJ6T7f1oAGbHAgeiwOjlTO+9lNXUX8ZPj0407V3syuF+64kFqJzIBCznBRpI+fmT4c9SA==", + "dependencies": { + "@pixi/extensions": "7.3.2", + "@pixi/settings": "7.3.2", + "@pixi/utils": "7.3.2" } }, "node_modules/@pixi/utils": { - "version": "6.5.10", - "license": "MIT", - "peer": true, + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-7.3.2.tgz", + "integrity": "sha512-KhNvj9YcY7Zi2dTKZgDpx8C6OxKKR541vwtG6JgdBZZYDeMBOIghN2Vi5zn4diW5BhDfHBmdSJ1wZXEtE2MDwg==", "dependencies": { + "@pixi/color": "7.3.2", + "@pixi/constants": "7.3.2", + "@pixi/settings": "7.3.2", "@types/earcut": "^2.1.0", "earcut": "^2.2.4", - "eventemitter3": "^3.1.0", + "eventemitter3": "^4.0.0", "url": "^0.11.0" - }, - "peerDependencies": { - "@pixi/constants": "6.5.10", - "@pixi/settings": "6.5.10" } }, "node_modules/@pkgr/utils": { @@ -2322,10 +747,14 @@ "@types/chai": "*" } }, + "node_modules/@types/css-font-loading-module": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.12.tgz", + "integrity": "sha512-x2tZZYkSxXqWvTDgveSynfjq/T2HyiZHXb00j/+gy19yp70PHCizM48XFdjBCWH7eHBD0R5i/pw9yMBP/BH5uA==" + }, "node_modules/@types/earcut": { "version": "2.1.2", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/eslint": { "version": "8.44.3", @@ -2347,9 +776,9 @@ "peer": true }, "node_modules/@types/jquery": { - "version": "3.5.28", - "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.28.tgz", - "integrity": "sha512-2o/vlzaDXiGWFrHz/PhX88cy68UDc8NBBT9i1nU+EtRkKgRxMWLTlUkEJb+MRfhIw6wKK8RDmfoEXClH2PsIyA==", + "version": "3.5.29", + "resolved": "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.29.tgz", + "integrity": "sha512-oXQQC9X9MOPRrMhPHHOsXqeQDnWeCDT3PelUIg/Oy8FAbzSZtFHRjc7IpbfFVmpLtJ+UOoywpRsuO5Jxjybyeg==", "dependencies": { "@types/sizzle": "*" } @@ -2365,8 +794,7 @@ }, "node_modules/@types/offscreencanvas": { "version": "2019.7.1", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@types/semver": { "version": "7.5.6", @@ -2375,9 +803,9 @@ "dev": true }, "node_modules/@types/showdown": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-2.0.5.tgz", - "integrity": "sha512-fpzpGeXq69n032uOYFEmctcaWftPw4ZZ4saxMaIi6k+aZrTVjME1bT6xWp2JNUJiAM587FGuwW7jMqYixWzgVw==" + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/showdown/-/showdown-2.0.6.tgz", + "integrity": "sha512-pTvD/0CIeqe4x23+YJWlX2gArHa8G0J0Oh6GKaVXV7TAeickpkkZiNOgFcFcmLQ5lB/K0qBJL1FtRYltBfbGCQ==" }, "node_modules/@types/simple-peer": { "version": "9.11.8", @@ -2397,16 +825,16 @@ "integrity": "sha512-d4GpH4uPYp9W07kc487tiq6V/EUHl18vZWFMbQoe4Sk9LXEWzFi/BMf9x7TI4m7/j7gU3KeX8H6M8aPBgykeLw==" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.12.0.tgz", - "integrity": "sha512-XOpZ3IyJUIV1b15M7HVOpgQxPPF7lGXgsfcEIu3yDxFPaf/xZKt7s9QO/pbk7vpWQyVulpJbu4E5LwpZiQo4kA==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.13.1.tgz", + "integrity": "sha512-5bQDGkXaxD46bPvQt08BUz9YSaO4S0fB1LB5JHQuXTfkGPI3+UUeS387C/e9jRie5GqT8u5kFTrMvAjtX4O5kA==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/type-utils": "6.12.0", - "@typescript-eslint/utils": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/type-utils": "6.13.1", + "@typescript-eslint/utils": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -2432,15 +860,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.12.0.tgz", - "integrity": "sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", + "integrity": "sha512-fs2XOhWCzRhqMmQf0eicLa/CWSaYss2feXsy7xBD/pLyWke/jCIVc2s1ikEAtSW7ina1HNhv7kONoEfVNEcdDQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4" }, "engines": { @@ -2460,13 +888,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.12.0.tgz", - "integrity": "sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.13.1.tgz", + "integrity": "sha512-BW0kJ7ceiKi56GbT2KKzZzN+nDxzQK2DS6x0PiSMPjciPgd/JRQGMibyaN2cPt2cAvuoH0oNvn2fwonHI+4QUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0" + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2477,13 +905,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.12.0.tgz", - "integrity": "sha512-WWmRXxhm1X8Wlquj+MhsAG4dU/Blvf1xDgGaYCzfvStP2NwPQh6KBvCDbiOEvaE0filhranjIlK/2fSTVwtBng==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.13.1.tgz", + "integrity": "sha512-A2qPlgpxx2v//3meMqQyB1qqTg1h1dJvzca7TugM3Yc2USDY+fsRBiojAEo92HO7f5hW5mjAUF6qobOPzlBCBQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.12.0", - "@typescript-eslint/utils": "6.12.0", + "@typescript-eslint/typescript-estree": "6.13.1", + "@typescript-eslint/utils": "6.13.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -2504,9 +932,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.12.0.tgz", - "integrity": "sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.13.1.tgz", + "integrity": "sha512-gjeEskSmiEKKFIbnhDXUyiqVma1gRCQNbVZ1C8q7Zjcxh3WZMbzWVfGE9rHfWd1msQtPS0BVD9Jz9jded44eKg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -2517,13 +945,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.12.0.tgz", - "integrity": "sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.13.1.tgz", + "integrity": "sha512-sBLQsvOC0Q7LGcUHO5qpG1HxRgePbT6wwqOiGLpR8uOJvPJbfs0mW3jPA3ujsDvfiVwVlWUDESNXv44KtINkUQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/visitor-keys": "6.12.0", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/visitor-keys": "6.13.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2544,17 +972,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.12.0.tgz", - "integrity": "sha512-LywPm8h3tGEbgfyjYnu3dauZ0U7R60m+miXgKcZS8c7QALO9uWJdvNoP+duKTk2XMWc7/Q3d/QiCuLN9X6SWyQ==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", + "integrity": "sha512-ouPn/zVoan92JgAegesTXDB/oUp6BP1v8WpfYcqh649ejNc9Qv+B4FF2Ff626kO1xg0wWwwG48lAJ4JuesgdOw==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.12.0", - "@typescript-eslint/types": "6.12.0", - "@typescript-eslint/typescript-estree": "6.12.0", + "@typescript-eslint/scope-manager": "6.13.1", + "@typescript-eslint/types": "6.13.1", + "@typescript-eslint/typescript-estree": "6.13.1", "semver": "^7.5.4" }, "engines": { @@ -2569,12 +997,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.12.0.tgz", - "integrity": "sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==", + "version": "6.13.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", + "integrity": "sha512-NDhQUy2tg6XGNBGDRm1XybOHSia8mcXmlbKWoQP+nm1BIIMxa55shyJfZkHpEBN62KNPLrocSM2PdPcaLgDKMQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.12.0", + "@typescript-eslint/types": "6.13.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -2732,27 +1160,27 @@ } }, "node_modules/ansi-escapes": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-5.0.0.tgz", - "integrity": "sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", "dev": true, "dependencies": { - "type-fest": "^1.0.2" + "type-fest": "^3.0.0" }, "engines": { - "node": ">=12" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/ansi-escapes/node_modules/type-fest": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz", - "integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", "dev": true, "engines": { - "node": ">=10" + "node": ">=14.16" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2966,16 +1394,16 @@ } }, "node_modules/cli-truncate": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", - "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", + "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", "dev": true, "dependencies": { "slice-ansi": "^5.0.0", - "string-width": "^5.0.0" + "string-width": "^7.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -3140,16 +1568,10 @@ "version": "2.2.4", "license": "ISC" }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", - "dev": true - }, "node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", + "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, "node_modules/engine.io-client": { @@ -3170,10 +1592,6 @@ "node": ">=10.0.0" } }, - "node_modules/es6-promise-polyfill": { - "version": "1.2.0", - "license": "MIT" - }, "node_modules/esbuild": { "version": "0.18.20", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", @@ -3223,15 +1641,15 @@ } }, "node_modules/eslint": { - "version": "8.54.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.54.0.tgz", - "integrity": "sha512-NY0DfAkM8BIZDVl6PgSa1ttZbx3xHgJzSNJKYcQglem6CppHyMhRIQkBVSSMaSRnLhig3jsDbEzOjwCVt4AmmA==", + "version": "8.55.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.55.0.tgz", + "integrity": "sha512-iyUUAM0PCKj5QpwGfmCAG9XXbZCWsqP/eWAWrG/W0umvjuLRBECwSFdt+rCntju0xEH7teIABPwXpahftIaTdA==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.3", - "@eslint/js": "8.54.0", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.55.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -3278,9 +1696,10 @@ } }, "node_modules/eslint-config-prettier": { - "version": "9.0.0", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", "dev": true, - "license": "MIT", "bin": { "eslint-config-prettier": "bin/cli.js" }, @@ -3408,8 +1827,9 @@ } }, "node_modules/eventemitter3": { - "version": "3.1.2", - "license": "MIT" + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" }, "node_modules/execa": { "version": "7.2.0", @@ -3565,6 +1985,18 @@ "version": "1.1.1", "license": "MIT" }, + "node_modules/get-east-asian-width": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", + "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-func-name": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", @@ -3933,7 +2365,8 @@ }, "node_modules/ismobilejs": { "version": "1.1.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-1.1.1.tgz", + "integrity": "sha512-VaFW53yt8QO61k2WJui0dHf4SlL8lxBofUuUmwBo0ljPk0Drz2TiuDW4jo3wDcv41qy/SxrJ+VAzJ/qYqsmzRw==" }, "node_modules/jju": { "version": "1.4.0", @@ -3994,25 +2427,26 @@ } }, "node_modules/lilconfig": { - "version": "2.1.0", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", + "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", "dev": true, - "license": "MIT", "engines": { - "node": ">=10" + "node": ">=14" } }, "node_modules/lint-staged": { - "version": "15.1.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.1.0.tgz", - "integrity": "sha512-ZPKXWHVlL7uwVpy8OZ7YQjYDAuO5X4kMh0XgZvPNxLcCCngd0PO5jKQyy3+s4TL2EnHoIXIzP1422f/l3nZKMw==", + "version": "15.2.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.0.tgz", + "integrity": "sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==", "dev": true, "dependencies": { "chalk": "5.3.0", "commander": "11.1.0", "debug": "4.3.4", "execa": "8.0.1", - "lilconfig": "2.1.0", - "listr2": "7.0.2", + "lilconfig": "3.0.0", + "listr2": "8.0.0", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", @@ -4096,20 +2530,20 @@ } }, "node_modules/listr2": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-7.0.2.tgz", - "integrity": "sha512-rJysbR9GKIalhTbVL2tYbF2hVyDnrf7pFUZBwjPaMIdadYHmeT+EVi/Bu3qd7ETQPahTotg2WRCatXwRBW554g==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.0.tgz", + "integrity": "sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==", "dev": true, "dependencies": { - "cli-truncate": "^3.1.0", + "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", - "log-update": "^5.0.1", + "log-update": "^6.0.0", "rfdc": "^1.3.0", - "wrap-ansi": "^8.1.0" + "wrap-ansi": "^9.0.0" }, "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } }, "node_modules/listr2/node_modules/eventemitter3": { @@ -4150,19 +2584,19 @@ "license": "MIT" }, "node_modules/log-update": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-5.0.1.tgz", - "integrity": "sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", + "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", "dev": true, "dependencies": { - "ansi-escapes": "^5.0.0", + "ansi-escapes": "^6.2.0", "cli-cursor": "^4.0.0", - "slice-ansi": "^5.0.0", - "strip-ansi": "^7.0.1", - "wrap-ansi": "^8.0.1" + "slice-ansi": "^7.0.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4180,6 +2614,49 @@ "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, + "node_modules/log-update/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-update/node_modules/is-fullwidth-code-point": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", + "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", + "dev": true, + "dependencies": { + "get-east-asian-width": "^1.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", + "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.2.1", + "is-fullwidth-code-point": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, "node_modules/log-update/node_modules/strip-ansi": { "version": "7.1.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", @@ -4263,10 +2740,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mini-signals": { - "version": "1.2.0", - "license": "MIT" - }, "node_modules/minimatch": { "version": "3.1.2", "dev": true, @@ -4353,13 +2826,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/object-inspect": { "version": "1.12.3", "license": "MIT", @@ -4466,13 +2932,6 @@ "node": ">=6" } }, - "node_modules/parse-uri": { - "version": "1.0.8", - "license": "MIT", - "engines": { - "node": ">= 0.10" - } - }, "node_modules/path-exists": { "version": "4.0.0", "dev": true, @@ -4553,133 +3012,275 @@ } }, "node_modules/pixi.js": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/accessibility": "5.3.12", - "@pixi/app": "5.3.12", - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/extract": "5.3.12", - "@pixi/filter-alpha": "5.3.12", - "@pixi/filter-blur": "5.3.12", - "@pixi/filter-color-matrix": "5.3.12", - "@pixi/filter-displacement": "5.3.12", - "@pixi/filter-fxaa": "5.3.12", - "@pixi/filter-noise": "5.3.12", - "@pixi/graphics": "5.3.12", - "@pixi/interaction": "5.3.12", - "@pixi/loaders": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/mesh": "5.3.12", - "@pixi/mesh-extras": "5.3.12", - "@pixi/mixin-cache-as-bitmap": "5.3.12", - "@pixi/mixin-get-child-by-name": "5.3.12", - "@pixi/mixin-get-global-position": "5.3.12", - "@pixi/particles": "5.3.12", - "@pixi/polyfill": "5.3.12", - "@pixi/prepare": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/sprite-animated": "5.3.12", - "@pixi/sprite-tiling": "5.3.12", - "@pixi/spritesheet": "5.3.12", - "@pixi/text": "5.3.12", - "@pixi/text-bitmap": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-7.3.2.tgz", + "integrity": "sha512-GJickUrT3UcBInGT1CU6cv2oktCdocE5QM74CD3t+weiJPPWIzleNlp7zrBR5QIDdU6bEO8CUgUXH2Y9QvlCMw==", + "dependencies": { + "@pixi/accessibility": "7.3.2", + "@pixi/app": "7.3.2", + "@pixi/assets": "7.3.2", + "@pixi/compressed-textures": "7.3.2", + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/events": "7.3.2", + "@pixi/extensions": "7.3.2", + "@pixi/extract": "7.3.2", + "@pixi/filter-alpha": "7.3.2", + "@pixi/filter-blur": "7.3.2", + "@pixi/filter-color-matrix": "7.3.2", + "@pixi/filter-displacement": "7.3.2", + "@pixi/filter-fxaa": "7.3.2", + "@pixi/filter-noise": "7.3.2", + "@pixi/graphics": "7.3.2", + "@pixi/mesh": "7.3.2", + "@pixi/mesh-extras": "7.3.2", + "@pixi/mixin-cache-as-bitmap": "7.3.2", + "@pixi/mixin-get-child-by-name": "7.3.2", + "@pixi/mixin-get-global-position": "7.3.2", + "@pixi/particle-container": "7.3.2", + "@pixi/prepare": "7.3.2", + "@pixi/sprite": "7.3.2", + "@pixi/sprite-animated": "7.3.2", + "@pixi/sprite-tiling": "7.3.2", + "@pixi/spritesheet": "7.3.2", + "@pixi/text": "7.3.2", + "@pixi/text-bitmap": "7.3.2", + "@pixi/text-html": "7.3.2" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/pixijs" } }, - "node_modules/pixi.js/node_modules/@pixi/constants": { - "version": "5.3.12", - "license": "MIT" + "node_modules/pixi.js/node_modules/@pixi/accessibility": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-7.3.2.tgz", + "integrity": "sha512-MdkU22HTauRvq9cMeWZIQGaDDa86sr+m12rKNdLV+FaDQgP/AhP+qCVpK7IKeJa9BrWGXaYMw/vueij7HkyDSA==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/events": "7.3.2" + } }, - "node_modules/pixi.js/node_modules/@pixi/core": { - "version": "5.3.12", - "license": "MIT", + "node_modules/pixi.js/node_modules/@pixi/app": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/app/-/app-7.3.2.tgz", + "integrity": "sha512-3YRFSMvAxDebAz3/JJv+2jzbPkT8cHC0IHmmLRN8krDL1pZV+YjMLgMwN/Oeyv5TSbwNqnrF5su5whNkRaxeZQ==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/assets": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/assets/-/assets-7.3.2.tgz", + "integrity": "sha512-yteq6ptAxA09EcwU9D9hl7qr5yWIqy+c2PsXkTDkc76vTAwIamLY3KxLq2aR5y1U4L4O6aHFJd26uNhHcuTPmw==", "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/runner": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/ticker": "5.3.12", - "@pixi/utils": "5.3.12" + "@types/css-font-loading-module": "^0.0.7" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/pixijs" + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/utils": "7.3.2" } }, - "node_modules/pixi.js/node_modules/@pixi/display": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" + "node_modules/pixi.js/node_modules/@pixi/compressed-textures": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/compressed-textures/-/compressed-textures-7.3.2.tgz", + "integrity": "sha512-J3ENMHDPQO6CJRei55gqI0WmiZJIK6SgsW5AEkShT0aAe5miEBSomv70pXw/58ru+4/Hx8cXjamsGt4aQB2D0Q==", + "peerDependencies": { + "@pixi/assets": "7.3.2", + "@pixi/core": "7.3.2" } }, - "node_modules/pixi.js/node_modules/@pixi/graphics": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/sprite": "5.3.12", - "@pixi/utils": "5.3.12" + "node_modules/pixi.js/node_modules/@pixi/events": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/events/-/events-7.3.2.tgz", + "integrity": "sha512-Moca9epu8jk1wIQCdVYjhz2pD9Ol21m50wvWUKvpgt9yM/AjkCLSDt8HO/PmTpavDrkhx5pVVWeDDA6FyUNaGA==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2" } }, - "node_modules/pixi.js/node_modules/@pixi/math": { - "version": "5.3.12", - "license": "MIT" + "node_modules/pixi.js/node_modules/@pixi/extract": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-7.3.2.tgz", + "integrity": "sha512-KsoflvQZV/XD8A8xbtRnmI4reYekbI4MOi7ilwQe5tMz6O1mO7IzrSukxkSMD02f6SpbAqbi7a1EayTjvY0ECQ==", + "peerDependencies": { + "@pixi/core": "7.3.2" + } }, - "node_modules/pixi.js/node_modules/@pixi/runner": { - "version": "5.3.12", - "license": "MIT" + "node_modules/pixi.js/node_modules/@pixi/filter-alpha": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-7.3.2.tgz", + "integrity": "sha512-nZMdn310wH5ZK1slwv3X4qT8eLoAGO7SgYGCy5IsMtpCtNObzE9XA4tAfhXrjihyzPS9KvszgAbnv1Qpfh0/uw==", + "peerDependencies": { + "@pixi/core": "7.3.2" + } }, - "node_modules/pixi.js/node_modules/@pixi/settings": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "ismobilejs": "^1.1.0" + "node_modules/pixi.js/node_modules/@pixi/filter-blur": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-7.3.2.tgz", + "integrity": "sha512-unu3zhwHMhN+iAe7Td2rK40i2UJ2GOhzWK+6jcU3ZkMOsFCT5kgBoMRTejeQVcvCs6GoYK8imbkE7mXt05Vj6A==", + "peerDependencies": { + "@pixi/core": "7.3.2" } }, - "node_modules/pixi.js/node_modules/@pixi/sprite": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/core": "5.3.12", - "@pixi/display": "5.3.12", - "@pixi/math": "5.3.12", - "@pixi/settings": "5.3.12", - "@pixi/utils": "5.3.12" + "node_modules/pixi.js/node_modules/@pixi/filter-color-matrix": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-7.3.2.tgz", + "integrity": "sha512-rbyjes/9SMoV9jjPiK0sLMkmLfN8D17GoTJIfq/KLv1x9646W5fL2QSKkN04UkZ+020ndWvIOxK1S97tvRyCfg==", + "peerDependencies": { + "@pixi/core": "7.3.2" } }, - "node_modules/pixi.js/node_modules/@pixi/ticker": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/settings": "5.3.12" + "node_modules/pixi.js/node_modules/@pixi/filter-displacement": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-7.3.2.tgz", + "integrity": "sha512-ZHl7Sfb8JYd9Z6j96OHCC0NhMKhhXJRE5AbkSDohjEMVCK1BV5rDGAHV8WVt/2MJ/j83CXUpydzyMhdM4lMchg==", + "peerDependencies": { + "@pixi/core": "7.3.2" } }, - "node_modules/pixi.js/node_modules/@pixi/utils": { - "version": "5.3.12", - "license": "MIT", - "dependencies": { - "@pixi/constants": "5.3.12", - "@pixi/settings": "5.3.12", - "earcut": "^2.1.5", - "eventemitter3": "^3.1.0", - "url": "^0.11.0" + "node_modules/pixi.js/node_modules/@pixi/filter-fxaa": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-7.3.2.tgz", + "integrity": "sha512-9brtlxDnQTZk2XiFBKdBK9e+8CX9LdxxcL7LRpjEyiHuAPvTlQgu9B85LrJ4GzWKqJJKaIIZBzhIoiCLUnfeXg==", + "peerDependencies": { + "@pixi/core": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/filter-noise": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-7.3.2.tgz", + "integrity": "sha512-F8GQQ20n7tCjThX6GCXckiXz2YffOCxicTJ0oat9aVDZh+sVsAxYX0aKSdHh0hhv18F0yuc6tPsSL5DYb63xFg==", + "peerDependencies": { + "@pixi/core": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/mesh": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-7.3.2.tgz", + "integrity": "sha512-LFkt7ELYXQLgbgHpjl68j6JD5ejUwma8zoPn2gqSBbY+6pK/phjvV1Wkh76muF46VvNulgXF0+qLIDdCsfrDaA==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/mesh-extras": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-7.3.2.tgz", + "integrity": "sha512-s/tg9TsTZZxLEdCDKWnBChDGkc041HCTP7ykJv4fEROzb9B0lskULYyvv+/YNNKa2Ugb9WnkMknpOdOXCpjyyg==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/mesh": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/mixin-cache-as-bitmap": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-7.3.2.tgz", + "integrity": "sha512-bZRlyUN5+9kCUjn67V0IFtYIrbmx9Vs4sMOmXyrX3Q4B4gPLE46IzZz3v0IVaTjp32udlQztfJalIaWbuqgb3A==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/sprite": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/mixin-get-child-by-name": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-7.3.2.tgz", + "integrity": "sha512-mbUi3WxXrkViH7qOgjk4fu2BN36NwNb7u+Fy1J5dS8Bntj57ZVKmEV9PbUy0zYjXE8rVmeAvSu/2kbn5n9UutQ==", + "peerDependencies": { + "@pixi/display": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/mixin-get-global-position": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-7.3.2.tgz", + "integrity": "sha512-1nhWbBgmw6rK7yQJxzeI9yjKYYEkM5i3pee8qVu4YWo3b1xWVQA7osQG7aGM/4qywDkXaA1ZvciA5hfg6f4Q5Q==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/particle-container": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/particle-container/-/particle-container-7.3.2.tgz", + "integrity": "sha512-JYc4j4z97KmxyLp+1Lg0SNi8hy6RxcBBNQGk+CSLNXeDWxx3hykT5gj/ORX1eXyzHh1ZCG1XzeVS9Yr8QhlFHA==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/sprite": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/prepare": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-7.3.2.tgz", + "integrity": "sha512-aLPAXSYLUhMwxzJtn9m0TSZe+dQlZCt09QNBqYbSi8LZId54QMDyvfBb4zBOJZrD2xAZgYL5RIJuKHwZtFX6lQ==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/graphics": "7.3.2", + "@pixi/text": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/sprite-animated": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-7.3.2.tgz", + "integrity": "sha512-j9pyUe4cefxE9wecNfbWQyL5fBQKvCGYaOA0DE1X46ukBHrIuhA8u3jg2X3N3r4IcbVvxpWFYDrDsWXWeiBmSw==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/sprite": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/sprite-tiling": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-7.3.2.tgz", + "integrity": "sha512-tWVVb/rMIx5AczfUrVxa0dZaIufP5C0IOL7IGfFUDQqDu5JSAUC0mwLe4F12jAXBVsqYhCGYx5bIHbPiI5vcSQ==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/sprite": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/spritesheet": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-7.3.2.tgz", + "integrity": "sha512-UkwqrPYDqrEdK5ub9qn/9VBvt5caA8ffV5iYR6ssCvrpaQovBKmS+b5pr/BYf8xNTExDpR3OmPIo8iDEYWWLuw==", + "peerDependencies": { + "@pixi/assets": "7.3.2", + "@pixi/core": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/text": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/text/-/text-7.3.2.tgz", + "integrity": "sha512-LdtNj+K5tPB/0UcDcO52M/C7xhwFTGFhtdF42fPhRuJawM23M3zm1Y8PapXv+mury+IxCHT1w30YlAi0qTVpKQ==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/sprite": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/text-bitmap": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-7.3.2.tgz", + "integrity": "sha512-p8KLgtZSPowWU/Zj+GVtfsUT8uGYo4TtKKYbLoWuxkRA5Pc1+4C9/rV/EOSFfoZIdW5C+iFg5VxRgBllUQf+aA==", + "peerDependencies": { + "@pixi/assets": "7.3.2", + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/mesh": "7.3.2", + "@pixi/text": "7.3.2" + } + }, + "node_modules/pixi.js/node_modules/@pixi/text-html": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/@pixi/text-html/-/text-html-7.3.2.tgz", + "integrity": "sha512-IYhBWEPOvqUtlHkS5/c1Hseuricj5jrrGd21ivcvHmcnK/x2m+CRGvvzeBp1mqoYBnDbQVrD2wSXSe4Dv9tEJA==", + "peerDependencies": { + "@pixi/core": "7.3.2", + "@pixi/display": "7.3.2", + "@pixi/sprite": "7.3.2", + "@pixi/text": "7.3.2" } }, "node_modules/pkg-types": { @@ -4797,6 +3398,38 @@ "prosemirror-transform": "^1.0.0" } }, + "node_modules/prosemirror-dropcursor": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.1.tgz", + "integrity": "sha512-M30WJdJZLyXHi3N8vxN6Zh5O8ZBbQCz0gURTfPmTIBNQ5pxrdU7A58QkNqfa98YEjSAL1HUyyU34f6Pm5xBSGw==", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0", + "prosemirror-view": "^1.1.0" + } + }, + "node_modules/prosemirror-gapcursor": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.3.2.tgz", + "integrity": "sha512-wtjswVBd2vaQRrnYZaBCbyDqr232Ed4p2QPtRIUK5FuqHYKGWkEwl08oQM4Tw7DOR0FsasARV5uJFvMZWxdNxQ==", + "dependencies": { + "prosemirror-keymap": "^1.0.0", + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-view": "^1.0.0" + } + }, + "node_modules/prosemirror-history": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.3.2.tgz", + "integrity": "sha512-/zm0XoU/N/+u7i5zepjmZAEnpvjDtzoPWW6VmKptcAnPadN/SStsBjMImdCEbb3seiNTpveziPTIrXQbHLtU1g==", + "dependencies": { + "prosemirror-state": "^1.2.2", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.31.0", + "rope-sequence": "^1.3.0" + } + }, "node_modules/prosemirror-inputrules": { "version": "1.2.1", "license": "MIT", @@ -4838,6 +3471,18 @@ "prosemirror-view": "^1.27.0" } }, + "node_modules/prosemirror-tables": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.3.4.tgz", + "integrity": "sha512-z6uLSQ1BLC3rgbGwZmpfb+xkdvD7W/UOsURDfognZFYaTtc0gsk7u/t71Yijp2eLflVpffMk6X0u0+u+MMDvIw==", + "dependencies": { + "prosemirror-keymap": "^1.1.2", + "prosemirror-model": "^1.8.1", + "prosemirror-state": "^1.3.1", + "prosemirror-transform": "^1.2.1", + "prosemirror-view": "^1.13.3" + } + }, "node_modules/prosemirror-transform": { "version": "1.8.0", "license": "MIT", @@ -4921,14 +3566,6 @@ "node": ">=4" } }, - "node_modules/resource-loader": { - "version": "3.0.1", - "license": "MIT", - "dependencies": { - "mini-signals": "^1.2.0", - "parse-uri": "^1.0.0" - } - }, "node_modules/restore-cursor": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", @@ -5014,6 +3651,11 @@ "fsevents": "~2.3.2" } }, + "node_modules/rope-sequence": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", + "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==" + }, "node_modules/run-applescript": { "version": "5.0.0", "dev": true, @@ -5285,17 +3927,17 @@ } }, "node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.0.0.tgz", + "integrity": "sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==", "dev": true, "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -5412,8 +4054,9 @@ "dev": true }, "node_modules/tinymce": { - "version": "6.7.0", - "license": "MIT" + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/tinymce/-/tinymce-6.8.0.tgz", + "integrity": "sha512-WSQlyfW8aPkOVMmmHmSVeA5Dq4JuUZjTB+PmePJ27oQ+ruv3Zn4KSTsvSnDUrHlqygjDvRidrCB/m5nTWCC2nA==" }, "node_modules/tinypool": { "version": "0.7.0", @@ -5755,17 +4398,17 @@ "license": "MIT" }, "node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", + "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", "dev": true, "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=12" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" diff --git a/package.json b/package.json index e246dd854..a04795dff 100644 --- a/package.json +++ b/package.json @@ -56,25 +56,29 @@ "typscript" ], "dependencies": { - "@pixi/graphics-smooth": "^0.0.30", - "@pixi/particle-emitter": "^5.0.7", + "@pixi/graphics-smooth": "^1.1.0", + "@pixi/particle-emitter": "^5.0.8", "@types/jquery": "~3.5.22", "@types/showdown": "~2.0.2", "@types/simple-peer": "~9.11.1", "@types/youtube": "~0.0.48", "handlebars": "^4.7.7", - "pixi.js": "^5.3.11", + "pixi.js": "^7.2.4", "prosemirror-collab": "^1.3.0", - "prosemirror-commands": "^1.3.0", + "prosemirror-commands": "^1.5.1", + "prosemirror-dropcursor": "^1.8.0", + "prosemirror-gapcursor": "^1.3.1", + "prosemirror-history": "^1.3.0", "prosemirror-inputrules": "^1.2.0", - "prosemirror-keymap": "^1.2.0", - "prosemirror-model": "^1.18.1", - "prosemirror-schema-list": "^1.2.1", - "prosemirror-state": "^1.4.1", - "prosemirror-transform": "^1.7.0", - "prosemirror-view": "^1.27.2", - "socket.io-client": "^4.5.1", - "tinymce": "^6.7.0" + "prosemirror-keymap": "^1.2.1", + "prosemirror-model": "^1.19.0", + "prosemirror-schema-list": "^1.2.2", + "prosemirror-state": "^1.4.2", + "prosemirror-tables": "^1.3.2", + "prosemirror-transform": "^1.7.1", + "prosemirror-view": "^1.30.2", + "socket.io-client": "^4.6.1", + "tinymce": "^6.7.1" }, "devDependencies": { "@typescript-eslint/eslint-plugin": "^6.7.4", @@ -90,6 +94,9 @@ "typescript": "~5.3", "vitest": "^0.34.6" }, + "overrides": { + "@types/css-font-loading-module": "^0.0.12s" + }, "husky": { "hooks": { "pre-commit": "lint-staged" diff --git a/src/foundry/client/config.d.ts b/src/foundry/client/config.d.ts index 37de6da81..3755115ff 100644 --- a/src/foundry/client/config.d.ts +++ b/src/foundry/client/config.d.ts @@ -3,7 +3,6 @@ import type { StatusEffect } from "./data/documents/token"; import * as CONST from "../common/constants.mjs"; // FIXME: Replace with imports for for the right things or remove when implemented -type VisionMode = unknown; type DetectInvisibilityVisionMode = VisionMode; type TremorSenseVisionMode = VisionMode; type DataModel = unknown; diff --git a/src/foundry/client/pixi/board.d.ts b/src/foundry/client/pixi/board.d.ts index 507b2a4c3..4bce96f75 100644 --- a/src/foundry/client/pixi/board.d.ts +++ b/src/foundry/client/pixi/board.d.ts @@ -84,7 +84,7 @@ declare global { * An set of blur filter instances which are modified by the zoom level and the "soft shadows" setting * @defaultValue `[]` */ - blurFilters: Set; + blurFilters: Set; /** * A reference to the MouseInteractionManager that is currently controlling pointer-based interaction, or null. @@ -173,7 +173,7 @@ declare global { * A debounced function which tracks movements of the mouse on the game canvas. * @defaultValue `foundry.utils.debounce(this._onMouseMove.bind(this), this.#mouseMoveDebounceMS)` */ - #debounceMouseMove: (event: PIXI.InteractionEvent) => void; + #debounceMouseMove: (event: PIXI.FederatedEvent) => void; /** * The singleton PIXI.Application instance rendered on the Canvas. @@ -519,14 +519,14 @@ declare global { * @param blurStrength - The desired blur strength to use for this filter * (default: `CONFIG.Canvas.blurStrength`) */ - createBlurFilter(blurStrength?: number): PIXI.filters.BlurFilter; + createBlurFilter(blurStrength?: number): PIXI.BlurFilter; /** * Add a filter to the blur filter list. The filter must have the blur property * @param filter - The Filter instance to add * @returns The added filter for method chaining */ - addBlurFilter(filter: PIXI.filters.BlurFilter): PIXI.filters.BlurFilter; + addBlurFilter(filter: PIXI.BlurFilter): PIXI.BlurFilter; /** * Update the blur strength depending on the scale of the canvas stage @@ -574,19 +574,19 @@ declare global { * Handle mouse movement on the game canvas. * This handler fires on both a throttle and a debounce, ensuring that the final update is always recorded. */ - protected _onMouseMove(event: PIXI.InteractionEvent): void; + protected _onMouseMove(event: PIXI.FederatedEvent): void; /** * Handle left mouse-click events occurring on the Canvas. * @see {@link MouseInteractionManager#_handleClickLeft} */ - protected _onClickLeft(event: PIXI.InteractionEvent): void; + protected _onClickLeft(event: PIXI.FederatedEvent): void; /** * Handle double left-click events occurring on the Canvas stage. * @see {@link MouseInteractionManager#_handleClickLeft2} */ - protected _onClickLeft2(event: PIXI.InteractionEvent): void; + protected _onClickLeft2(event: PIXI.FederatedEvent): void; /** * Handle long press events occurring on the Canvas. @@ -594,21 +594,21 @@ declare global { * @param event - The triggering canvas interaction event. * @param origin - The local canvas coordinates of the mousepress. */ - protected _onLongPress(event: PIXI.InteractionEvent, origin: PIXI.Point): void; + protected _onLongPress(event: PIXI.FederatedEvent, origin: PIXI.Point): void; /** * Handle the beginning of a left-mouse drag workflow on the Canvas stage or its active Layer. * @see {@link MouseInteractionManager#_handleDragStart} * @internal */ - protected _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected _onDragLeftStart(event: PIXI.FederatedEvent): void; /** * Handle mouse movement events occurring on the Canvas. * @see {@link MouseInteractionManager#_handleDragMove} * @internal */ - protected _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected _onDragLeftMove(event: PIXI.FederatedEvent): void; /** * Handle the conclusion of a left-mouse drag workflow when the mouse button is released. @@ -616,7 +616,7 @@ declare global { * @internal */ protected _onDragLeftDrop( - event: PIXI.InteractionEvent, + event: PIXI.FederatedEvent, ): ReturnType["selectObjects"]> | ReturnType | void; /** @@ -630,31 +630,31 @@ declare global { * Handle right mouse-click events occurring on the Canvas stage or it's active layer * @see {@link MouseInteractionManager#_handleClickRight} */ - protected _onClickRight(event: PIXI.InteractionEvent): void; + protected _onClickRight(event: PIXI.FederatedEvent): void; /** * Handle double right-click events occurring on the Canvas. * @see {@link MouseInteractionManager#_handleClickRight} * @internal */ - protected _onClickRight2(event: PIXI.InteractionEvent): void; + protected _onClickRight2(event: PIXI.FederatedEvent): void; /** * Handle right-mouse drag events occurring on the Canvas. * @see {@link MouseInteractionManager#_handleDragMove} */ - protected _onDragRightMove(event: PIXI.InteractionEvent): void; + protected _onDragRightMove(event: PIXI.FederatedEvent): void; /** * Handle the conclusion of a right-mouse drag workflow the Canvas stage. * @see {@link MouseInteractionManager#_handleDragDrop} */ - protected _onDragRightDrop(event: PIXI.InteractionEvent): void; + protected _onDragRightDrop(event: PIXI.FederatedEvent): void; /** * Determine selection coordinate rectangle during a mouse-drag workflow */ - protected _onDragSelect(event: PIXI.InteractionEvent): void; + protected _onDragSelect(event: PIXI.FederatedEvent): void; /** * Pan the canvas view when the cursor position gets close to the edge of the frame diff --git a/src/foundry/client/pixi/core/interaction/canvas-animation.d.ts b/src/foundry/client/pixi/core/interaction/canvas-animation.d.ts index e55bc9031..deec5f7e2 100644 --- a/src/foundry/client/pixi/core/interaction/canvas-animation.d.ts +++ b/src/foundry/client/pixi/core/interaction/canvas-animation.d.ts @@ -19,6 +19,9 @@ declare global { /** The amount of the total delta which has been animated */ done?: number; + + /** Is this a color animation that applies to RGB channels */ + color?: boolean; } interface CanvasAnimationOptions { diff --git a/src/foundry/client/pixi/core/interaction/control-icon.d.ts b/src/foundry/client/pixi/core/interaction/control-icon.d.ts index b154a4879..e14591c9a 100644 --- a/src/foundry/client/pixi/core/interaction/control-icon.d.ts +++ b/src/foundry/client/pixi/core/interaction/control-icon.d.ts @@ -33,9 +33,9 @@ declare class ControlIcon extends PIXI.Container { tintColor: number | null; /** - * @defaultValue `true` + * @defaultValue `static` */ - interactive: boolean; + eventMode: "none" | "passive" | "auto" | "static" | "dynamic"; /** * @defaultValue `false` @@ -48,11 +48,29 @@ declare class ControlIcon extends PIXI.Container { icon: PIXI.Sprite; + /** + * @defaultValue + * The `visible` property is true. + */ border: PIXI.Graphics; + /** + * Initial drawing of the ControlIcon + */ draw(): Promise; - protected _onHoverIn(event: PIXI.InteractionEvent): void; - - protected _onHoverOut(event: PIXI.InteractionEvent): void; + /** + * Incremental refresh for ControlIcon appearance. + */ + refresh({ + visible, + iconColor, + borderColor, + borderVisible, + }?: { + visible?: boolean; + iconColor?: number; + borderColor?: number; + borderVisible?: boolean; + }): this; } diff --git a/src/foundry/client/pixi/core/interaction/index.d.ts b/src/foundry/client/pixi/core/interaction/index.d.ts index 3a9972403..49f9aec2a 100644 --- a/src/foundry/client/pixi/core/interaction/index.d.ts +++ b/src/foundry/client/pixi/core/interaction/index.d.ts @@ -1,6 +1,8 @@ +import "./pings"; import "./canvas-animation"; import "./control-icon"; import "./mouse-handler"; import "./ping"; +import "./render-flags"; import "./resize-handle"; import "./targets"; diff --git a/src/foundry/client/pixi/core/interaction/mouse-handler.d.ts b/src/foundry/client/pixi/core/interaction/mouse-handler.d.ts index a7e33bac5..b9089630f 100644 --- a/src/foundry/client/pixi/core/interaction/mouse-handler.d.ts +++ b/src/foundry/client/pixi/core/interaction/mouse-handler.d.ts @@ -21,9 +21,9 @@ * Drag and Drop * _handleMouseMove * action: dragLeftStart - * action: dragLeftMove * action: dragRightStart * action: dragLeftMove + * action: dragRightMove * _handleMouseUp * action: dragLeftDrop * action: dragRightDrop @@ -57,14 +57,14 @@ declare class MouseInteractionManager boolean) | boolean + ((user: Game["user"], event: PIXI.FederatedEvent) => boolean) | boolean > >; /** * @defaultValue `{}` */ - callbacks: Partial void) | null>>; + callbacks: Partial void) | null>>; /** * @defaultValue `{}` @@ -81,12 +81,11 @@ declare class MouseInteractionManager void - > - >; + interactionData: { + origin?: PIXI.Point; + destination?: PIXI.Point; + object?: Record; + } & Partial>; /** * The drag handling time @@ -94,13 +93,6 @@ declare class MouseInteractionManager; /** - * Handle double right-click actions. - * @internal + * A public method to handle directly an event into this manager, according to its type. + * Note: drag events are not handled. + * @returns Has the event been processed? */ - protected _handleClickRight2(event: PIXI.InteractionEvent): unknown; + handleEvent(event: PIXI.FederatedEvent): boolean; /** - * Handle mouse movement during a drag workflow - * @internal + * A public method to cancel a current interaction workflow from this manager. + * @param event - The event that initiates the cancellation */ - protected _handleMouseMove(event: PIXI.InteractionEvent): unknown; + cancel(event: PIXI.FederatedEvent): void; /** - * Handle the beginning of a new drag start workflow, moving all controlled objects on the layer - * @internal + * Reset the mouse manager. */ - protected _handleDragStart(event: PIXI.InteractionEvent): unknown; + reset(options?: { + /** Reset the interaction data? */ + interactionData: boolean; - /** - * Handle the continuation of a drag workflow, moving all controlled objects on the layer - * @internal - */ - protected _handleDragMove(event: PIXI.InteractionEvent): unknown; + /** Reset the state? */ + state: boolean; + }): void; +} +declare namespace MouseInteractionManager { /** - * Handle mouse up events which may optionally conclude a drag workflow - * @internal + * Enumerate the states of handle outcome. */ - protected _handleMouseUp(event: PIXI.InteractionEvent): void; + type HANDLER_OUTCOME = { + /** -2: SKIPPED - the handler has been skipped by previous logic */ + SKIPPED: -2; - /** - * Handle the conclusion of a drag workflow, placing all dragged objects back on the layer - * @internal - */ - protected _handleDragDrop(event: PIXI.InteractionEvent): void; + /** -1: DISALLOWED - the handler has dissallowed further process */ + DISALLOWED: -1; - /** - * Handle the cancellation of a drag workflow, resetting back to the original state - * @internal - */ - protected _handleDragCancel(event: MouseEvent): void; + /** 1: REFUSED - the handler callback has been processed and is refusing further process */ + REFUSED: 1; - /** - * A public method to cancel a current interaction workflow from this manager. - * @param event - The event that initiates the cancellation - */ - cancel(event: Event): void; -} + /** 2: ACCEPTED - the handler callback has been processed and is accepting further process */ + ACCEPTED: 2; + }; -declare namespace MouseInteractionManager { type PermissionAction = | "clickLeft" | "clickLeft2" @@ -311,10 +253,7 @@ declare namespace MouseInteractionManager { type Action = PermissionAction | "dragLeftCancel" | "dragRightCancel"; interface Options { - /** - * @remarks If set, this must be the name of a property of the object that is a {@link PIXI.Container}. - */ - target?: string | null; + target?: PIXI.DisplayObject; dragResistance?: number; } diff --git a/src/foundry/client/pixi/core/interaction/ping.d.ts b/src/foundry/client/pixi/core/interaction/ping.d.ts index 916887437..2ae6da47a 100644 --- a/src/foundry/client/pixi/core/interaction/ping.d.ts +++ b/src/foundry/client/pixi/core/interaction/ping.d.ts @@ -1,5 +1,10 @@ +import type { IDestroyOptions } from "pixi.js"; + export {}; +// TODO: Remove once color export is fixed +type Color = number; + declare global { interface PingOptions { /** @@ -25,4 +30,34 @@ declare global { */ name?: string; } + + /** + * A class to manage a user ping on the canvas. + */ + class Ping extends PIXI.Container { + /** + * @param origin - The canvas co-ordinates of the origin of the ping. + * @param options - Additional options to configure the ping animation. + */ + constructor(origin: PIXI.Point, options?: PingOptions); + + options: PingOptions; + + _color: Color | number; + + destroy(options?: IDestroyOptions | boolean): void; + + /** + * Start the ping animation. + * @returns Returns true if the animation ran to completion, false otherwise. + */ + animate(): Promise; + + /** + * On each tick, advance the animation. + * @param dt - The number of ms that elapsed since the previous frame. + * @param animation - The animation state. + */ + protected _animateFrame(dt: number, animation: CanvasAnimationData): void; + } } diff --git a/src/foundry/client/pixi/core/interaction/pings/chevron.d.ts b/src/foundry/client/pixi/core/interaction/pings/chevron.d.ts new file mode 100644 index 000000000..3e7c8ea84 --- /dev/null +++ b/src/foundry/client/pixi/core/interaction/pings/chevron.d.ts @@ -0,0 +1,73 @@ +export {}; + +declare global { + /** + * A type of ping that points to a specific location. + */ + class ChevronPing extends Ping { + /** + * @param origin - The canvas co-ordinates of the origin of the ping. + * @param options - Additional options to configure the ping animation. + * (default: `{duration: 900, size: 128, color: "#ff6400"}`) + */ + constructor(origin: PIXI.Point, options?: PingOptions); + + /** @defaultValue `(this.options.size / 2) * .75` */ + _r: number; + + /** + * The inner ring is 3/4s the size of the outer. + * @defaultValue `this._r * .75` + */ + _rInner: number; + + /** + * The animation is split into three stages. First, the chevron fades in and moves downwards, then the rings fade + * in, then everything fades out as the chevron moves back up. + * Store the 1/4 time slice. + * @defaultValue `this.options.duration * .25` + */ + _t14: number; + + /** + * Store the 1/2 time slice. + * @defaultValue `this.options.duration * .5` + */ + _t12: number; + + /** + * Store the 3/4s time slice. + * @defaultValue `this._t14 * 3` + */ + _t34: number; + + /** + * The path to the chevron texture. + * @internal + */ + protected static _CHEVRON_PATH: "icons/pings/chevron.webp"; + + override animate(): Promise; + + override _animateFrame(dt: number, animation: CanvasAnimationData): void; + + /** + * Draw the outer and inner rings. + * @param a - The alpha. + * @internal + */ + protected _drawRings(a: number): void; + + /** + * Load the chevron texture. + * @internal + */ + protected _loadChevron(): Promise; + + /** + * Draw the two rings that are used as part of the ping animation. + * @internal + */ + protected _createRings(): PIXI.Graphics[]; + } +} diff --git a/src/foundry/client/pixi/core/interaction/pings/index.d.ts b/src/foundry/client/pixi/core/interaction/pings/index.d.ts new file mode 100644 index 000000000..65c6ac729 --- /dev/null +++ b/src/foundry/client/pixi/core/interaction/pings/index.d.ts @@ -0,0 +1,2 @@ +import "./chevron"; +import "./pulse"; diff --git a/src/foundry/client/pixi/core/interaction/pings/pulse.d.ts b/src/foundry/client/pixi/core/interaction/pings/pulse.d.ts new file mode 100644 index 000000000..80ab060c5 --- /dev/null +++ b/src/foundry/client/pixi/core/interaction/pings/pulse.d.ts @@ -0,0 +1,117 @@ +import Color from "../../../../../common/utils/color.mjs"; + +export {}; + +declare global { + interface PulsePingOptions extends PingOptions { + /** + * The number of rings used in the animation. + * (default: `3`) + */ + rings?: number; + + /** + * The alternate color that the rings begin at. Use white for a 'flashing' effect. + * (default: `#ffffff`) + */ + color2?: string; + } + + /** + * A type of ping that produces a pulsing animation. + */ + class PulsePing extends Ping { + /** + * @param origin - The canvas co-ordinates of the origin of the ping. + * @param options - Additional options to configure the ping animation. + */ + constructor(origin: PIXI.Point, options?: PulsePingOptions); + + _color2: Color | number; + + /** + * The radius is half the diameter. + * @defaultValue `this.options.size / 2` + */ + _r: number; + + /** + * This is the radius that the rings initially begin at. It's set to 1/5th of the maximum radius. + * @defaultValue `this._r / 5` + */ + _r0: number; + + /** + * Initialize some time slice variables that will be used to control the animation. + * + * The animation for each ring can be separated into two consecutive stages. + * Stage 1: Fade in a white ring with radius r0. + * Stage 2: Expand radius outward. While the radius is expanding outward, we have two additional, consecutive + * animations: + * Stage 2.1: Transition color from white to the configured color. + * Stage 2.2: Fade out. + * 1/5th of the animation time is allocated to Stage 1. 4/5ths are allocated to Stage 2. Of those 4/5ths, 2/5ths + * are allocated to Stage 2.1, and 2/5ths are allocated to Stage 2.2. + */ + protected _computeTimeSlices(): void; + + override animate(): Promise; + + override _animateFrame(dt: number, animation: CanvasAnimationData): void; + + /** + * Transition linearly from one color to another. + * @param from - The color to transition from. + * @param to - The color to transition to. + * @param duration - The length of the transition in milliseconds. + * @param t - The current time along the duration. + * @returns The incremental color between from and to. + * @internal + */ + protected _colorTransition(from: Color, to: Color, duration: number, t: number): number; + + /** + * Draw the shape for this ping. + * @param g - The graphics object to draw to. + * @param color - The color of the shape. + * @param alpha - The alpha of the shape. + * @param size - The size of the shape to draw. + */ + protected _drawShape(g: PIXI.Graphics, color: number, alph: number, size: number): void; + } + + /** + * A type of ping that produces an arrow pointing in a given direction. + */ + class ArrowPing extends PulsePing { + /** + * @param origin - The canvas co-ordinates of the origin of the ping. This becomes the arrow's tip. + * @param options - Additional options to configure the ping animation. + */ + constructor( + origin: PIXI.Point, + options: PulsePingOptions & { + /** + * The angle of the arrow in radians. + * (default: `0`) + */ + rotation: number; + }, + ); + + protected override _drawShape(g: PIXI.Graphics, color: number, alph: number, size: number): void; + } + + /** + * A type of ping that produces a pulse warning sign animation. + */ + class AlertPing extends PulsePing { + /** + * @param origin - The canvas co-ordinates of the origin of the ping. + * @param options - Additional options to configure the ping animation. + */ + constructor(origin: PIXI.Point, options: PulsePingOptions); + + protected override _drawShape(g: PIXI.Graphics, color: number, alph: number, size: number): void; + } +} diff --git a/src/foundry/client/pixi/core/interaction/render-flags.d.ts b/src/foundry/client/pixi/core/interaction/render-flags.d.ts new file mode 100644 index 000000000..3c11c683c --- /dev/null +++ b/src/foundry/client/pixi/core/interaction/render-flags.d.ts @@ -0,0 +1,98 @@ +export {}; + +/** + * Add RenderFlags functionality to some other object. + * This mixin standardizes the interface for such functionality. + * @remarks Actually a function `RenderFlagsMixin(Base)` + * @param Base - The base class being mixed + * @returns The mixed class definition + */ +declare class RenderFlagObject { + constructor(...args: any[]); + + /** + * Configure the render flags used for this class. + * @defaultValue `{}` + */ + static RENDER_FLAGS: Record>; + + /** + * The ticker priority when RenderFlags of this class are handled. + * Valid values are OBJECTS or PERCEPTION. + * @defaultValue "OBJECTS" + */ + static RENDER_FLAG_PRIORITY: "OBJECTS" | "PERCEPTION"; + + /** + * Status flags which are applied at render-time to update the PlaceableObject. + * If an object defines RenderFlags, it should at least include flags for "redraw" and "refresh". + */ + renderFlags: RenderFlags; + + /** + * Apply any current render flags, clearing the renderFlags set. + * Subclasses should override this method to define behavior. + */ + applyRenderFlags(): void; +} + +declare global { + /** @privateRemarks Values are marked as optional here based on use, foundry docs incomplete */ + type RenderFlag = { + /** Activating this flag also sets these flags to true */ + propagate?: Array>; + /** Activating this flag resets these flags to false */ + reset?: Array>; + }; + + /** + * A data structure for tracking a set of boolean status flags. + * This is a restricted set which can only accept flag values which are pre-defined. + */ + class RenderFlags extends Set { + /** + * @param flags - An object which defines the flags which are supported for tracking + * @param config - Optional configuration + */ + constructor( + flags: Record>>, + config?: { + /** The object which owns this RenderFlags instance */ + object?: RenderFlagObject; + + /** + * The update priority when these render flags are applied. + * Valid options are OBJECTS or PERCEPTION. + * @defaultValue `PIXI.UPDATE_PRIORITY.OBJECTS` + */ + priority?: PIXI.UPDATE_PRIORITY.OBJECTS | PIXI.UPDATE_PRIORITY.PERCEPTION; + }, + ); + + readonly flags: Record>>; + + readonly object: RenderFlagObject; + + readonly priority: "OBJECT" | "PERCEPTION"; + + /** + * @returns The flags which were previously set that have been cleared. + */ + clear(): Record; + + /** + * Allow for handling one single flag at a time. + * This function returns whether the flag needs to be handled and removes it from the pending set. + */ + handle(flag: string): boolean; + + /** + * Activate certain flags, also toggling propagation and reset behaviors + */ + set(changes: Record): void; + } + + function RenderFlagsMixin any>( + Base: BaseClass, + ): Mixin; +} diff --git a/src/foundry/client/pixi/core/interaction/resize-handle.d.ts b/src/foundry/client/pixi/core/interaction/resize-handle.d.ts index 767b9c48f..b4e0fb922 100644 --- a/src/foundry/client/pixi/core/interaction/resize-handle.d.ts +++ b/src/foundry/client/pixi/core/interaction/resize-handle.d.ts @@ -32,17 +32,17 @@ declare class ResizeHandle extends PIXI.Graphics { * Handle mouse-over event on a control handle * @param event - The mouseover event */ - protected _onHoverIn(event: PIXI.InteractionEvent): void; + protected _onHoverIn(event: PIXI.FederatedEvent): void; /** * Handle mouse-out event on a control handle * @param event - The mouseout event */ - protected _onHoverOut(event: PIXI.InteractionEvent): void; + protected _onHoverOut(event: PIXI.FederatedEvent): void; /** * When we start a drag event - create a preview copy of the Tile for re-positioning * @param event - The mousedown event */ - protected _onMouseDown(event: PIXI.InteractionEvent): void; + protected _onMouseDown(event: PIXI.FederatedEvent): void; } diff --git a/src/foundry/client/pixi/core/shapes/source-polygon.d.ts b/src/foundry/client/pixi/core/shapes/source-polygon.d.ts index 0fb387dcb..ac1ac9374 100644 --- a/src/foundry/client/pixi/core/shapes/source-polygon.d.ts +++ b/src/foundry/client/pixi/core/shapes/source-polygon.d.ts @@ -1,110 +1,254 @@ -interface PointSourcePolygonConfig { - /** The type of polygon being computed */ - type?: foundry.CONST.WALL_RESTRICTION_TYPES; +export {}; - /** The angle of emission, if limited */ - angle?: number; +declare global { + interface PointSourcePolygonConfig { + /** The type of polygon being computed */ + type?: foundry.CONST.WALL_RESTRICTION_TYPES; - /** The desired density of padding rays, a number per PI */ - density?: number; + /** The angle of emission, if limited */ + angle?: number; - /** A limited radius of the resulting polygon */ - radius?: number; + /** The desired density of padding rays, a number per PI */ + density?: number; - /** The direction of facing, required if the angle is limited */ - rotation?: number; + /** A limited radius of the resulting polygon */ + radius?: number; - /** Display debugging visualization and logging for the polygon */ - debug?: boolean; + /** The direction of facing, required if the angle is limited */ + rotation?: number; - /** Is this polygon constrained by any walls? */ - walls?: boolean; + /** Customize how wall direction of one-way walls is applied */ + wallDirectionMode?: number; - /** The object (if any) that spawned this polygon. */ - source?: PointSource; -} - -/** - * An extension of the default PIXI.Polygon which is used to represent the line of sight for a point source. - */ -declare abstract class PointSourcePolygon extends PIXI.Polygon { - /** - * The origin point of the source polygon. - */ - origin: Point; + /** Compute the polygon with threshold wall constraints applied */ + useThreshold?: boolean; - /** - * The configuration of this polygon. - * @defaultValue `{}` - */ - config: PointSourcePolygonConfig; + /** Display debugging visualization and logging for the polygon */ + debug?: boolean; - /** - * A cached array of SightRay objects used to compute the polygon. - * @defaultValue `[]` - * @remarks This is documented as `SightRay[]` but that's only correct for the {@link RadialSweepPolygon} - */ - rays: Ray[]; - - /** - * Compute the rectangular bounds for the Polygon. - * @param points - The initially provided array of coordinates - * @returns The computed Rectangular bounds - */ - protected _getBounds(points: number[]): PIXI.Rectangle; + /** The object (if any) that spawned this polygon. */ + source?: PointSource; - /** - * Benchmark the performance of polygon computation for this source - * @param iterations - The number of test iterations to perform - * @param args - Arguments passed to the compute method - */ - static benchmark( - iterations: number, - ...args: Parameters<(typeof PointSourcePolygon)["create"]> - ): ReturnType; + /** Limiting polygon boundary shapes */ + boundaryShapes?: Array; - /** - * Compute the polygon given a point origin and radius - * @param origin - The origin source point - * @param config - Configuration options which customize the polygon computation - * (default: `{}`) - * @returns The computed polygon instance - */ - static create( - origin: Point, - config?: Parameters[1] | undefined, - ): ReturnType; + /** Does this polygon use the Scene inner or outer bounding rectangle */ + readonly useInnerBounds?: boolean; - /** - * Compute the polygon using the origin and configuration options. - * @returns The computed polygon - */ - compute(): this; + /** Does this polygon have a limited radius? */ + readonly hasLimitedRadius?: boolean; - /** - * Perform the implementation-specific computation - */ - protected abstract _compute(): void; + /** Does this polygon have a limited angle? */ + readonly hasLimitedAngle?: boolean; - /** - * Customize the provided configuration object for this polygon type. - * @param origin - The provided polygon origin - * @param config - The provided configuration object - */ - initialize(origin: Point, config: PointSourcePolygonConfig): void; + /** The computed bounding box for the polygon */ + readonly boundingBox?: PIXI.Rectangle; + } /** - * Visualize the polygon, displaying its computed area, rays, and collision points + * An extension of the default PIXI.Polygon which is used to represent the line of sight for a point source. */ - visualize(): void; + abstract class PointSourcePolygon extends PIXI.Polygon { + /** + * Customize how wall direction of one-way walls is applied + */ + static readonly WALL_DIRECTION_MODES: Readonly<{ + NORMAL: 0; + REVERSED: 1; + BOTH: 2; + }>; + + /** + * The rectangular bounds of this polygon + * @defaultValue `new PIXI.Rectangle(0, 0, 0, 0)` + */ + bounds: PIXI.Rectangle; + + /** + * The origin point of the source polygon. + */ + origin: Point; + + /** + * The configuration of this polygon. + * @defaultValue `{}` + */ + config: PointSourcePolygonConfig; + + /** + * An indicator for whether this polygon is constrained by some boundary shape? + */ + get isConstrained(): boolean; + + /** + * Benchmark the performance of polygon computation for this source + * @param iterations - The number of test iterations to perform + * @param origin - The origin point to benchmark + * @param config - The polygon configuration to benchmark + */ + static benchmark( + iterations: number, + origin: Point, + config: PointSourcePolygonConfig, + ): ReturnType; + + /** + * Compute the polygon given a point origin and radius + * @param origin - The origin source point + * @param config - Configuration options which customize the polygon computation + * (default: `{}`) + * @returns The computed polygon instance + */ + static create( + origin: Point, + config?: Parameters[1] | undefined, + ): ReturnType; + + /** + * Create a clone of this polygon. + * This overrides the default PIXI.Polygon#clone behavior. + * @returns A cloned instance + */ + override clone(): PointSourcePolygon; + + /** + * Compute the polygon using the origin and configuration options. + * @returns The computed polygon + */ + compute(): this; + + /** + * Perform the implementation-specific computation + */ + protected abstract _compute(): void; + + /** + * Customize the provided configuration object for this polygon type. + * @param origin - The provided polygon origin + * @param config - The provided configuration object + */ + initialize(origin: Point, config: PointSourcePolygonConfig): void; + + /** + * Get the super-set of walls which could potentially apply to this polygon. + * Define a custom collision test used by the Quadtree to obtain candidate Walls. + */ + protected _getWalls(): Set; + + /** + * Test whether a wall should be included in the computed polygon for a given origin and type + * @param wall - The Wall being considered + * @param bounds - The overall bounding box + * @returns Should the wall be included? + */ + protected _testWallInclusion(wall: Wall, bounds: PIXI.Rectangle): boolean; + + /** + * Compute the aggregate bounding box which is the intersection of all boundary shapes. + * Round and pad the resulting rectangle by 1 pixel to ensure it always contains the origin. + */ + protected _defineBoundingBox(): PIXI.Rectangle; + + /** + * Apply a constraining boundary shape to an existing PointSourcePolygon. + * Return a new instance of the polygon with the constraint applied. + * The new instance is only a "shallow clone", as it shares references to component properties with the original. + * @param constraint - The constraining boundary shape + * @param intersectionOptions - Options passed to the shape intersection method + * @returns A new constrained polygon + */ + applyConstraint( + constraint: PIXI.Circle | PIXI.Rectangle | PIXI.Polygon, + intersectionOptions?: Record, + ): PointSourcePolygon; + + contains(x: number, y: number): boolean; + + /** + * Constrain polygon points by applying boundary shapes. + */ + protected _constrainBoundaryShapes(): void; + + /** + * Test whether a Ray between the origin and destination points would collide with a boundary of this Polygon. + * A valid wall restriction type is compulsory and must be passed into the config options. + * @param origin - An origin point + * @param destination - A destination point + * @param config - The configuration that defines a certain Polygon type + * @param mode - The collision mode to test: "any", "all", or "closest" + * (default: "all") + * @returns The collision result depends on the mode of the test: + * * any: returns a boolean for whether any collision occurred + * * all: returns a sorted array of PolygonVertex instances + * * closest: returns a PolygonVertex instance or null + */ + static testCollision( + origin: Point, + destination: Point, + { + mode, + ...config + }: { + /** + * The collision mode to test: "any", "all", or "closest" + * (default: "all") + */ + mode?: Mode; + + /** The configuration that defines a certain Polygon type */ + config?: PointSourcePolygonConfig; + }, + ): PointSourcePolygon.TestCollision; + + /** + * Determine the set of collisions which occurs for a Ray. + * @param ray - The Ray to test + * @param mode - The collision mode being tested + * @returns The collision test result + */ + protected abstract _testCollision( + ray: Ray, + mode: Mode, + ): PointSourcePolygon.TestCollision; + + /** + * Visualize the polygon, displaying its computed area, rays, and collision points + * @returns The rendered debugging shape + */ + visualize(): PIXI.Graphics | undefined; + + /** + * Determine if the shape is a complete circle. + * The config object must have an angle and a radius properties. + */ + isCompleteCircle(): boolean; + + /** + * Augment a PointSourcePolygon by adding additional coverage for shapes permitted by threshold walls. + * @param polygon - The computed polygon + * @returns The augmented polygon + */ + static applyThresholdAttenuation(polygon: PointSourcePolygon): PointSourcePolygon; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks You are referencing PointSourcePolygon#rays which is no longer a required property of that interface. + * If your subclass uses the rays property it should be explicitly defined by the subclass which requires it. + */ + get rays(): Ray[]; + + set rays(rays); + } + + namespace PointSourcePolygon { + type CollisionModes = "any" | "all" | "closest"; + + type CollisionTypes = { + any: boolean; + closest: PolygonVertex; + all: PolygonVertex[] | null; + }; + + type TestCollision = CollisionTypes[Mode]; + } } - -/** - * Compare sight performance between different algorithms - * @param n - The number of iterations - * @param args - Arguments passed to the polygon compute function - */ -declare function benchmarkSight( - n: number, - ...args: Parameters<(typeof ClockwiseSweepPolygon)["benchmark"]> -): Promise; diff --git a/src/foundry/client/pixi/extensions/circle.d.ts b/src/foundry/client/pixi/extensions/circle.d.ts new file mode 100644 index 000000000..ded1af985 --- /dev/null +++ b/src/foundry/client/pixi/extensions/circle.d.ts @@ -0,0 +1,132 @@ +export {}; + +declare global { + namespace PIXI { + interface Circle { + /** + * Determine the center of the circle. + * Trivial, but used to match center method for other shapes. + */ + get circle(): Point; + + /** + * Determine if a point is on or nearly on this circle. + * @param point - Point to test + * @param epsilon - Tolerated margin of error + * (default: `1e-08`) + * @returns Is the point on the circle within the allowed tolerance? + */ + pointIsOn(point: Point, epsilon: number): boolean; + + /** + * Get all intersection points on this circle for a segment A|B + * Intersections are sorted from A to B. + * @param a - The first endpoint on segment A|B + * @param b - The second endpoint on segment A|B + * @returns Points where the segment A|B intersects the circle + */ + segmentIntersections(a: Point, b: Point): Point[]; + + /** + * Calculate an x,y point on this circle's circumference given an angle + * 0: due east + * π / 2: due south + * π or -π: due west + * -π/2: due north + * @param angle - Angle of the point, in radians + * @returns The point on the circle at the given angle + */ + pointAtAngle(angle: number): Point; + + /** + * Get all the points for a polygon approximation of this circle between two points. + * The two points can be anywhere in 2d space. The intersection of this circle with the line from this circle center + * to the point will be used as the start or end point, respectively. + * This is used to draw the portion of the circle (the arc) between two intersection points on this circle. + * @param a - Point in 2d space representing the start point + * @param b - Point in 2d space representing the end point + * @param options - Options passed on to the pointsForArc method + * @returns An array of points arranged clockwise from start to end + */ + pointsBetween(a: Point, b: Point, options?: Circle.PointsForArcOptions): Point[]; + + /** + * Get the points that would approximate a circular arc along this circle, given a starting and ending angle. + * Points returned are clockwise. If from and to are the same, a full circle will be returned. + * @param fromAngle - Starting angle, in radians. π is due north, π/2 is due east + * @param toAngle - Ending angle, in radians + * @param options - Options which affect how the circle is converted + * @returns An array of points along the requested arc + */ + pointsForArc(fromAngle: number, toAngle: number, options?: Circle.PointsForArcOptions): Point[]; + + /** + * Approximate this PIXI.Circle as a PIXI.Polygon + * @param options - Options forwarded on to the pointsForArc method + * @returns The Circle expressed as a PIXI.Polygon + */ + toPolygon(options?: Circle.PointsForArcOptions): PIXI.Polygon; + + /** + * The recommended vertex density for the regular polygon approximation of a circle of a given radius. + * Small radius circles have fewer vertices. The returned value will be rounded up to the nearest integer. + * See the formula described at: + * https://math.stackexchange.com/questions/4132060/compute-number-of-regular-polgy-sides-to-approximate-circle-to-defined-precision + * @param radius - Circle radius + * @param epsilon - The maximum tolerable distance between an approximated line segment and the true radius. + * A larger epsilon results in fewer points for a given radius. + * @returns The number of points for the approximated polygon + */ + approximateVertexDensity(radius: number, epsilon?: number): number; + + /** + * Intersect this PIXI.Circle with a PIXI.Polygon. + * @param polygon - A PIXI.Polygon + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon + */ + intersectPolygon( + polygon: PIXI.Polygon, + options?: { + /** The number of points which defines the density of approximation */ + density: number; + + /** The clipper clip type */ + clipType: number; + + /** + * Use the Weiler-Atherton algorithm. Otherwise, use Clipper. + * (default: `true`) + * */ + weilerAtherton: boolean; + }, + ): PIXI.Polygon; + + /** + * Intersect this PIXI.Circle with an array of ClipperPoints. + * Convert the circle to a Polygon approximation and use intersectPolygon. + * In the future we may replace this with more specialized logic which uses the line-circle intersection formula. + * @param clipperPoints - Array of ClipperPoints generated by PIXI.Polygon.toClipperPoints() + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon + */ + intersectClipper( + clipperPoints: ClipperPoint[], + options?: { + /** The number of points which defines the density of approximation */ + density: number; + }, + ): PIXI.Polygon; + } + + namespace Circle { + type PointsForArcOptions = { + /** The number of points which defines the density of approximation */ + density: number; + + /** Whether to include points at the circle where the arc starts and ends */ + includeEndpoints: boolean; + }; + } + } +} diff --git a/src/foundry/client/pixi/extensions/index.d.ts b/src/foundry/client/pixi/extensions/index.d.ts new file mode 100644 index 000000000..e3f32251f --- /dev/null +++ b/src/foundry/client/pixi/extensions/index.d.ts @@ -0,0 +1,3 @@ +import "./circle"; +import "./polygon"; +import "./rectangle"; diff --git a/src/foundry/client/pixi/extensions/polygon.d.ts b/src/foundry/client/pixi/extensions/polygon.d.ts new file mode 100644 index 000000000..34abfbf79 --- /dev/null +++ b/src/foundry/client/pixi/extensions/polygon.d.ts @@ -0,0 +1,152 @@ +export {}; + +declare global { + namespace PIXI { + interface Polygon { + /** + * Test whether the polygon is has a positive signed area. + * Using a y-down axis orientation, this means that the polygon is "clockwise". + */ + get isPositive(): boolean; + + /** + * @remarks Non enumerable + */ + _isPositive?: boolean; + + /** + * Clear the cached signed orientation. + */ + clearCache(): void; + + /** + * Compute the signed area of polygon using an approach similar to ClipperLib.Clipper.Area. + * The math behind this is based on the Shoelace formula. https://en.wikipedia.org/wiki/Shoelace_formula. + * The area is positive if the orientation of the polygon is positive. + * @returns The signed area of the polygon + */ + signedArea(): number; + + /** + * Reverse the order of the polygon points in-place, replacing the points array into the polygon. + * Note: references to the old points array will not be affected. + * @returns This polygon with its orientation reversed + */ + reverseOrientation(): PIXI.Polygon; + + /** + * Add a de-duplicated point to the Polygon. + * @param point - The point to add to the Polygon + * @returns A reference to the polygon for method chaining + */ + addPoint(point: Point): this; + + /** + * Return the bounding box for a PIXI.Polygon. + * The bounding rectangle is normalized such that the width and height are non-negative. + * @returns The bounding PIXI.Rectangle + */ + getBounds(): PIXI.Rectangle; + + /** + * Construct a PIXI.Polygon instance from an array of clipper points [\{X,Y\}, ...]. + * @param points - An array of points returned by clipper + * @param options - Options which affect how canvas points are generated + * @param scalingFactor - + * @returns The resulting PIXI.Polygon + */ + fromClipperPoints( + points: ClipperPoint[], + options?: { + /** + * A scaling factor used to preserve floating point precision + * (default: `1`) + */ + scalingFactor: number; + }, + ): PIXI.Polygon; + + /** + * Convert a PIXI.Polygon into an array of clipper points [\{X,Y\}, ...]. + * Note that clipper points must be rounded to integers. + * In order to preserve some amount of floating point precision, an optional scaling factor may be provided. + * @param options - Options which affect how clipper points are generated + * @returns An array of points to be used by clipper + */ + toClipperPoints(options?: { + /** A scaling factor used to preserve floating point precision + * (default: `1`) */ + scalingFactor: number; + }): ClipperPoint[]; + + /** + * Determine whether the PIXI.Polygon is closed, defined by having the same starting and ending point. + */ + get isClosed(): boolean; + + /** + * Intersect this PIXI.Polygon with another PIXI.Polygon using the clipper library. + * @param other - Another PIXI.Polygon + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon or null if no solution was present + */ + intersectPolygon( + other: PIXI.Polygon, + options: { + /** The clipper clip type */ + clipType?: number; + + /** A scaling factor passed to Polygon#toClipperPoints to preserve precision */ + scalingFactor?: number; + }, + ): PIXI.Polygon | null; + + /** + * Intersect this PIXI.Polygon with an array of ClipperPoints. + * @param clipperPoints - Array of clipper points generated by PIXI.Polygon.toClipperPoints() + * @param options - Options which configure how the intersection is computed + */ + intersectClipper( + clipperPoints: ClipperPoint[], + options?: { + /** The clipper clip type */ + clipType?: number; + + /** A scaling factor passed to Polygon#toClipperPoints to preserve precision */ + scalingFactor?: number; + }, + ): ClipperPoint[]; + + /** + * Intersect this PIXI.Polygon with a PIXI.Circle. + * For now, convert the circle to a Polygon approximation and use intersectPolygon. + * In the future we may replace this with more specialized logic which uses the line-circle intersection formula. + * @param circle - A PIXI.Circle + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon + */ + intersectCircle( + circle: PIXI.Circle, + options?: { + /** The number of points which defines the density of approximation */ + density: number; + }, + ): PIXI.Polygon; + + /** + * Intersect this PIXI.Polygon with a PIXI.Rectangle. + * For now, convert the rectangle to a Polygon and use intersectPolygon. + * In the future we may replace this with more specialized logic which uses the line-line intersection formula. + * @param rect - A PIXI.Rectangle + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon + */ + intersectRectangle(rect: PIXI.Rectangle, options?: Record): PIXI.Polygon; + } + } + + type ClipperPoint = { + X: number; + Y: number; + }; +} diff --git a/src/foundry/client/pixi/extensions/rectangle.d.ts b/src/foundry/client/pixi/extensions/rectangle.d.ts new file mode 100644 index 000000000..54dfa57ca --- /dev/null +++ b/src/foundry/client/pixi/extensions/rectangle.d.ts @@ -0,0 +1,220 @@ +export {}; + +declare global { + namespace PIXI { + interface Rectangle { + /** + * Bit code labels splitting a rectangle into zones, based on the Cohen-Sutherland algorithm. + * See https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm + * left central right + * top 1001 1000 1010 + * central 0001 0000 0010 + * bottom 0101 0100 0110 + */ + CS_ZONES: { + INSIDE: 0x0000; + LEFT: 0x0001; + RIGHT: 0x0010; + TOP: 0x1000; + BOTTOM: 0x0100; + TOPLEFT: 0x1001; + TOPRIGHT: 0x1010; + BOTTOMRIGHT: 0x0110; + BOTTOMLEFT: 0x0101; + }; + + /** + * Calculate center of this rectangle. + */ + get center(): Point; + + /** + * Return the bounding box for a PIXI.Rectangle. + * The bounding rectangle is normalized such that the width and height are non-negative. + */ + getBounds(): PIXI.Rectangle; + + /** + * Determine if a point is on or nearly on this rectangle. + * @param p - Point to test + * @returns Is the point on the rectangle boundary? + */ + pointIsOn(p: Point): boolean; + + /** + * Calculate the rectangle Zone for a given point located around, on, or in the rectangle. + * See https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm + * This differs from _getZone in how points on the edge are treated: they are not considered inside. + * @param point - A point to test for location relative to the rectangle + * @returns Which edge zone does the point belong to? + */ + _getEdgeZone(point: Point): PIXI.Rectangle["CS_ZONES"]; + + /** + * Get all the points (corners) for a polygon approximation of a rectangle between two points on the rectangle. + * The two points can be anywhere in 2d space on or outside the rectangle. + * The starting and ending side are based on the zone of the corresponding a and b points. + * (See PIXI.Rectangle.CS_ZONES.) + * This is the rectangular version of PIXI.Circle.prototype.pointsBetween, and is similarly used + * to draw the portion of the shape between two intersection points on that shape. + * @param a - A point on or outside the rectangle, representing the starting position. + * @param b - A point on or outside the rectangle, representing the starting position. + * @returns Points returned are clockwise from start to end. + */ + pointsBetween(a: Point, b: Point): Point[]; + + /** + * Get all intersection points for a segment A|B + * Intersections are sorted from A to B. + * @param a - Endpoint A of the segment + * @param b - Endpoint B of the segment + * @returns Array of intersections or empty if no intersection. + * If A|B is parallel to an edge of this rectangle, returns the two furthest points on + * the segment A|B that are on the edge. + */ + segmentIntersections(a: Point, b: Point): Point[]; + + /** + * Compute the intersection of this Rectangle with some other Rectangle. + * @param other - Some other rectangle which intersects this one + * @returns The intersected rectangle + */ + intersection(other: PIXI.Rectangle): PIXI.Rectangle; + + /** + * Convert this PIXI.Rectangle into a PIXI.Polygon + * @returns The Rectangle expressed as a PIXI.Polygon + */ + toPolygon(): PIXI.Rectangle; + + /** + * Get the left edge of this rectangle. + * The returned edge endpoints are oriented clockwise around the rectangle. + */ + get leftEdge(): { + A: Point; + B: Point; + }; + + /** + * Get the right edge of this rectangle. + * The returned edge endpoints are oriented clockwise around the rectangle. + */ + get rightEdge(): { + A: Point; + B: Point; + }; + + /** + * Get the top edge of this rectangle. + * The returned edge endpoints are oriented clockwise around the rectangle. + */ + get topEdge(): { + A: Point; + B: Point; + }; + + /** + * Get the bottom edge of this rectangle. + * The returned edge endpoints are oriented clockwise around the rectangle. + */ + get bottomEdge(): { + A: Point; + B: Point; + }; + + /** + * Calculate the rectangle Zone for a given point located around or in the rectangle. + * https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm + * + * @param p - Point to test for location relative to the rectangle + */ + _getZone(p: Point): PIXI.Rectangle["CS_ZONES"]; + + /** + * Test whether a line segment AB intersects this rectangle. + * @param a - The first endpoint of segment AB + * @param b - The second endpoint of segment AB + * @param options - Options affecting the intersect test. + * @returns True if intersects. + */ + lineSegmentIntersects( + a: Point, + b: Point, + options?: { + /** If true, a line contained within the rectangle will return true */ + inside?: boolean; + }, + ): boolean; + + /** + * Intersect this PIXI.Rectangle with a PIXI.Polygon. + * @param polygon - A PIXI.Polygon + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon + */ + intersectPolygon( + polygon: PIXI.Polygon, + options?: { + /** The number of points which defines the density of approximation */ + density: number; + + /** The clipper clip type */ + clipType: number; + + /** + * Use the Weiler-Atherton algorithm. Otherwise, use Clipper. + * (default: `true`) + * */ + weilerAtherton: boolean; + }, + ): PIXI.Polygon | null; + + /** + * Intersect this PIXI.Rectangle with an array of ClipperPoints. Currently, uses the clipper library. + * In the future we may replace this with more specialized logic which uses the line-line intersection formula. + * @param clipperPoints - Array of ClipperPoints generated by PIXI.Polygon.toClipperPoints() + * @param options - Options which configure how the intersection is computed + * @returns The intersected polygon + */ + intersectClipper( + clipperPoints: ClipperPoint[], + options?: { + /** The number of points which defines the density of approximation */ + density: number; + }, + ): PIXI.Polygon | null; + + /** + * Determine whether some other Rectangle overlaps with this one. + * This check differs from the parent class Rectangle#intersects test because it is true for adjacency (zero area). + * @param other - Some other rectangle against which to compare + * @returns Do the rectangles overlap? + */ + overlaps(other: PIXI.Rectangle): boolean; + + /** + * Normalize the width and height of the rectangle in-place, enforcing that those dimensions be positive. + */ + normalize(): PIXI.Rectangle; + + /** + * Generate a new rectangle by rotating this one clockwise about its center by a certain number of radians + * @param radians - The angle of rotation + * @returns A new rotated rectangle + */ + rotate(radians: number): PIXI.Rectangle; + + /** + * Create normalized rectangular bounds given a rectangle shape and an angle of central rotation. + * @param x - The top-left x-coordinate of the un-rotated rectangle + * @param y - The top-left y-coordinate of the un-rotated rectangle + * @param width - The width of the un-rotated rectangle + * @param height - The height of the un-rotated rectangle + * @param radians - The angle of rotation about the center + * @returns The constructed rotated rectangle bounds + */ + fromRotation(x: number, y: number, width: number, height: number, radians: number): PIXI.Rectangle; + } + } +} diff --git a/src/foundry/client/pixi/layers/controls.d.ts b/src/foundry/client/pixi/layers/controls.d.ts index f1fa3b3bc..edc166818 100644 --- a/src/foundry/client/pixi/layers/controls.d.ts +++ b/src/foundry/client/pixi/layers/controls.d.ts @@ -111,7 +111,7 @@ declare global { /** * Handle mousemove events on the game canvas to broadcast activity of the user's cursor position */ - protected _onMoveCursor(event: PIXI.InteractionEvent): void; + protected _onMoveCursor(event: PIXI.FederatedEvent): void; /** * Create and draw the Cursor object for a given User diff --git a/src/foundry/client/pixi/layers/controls/door.d.ts b/src/foundry/client/pixi/layers/controls/door.d.ts index b590feb43..393560b52 100644 --- a/src/foundry/client/pixi/layers/controls/door.d.ts +++ b/src/foundry/client/pixi/layers/controls/door.d.ts @@ -38,13 +38,13 @@ declare global { * Handle mouse over events on a door control icon. * @param event - The originating interaction event */ - protected _onMouseOver(event: PIXI.InteractionEvent): false | void; + protected _onMouseOver(event: PIXI.FederatedEvent): false | void; /** * Handle mouse out events on a door control icon. * @param event - The originating interaction event */ - protected _onMouseOut(event: PIXI.InteractionEvent): false | void; + protected _onMouseOut(event: PIXI.FederatedEvent): false | void; /** * Handle left mouse down events on a door control icon. @@ -52,7 +52,7 @@ declare global { * @param event - The originating interaction event */ protected _onMouseDown( - event: PIXI.InteractionEvent, + event: PIXI.FederatedEvent, ): false | void | Promise> | undefined>; /** @@ -61,7 +61,7 @@ declare global { * @param event - The originating interaction event */ protected _onRightDown( - event: PIXI.InteractionEvent, + event: PIXI.FederatedEvent, ): void | Promise> | undefined>; } } diff --git a/src/foundry/client/pixi/layers/controls/ruler.d.ts b/src/foundry/client/pixi/layers/controls/ruler.d.ts index b7a02e429..31277cfbe 100644 --- a/src/foundry/client/pixi/layers/controls/ruler.d.ts +++ b/src/foundry/client/pixi/layers/controls/ruler.d.ts @@ -141,31 +141,31 @@ declare global { * Handle the beginning of a new Ruler measurement workflow * @see Canvas._onDragLeftStart */ - protected _onDragStart(event: PIXI.InteractionEvent): void; + protected _onDragStart(event: PIXI.FederatedEvent): void; /** * Handle left-click events on the Canvas during Ruler measurement. * @see Canvas._onClickLeft */ - protected _onClickLeft(event: PIXI.InteractionEvent): void; + protected _onClickLeft(event: PIXI.FederatedEvent): void; /** * Handle right-click events on the Canvas during Ruler measurement. * @see Canvas._onClickRight */ - protected _onClickRight(event: PIXI.InteractionEvent): boolean | void; + protected _onClickRight(event: PIXI.FederatedEvent): boolean | void; /** * Continue a Ruler measurement workflow for left-mouse movements on the Canvas. * @see Canvas._onDragLeftMove */ - protected _onMouseMove(event: PIXI.InteractionEvent): void; + protected _onMouseMove(event: PIXI.FederatedEvent): void; /** * Conclude a Ruler measurement workflow by releasing the left-mouse button. * @see Canvas._onDragLeftDrop */ - protected _onMouseUp(event: PIXI.InteractionEvent): void; + protected _onMouseUp(event: PIXI.FederatedEvent): void; /** * Handle the addition of a new waypoint in the Ruler measurement path diff --git a/src/foundry/client/pixi/layers/drawings.d.ts b/src/foundry/client/pixi/layers/drawings.d.ts index 9bc834b26..62e7898da 100644 --- a/src/foundry/client/pixi/layers/drawings.d.ts +++ b/src/foundry/client/pixi/layers/drawings.d.ts @@ -56,22 +56,22 @@ declare class DrawingsLayer extends PlaceablesLayer<"Drawing", DrawingsLayer.Lay */ _getNewDrawingData(origin: Point | {}): NewDrawingData; - protected override _onClickLeft(event: PIXI.InteractionEvent): void; + protected override _onClickLeft(event: PIXI.FederatedEvent): void; - protected override _onClickLeft2(event: PIXI.InteractionEvent): void | Promise; + protected override _onClickLeft2(event: PIXI.FederatedEvent): void | Promise; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): ReturnType; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): ReturnType; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; /** * Handling of mouse-up events which conclude a new object creation after dragging */ - protected _onDragLeftDrop(event: PIXI.InteractionEvent): Promise; + protected _onDragLeftDrop(event: PIXI.FederatedEvent): Promise; protected override _onDragLeftCancel(event: PointerEvent): void; - protected override _onClickRight(event: PIXI.InteractionEvent): void; + protected override _onClickRight(event: PIXI.FederatedEvent): void; } declare namespace DrawingsLayer { diff --git a/src/foundry/client/pixi/layers/lighting.d.ts b/src/foundry/client/pixi/layers/lighting.d.ts index 8d08268d6..f503d8320 100644 --- a/src/foundry/client/pixi/layers/lighting.d.ts +++ b/src/foundry/client/pixi/layers/lighting.d.ts @@ -204,9 +204,9 @@ declare class LightingLayer extends PlaceablesLayer<"AmbientLight", LightingLaye */ protected _onDarknessChange(darkness: number, prior: number): void; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): Promise; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): Promise; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; protected override _onDragLeftCancel(event: PointerEvent): void; diff --git a/src/foundry/client/pixi/layers/map.d.ts b/src/foundry/client/pixi/layers/map.d.ts index 46dc28e95..602555b6e 100644 --- a/src/foundry/client/pixi/layers/map.d.ts +++ b/src/foundry/client/pixi/layers/map.d.ts @@ -87,11 +87,11 @@ declare global { */ protected _drawBackground(): PIXI.Sprite | undefined; - protected _onDragLeftStart(event: PIXI.InteractionEvent): Promise; + protected _onDragLeftStart(event: PIXI.FederatedEvent): Promise; - protected _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected _onDragLeftMove(event: PIXI.FederatedEvent): void; - protected _onDragLeftDrop(event: PIXI.InteractionEvent): void; + protected _onDragLeftDrop(event: PIXI.FederatedEvent): void; protected _onDragLeftCancel(event: PointerEvent): void; diff --git a/src/foundry/client/pixi/layers/notes.d.ts b/src/foundry/client/pixi/layers/notes.d.ts index 7bdfc574f..666c2baae 100644 --- a/src/foundry/client/pixi/layers/notes.d.ts +++ b/src/foundry/client/pixi/layers/notes.d.ts @@ -40,7 +40,7 @@ declare global { static registerSettings(): void; /** @remarks this method seems to be unused, see https://gitlab.com/foundrynet/foundryvtt/-/issues/7004 */ - protected _onMouseDown(event: PIXI.InteractionEvent): void; + protected _onMouseDown(event: PIXI.FederatedEvent): void; /** * Handle JournalEntry document drop data diff --git a/src/foundry/client/pixi/layers/sounds.d.ts b/src/foundry/client/pixi/layers/sounds.d.ts index 49365770c..a8bf2cd7c 100644 --- a/src/foundry/client/pixi/layers/sounds.d.ts +++ b/src/foundry/client/pixi/layers/sounds.d.ts @@ -86,13 +86,13 @@ declare class SoundsLayer extends PlaceablesLayer<"AmbientSound", SoundsLayer.La * Handle mouse cursor movements which may cause ambient audio previews to occur * @param event - The initiating mouse move interaction event */ - protected _onMouseMove(event: PIXI.InteractionEvent): void; + protected _onMouseMove(event: PIXI.FederatedEvent): void; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): ReturnType; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): ReturnType; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; - protected override _onDragLeftDrop(event: PIXI.InteractionEvent): void; + protected override _onDragLeftDrop(event: PIXI.FederatedEvent): void; protected override _onDragLeftCancel(event: PointerEvent): void; diff --git a/src/foundry/client/pixi/layers/templates.d.ts b/src/foundry/client/pixi/layers/templates.d.ts index f879290e8..41269fc06 100644 --- a/src/foundry/client/pixi/layers/templates.d.ts +++ b/src/foundry/client/pixi/layers/templates.d.ts @@ -33,9 +33,9 @@ declare class TemplateLayer extends PlaceablesLayer<"MeasuredTemplate", Template */ static registerSettings(): void; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): Promise; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): Promise; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; protected override _onMouseWheel(event: WheelEvent): void | ReturnType; } diff --git a/src/foundry/client/pixi/layers/tokens.d.ts b/src/foundry/client/pixi/layers/tokens.d.ts index 20fb7ce6f..dd6c37824 100644 --- a/src/foundry/client/pixi/layers/tokens.d.ts +++ b/src/foundry/client/pixi/layers/tokens.d.ts @@ -148,7 +148,7 @@ declare global { data: TokenLayer.DropData, ): Promise>>; - protected override _onClickLeft(event: PIXI.InteractionEvent): void; + protected override _onClickLeft(event: PIXI.FederatedEvent): void; } namespace TokenLayer { diff --git a/src/foundry/client/pixi/layers/walls.d.ts b/src/foundry/client/pixi/layers/walls.d.ts index ad9108b07..4dfcf4b66 100644 --- a/src/foundry/client/pixi/layers/walls.d.ts +++ b/src/foundry/client/pixi/layers/walls.d.ts @@ -182,15 +182,15 @@ declare global { } | this["_cloneType"]; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): void; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; - protected override _onDragLeftDrop(event: PIXI.InteractionEvent): void; + protected override _onDragLeftDrop(event: PIXI.FederatedEvent): void; protected override _onDragLeftCancel(event: PointerEvent): void; - protected override _onClickRight(event: PIXI.InteractionEvent): void; + protected override _onClickRight(event: PIXI.FederatedEvent): void; /** @deprecated since v9 */ computePolygon( diff --git a/src/foundry/client/pixi/perception/clockwise-sweep.d.ts b/src/foundry/client/pixi/perception/clockwise-sweep.d.ts index 989a6793a..fa197e6fd 100644 --- a/src/foundry/client/pixi/perception/clockwise-sweep.d.ts +++ b/src/foundry/client/pixi/perception/clockwise-sweep.d.ts @@ -1,75 +1,10 @@ -import type { ConfiguredObjectClassForName } from "../../../../types/helperTypes"; +export {}; declare global { type VertexMap = Map; type EdgeSet = Set; - interface ClockwiseSweepPolygonConfig extends PointSourcePolygonConfig { - /** @defaultValue `canvas.dimensions.maxR` */ - radius?: number; - - /** @defaultValue `360` */ - angle?: number; - - /** @defaultValue `0` */ - rotation?: number; - - /** - * The desired density of padding rays, a number per PI - * @defaultValue `12` - */ - density?: number; - - /** - * The minimum angle of emission - * @defaultValue `config.hasLimitedAngle ? Math.normalizeRadians(Math.toRadians(config.rotation + 90 - (config.angle / 2))) : -Math.PI` - */ - aMin?: number; - - /** - * The maximum angle of emission - * @defaultValue `config.hasLimitedAngle ? config.aMin + Math.toRadians(config.angle) : Math.PI` - */ - aMax?: number; - - /** - * The minimum ray of emission - * @defaultValue `Ray.fromAngle(origin.x, origin.y, config.aMin, config.radius)` - */ - rMin?: PolygonRay; - - /** - * The maximum ray of emission - * @defaultValue `config.hasLimitedAngle && Ray.fromAngle(origin.x, origin.y, config.aMax, config.radius)` - */ - rMax?: PolygonRay; - - /** - * Does this polygon have a limited radius? - * @defaultValue `config.radius > 0` - */ - hasLimitedRadius?: boolean; - - /** - * Does this polygon have a limited angle? - * @defaultValue `config.angle !== 0` - */ - hasLimitedAngle?: boolean; - - /** - * The squared radius of the polygon, for faster computation later - * @defaultValue `Math.pow(config.radius, 2)` - */ - radius2?: number; - - /** - * A small epsilon used for avoiding floating point precision issues - * @defaultValue `0.5 / config.radius` - */ - radiusE?: number; - } - interface PolygonRay extends Ray { result: CollisionResult; } @@ -80,14 +15,6 @@ declare global { * This algorithm was created with valuable contributions from https://github.com/caewok */ class ClockwiseSweepPolygon extends PointSourcePolygon { - /** - * The configuration of this polygon. - */ - config: - | ClockwiseSweepPolygonConfig - | ClockwiseSweepPolygon.InitializedConfig - | ClockwiseSweepPolygon.LimitedAngleConfig; - /** * A mapping of vertices which define potential collision points */ @@ -101,58 +28,21 @@ declare global { /** * A collection of rays which are fired at vertices */ + //@ts-expect-error Getter/setter routine is deprecated functionality as of v11, removed in v13 rays: PolygonRay[]; - static benchmark( - iterations: number, - ...args: Parameters<(typeof ClockwiseSweepPolygon)["create"]> - ): ReturnType; + override initialize(origin: Point, config: PointSourcePolygonConfig): void; - static create( - origin: Point, - config: Parameters[1], - ): ReturnType; - - /** - * @param origin - The provided polygon origin - * @param config - The provided configuration object - */ - override initialize(origin: Point, config: ClockwiseSweepPolygon.InitConfig): void; + clone(): ClockwiseSweepPolygon; protected override _compute(): void; - /** - * Round vertices of a ray segment - * @param ray - The provided ray - * @returns The ray with rounded vertices - * @internal - */ - protected _roundRayVertices(ray: PolygonRay): PolygonRay; - /** * Translate walls and other obstacles into edges which limit visibility * @internal */ protected _identifyEdges(): void; - /** - * Get the super-set of walls which could potentially apply to this polygon. - * @internal - */ - protected _getWalls(): ConfiguredObjectClassForName<"Wall">[]; - - /** - * Restrict the set of candidate edges to those which appear within the limited angle of emission. - * @internal - */ - protected _restrictEdgesByAngle(): void; - - /** - * Process the candidate edges to further constrain them using a circular radius of effect. - * @internal - */ - protected _constrainEdgesByRadius(): void; - /** * Consolidate all vertices from identified edges and register them as part of the vertex mapping. * @internal @@ -172,6 +62,15 @@ declare global { */ protected _executeSweep(): void; + /** + * Update active edges at a given vertex + * Must delete first, in case the edge is in both sets. + * @param vertex - The current vertex + * @param activeEdges - A set of currently active edges + * @internal + */ + protected _updateActiveEdges(vertex: PolygonVertex, activeEdges: EdgeSet): void; + /** * Determine the initial set of active edges as those which intersect with the initial ray * @returns A set of initially active edges @@ -187,220 +86,80 @@ declare global { protected _sortVertices(): PolygonVertex[]; /** - * Test whether a target vertex is behind some closer active edge - * @param ray - The ray being evaluated + * Test whether a target vertex is behind some closer active edge. + * If the vertex is to the left of the edge, is must be behind the edge relative to origin. + * If the vertex is collinear with the edge, it should be considered "behind" and ignored. + * We know edge.A is ccw to edge.B because of the logic in _identifyVertices. * @param vertex - The target vertex * @param activeEdges - The set of active edges * @returns Is the target vertex behind some closer edge? * @internal */ protected _isVertexBehindActiveEdges( - ray: PolygonRay, vertex: PolygonVertex, activeEdges: EdgeSet, ): { isBehind: boolean; wasLimited: boolean }; /** - * Determine the final result of a candidate ray. - * @param ray - The candidate ray being tested - * @param vertex - The target vertex - * @param result - The result being prepared - * @param activeEdges - The set of active edges + * Determine the result for the sweep at a given vertex + * @param vertex - The target vertex + * @param activeEdges - The set of active edges + * @param hasCollinear - Are there collinear vertices behind the target vertex? * @internal */ - protected _determineRayResult( - ray: PolygonRay, - vertex: PolygonVertex, - result: CollisionResult, - activeEdges: EdgeSet, - ): void; + protected _determineSweepResult(vertex: PolygonVertex, activeEdges: EdgeSet, hasCollinear: boolean): void; /** - * Jump to a new closest active edge. - * In this case, our target vertex will be the primary collision. - * We may have a secondary collision if other active edges exist or if the vertex is prior to the ray endpoint. - * @internal + * Switch to a new active edge. + * Moving from the origin, a collision that first blocks a side must be stored as a polygon point. + * Subsequent collisions blocking that side are ignored. Once both sides are blocked, we are done. * - * @param ray - The ray being emitted - * @param result - The pending collision result - * @param activeEdges - The set of currently active edges - * @param isBinding - Is the target vertex a binding collision point? - * @param secondaryBefore - Whether to add secondary collision points before ("unshift") or after ("push") - * (default: `true`) - */ - protected _beginNewEdge( - ray: PolygonRay, - result: CollisionResult, - activeEdges: EdgeSet, - isBinding: boolean, - secondaryBefore?: boolean, - ): void; - - /** - * If the target vertex is connected to a currently active edge, we are terminating that edge. - * We know the target vertex is not behind another edge, so the target is our initial collision. - * There may be a second collision afterwards if no connected walls continue clockwise. - * @internal + * Collisions that limit a side will block if that side was previously limited. * - * @param ray - The ray being emitted - * @param result - The pending collision result - * @param activeEdges - The set of currently active edges - * @param isBinding - Is the target vertex a binding collision point? - */ - protected _completeCurrentEdge( - ray: PolygonRay, - result: CollisionResult, - activeEdges: EdgeSet, - isBinding: boolean, - ): void; - - /** - * Augment a CollisionResult with an additional secondary collision. - * Require secondary collisions to be a greater distance than the target vertex. - * @param ray - The ray being evaluated - * @param result - The collision result - * @param edges - The subset of active edges which are candidates for collision - * @internal - */ - protected _getSecondaryCollisions(ray: PolygonRay, result: CollisionResult, edges: EdgeSet): PolygonVertex[]; - - /** - * Identify collision points for a required terminal ray. + * If neither side is blocked and the ray internally collides with a non-limited edge, n skip without adding polygon + * endpoints. Sight is unaffected before this edge, and the internal collision can be ignored. * @internal * - * @param ray - The ray being emitted * @param result - The pending collision result * @param activeEdges - The set of currently active edges */ - protected _findRequiredCollision(ray: PolygonRay, result: CollisionResult, activeEdges: EdgeSet): void; + _switchEdge(result: CollisionResult, activeEdges: EdgeSet): void; /** * Identify the collision points between an emitted Ray and a set of active edges. - * @param ray - The candidate ray to test - * @param activeEdges - The set of active edges + * @param ray - The candidate ray to test + * @param internalEdges - The set of edges to check for collisions against the ray * @returns A sorted array of collision points * @internal */ - protected _getRayCollisions( - ray: PolygonRay, - activeEdges: EdgeSet, - { - minimumDistance, - }?: { - /** - * Require collisions to exceed some minimum distance - * @defaultValue `0` - */ - minimumDistance?: number; - }, - ): PolygonVertex[]; - - /** - * Update the set of active edges given the result of an emitted ray. - * @param result - The collision result - * @param activeEdges - The set of currently active edges - * @internal - */ - protected _updateActiveEdges(result: CollisionResult, activeEdges: EdgeSet): void; + protected _getInternalEdgeCollisions(ray: PolygonRay, internalEdges: EdgeSet): PolygonVertex[]; /** - * Construct the polygon from ray collision points - * @internal + * @deprecated since v10, will be removed in v12 + * @remarks ClockwiseSweepPolygon.getRayCollisions has been renamed to ClockwiseSweepPolygon.testCollision */ - protected _constructPolygonPoints(): void; - - /** - * Add additional points to limited-radius polygons to approximate the curvature of a circle - * @param r0 - The prior ray that collided with some vertex - * @param r1 - The next ray that collides with some vertex - * @internal - */ - protected _getPaddingPoints(r0: PolygonRay, r1: PolygonRay): Point[]; - - /** - * Test whether a wall should be included in the computed polygon for a given origin and type - * @param wall - The Wall being considered - * @param origin - The origin point for the ray or polygon - * @param type - The type of perception or movement restriction being imposed - * @returns Should the wall be included? - * - */ - static testWallInclusion( - wall: ConfiguredObjectClassForName<"Wall">, - origin: Point, - type: foundry.CONST.WALL_RESTRICTION_TYPES, - ): boolean; + static getRayCollisions( + ray: PolygonRay, + config: PointSourcePolygonConfig, + ): boolean | PolygonVertex | PolygonVertex[] | null; /** - * Test whether a vertex lies between two boundary rays - * @param vertex - The target vertex - * @param rMin - The counter-clockwise bounding ray - * @param rMax - The clockwise bounding ray - * @param angle - The angle being tested, in degrees - * @returns Is the vertex between the two rays? + * Determine the set of collisions which occurs for a Ray. + * @param ray - The Ray to test + * @param mode - The collision mode being tested + * @returns The collision test result */ - static pointBetweenRays(vertex: PolygonVertex, rMin: PolygonRay, rMax: PolygonRay, angle: number): boolean; + protected override _testCollision( + ray: Ray, + mode: Mode, + ): PointSourcePolygon.TestCollision; - override visualize(): void; - - /** - * Check whether a given ray intersects with walls. - * @param ray - The Ray being tested - * @param options - Options which customize how collision is tested - * @returns Whether any collision occurred if mode is "any" - * An array of collisions, if mode is "all" - * The closest collision, if mode is "closest" - */ - static getRayCollisions( - ray: PolygonRay, - options?: { - /** - * Which collision type to check, a value in CONST.WALL_RESTRICTION_TYPES - * @defaultValue `"move"` - */ - type?: foundry.CONST.WALL_RESTRICTION_TYPES; - - /** - * Which type of collisions are returned: any, closest, all - * @defaultValue `"all"` - */ - mode?: Mode; - - /** - * Visualize some debugging data to help understand the collision test - * @defaultValue `false` - */ - debug?: boolean; - }, - ): Mode extends "any" ? boolean : Mode extends "closest" ? PolygonVertex : PolygonVertex[]; + override visualize(): PIXI.Graphics | undefined; /** * Visualize the polygon, displaying its computed area, rays, and collision points * @internal */ - protected static _visualizeCollision(ray: PolygonRay, edges: EdgeSet, collisions: PolygonVertex[]): void; - } - - namespace ClockwiseSweepPolygon { - type InitConfig = Partial>; - - interface InitializedConfig extends ClockwiseSweepPolygonConfig { - hasLimitedRadius: boolean; - radius: number; - radius2: number; - radiusE: number; - aMin: number; - aMax: number; - angle: number; - rotation: number; - hasLimitedAngle: boolean; - density: number; - rMin: PolygonRay; - } - - interface LimitedAngleConfig extends InitializedConfig { - hasLimitedAngle: true; - rMax: PolygonRay; - } + protected _visualizeCollision(ray: Ray, collisions: PolygonVertex[]): void; } } diff --git a/src/foundry/client/pixi/perception/color-manager.d.ts b/src/foundry/client/pixi/perception/color-manager.d.ts new file mode 100644 index 000000000..d921519d5 --- /dev/null +++ b/src/foundry/client/pixi/perception/color-manager.d.ts @@ -0,0 +1,88 @@ +export {}; + +// TODO: Define Color in common/utils/color.mjs +type Color = number; +declare global { + /** + * A singleton class dedicated to manage the color spaces associated with the scene and the canvas. + */ + class CanvasColorManager { + /** + * Colors exposed by the manager. + */ + colors: { + darkness?: Color; + halfdark?: Color; + /** @defaultValue `0x909090` */ + background?: Color; + dim?: Color; + bright?: Color; + ambientBrightest?: Color; + ambientDaylight?: Color; + ambientDarkness?: Color; + sceneBackground?: Color; + /** @defaultValue `0x000000` */ + fogExplored?: Color; + /** @defaultValue `0x000000` */ + fogUnexplored?: Color; + }; + + /** + * Weights used by the manager to compute colors. + */ + weights: { + dark?: number; + halfdark?: number; + dim?: number; + bright?: number; + }; + + /** + * Fallback colors. + */ + static #fallbackColors: { + darknessColor: 0x242448; + daylightColor: 0xeeeeee; + brightestColor: 0xffffff; + backgroundColor: 0x909090; + fogUnexplored: 0x000000; + fogExplored: 0x000000; + }; + + /** + * Returns the darkness penalty for the actual scene configuration. + */ + get darknessPenalty(): number; + + /** + * Get the darkness level of this scene. + */ + get darknessLevel(): number; + + /** + * Initialize color space pertaining to a specific scene. + */ + initialize(colors?: { + /** The background canvas color */ + backgroundColor?: Color | number | string; + + /** The brightest ambient color */ + brightestColor?: Color | number | string; + + /** The color of darkness */ + darknessColor?: Color | number | string; + + /** A preview darkness level */ + darknessLevel?: number; + + /** The ambient daylight color */ + daylightColor?: Color | number | string; + + /** The color applied to explored areas */ + fogExploredColor?: number; + + /** The color applied to unexplored areas */ + fogUnexploredColor?: number; + }): void; + } +} diff --git a/src/foundry/client/pixi/perception/detection-mode.d.ts b/src/foundry/client/pixi/perception/detection-mode.d.ts new file mode 100644 index 000000000..ea29b521b --- /dev/null +++ b/src/foundry/client/pixi/perception/detection-mode.d.ts @@ -0,0 +1,198 @@ +export {}; + +// TODO: Move to common/documents/token +type TokenDetectionMode = { + /** The id of the detection mode, a key from CONFIG.Canvas.detectionModes */ + id: string; + /** Whether or not this detection mode is presently enabled */ + enabled: boolean; + /** The maximum range in distance units at which this mode can detect targets */ + range: number; +}; +// TODO: Move to client/pixi/layers/effects/visibility.js +type CanvasVisibilityTest = { + point: PIXI.Point; + los: Map; +}; +type CanvasVisibilityTestConfig = { + object: PlaceableObject; + tests: CanvasVisibilityTest[]; +}; + +// TODO: Remove after foundry.abstract.DataModel is defined +// Currently that is in PR #2331 (branch v10/non-inferring-data-fields) +declare namespace foundry { + namespace abstract { + class DataModel {} + } +} + +declare global { + /** + * A Detection Mode which can be associated with any kind of sense/vision/perception. + * A token could have multiple detection modes. + */ + class DetectionMode extends foundry.abstract.DataModel { + static defineSchema(): any; + + /** + * Get the detection filter pertaining to this mode. + */ + static getDetectionFilter(): PIXI.Filter | undefined; + + /** + * An optional filter to apply on the target when it is detected with this mode. + */ + static _detectionFilter: PIXI.Filter | undefined; + + /** + * The type of the detection mode. If its sight based, sound based, etc. + * It is related to wall's WALL_RESTRICTION_TYPES + * @see CONST.WALL_RESTRICTION_TYPES + */ + static DETECTION_TYPES: { + /** Sight, and anything depending on light perception */ + SIGHT: 0; + /** What you can hear. Includes echolocation for bats per example */ + SOUND: 1; + /** This is mostly a sense for touch and vibration, like tremorsense, movement detection, etc. */ + MOVE: 2; + /** Can't fit in other types (smell, life sense, trans-dimensional sense, sense of humor...) */ + OTHER: 3; + }; + + /** + * The identifier of the basic sight detection mode. + */ + static BASIC_MODE_ID: "basicSight"; + + /** + * Test visibility of a target object or array of points for a specific vision source. + * @param visionSource - The vision source being tested + * @param mode - The detection mode configuration + * @param config - The visibility test configuration + * @returns Is the test target visible? + */ + testVisibility( + visionSource: VisionSource, + mode: TokenDetectionMode, + { object, tests }: CanvasVisibilityTestConfig, + ): boolean; + + /** + * Can this VisionSource theoretically detect a certain object based on its properties? + * This check should not consider the relative positions of either object, only their state. + * @param visionSource - The vision source being tested + * @param target - The target object being tested + * @returns Can the target object theoretically be detected by this vision source? + */ + protected _canDetect(visionSource: VisionSource, target: PlaceableObject): boolean; + + /** + * Evaluate a single test point to confirm whether it is visible. + * Standard detection rules require that the test point be both within LOS and within range. + * @param visionSource - The vision source being tested + * @param mode - The detection mode configuration + * @param target - The target object being tested + * @param test - The test case being evaluated + */ + protected _testPoint( + visionSource: VisionSource, + mode: TokenDetectionMode, + target: PlaceableObject, + test: CanvasVisibilityTest, + ): boolean; + + /** + * Test whether the line-of-sight requirement for detection is satisfied. + * Always true if the detection mode bypasses walls, otherwise the test point must be contained by the LOS polygon. + * The result of is cached for the vision source so that later checks for other detection modes do not repeat it. + * @param visionSource - The vision source being tested + * @param mode - The detection mode configuration + * @param target - The target object being tested + * @param test - The test case being evaluated + * @returns Is the LOS requirement satisfied for this test? + */ + protected _testLOS( + visionSource: VisionSource, + mode: TokenDetectionMode, + target: PlaceableObject, + test: CanvasVisibilityTest, + ): boolean; + + /** + * Test whether the target is within the vision angle. + * @param visionSource - The vision source being tested + * @param mode - The detection mode configuration + * @param target - The target object being tested + * @param test - The test case being evaluated + * @returns Is the point within the vision angle? + */ + protected _testAngle( + visionSource: VisionSource, + mode: TokenDetectionMode, + target: PlaceableObject, + test: CanvasVisibilityTest, + ): boolean; + + /** + * Verify that a target is in range of a source. + * @param visionSource - The vision source being tested + * @param mode - The detection mode configuration + * @param target - The target object being tested + * @param test - The test case being evaluated + * @returns Is the target within range? + */ + protected _testRange( + visionSource: VisionSource, + mode: TokenDetectionMode, + target: PlaceableObject, + test: CanvasVisibilityTest, + ): boolean; + } + + /** + * A special detection mode which models standard human vision. + * This mode is the default case which is tested first when evaluating visibility of objects. + * It is also a special case, in that it is the only detection mode which considers the area of distant light sources. + */ + class DetectionModeBasicSight extends DetectionMode { + override _testPoint( + visionSource: VisionSource, + mode: TokenDetectionMode, + target: PlaceableObject, + test: CanvasVisibilityTest, + ): boolean; + } + + /** + * Detection mode that see invisible creatures. + * This detection mode allows the source to: + * - See/Detect the invisible target as if visible. + * - The "See" version needs sight and is affected by blindness + */ + class DetectionModeInvisibility extends DetectionMode { + static override getDetectionFilter(): PIXI.Filter | undefined; + + protected override _canDetect(visionSource: VisionSource, target: PlaceableObject): boolean; + } + + /** + * Detection mode that see creatures in contact with the ground. + */ + class DetectionModeTremor extends DetectionMode { + static override getDetectionFilter(): PIXI.Filter | undefined; + + protected override _canDetect(visionSource: VisionSource, target: PlaceableObject): boolean; + } + + /** + * Detection mode that see ALL creatures (no blockers). + * If not constrained by walls, see everything within the range. + */ + class DetectionModeAll extends DetectionMode { + static override getDetectionFilter(): PIXI.Filter | undefined; + + protected override _canDetect(visionSource: VisionSource, target: PlaceableObject): boolean; + } +} diff --git a/src/foundry/client/pixi/perception/fog.d.ts b/src/foundry/client/pixi/perception/fog.d.ts new file mode 100644 index 000000000..3e30bcc03 --- /dev/null +++ b/src/foundry/client/pixi/perception/fog.d.ts @@ -0,0 +1,104 @@ +export {}; + +type SpriteMesh = unknown; +type FogTextureConfiguration = unknown; +declare global { + /** + * A fog of war management class which is the singleton canvas.fog instance. + */ + class FogManager { + /** + * The FogExploration document which applies to this canvas view + * @defaultValue `null` + */ + exploration: FogExploration | null; + + /** + * Define the number of fog refresh needed before the fog texture is extracted and pushed to the server. + */ + static COMMIT_THRESHOLD: 70; + + /** + * The exploration SpriteMesh which holds the fog exploration texture. + */ + get sprite(): SpriteMesh; + + /** + * The configured options used for the saved fog-of-war texture. + */ + get textureConfiguration(): FogTextureConfiguration; + + /** + * Does the currently viewed Scene support Token field of vision? + */ + get tokenVision(): boolean; + + /** + * Does the currently viewed Scene support fog of war exploration? + */ + get fogExploration(): boolean; + + /** + * Initialize fog of war - resetting it when switching scenes or re-drawing the canvas + */ + initialize(): Promise; + + /** + * Clear the fog and reinitialize properties (commit and save in non reset mode) + */ + clear(): Promise; + + /** + * Once a new Fog of War location is explored, composite the explored container with the current staging sprite. + * Once the number of refresh is \> to the commit threshold, save the fog texture to the database. + */ + commit(): void; + + /** + * Load existing fog of war data from local storage and populate the initial exploration sprite + */ + load(): Promise; + + /** + * Dispatch a request to reset the fog of war exploration status for all users within this Scene. + * Once the server has deleted existing FogExploration documents, the _onReset handler will re-draw the canvas. + */ + reset(): Promise; + + /** + * Request a fog of war save operation. + * Note: if a save operation is pending, we're waiting for its conclusion. + */ + save(): Promise; + + /** + * If fog of war data is reset from the server, deactivate the current fog and initialize the exploration. + * @internal + */ + _handleReset(): Promise; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks pending is deprecated and redirected to the exploration container + */ + get pending(): unknown; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks revealed is deprecated and redirected to the exploration container + */ + get revealed(): unknown; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks update is obsolete and always returns true. The fog exploration does not record position anymore. + */ + update(source: any, force: boolean): true; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks resolution is deprecated and redirected to CanvasVisibility#textureConfiguration + */ + get resolution(): unknown; + } +} diff --git a/src/foundry/client/pixi/perception/index.d.ts b/src/foundry/client/pixi/perception/index.d.ts index e0a3fc40d..088d0134c 100644 --- a/src/foundry/client/pixi/perception/index.d.ts +++ b/src/foundry/client/pixi/perception/index.d.ts @@ -1,2 +1,7 @@ import "./clockwise-sweep"; +import "./color-manager"; +import "./detection-mode"; +import "./fog"; import "./perception-manager"; +import "./vision-mode"; +import "./weiler-atherton-clipping"; diff --git a/src/foundry/client/pixi/perception/perception-manager.d.ts b/src/foundry/client/pixi/perception/perception-manager.d.ts index 2e5b92557..dd160f536 100644 --- a/src/foundry/client/pixi/perception/perception-manager.d.ts +++ b/src/foundry/client/pixi/perception/perception-manager.d.ts @@ -1,107 +1,166 @@ -/** - * A helper class which manages the refresh workflow for perception layers on the canvas. - * This controls the logic which batches multiple requested updates to minimize the amount of work required. - * A singleton instance is available as canvas#perception. - * @see Canvas#perception - */ -declare class PerceptionManager { - constructor(); +export {}; - /** - * The number of milliseconds by which to throttle non-immediate refreshes - */ - protected _throttleMS: number | undefined; +declare global { + interface PerceptionManagerFlags { + /** Re-initialize the entire lighting configuration */ + initializeLighting: boolean; - /** - * An internal tracker for the last time that a perception refresh was executed - */ - protected _refreshTime: number | undefined; + /** Refresh the rendered appearance of lighting */ + refreshLighting: boolean; - /** - * An internal tracker for the window timeout that applies a debounce to the refresh - */ - protected _timeout: number | undefined; + /** Update the configuration of light sources */ + refreshLightSources: boolean; - /** - * Cache a reference to the canvas scene to avoid attempting scheduled refreshes after the scene is changed - */ - protected _scene: string | undefined; + /** Re-initialize the entire vision configuration */ + initializeVision: boolean; - /** - * The default values of update parameters. - * When a refresh occurs, the staged parameters are reset to these initial values. - */ - static DEFAULTS: PerceptionManager.Options; + /** Update the configuration of vision sources */ + refreshVisionSources: boolean; - /** - * The configured parameters for the next refresh. - */ - params: PerceptionManager.Options; + /** Refresh the rendered appearance of vision */ + refreshVision: boolean; - /** - * Cancel any pending perception refresh. - */ - cancel(): void; + /** Re-initialize the entire ambient sound configuration */ + initializeSounds: boolean; - /** - * Schedule a perception update with requested parameters. - * @param options - (default: `{}`) - */ - schedule(options?: DeepPartial): void; + /** Refresh the audio state of ambient sounds */ + refreshSounds: boolean; - /** - * Perform an immediate perception update. - * @param options - (default: `{}`) - */ - update(options?: DeepPartial): void; + /** Apply a fade duration to sound refresh workflow */ + soundFadeDuration: boolean; - /** - * A helper function to perform an immediate initialization plus incremental refresh. - */ - initialize(): ReturnType; + /** Refresh the visual appearance of tiles */ + refreshTiles: boolean; - /** - * A helper function to perform an incremental refresh only. - */ - refresh(): ReturnType; + /** Refresh the contents of the PrimaryCanvasGroup mesh */ + refreshPrimary: boolean; + } /** - * Set option flags which configure the next perception update + * A helper class which manages the refresh workflow for perception layers on the canvas. + * This controls the logic which batches multiple requested updates to minimize the amount of work required. + * A singleton instance is available as canvas#perception. + * @see Canvas#perception */ - protected _set(options: DeepPartial): void; + class PerceptionManager extends RenderFlagsMixin(Object) { + static RENDER_FLAGS: { + /** @defaultValue `{propagate: ["refreshLighting", "refreshVision"]}` */ + initializeLighting: RenderFlag; - /** - * Perform the perception update workflow - * @param immediate - Perform the workflow immediately, otherwise it is throttled - * (default: `false`) - */ - protected _update(immediate?: boolean): void; + /** @defaultValue `{propagate: ["refreshLightSources"]}` */ + refreshLighting: RenderFlag; - /** - * Reset the values of a pending refresh back to their default states. - */ - protected _reset(): void; -} + /** @defaultValue `{}` */ + refreshLightSources: RenderFlag; -declare namespace PerceptionManager { - interface Options { - lighting: { - initialize: boolean; - refresh: boolean; - }; - sight: { - initialize: boolean; - refresh: boolean; - skipUpdateFog: boolean; - forceUpdateFog: boolean; - }; - sounds: { - initialize: boolean; - refresh: boolean; - fade: boolean; + /** @defaultValue `{}` */ + refreshVisionSources: RenderFlag; + + /** @defaultValue `{}` */ + refreshPrimary: RenderFlag; + + /** @defaultValue `{propagate: ["refreshVision", "refreshTiles", "refreshLighting", "refreshLightSources", "refreshPrimary"]}` */ + initializeVision: RenderFlag; + + /** @defaultValue `{propagate: ["refreshVisionSources"]}` */ + refreshVision: RenderFlag; + + /** @defaultValue `{propagate: ["refreshSounds"]}` */ + initializeSounds: RenderFlag; + + /** @defaultValue `{}` */ + refreshSounds: RenderFlag; + + /** @defaultValue `{propagate: ["refreshLightSources", "refreshVisionSources"]}` */ + refreshTiles: RenderFlag; + + /** @defaultValue `{}` */ + soundFadeDuration: RenderFlag; + + /** @defaultValue `{propagate: ["initializeLighting", "initializeVision"]}` */ + identifyInteriorWalls: RenderFlag; + + /** @defaultValue `{propagate: ["refreshVision"]}` */ + forceUpdateFog: RenderFlag; }; - foreground: { - refresh: boolean; + + static RENDER_FLAG_PRIORITY: "PERCEPTION"; + + applyRenderFlags(): void; + + /** + * A shim mapping which supports backwards compatibility for old-style (V9 and before) perception manager flags. + */ + static COMPATIBILITY_MAPPING: { + "lighting.initialize": "initializeLighting"; + "lighting.refresh": "refreshLighting"; + "sight.initialize": "initializeVision"; + "sight.refresh": "refreshVision"; + "sounds.initialize": "initializeSounds"; + "sounds.refresh": "refreshSounds"; + "sounds.fade": "soundFadeDuration"; + "foreground.refresh": "refreshTiles"; }; + + /** + * Update perception manager flags which configure which behaviors occur on the next frame render. + * @param flags - Flag values (true) to assign where the keys belong to PerceptionManager.FLAGS + * @param v2 - Opt-in to passing v2 flags, otherwise a backwards compatibility shim will be applied + * (default: `true`) + */ + update(flags: Partial, v2?: boolean): void; + + /** + * A helper function to perform an immediate initialization plus incremental refresh. + */ + initialize(): ReturnType; + + /** + * A helper function to perform an incremental refresh only. + */ + refresh(): ReturnType; + + /** + * @deprecated since v10, will be removed in v12 + * @remarks PerceptionManager#cancel is renamed to PerceptionManager#deactivate + * @remarks PerceptionManager#deactivate does not actually exist as of v11 + */ + cancel(): void; + + /** + * @deprecated since v10, will be removed in v12 + * @remarks PerceptionManager#schedule is replaced by PerceptionManager#update + */ + schedule(options?: DeepPartial): void; + + /** + * @deprecated since v11 + * @remarks forceUpdateFog flag is now obsolete and has no replacement. The fog is now always updated when the visibility is refreshed + */ + static forceUpdateFog(): void; + } + + namespace PerceptionManager { + /** @deprecated Old flag structure */ + interface Options { + lighting: { + initialize: boolean; + refresh: boolean; + }; + sight: { + initialize: boolean; + refresh: boolean; + skipUpdateFog: boolean; + forceUpdateFog: boolean; + }; + sounds: { + initialize: boolean; + refresh: boolean; + fade: boolean; + }; + foreground: { + refresh: boolean; + }; + } } } diff --git a/src/foundry/client/pixi/perception/vision-mode.d.ts b/src/foundry/client/pixi/perception/vision-mode.d.ts new file mode 100644 index 000000000..f2e0e8d54 --- /dev/null +++ b/src/foundry/client/pixi/perception/vision-mode.d.ts @@ -0,0 +1,109 @@ +export {}; + +// TODO: Remove after foundry.abstract.DataModel is defined +// Currently that is in PR #2331 (branch v10/non-inferring-data-fields +declare namespace foundry { + namespace data { + namespace fields { + class DataField { + static get _defaults(): Record; + + _cast(value: any): any; + } + } + } + namespace abstract { + class DataModel {} + } +} + +declare global { + class ShaderField extends foundry.data.fields.DataField { + /** + * @defaultValue + * ```typescript + * const defaults = super._defaults; + * defaults.nullable = true; + * defaults.initial = undefined; + * return defaults; + * ``` + */ + static override get _defaults(): Record; + + /** @remarks The value provided to a ShaderField must be an AbstractBaseShader subclass. */ + override _cast(value: any): AbstractBaseShader | Error; + } + + /** + * A Vision Mode which can be selected for use by a Token. + * The selected Vision Mode alters the appearance of various aspects of the canvas while that Token is the POV. + */ + abstract class VisionMode extends foundry.abstract.DataModel { + /** + * Construct a Vision Mode using provided configuration parameters and callback functions. + * @param data - Data which fulfills the model defined by the VisionMode schema. + * @param options - Additional options passed to the DataModel constructor. + */ + constructor(data: Partial, options?: object); + + static defineSchema(): any; + + /** The lighting illumination levels which are supported. */ + static LIGHTING_LEVELS: { + DARKNESS: -2; + HALFDARK: -1; + UNLIT: 0; + DIM: 1; + BRIGHT: 2; + BRIGHTEST: 3; + }; + + /** + * Flags for how each lighting channel should be rendered for the currently active vision modes: + * - Disabled: this lighting layer is not rendered, the shaders does not decide. + * - Enabled: this lighting layer is rendered normally, and the shaders can choose if they should be rendered or not. + * - Required: the lighting layer is rendered, the shaders does not decide. + */ + static LIGHTING_VISIBILITY: { + DISABLED: 0; + ENABLED: 1; + REQUIRED: 2; + }; + + /** + * A flag for whether this vision source is animated + * @defaultValue `false` + */ + animated: boolean; + + /** + * Special activation handling that could be implemented by VisionMode subclasses + * @param source - Activate this VisionMode for a specific source + */ + abstract _activate(source: VisionSource): void; + + /** + * Special deactivation handling that could be implemented by VisionMode subclasses + * @param source - Deactivate this VisionMode for a specific source + */ + abstract _deactivate(source: VisionSource): void; + + /** + * Special handling which is needed when this Vision Mode is activated for a VisionSource. + * @param source - Activate this VisionMode for a specific source + */ + activate(source: VisionSource): void; + + /** + * Special handling which is needed when this Vision Mode is deactivated for a VisionSource. + * @param source - Deactivate this VisionMode for a specific source + */ + deactivate(source: VisionSource): void; + + /** + * An animation function which runs every frame while this Vision Mode is active. + * @param dt - The deltaTime passed by the PIXI Ticker + */ + animate(dt: number): void; + } +} diff --git a/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.ts b/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.ts new file mode 100644 index 000000000..72e33e4b5 --- /dev/null +++ b/src/foundry/client/pixi/perception/weiler-atherton-clipping.d.ts @@ -0,0 +1,131 @@ +export {}; + +declare global { + /** + * An implementation of the Weiler Atherton algorithm for clipping polygons. + * This currently only handles combinations that will not result in any holes. + * Support may be added for holes in the future. + * + * This algorithm is faster than the Clipper library for this task because it relies on the unique properties of the + * circle, ellipse, or convex simple clip object. + * It is also more precise in that it uses the actual intersection points between the circle/ellipse and polygon, + * instead of relying on the polygon approximation of the circle/ellipse to find the intersection points. + * + * For more explanation of the underlying algorithm, see: + * https://en.wikipedia.org/wiki/Weiler%E2%80%93Atherton_clipping_algorithm + * https://www.geeksforgeeks.org/weiler-atherton-polygon-clipping-algorithm + * https://h-educate.in/weiler-atherton-polygon-clipping-algorithm/ + */ + class WeilerAthertonClipper { + /** + * Construct a WeilerAthertonClipper instance used to perform the calculation. + * @param polygon - Polygon to clip + * @param clipObject - Object used to clip the polygon + * @param clipType - Type of clip to use + * @param clipOpts - Object passed to the clippingObject methods toPolygon and pointsBetween + */ + constructor(polygon: PIXI.Polygon, clipObject: PIXI.Rectangle | PIXI.Circle, clipType: number, clipOpts: object); + + /** + * The supported clip types. + * Values are equivalent to those in ClipperLib.ClipType. + */ + static readonly CLIP_TYPES: Readonly<{ + INTERSECT: 0; + UNION: 1; + }>; + + /** + * The supported intersection types. + */ + static readonly INTERSECTION_TYPES: Readonly<{ + OUT_IN: -1; + IN_OUT: 1; + TANGENT: 0; + }>; + + polygon: PIXI.Polygon; + + clipObject: PIXI.Rectangle | PIXI.Circle; + + /** + * Configuration settings + * @param clipType - One of CLIP_TYPES + * @param clipOpts - Object passed to the clippingObject methods + * toPolygon and pointsBetween + * @defaultValue `{}` + */ + config: { + clipType?: typeof WeilerAthertonClipper.CLIP_TYPES; + clipOpts?: Record; + }; + + /** + * Union a polygon and clipObject using the Weiler Atherton algorithm. + * @param polygon - Polygon to clip + * @param clipObject - Object to clip against the polygon + * @param clipOpts - Options passed to the clipping object + * methods toPolygon and pointsBetween + */ + static union( + polygon: PIXI.Polygon, + clipObject: PIXI.Rectangle | PIXI.Circle, + clipOpts: Record, + ): PIXI.Polygon[]; + + /** + * Intersect a polygon and clipObject using the Weiler Atherton algorithm. + * @param polygon - Polygon to clip + * @param clipObject - Object to clip against the polygon + * @param clipOpts - Options passed to the clipping object + * methods toPolygon and pointsBetween + */ + static intersect( + polygon: PIXI.Polygon, + clipObject: PIXI.Rectangle | PIXI.Circle, + clipOpts: Record, + ): PIXI.Polygon[]; + + /** + * Clip a given clipObject using the Weiler-Atherton algorithm. + * + * At the moment, this will return a single PIXI.Polygon in the array unless clipType is a union and the polygon + * and clipObject do not overlap, in which case the [polygon, clipObject.toPolygon()] array will be returned. + * If this algorithm is expanded in the future to handle holes, an array of polygons may be returned. + * + * @param polygon - Polygon to clip + * @param clipObject - Object to clip against the polygon + * @param clipType - One of CLIP_TYPES + * @param canMutate - If the WeilerAtherton constructor could mutate or not the subject polygon points + * @param clipOpts - Options passed to the WeilerAthertonClipper constructor + * @returns Array of polygons and clipObjects + */ + static combine( + polygon: PIXI.Polygon, + clipObject: PIXI.Rectangle | PIXI.Circle, + { + clipType, + canMutate, + ...clipOpts + }?: { clipType: typeof WeilerAthertonClipper.CLIP_TYPES; canMutate: boolean; clipOpts: Record }, + ): PIXI.Polygon[]; + + /** + * Test if one shape envelops the other. Assumes the shapes do not intersect. + * 1. Polygon is contained within the clip object. Union: clip object; Intersect: polygon + * 2. Clip object is contained with polygon. Union: polygon; Intersect: clip object + * 3. Polygon and clip object are outside one another. Union: both; Intersect: null + * @param polygon - Polygon to clip + * @param clipObject - Object to clip against the polygon + * @param clipType - One of CLIP_TYPES + * @param clipOpts - Clip options which are forwarded to toPolygon methods + * @returns Returns the polygon, the clipObject.toPolygon(), both, or neither. + */ + static testForEnvelopment( + polygon: PIXI.Polygon, + clipObject: PIXI.Rectangle | PIXI.Circle, + clipType: typeof WeilerAthertonClipper.CLIP_TYPES, + clipOpts: Record, + ): PIXI.Polygon[]; + } +} diff --git a/src/foundry/client/pixi/placeable.d.ts b/src/foundry/client/pixi/placeable.d.ts index a84cd5bd6..c2f4349d3 100644 --- a/src/foundry/client/pixi/placeable.d.ts +++ b/src/foundry/client/pixi/placeable.d.ts @@ -291,62 +291,62 @@ declare global { * @param options - Options which customize event handling * (default: `{}`) */ - protected _onHoverIn(event: PIXI.InteractionEvent, options?: HoverInOptions): false | void; + protected _onHoverIn(event: PIXI.FederatedEvent, options?: HoverInOptions): false | void; /** * Actions that should be taken for this Placeable Object when a mouseout event occurs * @param event - The triggering canvas interaction event */ - protected _onHoverOut(event: PIXI.InteractionEvent): false | void; + protected _onHoverOut(event: PIXI.FederatedEvent): false | void; /** * Callback actions which occur on a single left-click event to assume control of the object * @see MouseInteractionManager#_handleClickLeft * @param event - The triggering canvas interaction event */ - protected _onClickLeft(event: PIXI.InteractionEvent): boolean | void; + protected _onClickLeft(event: PIXI.FederatedEvent): boolean | void; /** * Callback actions which occur on a double left-click event to activate * @see MouseInteractionManager#_handleClickLeft2 * @param event - The triggering canvas interaction event */ - protected _onClickLeft2(event: PIXI.InteractionEvent): void; + protected _onClickLeft2(event: PIXI.FederatedEvent): void; /** * Callback actions which occur on a single right-click event to configure properties of the object * @see MouseInteractionManager#_handleClickRight * @param event - The triggering canvas interaction event */ - protected _onClickRight(event: PIXI.InteractionEvent): void; + protected _onClickRight(event: PIXI.FederatedEvent): void; /** * Callback actions which occur on a double right-click event to configure properties of the object * @see MouseInteractionManager#_handleClickRight2 * @param event - The triggering canvas interaction event */ - protected _onClickRight2(event: PIXI.InteractionEvent): void; + protected _onClickRight2(event: PIXI.FederatedEvent): void; /** * Callback actions which occur when a mouse-drag action is first begun. * @see MouseInteractionManager#_handleDragStart * @param event - The triggering canvas interaction event */ - protected _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected _onDragLeftStart(event: PIXI.FederatedEvent): void; /** * Callback actions which occur on a mouse-move operation. * @see MouseInteractionManager#_handleDragMove * @param event - The triggering canvas interaction event */ - protected _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected _onDragLeftMove(event: PIXI.FederatedEvent): void; /** * Callback actions which occur on a mouse-move operation. * @see MouseInteractionManager#_handleDragDrop * @param event - The triggering canvas interaction event */ - protected _onDragLeftDrop(event: PIXI.InteractionEvent): unknown; + protected _onDragLeftDrop(event: PIXI.FederatedEvent): unknown; /** * Callback actions which occur on a mouse-move operation. @@ -372,10 +372,10 @@ declare global { interface Vision { /** - * @remarks - * This is required but has been set to optional because of PointSource + * @privateRemarks Documentation says PIXI.Circle, but determined by Atropos to be out of date. + * Likely to be removed in future version as it's no longer used generally. */ - fov?: PIXI.Circle | undefined; + fov?: PIXI.Polygon | undefined; /** * @remarks diff --git a/src/foundry/client/pixi/placeables.d.ts b/src/foundry/client/pixi/placeables.d.ts index e0756ec1c..0427e5cdb 100644 --- a/src/foundry/client/pixi/placeables.d.ts +++ b/src/foundry/client/pixi/placeables.d.ts @@ -311,31 +311,31 @@ declare global { * Handle left mouse-click events which originate from the Canvas stage and are dispatched to this Layer. * @see {@link Canvas#_onClickLeft} */ - protected _onClickLeft(event: PIXI.InteractionEvent): void; + protected _onClickLeft(event: PIXI.FederatedEvent): void; /** * Handle double left-click events which originate from the Canvas stage and are dispatched to this Layer. * @see {@link Canvas#_onClickLeft2} */ - protected _onClickLeft2(event: PIXI.InteractionEvent): void; + protected _onClickLeft2(event: PIXI.FederatedEvent): void; /** * Start a left-click drag workflow originating from the Canvas stage. * @see {@link Canvas#_onDragLeftStart} */ - protected _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected _onDragLeftStart(event: PIXI.FederatedEvent): void; /** * Continue a left-click drag workflow originating from the Canvas stage. * @see {@link Canvas#_onDragLeftMove} */ - protected _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected _onDragLeftMove(event: PIXI.FederatedEvent): void; /** * Conclude a left-click drag workflow originating from the Canvas stage. * @see {@link Canvas#_onDragLeftDrop} */ - protected _onDragLeftDrop(event: PIXI.InteractionEvent): void; + protected _onDragLeftDrop(event: PIXI.FederatedEvent): void; /** * Cancel a left-click drag workflow originating from the Canvas stage. @@ -347,7 +347,7 @@ declare global { * Handle right mouse-click events which originate from the Canvas stage and are dispatched to this Layer. * @see {@link Canvas#_onClickRight} */ - protected _onClickRight(event: PIXI.InteractionEvent): void; + protected _onClickRight(event: PIXI.FederatedEvent): void; /** * Handle mouse-wheel events at the PlaceableObjects layer level to rotate multiple objects at once. diff --git a/src/foundry/client/pixi/placeables/drawing.d.ts b/src/foundry/client/pixi/placeables/drawing.d.ts index 6dd595e26..f3edfcea4 100644 --- a/src/foundry/client/pixi/placeables/drawing.d.ts +++ b/src/foundry/client/pixi/placeables/drawing.d.ts @@ -203,13 +203,13 @@ declare global { * Handle mouse movement which modifies the dimensions of the drawn shape * @internal */ - protected _onMouseDraw(event: PIXI.InteractionEvent): void; + protected _onMouseDraw(event: PIXI.FederatedEvent): void; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): void; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; - protected override _onDragLeftDrop(event: PIXI.InteractionEvent): Promise; + protected override _onDragLeftDrop(event: PIXI.FederatedEvent): Promise; protected override _onDragLeftCancel(event: MouseEvent): void; @@ -218,34 +218,34 @@ declare global { * @param event - The mouseover event * @internal */ - protected _onHandleHoverIn(event: PIXI.InteractionEvent): void; + protected _onHandleHoverIn(event: PIXI.FederatedEvent): void; /** * Handle mouse-out event on a control handle * @param event - The mouseout event * @internal */ - protected _onHandleHoverOut(event: PIXI.InteractionEvent): void; + protected _onHandleHoverOut(event: PIXI.FederatedEvent): void; /** * When we start a drag event - create a preview copy of the Tile for re-positioning * @param event - The mousedown event * @internal */ - protected _onHandleMouseDown(event: PIXI.InteractionEvent): void; + protected _onHandleMouseDown(event: PIXI.FederatedEvent): void; /** * Handle the beginning of a drag event on a resize handle * @internal */ - protected _onHandleDragStart(event: PIXI.InteractionEvent): void; + protected _onHandleDragStart(event: PIXI.FederatedEvent): void; /** * Handle mousemove while dragging a tile scale handler * @param event - The mousemove event * @internal */ - protected _onHandleDragMove(event: PIXI.InteractionEvent): void; + protected _onHandleDragMove(event: PIXI.FederatedEvent): void; /** * Handle mouseup after dragging a tile scale handler @@ -253,14 +253,14 @@ declare global { * @internal */ protected _onHandleDragDrop( - event: PIXI.InteractionEvent, + event: PIXI.FederatedEvent, ): ReturnType>["update"]>; /** * Handle cancellation of a drag event for one of the resizing handles * @internal */ - protected _onHandleDragCancel(event: PIXI.InteractionEvent): void; + protected _onHandleDragCancel(event: PIXI.FederatedEvent): void; /** * Apply a vectorized rescaling transformation for the drawing data diff --git a/src/foundry/client/pixi/placeables/light.d.ts b/src/foundry/client/pixi/placeables/light.d.ts index 63b8df495..8d7a2b5c0 100644 --- a/src/foundry/client/pixi/placeables/light.d.ts +++ b/src/foundry/client/pixi/placeables/light.d.ts @@ -99,11 +99,11 @@ declare global { protected override _canConfigure(user: InstanceType>, event?: any): boolean; - protected override _onClickRight(event: PIXI.InteractionEvent): Promise; + protected override _onClickRight(event: PIXI.FederatedEvent): Promise; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): void; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; protected override _onDragLeftCancel(event: MouseEvent): void; } diff --git a/src/foundry/client/pixi/placeables/note.d.ts b/src/foundry/client/pixi/placeables/note.d.ts index fd85e7360..d6ad6e0d3 100644 --- a/src/foundry/client/pixi/placeables/note.d.ts +++ b/src/foundry/client/pixi/placeables/note.d.ts @@ -58,10 +58,10 @@ declare global { protected override _canView(user: InstanceType>): boolean; - protected override _onHoverIn(event: PIXI.InteractionEvent, options?: HoverInOptions): false | void; + protected override _onHoverIn(event: PIXI.FederatedEvent, options?: HoverInOptions): false | void; - protected override _onHoverOut(event: PIXI.InteractionEvent): false | void; + protected override _onHoverOut(event: PIXI.FederatedEvent): false | void; - protected override _onClickLeft2(event: PIXI.InteractionEvent): void; + protected override _onClickLeft2(event: PIXI.FederatedEvent): void; } } diff --git a/src/foundry/client/pixi/placeables/sound.d.ts b/src/foundry/client/pixi/placeables/sound.d.ts index bf26765d3..8700547df 100644 --- a/src/foundry/client/pixi/placeables/sound.d.ts +++ b/src/foundry/client/pixi/placeables/sound.d.ts @@ -100,9 +100,9 @@ declare global { protected override _canConfigure(user: InstanceType>, event?: any): boolean; - protected override _onClickRight(event: PIXI.InteractionEvent): void; + protected override _onClickRight(event: PIXI.FederatedEvent): void; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; } namespace AmbientSound { diff --git a/src/foundry/client/pixi/placeables/tile.d.ts b/src/foundry/client/pixi/placeables/tile.d.ts index 626a5f694..e63aed23f 100644 --- a/src/foundry/client/pixi/placeables/tile.d.ts +++ b/src/foundry/client/pixi/placeables/tile.d.ts @@ -208,13 +208,13 @@ declare global { protected override _canConfigure(user: User, event?: any): boolean; - protected override _onClickLeft2(event: PIXI.InteractionEvent): void; + protected override _onClickLeft2(event: PIXI.FederatedEvent): void; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): void; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; - protected override _onDragLeftDrop(event: PIXI.InteractionEvent): Promise; + protected override _onDragLeftDrop(event: PIXI.FederatedEvent): Promise; protected override _onDragLeftCancel(event: MouseEvent): void; @@ -222,37 +222,37 @@ declare global { * Handle mouse-over event on a control handle * @param event - The mouseover event */ - protected _onHandleHoverIn(event: PIXI.InteractionEvent): void; + protected _onHandleHoverIn(event: PIXI.FederatedEvent): void; /** * Handle mouse-out event on a control handle * @param event - The mouseout event */ - protected _onHandleHoverOut(event: PIXI.InteractionEvent): void; + protected _onHandleHoverOut(event: PIXI.FederatedEvent): void; /** * When we start a drag event - create a preview copy of the Tile for re-positioning * @param event - The mousedown event */ - protected _onHandleMouseDown(event: PIXI.InteractionEvent): void; + protected _onHandleMouseDown(event: PIXI.FederatedEvent): void; /** * Handle the beginning of a drag event on a resize handle * @param event - The mousedown event */ - protected _onHandleDragStart(event: PIXI.InteractionEvent): void; + protected _onHandleDragStart(event: PIXI.FederatedEvent): void; /** * Handle mousemove while dragging a tile scale handler * @param event - The mousemove event */ - protected _onHandleDragMove(event: PIXI.InteractionEvent): void; + protected _onHandleDragMove(event: PIXI.FederatedEvent): void; /** * Handle mouseup after dragging a tile scale handler * @param event - The mouseup event */ - protected _onHandleDragDrop(event: PIXI.InteractionEvent): Promise; + protected _onHandleDragDrop(event: PIXI.FederatedEvent): Promise; /** * Get resized Tile dimensions diff --git a/src/foundry/client/pixi/placeables/token.d.ts b/src/foundry/client/pixi/placeables/token.d.ts index b3ac59859..98fe26de0 100644 --- a/src/foundry/client/pixi/placeables/token.d.ts +++ b/src/foundry/client/pixi/placeables/token.d.ts @@ -523,47 +523,47 @@ declare global { protected override _canControl( user?: InstanceType>, - event?: PIXI.InteractionEvent, + event?: PIXI.FederatedEvent, ): boolean; protected override _canHUD( user: InstanceType>, - event?: PIXI.InteractionEvent, + event?: PIXI.FederatedEvent, ): boolean; protected override _canConfigure( user?: InstanceType>, - event?: PIXI.InteractionEvent, + event?: PIXI.FederatedEvent, ): true; protected override _canHover( user?: InstanceType>, - event?: PIXI.InteractionEvent, + event?: PIXI.FederatedEvent, ): true; protected override _canView( user?: InstanceType>, - event?: PIXI.InteractionEvent, + event?: PIXI.FederatedEvent, ): boolean; protected override _canDrag( user: InstanceType>, - event: PIXI.InteractionEvent, + event: PIXI.FederatedEvent, ): boolean; - protected override _onHoverIn(event: PIXI.InteractionEvent, options?: { hoverOutOthers?: boolean }): void; + protected override _onHoverIn(event: PIXI.FederatedEvent, options?: { hoverOutOthers?: boolean }): void; - protected override _onHoverOut(event: PIXI.InteractionEvent): false | void; + protected override _onHoverOut(event: PIXI.FederatedEvent): false | void; - protected override _onClickLeft(event: PIXI.InteractionEvent): void; + protected override _onClickLeft(event: PIXI.FederatedEvent): void; - protected override _onClickLeft2(event?: PIXI.InteractionEvent): void; + protected override _onClickLeft2(event?: PIXI.FederatedEvent): void; - protected override _onClickRight2(event: PIXI.InteractionEvent): void; + protected override _onClickRight2(event: PIXI.FederatedEvent): void; - protected override _onDragLeftDrop(event: PIXI.InteractionEvent): Promise; + protected override _onDragLeftDrop(event: PIXI.FederatedEvent): Promise; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; protected override _onDragLeftCancel(event: MouseEvent): void; /** diff --git a/src/foundry/client/pixi/placeables/wall.d.ts b/src/foundry/client/pixi/placeables/wall.d.ts index 9aec76a92..d107dc256 100644 --- a/src/foundry/client/pixi/placeables/wall.d.ts +++ b/src/foundry/client/pixi/placeables/wall.d.ts @@ -241,27 +241,27 @@ declare global { protected override _canControl(user: InstanceType>, event?: any): boolean; - protected override _onHoverIn(event: PIXI.InteractionEvent, options?: HoverInOptions): false | void; + protected override _onHoverIn(event: PIXI.FederatedEvent, options?: HoverInOptions): false | void; - protected override _onHoverOut(event: PIXI.InteractionEvent): false | void; + protected override _onHoverOut(event: PIXI.FederatedEvent): false | void; /** * Handle mouse-hover events on the line segment itself, pulling the Wall to the front of the container stack * @internal */ - protected _onMouseOverLine(event: PIXI.InteractionEvent): void; + protected _onMouseOverLine(event: PIXI.FederatedEvent): void; - protected override _onClickLeft(event: PIXI.InteractionEvent): boolean; + protected override _onClickLeft(event: PIXI.FederatedEvent): boolean; - protected override _onClickLeft2(event: PIXI.InteractionEvent): void; + protected override _onClickLeft2(event: PIXI.FederatedEvent): void; - protected override _onClickRight2(event: PIXI.InteractionEvent): void; + protected override _onClickRight2(event: PIXI.FederatedEvent): void; - protected override _onDragLeftStart(event: PIXI.InteractionEvent): void; + protected override _onDragLeftStart(event: PIXI.FederatedEvent): void; - protected override _onDragLeftMove(event: PIXI.InteractionEvent): void; + protected override _onDragLeftMove(event: PIXI.FederatedEvent): void; - protected override _onDragLeftDrop(event: PIXI.InteractionEvent): Promise; + protected override _onDragLeftDrop(event: PIXI.FederatedEvent): Promise; } } diff --git a/src/foundry/client/pixi/sources/base-source.d.ts b/src/foundry/client/pixi/sources/base-source.d.ts index 8faf8b440..ba2cb8ab0 100644 --- a/src/foundry/client/pixi/sources/base-source.d.ts +++ b/src/foundry/client/pixi/sources/base-source.d.ts @@ -1,145 +1,221 @@ -/** - * A helper class used by the Sight Layer to represent a source of vision or illumination. - */ -declare abstract class PointSource { - /** - * @param object - The object responsible for the PointSource - */ - constructor(object: PlaceableObject); - - /** - * The object responsible for this source. - */ - object: PlaceableObject; - - /** - * The type of source represented by this data structure. - * Each subclass must implement this attribute. - * @remarks This is undefined in PointSource. - */ - static sourceType: string | undefined; - - /** - * The default Geometry stored in the GPU for all Point Source meshes. - */ - static GEOMETRY: PIXI.Geometry; - - /** - * A flag for whether this source is currently active (rendered) or not - * @defaultValue `false` - */ - active: boolean; - - /** - * The object of data which configures how this source is rendered - * @defaultValue `{}` - */ - data: Partial; - - /** - * The maximum radius of emission for this source - * @defaultValue `0` - */ - radius: number; - - /** - * The restricted line-of-sight polygon that is generated by the origin and radius of this source. - * @defaultValue `undefined` - */ - los: PointSourcePolygon | undefined; - - /** - * A Graphics object with pre-computed geometry used for masking based on line-of-sight. - * @defaultValue `new PIXI.LegacyGraphics()` - */ - losMask: PIXI.Graphics; - - /** - * Is the angle of emission for this source limited? - * @defaultValue `false` - */ - limited: boolean; - - /** - * Boolean flags which control whether certain behaviors of the source must be enforced - * @defaultValue `{}` - */ - protected _flags: { - renderFOV?: boolean; - } & Record; - - /** - * The x-coordinate of the point source origin. - */ - get x(): number | undefined; - - /** - * The y-coordinate of the point source origin. - */ - get y(): number | undefined; - - /** - * The type of source represented by this data structure. - */ - get sourceType(): (typeof PointSource)["sourceType"]; - - /** - * A point is contained with the area of the source if it is within both the FOV circle as well as the LOS polygon. - * @param point - The point to test - * @returns Is the point contained - */ - containsPoint(point: Point): boolean; - - /** - * Steps that must be performed when the base source is destroyed. - */ - destroy(): void; - - fovTexture?: PIXI.RenderTexture | undefined; +export {}; + +declare global { + /** + * An abstract base class which defines a framework for effect sources which originate radially from a specific point. + * This abstraction is used by the LightSource, VisionSource, SoundSource, and MovementSource subclasses. + * + * @example A standard PointSource lifecycle: + * ```js + * const source = new PointSource({object}); // Create the point source + * source.initialize(data); // Configure the point source with new data + * source.refresh(); // Refresh the point source + * source.destroy(); // Destroy the point source + * ``` + */ + abstract class PointSource { + constructor(options?: { + /** Some other object which is responsible for this source */ + object: PlaceableObject; + }); + + /** + * The type of source represented by this data structure. + * Each subclass must implement this attribute. + * @remarks This is undefined in PointSource. + */ + static sourceType: string | undefined; + + /** + * Some other object which is responsible for this source. + */ + object: PlaceableObject | null; + + /** + * The object of data which configures how this source is rendered + * @defaultValue `{}` + */ + data: Partial; + + /** The polygonal shape of the point source, generated from its origin, radius, and other data. */ + shape: PointSourcePolygon | PIXI.Polygon; + + /** + * Additional information which controls whether certain behaviors of the source must be enforced + * @defaultValue `{}` + */ + protected _flags: { + renderFOV?: boolean; + } & Record; + + /** + * Returns the update ID associated with this point source. + * The update ID is increased whenever the source is initialized. + * @defaultValue `0` + */ + get updateId(): number; + + /** + * Is this point source currently active? + * Returns false if the source is disabled, temporarily suppressed, or not initialized. + * @defaultValue `false` + */ + get active(): boolean; + + /** + * Is this source currently disabled? + * Returns false if the source hasn't been initialized yet. + * @defaultValue `true` + */ + get disabled(): boolean; + + /** + * Has this point source been initialized? + * @defaultValue `false` + */ + get initialized(): boolean; + + /** + * The x-coordinate of the point source origin. + */ + get x(): number | undefined; + + /** + * The y-coordinate of the point source origin. + */ + get y(): number | undefined; + + /** + * The elevation bound to this source. + */ + get elevation(): number; + + /** + * A convenience reference to the radius of the source. + * @defaultValue `0` + */ + get radius(): number; + + /** + * Initialize and configure the PointSource using provided data. + * @param data - Provided data for configuration + * @returns The configured source + */ + initialize(data?: Partial): this; + + /** + * Subclass specific data initialization steps. + * This method is responsible for populating the instance data object. + * @param data - Provided data for configuration + */ + protected _initialize(data: Partial): void; + + /** + * Subclass specific configuration steps. Occurs after data initialization and shape computation. + * @param changes - The fields of data which changed during initialization + */ + protected _configure(changes: Partial): void; + + /** + * Refresh the state and uniforms of the PointSource. + */ + refresh(): void; + + /** + * Test whether this source should be active under current conditions? + */ + protected _isActive(): boolean; + + /** + * Subclass-specific refresh steps. + */ + protected abstract _refresh(): void; + + /** + * Steps that must be performed when the base source is destroyed. + */ + destroy(): void; + + /** + * Subclass specific destruction steps. + */ + protected abstract _destroy(): void; + + /** + * Configure the parameters of the polygon that is generated for this source. + */ + protected _getPolygonConfiguration(): PointSourcePolygonConfig; + + /** + * Create the polygon shape for this source using configured data. + * @remarks Listed return type is PointSourcePolygon + * @remarks Actual return: CONFIG.Canvas.polygonBackends[this.constructor.sourceType].create(...) + * It might be possible to derive the exact polygon type based on that. + */ + protected _createPolygon(): PIXI.Polygon; + + /** + * The type of source represented by this data structure. + * @deprecated since v11, will be removed in v13. + * @remarks Use PointSource#constructor.sourceType instead. + */ + get sourceType(): (typeof PointSource)["sourceType"]; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks The setter PointSource#radius is deprecated. + * @remarks The radius should not be set anywhere except in PointSource#_initialize. + */ + set radius(radius); + + /** + * @deprecated since v11, will be removed in v13 + * @remarks PointSource#los is deprecated in favor of PointSource#shape. + */ + get los(): PointSourcePolygon | PIXI.Polygon; + + /** + * @deprecated since v11, will be removed in v13 + * @remarks PointSource#los is deprecated in favor of PointSource#shape. + */ + set los(shape: PointSourcePolygon | PIXI.Polygon); + + /** + * @deprecated since v10, will be removed in v12 + * @remarks PointSource#refreshSource is deprecated in favor of PointSource#refresh. + */ + refreshSource(): void; + } - abstract initialize(data?: Partial): this; + interface PointSourceData { + /** The x-coordinate of the source location */ + x: number; - /** - * Get power of 2 size pertaining to base-source radius and performance modes - * @returns The computed power of 2 size - */ - getPowerOf2Size(): number; + /** The y-coordinate of the source location */ + y: number; - /** - * Create a new Mesh for this source using a provided shader class - * @param shaderCls - The subclass of AdaptiveLightingShader being used for this Mesh - * @returns The created Mesh - */ - protected _createMesh(shaderCls: ConstructorOf): PIXI.Mesh; + /** The elevation of the point source */ + elevation: number; - /** - * Update the position and size of the mesh each time it is drawn. - * @param mesh - The Mesh being updated - * @returns The updated Mesh - */ - protected _updateMesh(mesh: PIXI.Mesh): PIXI.Mesh; + /** An index for sorting the source relative to others at the same elevation */ + z: number | null; - /** - * Render this source to a texture which can be used for masking and blurring. - */ - protected _renderTexture(): PIXI.RenderTexture; + /** The radius of the source */ + radius: number; - /** - * Create a container that should be rendered to the fov texture for this source - * @returns The drawn container for the render texture - */ - protected _drawRenderTextureContainer(): PIXI.Container; -} + /** A secondary radius used for limited angles */ + externalRadius: number; -declare namespace PointSource { - interface Data { - /** The x-coordinate of the source location */ - x?: number; + /** The angle of rotation for this point source */ + rotation: number; - /** The y-coordinate of the source location */ - y?: number; + /** The angle of emission for this point source */ + angle: number; /** Whether or not the source is constrained by walls */ - walls?: boolean; + walls: boolean; + + /** Whether or not the source is disabled */ + disabled: boolean; } } diff --git a/src/foundry/client/pixi/sources/index.d.ts b/src/foundry/client/pixi/sources/index.d.ts index 8d58f6973..d4ba63cd7 100644 --- a/src/foundry/client/pixi/sources/index.d.ts +++ b/src/foundry/client/pixi/sources/index.d.ts @@ -1,4 +1,6 @@ import "./base-source"; import "./light-source"; +import "./movement-source"; +import "./rendered-source"; import "./sound-source"; import "./vision-source"; diff --git a/src/foundry/client/pixi/sources/light-source.d.ts b/src/foundry/client/pixi/sources/light-source.d.ts index 11d3a483b..fb6b17212 100644 --- a/src/foundry/client/pixi/sources/light-source.d.ts +++ b/src/foundry/client/pixi/sources/light-source.d.ts @@ -1,26 +1,10 @@ -import type { ConfiguredObjectClassForName } from "../../../../types/helperTypes"; +export {}; -declare global { - /** @see {@link foundry.data.LightData} */ - interface LightSourceData extends PointSource.Data { - /** @defaultValue `0` */ - x: number; - - /** @defaultValue `0` */ - y: number; - - /** - * An optional z-index sorting for the source - * @defaultValue `null` - */ - z: number | null; - - /** - * The angle of rotation for this point source - * @defaultValue `0` - */ - rotation: number; +// TODO: Define in client/pixi/layers/effects/visibility.js +type CanvasVisibilityTest = unknown; +declare global { + interface LightSourceData extends RenderedPointSourceData { /** * An opacity for the emitted light, if any * @defaultValue `0.5` @@ -29,15 +13,9 @@ declare global { /** * An animation configuration for the source - * @defaultValue `{ type: null }` - */ - animation: LightAnimationConfiguration; - - /** - * The angle of emission for this point source - * @defaultValue `360` + * @defaultValue `{}` */ - angle: number; + animation: RenderedPointSource.RenderedPointSourceAnimationConfig; /** * The allowed radius of bright vision or illumination @@ -45,12 +23,6 @@ declare global { */ bright: number; - /** - * A tint color for the emitted light, if any - * @defaultValue `null` - */ - color: number | null; - /** * The coloration technique applied in the shader * @defaultValue `1` @@ -59,270 +31,101 @@ declare global { /** * The amount of contrast this light applies to the background texture - * @defaultValue `0.0` + * @defaultValue `0` */ contrast: number; - /** - * A darkness range (min and max) for which the source should be active - * @defaultValue `{ min: 0, max: 1 }` - */ - darkness: { min: number; max: number }; - /** * The allowed radius of dim vision or illumination * @defaultValue `0` */ dim: number; - /** Fade the difference between bright, dim, and dark gradually? */ - gradual: boolean; + /** + * Strength of the attenuation between bright, dim, and dark + * @defaultValue `0.5` + */ + attenuation: number; /** * The luminosity applied in the shader - * @defaultValue `0.0` + * @defaultValue `0.5` */ luminosity: number; /** * The amount of color saturation this light applies to the background texture - * @defaultValue `0.0` + * @defaultValue `0` */ saturation: number; /** * The depth of shadows this light applies to the background texture - * @defaultValue `0.0` + * @defaultValue `0` */ shadows: number; - /** @defaultValue `true` */ - walls: boolean; - /** * Whether or not this source provides a source of vision * @defaultValue `false` */ vision: boolean; - - /** An integer seed to synchronize (or de-synchronize) animations */ - seed: number; - } - - interface LightAnimationConfiguration { - /** The human-readable (localized) label for the animation */ - label: string; - - /** The animation function that runs every frame */ - animation: (this: LightSource, dt: number, animation: LightAnimationConfiguration) => void; - - /** A custom illumination shader used by this animation */ - illuminationShader: AdaptiveIlluminationShader; - - /** A custom coloration shader used by this animation */ - colorationShader: AdaptiveColorationShader; - - /** A custom background shader used by this animation */ - backgroundShader: AdaptiveBackgroundShader; - - /** The animation seed */ - seed?: number; - - /** The animation time */ - time?: number; - - /** @defaultValue `null` */ - type?: keyof typeof CONFIG.Canvas.lightAnimations | null; } /** * A specialized subclass of the PointSource abstraction which is used to control the rendering of light sources. */ - class LightSource extends PointSource { - /** @param object - The light-emitting object that generates this light source */ - constructor(object: InstanceType>); - - /** - * The light or darkness container for this source - * @defaultValue `this._createMesh(AdaptiveBackgroundShader)` - */ - background: PIXI.Mesh; - - /** - * The light or darkness container for this source - * @defaultValue `this._createMesh(AdaptiveIlluminationShader)` - */ - illumination: PIXI.Mesh; - - /** - * This visible color container for this source - * @defaultValue `this._createMesh(AdaptiveColorationShader)` - */ - coloration: PIXI.Mesh; - + class LightSource extends RenderedPointSource { static override sourceType: "light"; - /** - * Strength of the blur for light source edges - * @defaultValue `3` - */ - static BLUR_STRENGTH: number; + protected static _initializeShaderKeys: ["animation.type", "walls"]; - /** - * Keys in the LightSourceData structure which, when modified, change the appearance of the light - * @internal - * @defaultValue - * ```javascript - * [ - * "dim", "bright", "gradual", "alpha", "coloration", "color", - * "contrast", "saturation", "shadows", "luminosity" - * ] - * ``` - */ - protected static _appearanceKeys: string[]; + static override _refreshUniformsKeys: [ + "dim", + "bright", + "attenuation", + "alpha", + "coloration", + "color", + "contrast", + "saturation", + "shadows", + "luminosity", + ]; /** * The object of data which configures how the source is rendered - * @defaultValue `{}` - */ - data: Partial; - - /** - * The animation configuration applied to this source - * @defaultValue `{}` - */ - animation: LightAnimationConfiguration; - - /** - * Internal flag for whether this is a darkness source - * @defaultValue `false` - */ - isDarkness: boolean; - - /** - * The rendered field-of-vision texture for the source for use within shaders. - * @defaultValue `undefined` */ - fovTexture: PIXI.RenderTexture | undefined; - - /** - * To know if a light source is a preview or not. False by default. - * @defaultValue `false` - */ - preview: boolean; + data: LightSourceData; /** * The ratio of dim:bright as part of the source radius - * @defaultValue `undefined` + * @defaultValue `0` */ - ratio: number | undefined; + ratio: number; /** - * Track which uniforms need to be reset - * @internal - * @defaultValue - * ```javascript - * { - * background: true, - * illumination: true, - * coloration: true - * } - * ``` + * Is this darkness? */ - protected _resetUniforms: { - background: boolean; - illumination: boolean; - coloration: boolean; - }; + get isDarkness(): boolean; - /** - * To track if a source is temporarily shutdown to avoid glitches - * @defaultValue `{ illumination: false }` - * @internal - */ - protected _shutdown: { illumination: boolean }; + protected _initialize(data: Partial): void; - /** - * Initialize the source with provided object data. - * @param data - Initial data provided to the point source - * @returns A reference to the initialized source - */ - initialize(data?: Partial & { color?: string | number | null }): this; + protected override _configure(changes: Partial): void; - /** - * Initialize the PointSource with new input data - * @param data - Initial data provided to the light source - * @returns The changes compared to the prior data - * @internal - */ - protected _initializeData( - data: Partial & { color?: string | number | null }, - ): Partial; + protected override _getPolygonConfiguration(): PointSourcePolygonConfig; - /** - * Initialize the shaders used for this source, swapping to a different shader if the animation has changed. - * @internal - */ - protected _initializeShaders(): void; + protected override _initializeBlending(): void; - /** - * Initialize the blend mode and vertical sorting of this source relative to others in the container. - * @internal - */ - protected _initializeBlending(): void; - - /** - * Render the containers used to represent this light source within the LightingLayer - */ - drawMeshes(): { - background: ReturnType; - light: ReturnType; - color: ReturnType; - }; - - /** - * Draw the display of this source for background container. - * @returns The rendered light container - */ - drawBackground(): PIXI.Container | null; + protected override _updateColorationUniforms(): void; - /** - * Draw the display of this source for the darkness/light container of the SightLayer. - * @returns The rendered light container - */ - drawLight(): PIXI.Container | null; + protected override _updateIlluminationUniforms(): void; - /** - * Draw and return a container used to depict the visible color tint of the light source on the LightingLayer - * @returns An updated color container for the source - */ - drawColor(): PIXI.Container | null; - - /** - * Update shader uniforms by providing data from this PointSource - * @param shader - The shader being updated - * @internal - */ - protected _updateColorationUniforms(shader: AdaptiveColorationShader): void; - - /** - * Update shader uniforms by providing data from this PointSource - * @param shader - The shader being updated - * @internal - */ - protected _updateIlluminationUniforms(shader: AdaptiveIlluminationShader): void; - - /** - * Update shader uniforms by providing data from this PointSource - * @param shader - The shader being updated - * @internal - */ - protected _updateBackgroundUniforms(shader: AdaptiveBackgroundShader): void; + protected override _updateBackgroundUniforms(): void; /** * Update shader uniforms shared by all shader types * @param shader - The shader being updated - * @internal */ protected _updateCommonUniforms(shader: AdaptiveLightingShader): void; @@ -338,76 +141,120 @@ declare global { protected _mapLuminosity(lum: number): number; /** - * Animate the PointSource, if an animation is enabled and if it currently has rendered containers. - * @param dt - Delta time + * A torch animation where the luminosity and coloration decays each frame and is revitalized by flashes + * @param dt - Delta time + * @param options - Additional options which modify the flame animation */ - animate(dt: number): void; + animateTorch( + dt: number, + options?: { + /** + * The animation speed, from 1 to 10 + * (default: `5`) + */ + speed: number; + /** + * The animation intensity, from 1 to 10 + * (default: `5`) + */ + intensity: number; + /** + * Reverse the animation direction + * (default: `false`) + */ + reverse: boolean; + }, + ): void; /** - * A torch animation where the luminosity and coloration decays each frame and is revitalized by flashes - * @param dt - Delta time - * @param speed - The animation speed, from 1 to 10 - * (default: `5`) - * @param intensity - The animation intensity, from 1 to 10 - * (default: `5`) + * An animation with flickering ratio and light intensity + * @param dt - Delta time + * @param options - Additional options which modify the flame animation */ - animateTorch(dt: number, { speed, intensity }?: { speed: number; intensity: number }): void; + animateFlickering( + dt: number, + options?: { + /** + * The animation speed, from 1 to 10 + * (default: `5`) + */ + speed: number; + /** + * The animation intensity, from 1 to 10 + * (default: `5`) + */ + intensity: number; + /** + * Noise amplification (\>1) or dampening (\<1) + * (default: 1) + */ + amplification: number; + /** + * Reverse the animation direction + * (default: `false`) + */ + reverse: boolean; + }, + ): void; /** * A basic "pulse" animation which expands and contracts. * @param dt - Delta time - * @param speed - The animation speed, from 1 to 10 - * (default: `5`) - * @param intensity - The animation intensity, from 1 to 10 - * (default: `5`) - * @param reverse - Is the animation reversed? - * (default: `false`) + * @param options - Additional options which modify the flame animation */ animatePulse( dt: number, - { speed, intensity, reverse }?: { speed?: number; intensity?: number; reverse?: boolean }, + options?: { + /** + * The animation speed, from 1 to 10 + * (default: `5`) + */ + speed: number; + /** + * The animation intensity, from 1 to 10 + * (default: `5`) + */ + intensity: number; + /** + * Reverse the animation direction + * (default: `false`) + */ + reverse: boolean; + }, ): void; /** - * Emanate waves of light from the source origin point - * @param dt - Delta time - * @param speed - The animation speed, from 1 to 10 - * (default: `5`) - * @param intensity - The animation intensity, from 1 to 10 - * (default: `5`) - * @param reverse - Is the animation reversed? - * (default: `false`) + * Test whether this LightSource provides visibility to see a certain target object. + * @param config - The visibility test configuration + * @returns Is the target object visible to this source? */ - animateTime( - dt: number, - { speed, intensity, reverse }?: { speed?: number; intensity?: number; reverse?: boolean }, - ): void; + testVisibility(config: { + /** The sequence of tests to perform */ + tests: CanvasVisibilityTest[]; + /** The target object being tested */ + object: PlaceableObject; + }): boolean; /** - * Evolve a value using a stochastic AR(1) process - * @param y - The current value - * @param phi - The decay rate of prior values - * (default: `0.5`) - * @param center - The stationary mean of the series - * (default: `0`) - * @param sigma - The volatility of the process - standard deviation of the error term - * (default: `0.1`) - * @param max - The maximum allowed outcome, or null - * (default: `null`) - * @param min - The minimum allowed outcome, or null - * (default: `null`) - * @returns The new value of the process - * @internal + * Can this LightSource theoretically detect a certain object based on its properties? + * This check should not consider the relative positions of either object, only their state. + * @param target - The target object being tested + * @returns Can the target object theoretically be detected by this vision source? + */ + _canDetectObject(target: PlaceableObject): boolean; + } + + /** + * A specialized subclass of the LightSource which is used to render global light source linked to the scene. + */ + class GlobalLightSource extends LightSource { + override _createPolygon(): PIXI.Polygon; + + protected override _configureSoftEdges(): void; + + /** + * @remarks Sets attenuation to 0 */ - protected _ar1( - y: number, - { - phi, - center, - sigma, - max, - min, - }?: { phi?: number; center?: number; sigma?: number; max?: number | null; min?: number | null }, - ): number; + protected override _initialize(data: Partial): void; } } diff --git a/src/foundry/client/pixi/sources/movement-source.d.ts b/src/foundry/client/pixi/sources/movement-source.d.ts new file mode 100644 index 000000000..e08db80ac --- /dev/null +++ b/src/foundry/client/pixi/sources/movement-source.d.ts @@ -0,0 +1,13 @@ +export {}; + +declare global { + class MovementSource extends PointSource { + static override sourceType: "move"; + + /** @remarks A no-op */ + protected _refresh(): void; + + /** @remarks A no-op */ + protected _destroy(): void; + } +} diff --git a/src/foundry/client/pixi/sources/rendered-source.d.ts b/src/foundry/client/pixi/sources/rendered-source.d.ts new file mode 100644 index 000000000..5e69b1fa5 --- /dev/null +++ b/src/foundry/client/pixi/sources/rendered-source.d.ts @@ -0,0 +1,238 @@ +export {}; + +/** TODO: Declared in client/pixi/core/containers/point-source-mesh */ +type PointSourceMesh = unknown; + +declare global { + interface RenderedPointSourceData extends PointSourceData { + /** A color applied to the rendered effect */ + color: number | null; + + /** An integer seed to synchronize (or de-synchronize) animations */ + seed: number | null; + + /** Is this source a temporary preview? */ + preview: boolean; + } + + namespace RenderedPointSource { + type RenderedPointSourceAnimationConfig = InexactPartial<{ + /** The human-readable (localized) label for the animation */ + label: string; + + /** The animation function that runs every frame */ + animation: (dt: number, options: RenderedPointSourceAnimationConfig) => number; + + /** A custom illumination shader used by this animation */ + illuminationShader: AdaptiveIlluminationShader; + + /** A custom coloration shader used by this animation */ + colorationShader: AdaptiveColorationShader; + + /** A custom background shader used by this animation */ + backgroundShader: AdaptiveBackgroundShader; + + /** The animation seed */ + seed: number; + + /** The animation time */ + time: number; + }>; + + type RenderedPointSourceLayer = { + /** Is this layer actively rendered? */ + active?: boolean; + /** Do uniforms need to be reset? */ + reset?: boolean; + /** Is this layer temporarily suppressed? */ + suppressed?: boolean; + /** The rendered mesh for this layer */ + mesh?: PointSourceMesh; + /** The shader instance used for the layer */ + shader?: AdaptiveLightingShader; + }; + } + + class RenderedPointSource extends PointSource { + /** + * Keys of the data object which require shaders to be re-initialized. + */ + protected static _initializeShaderKeys: string[]; + + /** + * Keys of the data object which require uniforms to be refreshed. + */ + protected static _refreshUniformsKeys: string[]; + + /** + * The offset in pixels applied to create soft edges. + * @defaultValue `-8` + */ + static EDGE_OFFSET: number; + + /** + * The animation configuration applied to this source + * @defaultValue `{}` + */ + animation: RenderedPointSource.RenderedPointSourceAnimationConfig; + + /** + * The object of data which configures how the source is rendered + */ + data: RenderedPointSourceData; + + /** + * Track the status of rendering layers + */ + layers: { + background: RenderedPointSource.RenderedPointSourceLayer; + coloration: RenderedPointSource.RenderedPointSourceLayer; + illumination: RenderedPointSource.RenderedPointSourceLayer; + }; + + /** + * The color of the source as a RGB vector. + */ + colorRGB: [number, number, number] | null; + + /** + * A convenience accessor to the background layer mesh. + */ + get background(): PointSourceMesh; + + /** + * A convenience accessor to the coloration layer mesh. + */ + get coloration(): PointSourceMesh; + + /** + * A convenience accessor to the illumination layer mesh. + */ + get illumination(): PointSourceMesh; + + /** + * Is the rendered source animated? + */ + get isAnimated(): boolean; + + /** + * Has the rendered source at least one active layer? + */ + get hasActiveLayer(): boolean; + + /** + * Is this RenderedPointSource a temporary preview? + */ + get isPreview(): boolean; + + protected override _initialize(data: InexactPartial): void; + + protected override _configure(changes: InexactPartial): void; + + /** + * Decide whether to render soft edges with a blur. + */ + protected _configureSoftEdges(): void; + + /** + * Configure the derived color attributes and associated flag. + * @param color - The color to configure (usually a color coming for the rendered point source data) or null if no color is configured for this rendered source. + */ + protected _configureColorAttributes(color: number | null): void; + + /** + * Configure which shaders are used for each rendered layer. + * @internal + */ + protected _configureShaders(): { + background: AdaptiveLightingShader; + coloration: AdaptiveLightingShader; + illumination: AdaptiveLightingShader; + }; + + /** + * Specific configuration for a layer. + */ + protected _configureLayer(layer: RenderedPointSource.RenderedPointSourceLayer, layerId: string): void; + + /** + * Initialize the blend mode and vertical sorting of this source relative to others in the container. + */ + protected _initializeBlending(): void; + + /** + * Render the containers used to represent this light source within the LightingLayer + */ + drawMeshes(): { background: PIXI.Mesh; coloration: PIXI.Mesh; illumination: PIXI.Mesh }; + + override _refresh(): void; + + protected _isActive(): boolean; + + /** + * Update shader uniforms used for the background layer. + */ + protected _updateBackgroundUniforms(): void; + + /** + * Update shader uniforms used for the coloration layer. + */ + protected _updateColorationUniforms(): void; + + /** + * Update shader uniforms used for the illumination layer. + */ + protected _updateIlluminationUniforms(): void; + + protected override _destroy(): void; + + /** + * Animate the PointSource, if an animation is enabled and if it currently has rendered containers. + * @param dt - Delta time. + * @remarks Returns `this.animation.animation.call(this, dt, options)` + */ + animate(dt: number): number | undefined; + + /** + * Generic time-based animation used for Rendered Point Sources. + * @param dt - Delta time. + * @param options - Options which affect the time animation + */ + animateTime( + dt: number, + options?: { + /** + * The animation speed, from 1 to 10 + * (default: `5`) + */ + speed: number; + + /** + * The animation intensity, from 1 to 10 + * (default: `5`) + */ + intensity: number; + + /** + * Reverse the animation direction + * (default: `false`) + */ + reverse: boolean; + }, + ): void; + + /** + * @deprecated since v11, will be removed in v13. + * @remarks The RenderedPointSource#preview is deprecated. + * @remarks Use RenderedPointSource#isPreview instead. + */ + get preview(): boolean; + + /** + * @deprecated since v11, will be removed in v13. + * @remarks The RenderedPointSource#preview is deprecated. + * @remarks Set RenderedPointSourceData#preview as part of RenderedPointSourceData#initialize instead. + */ + set preview(preview); + } +} diff --git a/src/foundry/client/pixi/sources/sound-source.d.ts b/src/foundry/client/pixi/sources/sound-source.d.ts index b9ef74d9a..76ba4ff0f 100644 --- a/src/foundry/client/pixi/sources/sound-source.d.ts +++ b/src/foundry/client/pixi/sources/sound-source.d.ts @@ -1,45 +1,18 @@ -import type { ConfiguredObjectClassForName } from "../../../../types/helperTypes"; +export {}; declare global { - interface SoundSourceData extends PointSource.Data { - x: number; - - y: number; - - /** The radius of the sound effect */ - radius: number; - - walls: boolean; - } - /** * A specialized subclass of the PointSource abstraction which is used to control the rendering of sound sources. */ class SoundSource extends PointSource { - /** @param object - The AmbientSound object that generates this sound source */ - constructor(object: InstanceType>); - static override sourceType: "sound"; - /** - * The object of data which configures how the source is rendered - * @defaultValue `{}` - */ - data: Partial; + protected override _getPolygonConfiguration(): PointSourcePolygonConfig & { useThreshold: true }; - /** - * Initialize the source with provided object data. - * @param data - Initial data provided to the point source - * @returns A reference to the initialized source - */ - initialize(data?: Partial): this; + /** @remarks A no-op */ + protected _refresh(): void; - /** - * Process new input data provided to the SoundSource. - * @param data - Initial data provided to the sound source - * @returns The changes compared to the prior data - * @internal - */ - protected _initializeData(data: Partial): void; + /** @remarks A no-op */ + protected _destroy(): void; } } diff --git a/src/foundry/client/pixi/sources/vision-source.d.ts b/src/foundry/client/pixi/sources/vision-source.d.ts index 7272da45b..1dd839b48 100644 --- a/src/foundry/client/pixi/sources/vision-source.d.ts +++ b/src/foundry/client/pixi/sources/vision-source.d.ts @@ -1,123 +1,145 @@ -import type { ConfiguredObjectClassForName } from "../../../../types/helperTypes"; +export {}; -declare global { - interface VisionSourceData extends Exclude { - x: number; - - y: number; - - /** An optional z-index sorting for the source */ - z: number; - - /** The angle of rotation for this point source */ - rotation: number; - - /** The angle of emission for this point source */ - angle: number; - - /** The allowed radius of bright vision or illumination */ - bright: number; - - /** The allowed radius of dim vision or illumination */ - dim: number; - } +// TODO: Define in client/pixi/webgl/shaders/effects/vision +type AdaptiveVisionShader = unknown; +declare global { /** * A specialized subclass of the PointSource abstraction which is used to control the rendering of vision sources. */ - class VisionSource extends PointSource { - /** @param object - The Token object that generates this vision source */ - constructor(object: InstanceType>); + class VisionSource extends RenderedPointSource { + static override sourceType: "sight"; - /** - * The current vision mesh for this source - * @defaultValue `this._createMesh(AdaptiveIlluminationShader)` - */ - illumination: PIXI.Mesh; + static override _refreshUniformsKeys: [ + "radius", + "color", + "attenuation", + "brightness", + "contrast", + "saturation", + "visionMode", + ]; - static override sourceType: "vision"; + static override EDGE_OFFSET: -2; /** - * Keys in the VisionSourceData structure which, when modified, change the appearance of the source - * @defaultValue `["dim", "bright"]` - * @internal + * The object of data which configures how the source is rendered */ - protected static _appearanceKeys: string[]; + data: VisionSourceData; /** - * The object of data which configures how the source is rendered - * @defaultValue `{}` + * The vision mode linked to this VisionSource + * @defaultValue `null` */ - data: Partial; + visionMode: VisionMode | null; /** - * The ratio of dim:bright as part of the source radius - * @defaultValue `undefined` + * The vision mode activation flag for handlers + * @defaultValue `false` + * @internal */ - ratio: number | undefined; + protected _visionModeActivated: boolean; /** - * The rendered field-of-vision texture for the source for use within shaders. - * @defaultValue `undefined` + * The unconstrained LOS polygon. + * @privateRemarks This is actually a true property and the getter in PointSource will be deprecated in v13 */ - fovTexture: PIXI.RenderTexture | undefined; + get los(): PointSourcePolygon; + + /** The constrained LOS polygon that is generated by the origin and radius of this source. */ + get fov(): PointSourcePolygon | PIXI.Polygon; /** - * Track which uniforms need to be reset - * @defaultValue `{ illumination: true }` - * @internal + * If this vision source background is rendered into the lighting container. */ - protected _resetUniforms: { illumination: boolean }; + get preferred(): boolean; + + override get isAnimated(): boolean; + + protected override _initialize(data: Partial): void; + + protected override _configure(changes: Partial): void; + + protected override _configureLayer(layer: RenderedPointSource.RenderedPointSourceLayer, layerId: string): void; + + /** Responsible for assigning the Vision Mode and handling exceptions based on vision special status. */ + protected _initializeVisionMode(): void; + + override _getPolygonConfiguration(): PointSourcePolygonConfig; + + /** Create a restricted FOV polygon by limiting the radius of the unrestricted LOS polygon. */ + protected _createRestrictedPolygon(): PointSourcePolygon; + + protected override _configureShaders(): { + background: AdaptiveLightingShader; + coloration: AdaptiveLightingShader; + illumination: AdaptiveLightingShader; + }; /** - * To track if a source is temporarily shutdown to avoid glitches - * @defaultValue `{ illumination: false }` - * @internal + * Update shader uniforms by providing data from this VisionSource */ - protected _shutdown: { illumination: boolean }; + protected _updateColorationUniforms(): void; /** - * Initialize the source with provided object data. - * @param data - Initial data provided to the point source - * @returns A reference to the initialized source + * Update shader uniforms by providing data from this VisionSource */ - initialize(data?: Partial): this; + protected _updateIlluminationUniforms(): void; - fov?: PIXI.Circle; + /** + * Update shader uniforms by providing data from this VisionSource + */ + protected _updateBackgroundUniforms(): void; /** - * Initialize the blend mode and vertical sorting of this source relative to others in the container. + * Update shader uniforms shared by all shader types + * @param shader - The shader being updated * @internal */ - protected _initializeBlending(): void; + _updateCommonUniforms(shader: AdaptiveVisionShader): void; /** - * Process new input data provided to the LightSource. - * @param data - Initial data provided to the vision source - * @returns The changes compared to the prior data + * Update layer uniforms according to vision mode uniforms, if any. + * @param shader - The shader being updated. + * @param vmUniforms - The targeted layer. * @internal */ - protected _initializeData(data: Partial): Partial; + _updateVisionModeUniforms( + shader: AdaptiveVisionShader, + vmUniforms: Array<[uniform: string, value: AbstractBaseShader.UniformValue]>, + ): void; + } + interface VisionSourceData extends RenderedPointSourceData { /** - * Draw the display of this source to remove darkness from the LightingLayer illumination container. - * @see LightSource#drawLight - * @returns The rendered light container + * The amount of contrast + * @defaultValue `0` */ - drawVision(): PIXI.Container | null; - + contrast: number; /** - * Draw a Container used for exploring the FOV area of Token sight in the SightLayer + * Strength of the attenuation between bright, dim, and dark + * @defaultValue `0.5` */ - drawSight(): PIXI.Container; - + attenuation: number; /** - * Update shader uniforms by providing data from this PointSource - * @param shader - The shader being updated - * @internal + * The amount of color saturation + * @defaultValue `0` */ - protected _updateIlluminationUniforms(shader: AdaptiveIlluminationShader): void; - - protected override _drawRenderTextureContainer(): PIXI.Container; + saturation: number; + /** + * The vision brightness. + * @defaultValue `0` + */ + brightness: number; + /** + * The vision mode. + * @defaultValue `"basic"` + * */ + visionMode: string; + /** + * Is this vision source blinded? + * @defaultValue `false` + * */ + blinded: boolean; } } diff --git a/src/foundry/client/pixi/webgl/base.d.ts b/src/foundry/client/pixi/webgl/base.d.ts index 3250489c7..08f3035d4 100644 --- a/src/foundry/client/pixi/webgl/base.d.ts +++ b/src/foundry/client/pixi/webgl/base.d.ts @@ -2,9 +2,6 @@ * This class defines an interface which all shaders utilize */ declare abstract class AbstractBaseShader extends PIXI.Shader { - /** The current uniforms of the Shader */ - uniforms: AbstractBaseShader.Uniforms; - constructor(program: PIXI.Program, uniforms: AbstractBaseShader.Uniforms); /** diff --git a/src/foundry/client/pixi/webgl/filters.d.ts b/src/foundry/client/pixi/webgl/filters.d.ts index 0b12e6263..768ccf030 100644 --- a/src/foundry/client/pixi/webgl/filters.d.ts +++ b/src/foundry/client/pixi/webgl/filters.d.ts @@ -27,7 +27,7 @@ declare abstract class AbstractBaseMaskFilter extends PIXI.Filter { ): T; override apply( - filterManager: PIXI.systems.FilterSystem, + filterManager: PIXI.FilterSystem, input: PIXI.RenderTexture, output: PIXI.RenderTexture, clear: PIXI.CLEAR_MODES, @@ -86,13 +86,13 @@ declare abstract class AbstractFilter extends PIXI.Filter { /** * Always target the resolution of the render texture or renderer */ - // @ts-expect-error this is a property on PIXI.Filter get resolution(): number; set resolution(value: number); /** * Always target the MSAA level of the render texture or renderer */ + // @ts-expect-error this is a property on PIXI.Filter get multisample(): PIXI.MSAA_QUALITY; set multisample(value: PIXI.MSAA_QUALITY); } diff --git a/src/types/augments/index.d.ts b/src/types/augments/index.d.ts index ae8d8e9f2..8d7314942 100644 --- a/src/types/augments/index.d.ts +++ b/src/types/augments/index.d.ts @@ -1,7 +1,4 @@ -import "./pixiGraphics"; -import "./pixiGraphicsSmooth"; -import "./pixiLegacyGraphics"; -import "./pixiParticleEmitter"; +import "./pixi"; import "./simple-peer"; import "./socket.io-client"; import "./tinyMCE"; diff --git a/src/types/augments/pixi.d.ts b/src/types/augments/pixi.d.ts new file mode 100644 index 000000000..6a9752e1d --- /dev/null +++ b/src/types/augments/pixi.d.ts @@ -0,0 +1,60 @@ +import * as PIXI from "pixi.js"; +import * as pixiParticles from "@pixi/particle-emitter"; +import * as graphicsSmooth from "@pixi/graphics-smooth"; + +/** + * Foundry exports PIXI into the global namespace + */ +export = PIXI; +export as namespace PIXI; + +declare global { + namespace PIXI { + export import smooth = graphicsSmooth; + export import particles = pixiParticles; + + export const LegacyGraphics: typeof PIXI.Graphics; + export class Graphics extends PIXI.smooth.SmoothGraphics {} + + enum UPDATE_PRIORITY { + /** + * Highest priority used for interaction events in {@link PIXI.EventSystem} + * @defaultValue 50 + */ + INTERACTION = 50, + /** + * High priority updating, used by {@link PIXI.AnimatedSprite} + * @defaultValue 25 + */ + HIGH = 25, + + /** + * @remarks Foundry defined custom ticker priority + * Handled in Canvas##activateTicker + */ + OBJECTS = 23, + + /** + * @remarks Foundry defined custom ticker priority + * Handled in Canvas##activateTicker + */ + PERCEPTION = 2, + + /** + * defaultValue priority for ticker events, see {@link PIXI.Ticker#add}. + * @defaultValue 0 + */ + NORMAL = 0, + /** + * Low priority used for {@link PIXI.Application} rendering. + * @defaultValue -25 + */ + LOW = -25, + /** + * Lowest priority used for {@link PIXI.BasePrepare} utility. + * @defaultValue -50 + */ + UTILITY = -50, + } + } +} diff --git a/src/types/augments/pixiGraphics.d.ts b/src/types/augments/pixiGraphics.d.ts deleted file mode 100644 index 5c8d19dec..000000000 --- a/src/types/augments/pixiGraphics.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare global { - namespace PIXI { - interface Graphics { - nextRoundedRectBehavior: boolean; - } - } -} - -export {}; diff --git a/src/types/augments/pixiGraphicsSmooth.d.ts b/src/types/augments/pixiGraphicsSmooth.d.ts deleted file mode 100644 index 3103282bd..000000000 --- a/src/types/augments/pixiGraphicsSmooth.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as graphicsSmooth from "@pixi/graphics-smooth"; - -declare global { - namespace PIXI { - export import smooth = graphicsSmooth; // eslint-disable-line @typescript-eslint/no-unused-vars - } -} diff --git a/src/types/augments/pixiLegacyGraphics.d.ts b/src/types/augments/pixiLegacyGraphics.d.ts deleted file mode 100644 index 3c45b87ee..000000000 --- a/src/types/augments/pixiLegacyGraphics.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -declare global { - namespace PIXI { - export const LegacyGraphics: typeof PIXI.Graphics & { - nextRoundedRectBehavior: boolean; - }; - } -} - -export {}; diff --git a/src/types/augments/pixiParticleEmitter.d.ts b/src/types/augments/pixiParticleEmitter.d.ts deleted file mode 100644 index c7e75ec96..000000000 --- a/src/types/augments/pixiParticleEmitter.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import * as pixiParticles from "@pixi/particle-emitter"; - -declare global { - namespace PIXI { - export import particles = pixiParticles; // eslint-disable-line @typescript-eslint/no-unused-vars - } -} diff --git a/src/types/utils.d.ts b/src/types/utils.d.ts index 1fce65af3..2cf33396f 100644 --- a/src/types/utils.d.ts +++ b/src/types/utils.d.ts @@ -141,3 +141,11 @@ type PropertyTypeOrFallback = Key extends keyof * Makes the given keys `K` of the type `T` required */ type RequiredProps = Required> & Omit; + +type Mixin< + MixinClass extends new (...args: any[]) => any, + BaseClass extends abstract new (...args: any[]) => any, +> = Pick & + Pick & { + new (...args: ConstructorParameters): InstanceType & InstanceType; + }; diff --git a/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts b/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts index 0b7cb653e..434e5db25 100644 --- a/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts +++ b/tests/foundry/client/pixi/perception/clockwise-sweep.test-d.ts @@ -1,38 +1,11 @@ +import { Point } from "pixi.js"; import { expectTypeOf } from "vitest"; -const someRay = new Ray({ x: 0, y: 0 }, { x: 0, y: 0 }); -const somePolygonRay: PolygonRay = someRay as PolygonRay; -somePolygonRay.result = new CollisionResult(); +const pointA = new Point(0, 0); +const pointB = new Point(0, 0); -expectTypeOf(ClockwiseSweepPolygon.getRayCollisions(somePolygonRay, { mode: "any" })).toEqualTypeOf(); -expectTypeOf( - ClockwiseSweepPolygon.getRayCollisions(somePolygonRay, { mode: "closest" }), -).toEqualTypeOf(); -expectTypeOf(ClockwiseSweepPolygon.getRayCollisions(somePolygonRay, { mode: "all" })).toEqualTypeOf(); - -declare const initializedConfig: ClockwiseSweepPolygon.InitializedConfig; -expectTypeOf(initializedConfig.hasLimitedRadius).toEqualTypeOf(); -expectTypeOf(initializedConfig.radius).toEqualTypeOf(); -expectTypeOf(initializedConfig.radius2).toEqualTypeOf(); -expectTypeOf(initializedConfig.radiusE).toEqualTypeOf(); -expectTypeOf(initializedConfig.aMin).toEqualTypeOf(); -expectTypeOf(initializedConfig.aMax).toEqualTypeOf(); -expectTypeOf(initializedConfig.angle).toEqualTypeOf(); -expectTypeOf(initializedConfig.rotation).toEqualTypeOf(); -expectTypeOf(initializedConfig.hasLimitedAngle).toEqualTypeOf(); -expectTypeOf(initializedConfig.density).toEqualTypeOf(); -expectTypeOf(initializedConfig.rMax).toEqualTypeOf(); -expectTypeOf(initializedConfig.rMin).toEqualTypeOf(); -declare const limitedAngleConfig: ClockwiseSweepPolygon.LimitedAngleConfig; -expectTypeOf(limitedAngleConfig.hasLimitedRadius).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.radius).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.radius2).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.radiusE).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.aMin).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.aMax).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.angle).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.rotation).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.hasLimitedAngle).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.density).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.rMax).toEqualTypeOf(); -expectTypeOf(limitedAngleConfig.rMin).toEqualTypeOf(); +expectTypeOf(ClockwiseSweepPolygon.testCollision(pointA, pointB, { mode: "any" })).toEqualTypeOf(); +expectTypeOf(ClockwiseSweepPolygon.testCollision(pointA, pointB, { mode: "closest" })).toEqualTypeOf(); +expectTypeOf(ClockwiseSweepPolygon.testCollision(pointA, pointB, { mode: "all" })).toEqualTypeOf< + PolygonVertex[] | null +>(); diff --git a/tests/foundry/client/pixi/perception/perception-manager.test-d.ts b/tests/foundry/client/pixi/perception/perception-manager.test-d.ts index 9dfcdab2b..16e2b7220 100644 --- a/tests/foundry/client/pixi/perception/perception-manager.test-d.ts +++ b/tests/foundry/client/pixi/perception/perception-manager.test-d.ts @@ -2,43 +2,45 @@ import { expectTypeOf } from "vitest"; const manager = new PerceptionManager(); -expectTypeOf(manager.params).toEqualTypeOf(); - -expectTypeOf(manager.cancel()).toEqualTypeOf(); - -expectTypeOf(manager.schedule()).toEqualTypeOf(); -expectTypeOf(manager.schedule({})).toEqualTypeOf(); +expectTypeOf(manager.update({})).toEqualTypeOf(); expectTypeOf( - manager.schedule({ - lighting: { initialize: true }, - sight: { initialize: false }, - sounds: { initialize: false }, + manager.update({ + initializeLighting: true, + initializeVision: false, + initializeSounds: false, }), ).toEqualTypeOf(); expectTypeOf( - manager.schedule({ - lighting: { initialize: true, refresh: true }, - sight: { initialize: false, refresh: true, skipUpdateFog: true, forceUpdateFog: true }, - sounds: { initialize: false, refresh: false, fade: true }, - foreground: { refresh: true }, + manager.update({ + initializeLighting: true, + refreshLighting: true, + initializeVision: false, + refreshVision: true, + initializeSounds: false, + refreshSounds: false, + soundFadeDuration: true, + refreshTiles: true, }), ).toEqualTypeOf(); -expectTypeOf(manager.update()).toEqualTypeOf(); expectTypeOf(manager.update({})).toEqualTypeOf(); expectTypeOf( manager.update({ - lighting: { initialize: true }, - sight: { initialize: false }, - sounds: { initialize: false }, + initializeLighting: true, + initializeVision: true, + initializeSounds: true, }), ).toEqualTypeOf(); expectTypeOf( manager.update({ - lighting: { initialize: true, refresh: true }, - sight: { initialize: false, refresh: true, skipUpdateFog: true, forceUpdateFog: true }, - sounds: { initialize: false, refresh: false, fade: true }, - foreground: { refresh: true }, + initializeLighting: true, + refreshLighting: true, + initializeVision: false, + refreshVision: true, + initializeSounds: false, + refreshSounds: false, + soundFadeDuration: true, + refreshTiles: true, }), ).toEqualTypeOf(); diff --git a/tests/foundry/client/pixi/sources/Vision.test-d.ts b/tests/foundry/client/pixi/sources/Vision.test-d.ts new file mode 100644 index 000000000..5eebac16f --- /dev/null +++ b/tests/foundry/client/pixi/sources/Vision.test-d.ts @@ -0,0 +1,3 @@ +const myVision = new VisionSource(); + +myVision._updateVisionModeUniforms({}, [["myUniform", 3]]); diff --git a/tsconfig.json b/tsconfig.json index 6944ee671..a047bb7c7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "exactOptionalPropertyTypes": true, "lib": ["DOM", "ES2020"], "moduleResolution": "Node", + "esModuleInterop": true, "noEmit": true, "strict": true, "target": "ES2020",