From 6452fc865f268c79bc759d7ca6f874ae7b8df52c Mon Sep 17 00:00:00 2001 From: Donovan Hutchence Date: Thu, 27 Jun 2024 12:36:23 +0100 Subject: [PATCH] Update dependencies (#301) --- package-lock.json | 134 ++++++++++++++++++++++----------------------- package.json | 18 +++--- src/debug-lines.ts | 9 ++- src/index.tsx | 2 +- src/viewer.ts | 3 +- 5 files changed, 86 insertions(+), 80 deletions(-) diff --git a/package-lock.json b/package-lock.json index a19eabc..df98979 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "model-viewer", - "version": "4.12.0", + "version": "4.13.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "model-viewer", - "version": "4.12.0", + "version": "4.13.0", "license": "MIT", "devDependencies": { "@playcanvas/eslint-config": "^1.7.1", - "@playcanvas/observer": "^1.4.0", - "@playcanvas/pcui": "^4.3.0", + "@playcanvas/observer": "^1.5.1", + "@playcanvas/pcui": "^4.4.0", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-commonjs": "^26.0.1", "@rollup/plugin-image": "^3.0.3", @@ -22,21 +22,21 @@ "@rollup/plugin-typescript": "^11.1.6", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^7.14.1", + "@typescript-eslint/parser": "^7.14.1", "concurrently": "^8.2.2", "cross-env": "^7.0.3", "eslint": "^8.56.0", - "playcanvas": "^1.71.5", + "playcanvas": "^1.72.0", "qrious": "^4.0.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-visibility-sensor": "^5.1.1", "rollup": "^4.18.0", - "rollup-plugin-sass": "^1.12.22", + "rollup-plugin-sass": "^1.13.0", "serve": "^14.2.3", "tslib": "^2.6.3", - "typescript": "^5.4.5" + "typescript": "^5.5.2" } }, "node_modules/@babel/runtime": { @@ -359,15 +359,15 @@ } }, "node_modules/@playcanvas/observer": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/@playcanvas/observer/-/observer-1.4.0.tgz", - "integrity": "sha512-aeyAbH+CPWs39DS3vNcIfKODF3lTqd0vn0xrLeZoaylGVw3XTCKjxyc9z0SGC9qivTZpQj0SksU8wT/0HbgkWw==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@playcanvas/observer/-/observer-1.5.1.tgz", + "integrity": "sha512-0y4OQOtwhgCvFaNlhLgi4ycSeOdnp0Frf4R+8eewxtfZQW1Muox2lkUGoMywoRRLhaRjUMdaxQN1o53lNjlB9w==", "dev": true }, "node_modules/@playcanvas/pcui": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@playcanvas/pcui/-/pcui-4.3.0.tgz", - "integrity": "sha512-nhyF+u55ws1FPA4A3EkD9p4ujK2HfGxuA6GRWJWe2A9tPyKRMGTNNjrubc/4GnmCxfZP7ux9QEd/a82MXSoU3g==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@playcanvas/pcui/-/pcui-4.4.0.tgz", + "integrity": "sha512-pMFM4adUwICRP304b4miWmnfOJQFXiOYQiGVtnzSDWl87PMLEVAoeGnxDIZp/HZ3VCgcXd0j5Vbr3cKURmcWqg==", "dev": true, "dependencies": { "@playcanvas/observer": "^1.4.0" @@ -833,16 +833,16 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.12.0.tgz", - "integrity": "sha512-7F91fcbuDf/d3S8o21+r3ZncGIke/+eWk0EpO21LXhDfLahriZF9CGj4fbAetEjlaBdjdSm9a6VeXbpbT6Z40Q==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.14.1.tgz", + "integrity": "sha512-aAJd6bIf2vvQRjUG3ZkNXkmBpN+J7Wd0mfQiiVCJMu9Z5GcZZdcc0j8XwN/BM97Fl7e3SkTXODSk4VehUv7CGw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "7.12.0", - "@typescript-eslint/type-utils": "7.12.0", - "@typescript-eslint/utils": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/type-utils": "7.14.1", + "@typescript-eslint/utils": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -866,15 +866,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.12.0.tgz", - "integrity": "sha512-dm/J2UDY3oV3TKius2OUZIFHsomQmpHtsV0FTh1WO8EKgHLQ1QCADUqscPgTpU+ih1e21FQSRjXckHn3txn6kQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.14.1.tgz", + "integrity": "sha512-8lKUOebNLcR0D7RvlcloOacTOWzOqemWEWkKSVpMZVF/XVcwjPR+3MD08QzbW9TCGJ+DwIc6zUSGZ9vd8cO1IA==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.12.0", - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/typescript-estree": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0", + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/typescript-estree": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "debug": "^4.3.4" }, "engines": { @@ -894,13 +894,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.12.0.tgz", - "integrity": "sha512-itF1pTnN6F3unPak+kutH9raIkL3lhH1YRPGgt7QQOh43DQKVJXmWkpb+vpc/TiDHs6RSd9CTbDsc/Y+Ygq7kg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.14.1.tgz", + "integrity": "sha512-gPrFSsoYcsffYXTOZ+hT7fyJr95rdVe4kGVX1ps/dJ+DfmlnjFN/GcMxXcVkeHDKqsq6uAcVaQaIi3cFffmAbA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0" + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -911,13 +911,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.12.0.tgz", - "integrity": "sha512-lib96tyRtMhLxwauDWUp/uW3FMhLA6D0rJ8T7HmH7x23Gk1Gwwu8UZ94NMXBvOELn6flSPiBrCKlehkiXyaqwA==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.14.1.tgz", + "integrity": "sha512-/MzmgNd3nnbDbOi3LfasXWWe292+iuo+umJ0bCCMCPc1jLO/z2BQmWUUUXvXLbrQey/JgzdF/OV+I5bzEGwJkQ==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.12.0", - "@typescript-eslint/utils": "7.12.0", + "@typescript-eslint/typescript-estree": "7.14.1", + "@typescript-eslint/utils": "7.14.1", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -938,9 +938,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.12.0.tgz", - "integrity": "sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.14.1.tgz", + "integrity": "sha512-mL7zNEOQybo5R3AavY+Am7KLv8BorIv7HCYS5rKoNZKQD9tsfGUpO4KdAn3sSUvTiS4PQkr2+K0KJbxj8H9NDg==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -951,13 +951,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.12.0.tgz", - "integrity": "sha512-5bwqLsWBULv1h6pn7cMW5dXX/Y2amRqLaKqsASVwbBHMZSnHqE/HN4vT4fE0aFsiwxYvr98kqOWh1a8ZKXalCQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.14.1.tgz", + "integrity": "sha512-k5d0VuxViE2ulIO6FbxxSZaxqDVUyMbXcidC8rHvii0I56XZPv8cq+EhMns+d/EVIL41sMXqRbK3D10Oza1bbA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/visitor-keys": "7.12.0", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/visitor-keys": "7.14.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -979,15 +979,15 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.12.0.tgz", - "integrity": "sha512-Y6hhwxwDx41HNpjuYswYp6gDbkiZ8Hin9Bf5aJQn1bpTs3afYY4GX+MPYxma8jtoIV2GRwTM/UJm/2uGCVv+DQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.14.1.tgz", + "integrity": "sha512-CMmVVELns3nak3cpJhZosDkm63n+DwBlDX8g0k4QUa9BMnF+lH2lr3d130M1Zt1xxmB3LLk3NV7KQCq86ZBBhQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "7.12.0", - "@typescript-eslint/types": "7.12.0", - "@typescript-eslint/typescript-estree": "7.12.0" + "@typescript-eslint/scope-manager": "7.14.1", + "@typescript-eslint/types": "7.14.1", + "@typescript-eslint/typescript-estree": "7.14.1" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -1001,12 +1001,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.12.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.12.0.tgz", - "integrity": "sha512-uZk7DevrQLL3vSnfFl5bj4sL75qC9D6EdjemIdbtkuUmIheWpuiiylSY01JxJE7+zGrOWDZrp1WxOuDntvKrHQ==", + "version": "7.14.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.14.1.tgz", + "integrity": "sha512-Crb+F75U1JAEtBeQGxSKwI60hZmmzaqA3z9sYsVm8X7W5cwLEm5bRe0/uXS6+MR/y8CVpKSR/ontIAIEPFcEkA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.12.0", + "@typescript-eslint/types": "7.14.1", "eslint-visitor-keys": "^3.4.3" }, "engines": { @@ -3971,12 +3971,12 @@ } }, "node_modules/playcanvas": { - "version": "1.71.5", - "resolved": "https://registry.npmjs.org/playcanvas/-/playcanvas-1.71.5.tgz", - "integrity": "sha512-1Gba1sdye9HhcSl4DstBAxCgtnKy/oHFgDzmRxcOlcZLvlYIK+G7SxPluiXfRewnTpWIGn03yZ4841zhtNAZDg==", + "version": "1.72.0", + "resolved": "https://registry.npmjs.org/playcanvas/-/playcanvas-1.72.0.tgz", + "integrity": "sha512-emtQBXvBrr5gl/9bNT+FK+fl7Zc1Z2/9faxDuo/t/J1Vrz2XFimhjQeJt6QB2F2G2typwylXm6HvRxjVF5TX8w==", "dev": true, "dependencies": { - "@types/webxr": "^0.5.15", + "@types/webxr": "^0.5.16", "@webgpu/types": "^0.1.40" }, "engines": { @@ -4335,9 +4335,9 @@ } }, "node_modules/rollup-plugin-sass": { - "version": "1.12.22", - "resolved": "https://registry.npmjs.org/rollup-plugin-sass/-/rollup-plugin-sass-1.12.22.tgz", - "integrity": "sha512-bwlXqkmRDc1rVjkbN+wxXFh1jfnMEi3vHr5TufM+loUFYKd6RskGMx5Xz4sIVdxIu1oAilZkM4Px8P3QlmwfUA==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-sass/-/rollup-plugin-sass-1.13.0.tgz", + "integrity": "sha512-TL/pBbuqN3Qftiub1rLWiPnUGyL5PC7/+4x1ZgFJWzu1Y8n2vwYILt1kPR83AUzPOwqgFfD+B/LqgV6ee0+CYQ==", "dev": true, "dependencies": { "@rollup/pluginutils": "^3 || ^4 || ^5", @@ -5129,9 +5129,9 @@ } }, "node_modules/typescript": { - "version": "5.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", - "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.2.tgz", + "integrity": "sha512-NcRtPEOsPFFWjobJEtfihkLCZCXZt/os3zf8nTxjVH3RvTSxjrCamJpbExGvYOF+tFHc3pA65qpdwPbzjohhew==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index 39423dc..bbcdd25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "model-viewer", - "version": "4.12.0", + "version": "4.13.0", "author": "PlayCanvas", "homepage": "https://playcanvas.com", "description": "PlayCanvas glTF Viewer", @@ -56,8 +56,8 @@ }, "devDependencies": { "@playcanvas/eslint-config": "^1.7.1", - "@playcanvas/observer": "^1.4.0", - "@playcanvas/pcui": "^4.3.0", + "@playcanvas/observer": "^1.5.1", + "@playcanvas/pcui": "^4.4.0", "@rollup/plugin-alias": "^5.1.0", "@rollup/plugin-commonjs": "^26.0.1", "@rollup/plugin-image": "^3.0.3", @@ -68,27 +68,27 @@ "@rollup/plugin-typescript": "^11.1.6", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", - "@typescript-eslint/eslint-plugin": "^7.12.0", - "@typescript-eslint/parser": "^7.12.0", + "@typescript-eslint/eslint-plugin": "^7.14.1", + "@typescript-eslint/parser": "^7.14.1", "concurrently": "^8.2.2", "cross-env": "^7.0.3", "eslint": "^8.56.0", - "playcanvas": "^1.71.5", + "playcanvas": "^1.72.0", "qrious": "^4.0.2", "react": "^18.3.1", "react-dom": "^18.3.1", "react-visibility-sensor": "^5.1.1", "rollup": "^4.18.0", - "rollup-plugin-sass": "^1.12.22", + "rollup-plugin-sass": "^1.13.0", "serve": "^14.2.3", "tslib": "^2.6.3", - "typescript": "^5.4.5" + "typescript": "^5.5.2" }, "scripts": { "build": "rollup -c", "watch": "rollup -c -w", "serve": "serve dist", - "develop": "cross-env BUILD_TYPE=debug concurrently --kill-others \"npm run watch\" \"npm run serve\"", + "develop": "cross-env concurrently --kill-others \"npm run watch\" \"npm run serve\"", "develop:local": "cross-env ENGINE_PATH=../engine npm run develop", "build:local": "cross-env ENGINE_PATH=../engine npm run build", "watch:local": "cross-env ENGINE_PATH=../engine npm run watch", diff --git a/src/debug-lines.ts b/src/debug-lines.ts index 71efd52..f2a9cf2 100644 --- a/src/debug-lines.ts +++ b/src/debug-lines.ts @@ -125,8 +125,13 @@ class DebugLines { overrideClear: true }); - app.scene.layers.pushTransparent(debugLayerBack); - app.scene.layers.pushTransparent(debugLayerFront); + const layers = app.scene.layers; + const worldLayer = layers.getLayerByName('World'); + const idx = layers.getTransparentIndex(worldLayer); + + layers.insert(debugLayerBack, idx); + layers.insert(debugLayerFront, idx + 1); + camera.camera.layers = camera.camera.layers.concat([debugLayerBack.id, debugLayerFront.id]); } diff --git a/src/index.tsx b/src/index.tsx index 0aa26f6..f2c2aed 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -167,7 +167,7 @@ const observerData: ObserverData = { }; const saveOptions = (observer: Observer, name: string) => { - const options = observer.json(); + const options = observer.json() as any; window.localStorage.setItem(`model-viewer-${name}`, JSON.stringify({ camera: options.camera, skybox: options.skybox, diff --git a/src/viewer.ts b/src/viewer.ts index 856a11a..a086167 100644 --- a/src/viewer.ts +++ b/src/viewer.ts @@ -951,6 +951,7 @@ class Viewer { texture.downloadAsync().then(() => { this.pngExporter.export( 'model-viewer.png', + // @ts-ignore new Uint32Array(texture.getSource().buffer.slice()), texture.width, texture.height @@ -1920,7 +1921,7 @@ class Viewer { // resolve the (possibly multisampled) render target const rt = this.camera.camera.renderTarget; - if (!this.app.graphicsDevice.isWebGPU && rt._samples > 1) { + if (!this.app.graphicsDevice.isWebGPU && rt.samples > 1) { rt.resolve(); }