bump: Viewer 2.18.15 + code changes (#51)

This commit is contained in:
Alan Rynne 2024-04-23 14:25:09 +02:00 коммит произвёл GitHub
Родитель 31c75f5407
Коммит b13eef0b18
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 115 добавлений и 26 удалений

118
package-lock.json сгенерированный
Просмотреть файл

@ -13,7 +13,7 @@
"@heroicons/vue": "^2.0.12",
"@speckle/tailwind-theme": "2.14.7",
"@speckle/ui-components": "2.14.7",
"@speckle/viewer": "^2.16.0",
"@speckle/viewer": "^2.18.14",
"color-interpolate": "^1.0.5",
"core-js": "^3.30.2",
"lodash": "^4.17.21",
@ -2661,12 +2661,12 @@
}
},
"node_modules/@speckle/objectloader": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/@speckle/objectloader/-/objectloader-2.16.0.tgz",
"integrity": "sha512-UjzOUf+Vpi0ESmrlJ9kYin0BqaziSQmR6I/ZJjCgWgOOdL6g9ME3e3BdpJj+DTEAMQQ3j7BkGpzlpU9U+qRXeQ==",
"version": "2.18.14",
"resolved": "https://registry.npmjs.org/@speckle/objectloader/-/objectloader-2.18.14.tgz",
"integrity": "sha512-snOHg8ZdX/OxOOijx//B80D0QCAv9s7L7hap23e1ApeUh7XhlZS53K7QmmUIx9MLCjf+V4WDy+5xBjKRkQmODQ==",
"dependencies": {
"@babel/core": "^7.17.9",
"@speckle/shared": "^2.16.0",
"@speckle/shared": "^2.18.14",
"core-js": "^3.21.1",
"regenerator-runtime": "^0.13.7"
},
@ -2675,9 +2675,9 @@
}
},
"node_modules/@speckle/shared": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/@speckle/shared/-/shared-2.16.0.tgz",
"integrity": "sha512-hGFMwZ3al4haM/FaEeuD9gZ9hG2fa78BTviWXwRyTzrKwvI5n2BK/h/FfgnyTlg3q/TMJ3xm7DLqpbpPx5Jqtw==",
"version": "2.18.14",
"resolved": "https://registry.npmjs.org/@speckle/shared/-/shared-2.18.14.tgz",
"integrity": "sha512-AXYKQmT1VtQFN8n3/l0ObKR03YMshioYzq8UBLKVf+di0jWxBSBXpJsDhfgCh4UwN6lNO5pgjYJE6e09o2m26A==",
"dependencies": {
"lodash": "^4.17.0",
"lodash-es": "^4.17.21",
@ -2689,7 +2689,8 @@
"peerDependencies": {
"@tiptap/core": "^2.0.0-beta.176",
"pino": "^8.7.0",
"pino-http": "^8.0.0"
"pino-http": "^8.0.0",
"pino-pretty": ">=8.0.0"
}
},
"node_modules/@speckle/tailwind-theme": {
@ -2728,11 +2729,11 @@
}
},
"node_modules/@speckle/viewer": {
"version": "2.16.0",
"resolved": "https://registry.npmjs.org/@speckle/viewer/-/viewer-2.16.0.tgz",
"integrity": "sha512-awQpKKxGMgsTdfPGd46ftmOKiqojX0grjm1H6C9zaK17pceKOow3oz9KkIhniNVTwocfhOfuNBCrjtk03siNNw==",
"version": "2.18.14",
"resolved": "https://registry.npmjs.org/@speckle/viewer/-/viewer-2.18.14.tgz",
"integrity": "sha512-yUjlDzKO0bdhM9BuPGJcsjed8i3hWYKfhTbB+b4iN+4KCngwqANkGUTJyMYYa1SBkwd4/FOn6NGvackH6nwVmg==",
"dependencies": {
"@speckle/objectloader": "^2.16.0",
"@speckle/objectloader": "^2.18.14",
"@types/flat": "^5.0.2",
"camera-controls": "^1.33.1",
"flat": "^5.0.2",
@ -4485,8 +4486,7 @@
"node_modules/colorette": {
"version": "2.0.20",
"resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz",
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==",
"dev": true
"integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="
},
"node_modules/colornames": {
"version": "1.1.1",
@ -4866,6 +4866,15 @@
"integrity": "sha512-4FbVrHDwfOASx7uQVxeiCTo7ggSdYZbqs8lH+WU6ViypPlDbe9y6IP5VVUDQBv9DcnyaiPT5XT0UWHgJ64zLeQ==",
"peer": true
},
"node_modules/dateformat": {
"version": "4.6.3",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz",
"integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==",
"peer": true,
"engines": {
"node": "*"
}
},
"node_modules/de-indent": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz",
@ -5045,6 +5054,15 @@
"node": ">= 0.8"
}
},
"node_modules/end-of-stream": {
"version": "1.4.4",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
"integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
"peer": true,
"dependencies": {
"once": "^1.4.0"
}
},
"node_modules/enhanced-resolve": {
"version": "5.14.0",
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.14.0.tgz",
@ -5639,6 +5657,12 @@
"node": ">= 4"
}
},
"node_modules/fast-copy": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-3.0.2.tgz",
"integrity": "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ==",
"peer": true
},
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@ -5690,6 +5714,12 @@
"node": ">=6"
}
},
"node_modules/fast-safe-stringify": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
"integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
"peer": true
},
"node_modules/fastest-levenshtein": {
"version": "1.0.16",
"resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz",
@ -6144,6 +6174,12 @@
"he": "bin/he"
}
},
"node_modules/help-me": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz",
"integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==",
"peer": true
},
"node_modules/hex-rgb": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/hex-rgb/-/hex-rgb-4.3.0.tgz",
@ -6613,6 +6649,15 @@
"jiti": "bin/jiti.js"
}
},
"node_modules/joycon": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz",
"integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==",
"peer": true,
"engines": {
"node": ">=10"
}
},
"node_modules/js-logger": {
"version": "1.6.1",
"resolved": "https://registry.npmjs.org/js-logger/-/js-logger-1.6.1.tgz",
@ -7115,7 +7160,6 @@
"version": "1.2.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
"dev": true,
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@ -7628,6 +7672,31 @@
"process-warning": "^2.0.0"
}
},
"node_modules/pino-pretty": {
"version": "11.0.0",
"resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-11.0.0.tgz",
"integrity": "sha512-YFJZqw59mHIY72wBnBs7XhLGG6qpJMa4pEQTRgEPEbjIYbng2LXEZZF1DoyDg9CfejEy8uZCyzpcBXXG0oOCwQ==",
"peer": true,
"dependencies": {
"colorette": "^2.0.7",
"dateformat": "^4.6.3",
"fast-copy": "^3.0.0",
"fast-safe-stringify": "^2.1.1",
"help-me": "^5.0.0",
"joycon": "^3.1.1",
"minimist": "^1.2.6",
"on-exit-leak-free": "^2.1.0",
"pino-abstract-transport": "^1.0.0",
"pump": "^3.0.0",
"readable-stream": "^4.0.0",
"secure-json-parse": "^2.4.0",
"sonic-boom": "^3.0.0",
"strip-json-comments": "^3.1.1"
},
"bin": {
"pino-pretty": "bin.js"
}
},
"node_modules/pino-std-serializers": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz",
@ -9017,6 +9086,16 @@
"node": ">= 0.10"
}
},
"node_modules/pump": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
"peer": true,
"dependencies": {
"end-of-stream": "^1.1.0",
"once": "^1.3.1"
}
},
"node_modules/punycode": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
@ -9461,6 +9540,12 @@
"integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
"dev": true
},
"node_modules/secure-json-parse": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz",
"integrity": "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==",
"peer": true
},
"node_modules/select-hose": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/select-hose/-/select-hose-2.0.0.tgz",
@ -9899,7 +9984,6 @@
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true,
"engines": {
"node": ">=8"
},

Просмотреть файл

@ -18,7 +18,7 @@
"@heroicons/vue": "^2.0.12",
"@speckle/tailwind-theme": "2.14.7",
"@speckle/ui-components": "2.14.7",
"@speckle/viewer": "^2.16.0",
"@speckle/viewer": "^2.18.14",
"color-interpolate": "^1.0.5",
"core-js": "^3.30.2",
"lodash": "^4.17.21",

Просмотреть файл

@ -1,17 +1,18 @@
import {
CanonicalView,
FilteringState,
Viewer,
LegacyViewer,
IntersectionQuery,
DefaultViewerParams,
Box3,
SpeckleView
SpeckleView,
CameraController
} from '@speckle/viewer'
import { pickViewableHit, projectToScreen } from '../utils/viewerUtils'
import _ from 'lodash'
import { SpeckleVisualSettingsModel } from 'src/settings/visualSettingsModel'
export default class ViewerHandler {
private viewer: Viewer
private viewer: LegacyViewer
private readonly parent: HTMLElement
private state: FilteringState
private loadedObjectsCache: Set<string> = new Set<string>()
@ -37,7 +38,8 @@ export default class ViewerHandler {
break
}
this.viewer.cameraHandler.controls.maxPolarAngle = settings.camera.allowCameraUnder.value
this.viewer.getExtension(CameraController).controls.maxPolarAngle = settings.camera
.allowCameraUnder.value
? Math.PI
: Math.PI / 2
@ -70,7 +72,7 @@ export default class ViewerHandler {
}
public addCameraUpdateEventListener(listener: (ev) => void) {
this.viewer.cameraHandler.controls.addEventListener('update', listener)
this.viewer.getExtension(CameraController).controls.addEventListener('update', listener)
}
public constructor(parent: HTMLElement) {
@ -82,7 +84,7 @@ export default class ViewerHandler {
const viewerSettings = DefaultViewerParams
viewerSettings.showStats = false
viewerSettings.verbose = false
const viewer = new Viewer(this.parent, viewerSettings)
const viewer = new LegacyViewer(this.parent, viewerSettings)
await viewer.init()
this.viewer = viewer
}
@ -210,11 +212,14 @@ export default class ViewerHandler {
}
public getScreenPosition(worldPosition): { x: number; y: number } {
return projectToScreen(this.viewer.cameraHandler.camera, worldPosition)
return projectToScreen(
this.viewer.getExtension(CameraController).controls.camera,
worldPosition
)
}
public dispose() {
this.viewer.cameraHandler.controls.removeAllEventListeners()
this.viewer.getExtension(CameraController).controls.removeAllEventListeners()
this.viewer.dispose()
this.viewer = null
}