From 132ed80a9dd459bd08ca794724204cf674366330 Mon Sep 17 00:00:00 2001 From: vim-sroberge Date: Thu, 8 Aug 2024 15:22:56 -0400 Subject: [PATCH 1/6] restored fit section box on first toggle --- src/controlbar/sectionBoxState.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/controlbar/sectionBoxState.ts b/src/controlbar/sectionBoxState.ts index 806f4071..06e452e9 100644 --- a/src/controlbar/sectionBoxState.ts +++ b/src/controlbar/sectionBoxState.ts @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react' +import { useEffect, useState, useRef } from 'react' import ReactTooltip from 'react-tooltip' import * as VIM from 'vim-webgl-viewer/' @@ -10,6 +10,7 @@ export type SectionState = { export function getSectionBoxState (viewer: VIM.Viewer) { const sectionGizmo = viewer.gizmos.section + const first = useRef(true) const [section, setSection] = useState({ clip: sectionGizmo.clip, active: sectionGizmo.visible && sectionGizmo.interactive @@ -42,6 +43,11 @@ export function getSectionBoxState (viewer: VIM.Viewer) { sectionGizmo.interactive = next sectionGizmo.visible = next + + if (next && first.current) { + sectionGizmo.fitBox(viewer.renderer.getBoundingBox()) + first.current = false + } } return { From 1add5a1762203fab0ae37a54897b4507ef48336f Mon Sep 17 00:00:00 2001 From: vim-sroberge Date: Thu, 8 Aug 2024 15:23:17 -0400 Subject: [PATCH 2/6] "version": "0.3.11-dev.2", --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cdd9900a..07eda32d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vim-webgl-component", - "version": "0.3.11-dev.0", + "version": "0.3.11-dev.2", "description": "A demonstration app built on top of the vim-webgl-viewer", "files": [ "dist" @@ -62,7 +62,7 @@ "react-tooltip": "^4.2.21", "stats-js": "^1.0.1", "tailwindcss-scoped-preflight": "^3.2.8", - "vim-webgl-viewer": "2.0.5-dev.3" + "vim-webgl-viewer": "2.0.5-dev.8" }, "peerDependencies": { "react": "^18.2.0", From 5c983d62fbffdc5f5867a6a92c4b94b5bccbe7c7 Mon Sep 17 00:00:00 2001 From: vim-sroberge Date: Thu, 8 Aug 2024 16:08:37 -0400 Subject: [PATCH 3/6] fixed section box clip button --- src/controlbar/controlBar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controlbar/controlBar.tsx b/src/controlbar/controlBar.tsx index 3423c26f..39d1ca93 100644 --- a/src/controlbar/controlBar.tsx +++ b/src/controlbar/controlBar.tsx @@ -228,9 +228,9 @@ export function ControlBar (props: { }, { id: elementIds.buttonSectionBoxClip, - tip: section.clip ? 'Clip Section Box' : 'Ignore Section Box', + tip: section.clip ? 'Ignore Section Box' : 'Clip Section Box', action: () => section.toggleClip(), - icon: section.clip ? Icons.sectionBoxClip : Icons.sectionBoxNoClip, + icon: section.clip ? Icons.sectionBoxIgnore : Icons.sectionBoxClip, style: buttonBlueStyle }, { From 7638a7cb2885fbab82f4e7c98b3ab6cd7e6e91b2 Mon Sep 17 00:00:00 2001 From: vim-sroberge Date: Thu, 29 Aug 2024 16:41:37 -0400 Subject: [PATCH 4/6] "vim-webgl-viewer": "2.0.5-dev.14" --- package-lock.json | 104 ++++++++++++++-------------------- package.json | 5 +- src/panels/icons.tsx | 2 +- src/settings/settingsState.ts | 2 +- 4 files changed, 45 insertions(+), 68 deletions(-) diff --git a/package-lock.json b/package-lock.json index 80fc4ebd..20a05e76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vim-webgl-component", - "version": "0.3.8", + "version": "0.3.11-dev.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vim-webgl-component", - "version": "0.3.8", + "version": "0.3.11-dev.8", "bundleDependencies": [ "vim-webgl-viewer" ], @@ -19,13 +19,11 @@ "react-tooltip": "^4.2.21", "stats-js": "^1.0.1", "tailwindcss-scoped-preflight": "^3.2.8", - "vim-webgl-viewer": "2.0.4-dev.0" + "vim-webgl-viewer": "2.0.5-dev.14" }, "devDependencies": { - "@tailwindcss/forms": "0.5.3", "@types/react": "^17.0.39", "@types/react-dom": "^18.0.9", - "@types/three": "^0.146.0", "@typescript-eslint/eslint-plugin": "^5.36.2", "autoprefixer": "10.4.5", "eslint": "^8.23.1", @@ -218,18 +216,6 @@ "node": ">= 8" } }, - "node_modules/@tailwindcss/forms": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.3.tgz", - "integrity": "sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==", - "dev": true, - "dependencies": { - "mini-svg-data-uri": "^1.2.3" - }, - "peerDependencies": { - "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" - } - }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -289,19 +275,19 @@ "dev": true }, "node_modules/@types/three": { - "version": "0.146.0", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.146.0.tgz", - "integrity": "sha512-75AgysUrIvTCB054eQa2pDVFurfeFW8CrMQjpzjt3yHBfuuknoSvvsESd/3EhQxPrz9si3+P0wiDUVsWUlljfA==", - "dev": true, + "version": "0.143.2", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.143.2.tgz", + "integrity": "sha512-HjsRWvd6rsXViFeOdU97/pHNDQknzJbFI0/5MrQ0joOlK0uixQH40sDJs/LwkNHhFYUvVENXAUQdKDeiQChHDw==", + "inBundle": true, "dependencies": { "@types/webxr": "*" } }, "node_modules/@types/webxr": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.1.tgz", - "integrity": "sha512-xlFXPfgJR5vIuDefhaHuUM9uUgvPaXB6GKdXy2gdEh8gBWQZ2ul24AJz3foUd8NNKlSTQuWYJpCb1/pL81m1KQ==", - "dev": true + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.19.tgz", + "integrity": "sha512-4hxA+NwohSgImdTSlPXEqDqqFktNgmTXQ05ff1uWam05tNGroCMp4G+4XVl6qWm1p7GQ/9oD41kAYsSssF6Mzw==", + "inBundle": true }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.55.0", @@ -2902,6 +2888,15 @@ "node": ">=8" } }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "inBundle": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -3208,15 +3203,6 @@ "node": ">=4" } }, - "node_modules/mini-svg-data-uri": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", - "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==", - "dev": true, - "bin": { - "mini-svg-data-uri": "cli.js" - } - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -4637,15 +4623,17 @@ } }, "node_modules/vim-webgl-viewer": { - "version": "2.0.4-dev.0", - "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.4-dev.0.tgz", - "integrity": "sha512-TymCTeZZcKDBQq8LI1Ag6i2LDf2BGhWZIu66cqDyP7u7Ukc4/NQN8OE8fiEid+Pis+NzMTUcjIxS5nHtW1tAug==", + "version": "2.0.5-dev.14", + "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.5-dev.14.tgz", + "integrity": "sha512-qDkvvE0g8Ohv4Xwly4Z2EUbEExDdoVv+5Cx47ocdY01nCYyh+NCzpo8nOKRjJcowqSzQvTz27i9RL+04q+RS8Q==", "bundleDependencies": [ "three" ], "inBundle": true, "dependencies": { + "@types/three": "^0.143.0", "deepmerge": "^4.2.2", + "is-plain-object": "^5.0.0", "ste-events": "^3.0.7", "ste-signals": "^3.0.9", "ste-simple-events": "^3.0.7", @@ -4948,15 +4936,6 @@ "fastq": "^1.6.0" } }, - "@tailwindcss/forms": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.3.tgz", - "integrity": "sha512-y5mb86JUoiUgBjY/o6FJSFZSEttfb3Q5gllE4xoKjAAD+vBrnIhE4dViwUuow3va8mpH4s9jyUbUbrRGoRdc2Q==", - "dev": true, - "requires": { - "mini-svg-data-uri": "^1.2.3" - } - }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -5016,19 +4995,17 @@ "dev": true }, "@types/three": { - "version": "0.146.0", - "resolved": "https://registry.npmjs.org/@types/three/-/three-0.146.0.tgz", - "integrity": "sha512-75AgysUrIvTCB054eQa2pDVFurfeFW8CrMQjpzjt3yHBfuuknoSvvsESd/3EhQxPrz9si3+P0wiDUVsWUlljfA==", - "dev": true, + "version": "0.143.2", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.143.2.tgz", + "integrity": "sha512-HjsRWvd6rsXViFeOdU97/pHNDQknzJbFI0/5MrQ0joOlK0uixQH40sDJs/LwkNHhFYUvVENXAUQdKDeiQChHDw==", "requires": { "@types/webxr": "*" } }, "@types/webxr": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.1.tgz", - "integrity": "sha512-xlFXPfgJR5vIuDefhaHuUM9uUgvPaXB6GKdXy2gdEh8gBWQZ2ul24AJz3foUd8NNKlSTQuWYJpCb1/pL81m1KQ==", - "dev": true + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.19.tgz", + "integrity": "sha512-4hxA+NwohSgImdTSlPXEqDqqFktNgmTXQ05ff1uWam05tNGroCMp4G+4XVl6qWm1p7GQ/9oD41kAYsSssF6Mzw==" }, "@typescript-eslint/eslint-plugin": { "version": "5.55.0", @@ -6757,6 +6734,11 @@ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true }, + "is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" + }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -6976,12 +6958,6 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", "dev": true }, - "mini-svg-data-uri": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/mini-svg-data-uri/-/mini-svg-data-uri-1.4.4.tgz", - "integrity": "sha512-r9deDe9p5FJUPZAk3A59wGH7Ii9YrjjWw0jmw/liSbHl2CHiyXj6FcDXDu2K3TjVAXqiJdaw3xxwlZZr9E6nHg==", - "dev": true - }, "minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -7962,11 +7938,13 @@ } }, "vim-webgl-viewer": { - "version": "2.0.4-dev.0", - "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.4-dev.0.tgz", - "integrity": "sha512-TymCTeZZcKDBQq8LI1Ag6i2LDf2BGhWZIu66cqDyP7u7Ukc4/NQN8OE8fiEid+Pis+NzMTUcjIxS5nHtW1tAug==", + "version": "2.0.5-dev.14", + "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.5-dev.14.tgz", + "integrity": "sha512-qDkvvE0g8Ohv4Xwly4Z2EUbEExDdoVv+5Cx47ocdY01nCYyh+NCzpo8nOKRjJcowqSzQvTz27i9RL+04q+RS8Q==", "requires": { + "@types/three": "^0.143.0", "deepmerge": "^4.2.2", + "is-plain-object": "^5.0.0", "ste-events": "^3.0.7", "ste-signals": "^3.0.9", "ste-simple-events": "^3.0.7", diff --git a/package.json b/package.json index 07eda32d..893a53a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vim-webgl-component", - "version": "0.3.11-dev.2", + "version": "0.3.11-dev.8", "description": "A demonstration app built on top of the vim-webgl-viewer", "files": [ "dist" @@ -30,7 +30,6 @@ "devDependencies": { "@types/react": "^17.0.39", "@types/react-dom": "^18.0.9", - "@types/three": "^0.146.0", "@typescript-eslint/eslint-plugin": "^5.36.2", "autoprefixer": "10.4.5", "eslint": "^8.23.1", @@ -62,7 +61,7 @@ "react-tooltip": "^4.2.21", "stats-js": "^1.0.1", "tailwindcss-scoped-preflight": "^3.2.8", - "vim-webgl-viewer": "2.0.5-dev.8" + "vim-webgl-viewer": "2.0.5-dev.14" }, "peerDependencies": { "react": "^18.2.0", diff --git a/src/panels/icons.tsx b/src/panels/icons.tsx index dce692b4..888cb03d 100644 --- a/src/panels/icons.tsx +++ b/src/panels/icons.tsx @@ -542,7 +542,7 @@ export function sectionBoxClip ({ height, width, fill, className }: IconOptions) ) } -export function sectionBoxNoClip ({ height, width, fill, className }: IconOptions) { +export function sectionBoxIgnore ({ height, width, fill, className }: IconOptions) { return ( diff --git a/src/settings/settingsState.ts b/src/settings/settingsState.ts index 8548d3b5..9ce9b5c6 100644 --- a/src/settings/settingsState.ts +++ b/src/settings/settingsState.ts @@ -29,7 +29,7 @@ export function useSettings ( const next = { ...settings } // Shallow copy updater(next) validateSettings(next) - saveSettingsToLocal(settings) + saveSettingsToLocal(next) setSettings(next) onUpdate.current?.(next) } From 8e253b6f49b8fec088189ee5cc1b34c9c980d1c2 Mon Sep 17 00:00:00 2001 From: vim-sroberge Date: Fri, 30 Aug 2024 08:19:41 -0400 Subject: [PATCH 5/6] "version": "0.3.11", --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 893a53a2..417004a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vim-webgl-component", - "version": "0.3.11-dev.8", + "version": "0.3.11", "description": "A demonstration app built on top of the vim-webgl-viewer", "files": [ "dist" From c1e29e7795af64f73b746d59d53a928854263d78 Mon Sep 17 00:00:00 2001 From: vim-sroberge Date: Fri, 30 Aug 2024 08:19:41 -0400 Subject: [PATCH 6/6] "version": "0.3.11", --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 20a05e76..7dff4217 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vim-webgl-component", - "version": "0.3.11-dev.8", + "version": "0.3.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vim-webgl-component", - "version": "0.3.11-dev.8", + "version": "0.3.11", "bundleDependencies": [ "vim-webgl-viewer" ], @@ -19,7 +19,7 @@ "react-tooltip": "^4.2.21", "stats-js": "^1.0.1", "tailwindcss-scoped-preflight": "^3.2.8", - "vim-webgl-viewer": "2.0.5-dev.14" + "vim-webgl-viewer": "2.0.5" }, "devDependencies": { "@types/react": "^17.0.39", @@ -4623,9 +4623,9 @@ } }, "node_modules/vim-webgl-viewer": { - "version": "2.0.5-dev.14", - "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.5-dev.14.tgz", - "integrity": "sha512-qDkvvE0g8Ohv4Xwly4Z2EUbEExDdoVv+5Cx47ocdY01nCYyh+NCzpo8nOKRjJcowqSzQvTz27i9RL+04q+RS8Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.5.tgz", + "integrity": "sha512-QkmxaU5/8cicuBEWaNTVzjhye6UKS5ty8yCj5olnKyNqZcTecL/s9A3EPGjoByrAuCVxg4bBJNvvq8ygdo8ecg==", "bundleDependencies": [ "three" ], @@ -7938,9 +7938,9 @@ } }, "vim-webgl-viewer": { - "version": "2.0.5-dev.14", - "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.5-dev.14.tgz", - "integrity": "sha512-qDkvvE0g8Ohv4Xwly4Z2EUbEExDdoVv+5Cx47ocdY01nCYyh+NCzpo8nOKRjJcowqSzQvTz27i9RL+04q+RS8Q==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/vim-webgl-viewer/-/vim-webgl-viewer-2.0.5.tgz", + "integrity": "sha512-QkmxaU5/8cicuBEWaNTVzjhye6UKS5ty8yCj5olnKyNqZcTecL/s9A3EPGjoByrAuCVxg4bBJNvvq8ygdo8ecg==", "requires": { "@types/three": "^0.143.0", "deepmerge": "^4.2.2", diff --git a/package.json b/package.json index 893a53a2..7a21a882 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vim-webgl-component", - "version": "0.3.11-dev.8", + "version": "0.3.11", "description": "A demonstration app built on top of the vim-webgl-viewer", "files": [ "dist" @@ -61,7 +61,7 @@ "react-tooltip": "^4.2.21", "stats-js": "^1.0.1", "tailwindcss-scoped-preflight": "^3.2.8", - "vim-webgl-viewer": "2.0.5-dev.14" + "vim-webgl-viewer": "2.0.5" }, "peerDependencies": { "react": "^18.2.0",