From 5e2876973fce13c073391cecba98e5686da51575 Mon Sep 17 00:00:00 2001 From: Arun George <11051042+aruniverse@users.noreply.github.com> Date: Fri, 1 Nov 2024 10:02:05 -0400 Subject: [PATCH] update to ^1.0 of new presentation pkgs (#334) * use 1.0.0 vers of new presentation pkgs * rush change * update to tree-widget 3.0 * rush change --------- Co-authored-by: Arun George --- .../presentation-1.0_2024-10-31-15-06.json | 10 ++ .../presentation-1.0_2024-10-31-16-31.json | 10 ++ .../presentation-1.0_2024-10-31-15-06.json | 10 ++ .../presentation-1.0_2024-10-31-16-31.json | 10 ++ .../presentation-1.0_2024-10-31-15-06.json | 10 ++ common/config/rush/pnpm-lock.yaml | 147 +++++++++++++----- .../apps/desktop-viewer-test/package.json | 4 +- .../components/routes/ViewerRoute.tsx | 49 +++++- packages/apps/web-viewer-test/package.json | 4 +- .../src/components/home/ViewerHome.tsx | 64 ++++++-- packages/modules/viewer-react/package.json | 6 +- .../cra-template-desktop-viewer/template.json | 8 +- .../components/routes/ViewerRoute.tsx | 43 ++++- .../cra-template-web-viewer/template.json | 8 +- .../template/src/App.tsx | 41 ++++- rush.json | 2 +- 16 files changed, 356 insertions(+), 70 deletions(-) create mode 100644 common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-15-06.json create mode 100644 common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-16-31.json create mode 100644 common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-15-06.json create mode 100644 common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-16-31.json create mode 100644 common/changes/@itwin/viewer-react/presentation-1.0_2024-10-31-15-06.json diff --git a/common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-15-06.json b/common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-15-06.json new file mode 100644 index 00000000..fa1be96e --- /dev/null +++ b/common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-15-06.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/cra-template-desktop-viewer", + "comment": "Update Presentation packages to ^1.0.0", + "type": "patch" + } + ], + "packageName": "@itwin/cra-template-desktop-viewer" +} \ No newline at end of file diff --git a/common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-16-31.json b/common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-16-31.json new file mode 100644 index 00000000..71154e9b --- /dev/null +++ b/common/changes/@itwin/cra-template-desktop-viewer/presentation-1.0_2024-10-31-16-31.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/cra-template-desktop-viewer", + "comment": "Update tree-widget to 3.0", + "type": "minor" + } + ], + "packageName": "@itwin/cra-template-desktop-viewer" +} \ No newline at end of file diff --git a/common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-15-06.json b/common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-15-06.json new file mode 100644 index 00000000..6d03a221 --- /dev/null +++ b/common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-15-06.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/cra-template-web-viewer", + "comment": "Update Presentation packages to ^1.0.0", + "type": "patch" + } + ], + "packageName": "@itwin/cra-template-web-viewer" +} \ No newline at end of file diff --git a/common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-16-31.json b/common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-16-31.json new file mode 100644 index 00000000..54377399 --- /dev/null +++ b/common/changes/@itwin/cra-template-web-viewer/presentation-1.0_2024-10-31-16-31.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/cra-template-web-viewer", + "comment": "Update tree-widget to 3.0", + "type": "minor" + } + ], + "packageName": "@itwin/cra-template-web-viewer" +} \ No newline at end of file diff --git a/common/changes/@itwin/viewer-react/presentation-1.0_2024-10-31-15-06.json b/common/changes/@itwin/viewer-react/presentation-1.0_2024-10-31-15-06.json new file mode 100644 index 00000000..1176df98 --- /dev/null +++ b/common/changes/@itwin/viewer-react/presentation-1.0_2024-10-31-15-06.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@itwin/viewer-react", + "comment": "Update Presentation packages to ^1.0.0", + "type": "patch" + } + ], + "packageName": "@itwin/viewer-react" +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 061f3b29..59cb4d97 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -58,8 +58,8 @@ importers: '@itwin/presentation-components': ^5.0.0 '@itwin/presentation-frontend': ^4.7.3 '@itwin/property-grid-react': ^1.0.0 - '@itwin/tree-widget-react': ^1.0.0 - '@itwin/unified-selection': ^0.4.5 + '@itwin/tree-widget-react': ^3.0.0 + '@itwin/unified-selection': ^1.0.0 '@itwin/webgl-compatibility': ^4.7.3 '@types/electron-devtools-installer': ^2.2.2 '@types/minimist': ^1.2.2 @@ -124,8 +124,8 @@ importers: '@itwin/presentation-components': 5.4.1_coeiqitrdc3kbyoxwt3ak4fycm '@itwin/presentation-frontend': 4.7.4_lbci6e5ivpkspr33wpe53pcp5i '@itwin/property-grid-react': 1.10.0_qjr4doayn7cutuokumbiwhomja - '@itwin/tree-widget-react': 1.2.2_mwt5u2ylvl5wdlvny262vrwmma - '@itwin/unified-selection': 0.4.5 + '@itwin/tree-widget-react': 3.0.1_i672swagn374al3m4ors5guk4q + '@itwin/unified-selection': 1.1.0 '@itwin/webgl-compatibility': 4.7.4 dotenv-flow: 3.3.0 electron: 24.8.8 @@ -185,8 +185,8 @@ importers: '@itwin/property-grid-react': ^1.0.0 '@itwin/reality-data-client': ^1.1.0 '@itwin/test-local-extension': workspace:* - '@itwin/tree-widget-react': ^1.0.0 - '@itwin/unified-selection': ^0.4.5 + '@itwin/tree-widget-react': ^3.0.0 + '@itwin/unified-selection': ^1.0.0 '@itwin/web-viewer-react': workspace:* '@itwin/webgl-compatibility': ^4.7.3 '@remix-run/router': ^1.7.2 @@ -231,8 +231,8 @@ importers: '@itwin/property-grid-react': 1.10.0_qjr4doayn7cutuokumbiwhomja '@itwin/reality-data-client': 1.2.1_@itwin+core-bentley@4.7.4 '@itwin/test-local-extension': link:../../modules/test-local-extension - '@itwin/tree-widget-react': 1.2.2_mwt5u2ylvl5wdlvny262vrwmma - '@itwin/unified-selection': 0.4.5 + '@itwin/tree-widget-react': 3.0.1_i672swagn374al3m4ors5guk4q + '@itwin/unified-selection': 1.1.0 '@itwin/web-viewer-react': link:../../modules/web-viewer-react '@itwin/webgl-compatibility': 4.7.4 '@remix-run/router': 1.17.1 @@ -445,11 +445,11 @@ importers: '@itwin/itwinui-react': ^2.6.0 '@itwin/presentation-common': ^4.7.3 '@itwin/presentation-components': ^5.0.0 - '@itwin/presentation-core-interop': ^0.2.3 + '@itwin/presentation-core-interop': ^1.0.0 '@itwin/presentation-frontend': ^4.7.3 - '@itwin/presentation-shared': ^0.3.1 + '@itwin/presentation-shared': ^1.0.0 '@itwin/reality-data-client': ^1.0.0 - '@itwin/unified-selection': ^0.4.5 + '@itwin/unified-selection': ^1.0.0 '@itwin/webgl-compatibility': ^4.7.3 '@testing-library/jest-dom': ^4.2.4 '@testing-library/react': ^14.0.0 @@ -477,10 +477,10 @@ importers: '@bentley/icons-generic-webfont': 1.0.34 '@itwin/itwinui-illustrations-react': 2.1.0_nnrd3gsncyragczmpvfhocinkq '@itwin/itwinui-react': 2.12.26_nnrd3gsncyragczmpvfhocinkq - '@itwin/presentation-core-interop': 0.2.4_rll2n26bhzrezeyt23jhdcbtsy - '@itwin/presentation-shared': 0.3.2 + '@itwin/presentation-core-interop': 1.1.1_rll2n26bhzrezeyt23jhdcbtsy + '@itwin/presentation-shared': 1.1.0 '@itwin/reality-data-client': 1.2.1_@itwin+core-bentley@4.7.4 - '@itwin/unified-selection': 0.4.5 + '@itwin/unified-selection': 1.1.0 lodash.isequal: 4.5.0 devDependencies: '@itwin/appui-abstract': 4.7.4_@itwin+core-bentley@4.7.4 @@ -3105,6 +3105,10 @@ packages: /@itwin/core-bentley/4.7.4: resolution: {integrity: sha512-iwMNTRTV2xtuJVa1QGWyn+XudrLssemvkmaGc3hJXCasqSB8bQfFTYSrYoiNxcjdv9N9i3r27XtC0XNIoL8tTg==} + /@itwin/core-bentley/4.9.5: + resolution: {integrity: sha512-2cFqJnWKdGyNgZziqYHg4KkYVXD3+f4WQ5xhVPkEYffcOpXXz4yFh8nDOZmhgOLAmJo6KDH2x+uNJembcX6wjQ==} + dev: false + /@itwin/core-common/4.7.4_7i4fuy3zzvrtjsnyekcav72ie4: resolution: {integrity: sha512-0Xd2E877gXVDP18YMCzsQU/XdTg6VoPFTwT6zlqTQ5XP6nEIZVQzwR/n3egCLc6bdSY0KoiG8RPajK9p7NqV8g==} peerDependencies: @@ -3116,6 +3120,18 @@ packages: flatbuffers: 1.12.0 js-base64: 3.7.7 + /@itwin/core-common/4.9.5_uihgl3rfhguqy2f4jpx67fyjwm: + resolution: {integrity: sha512-k3Pfyvm7q17m0ohQpWfBTOsdKCkPNgC0fQCpebs8WMFimoYuuxC2BJwUqKMyRcvesI+eT3pOHJ94DM4PH8i2uw==} + peerDependencies: + '@itwin/core-bentley': ^4.9.5 + '@itwin/core-geometry': ^4.9.5 + dependencies: + '@itwin/core-bentley': 4.9.5 + '@itwin/core-geometry': 4.9.5 + flatbuffers: 1.12.0 + js-base64: 3.7.7 + dev: false + /@itwin/core-electron/4.7.4_hworozxoblmw2cyo32mpk5ebjm: resolution: {integrity: sha512-5G50nqdJw+sih4eR3AjdzK/Q/DVzglxO33THVBu414MVDjaGoemWkUnpQFn3zFMxXWVeJHwCbZG/44hylsATvA==} engines: {node: ^18.0.0 || ^20.0.0} @@ -3192,6 +3208,13 @@ packages: '@itwin/core-bentley': 4.7.4 flatbuffers: 1.12.0 + /@itwin/core-geometry/4.9.5: + resolution: {integrity: sha512-o2fe6/yuxo+9I9JS7o1nytv+CZ8XL8a1vVaDRwqqPAMwnHh7qwHgGfD7WuGyn7/NHbjPNv9Srrb9rtOMua8ryg==} + dependencies: + '@itwin/core-bentley': 4.9.5 + flatbuffers: 1.12.0 + dev: false + /@itwin/core-i18n/4.7.4_@itwin+core-bentley@4.7.4: resolution: {integrity: sha512-mux7dJk84X0Fsswah3n/LNlJcFyPqeXZG+YvtKV5GYaVg2LQOM+fIDL5/fjTiZNFWWKaqMHnA7r2BINwJk/R8g==} peerDependencies: @@ -3796,8 +3819,8 @@ packages: - supports-color dev: true - /@itwin/presentation-core-interop/0.2.4_rll2n26bhzrezeyt23jhdcbtsy: - resolution: {integrity: sha512-udofwj3KXjDIgW2FxJ/hblUNk/VQBZff/3eLjZUP3q2Jl6N116w0AqTP00aL/5p1RP2+E1yebP6gSno2iRS/EQ==} + /@itwin/presentation-core-interop/1.1.1_rll2n26bhzrezeyt23jhdcbtsy: + resolution: {integrity: sha512-Ts3U1/0pJ+igKT2cRlUiO+QKldz/92ma2hKWxTgJWfBAybPR3DI34NAy1Jl7q/r7QcZ+5DAsIcO9Et/SP+Lt9A==} peerDependencies: '@itwin/core-bentley': ^4.1.0 '@itwin/core-common': ^4.1.0 @@ -3810,7 +3833,7 @@ packages: '@itwin/core-geometry': 4.7.4 '@itwin/core-quantity': 4.7.4_@itwin+core-bentley@4.7.4 '@itwin/ecschema-metadata': 4.7.4_jokiwfzdpldlrb2ppvojwoxovq - '@itwin/presentation-shared': 0.3.2 + '@itwin/presentation-shared': 1.1.0 rxjs: 7.8.1 dev: false @@ -3834,10 +3857,46 @@ packages: rxjs: 7.8.1 rxjs-for-await: 1.0.0_rxjs@7.8.1 - /@itwin/presentation-shared/0.3.2: - resolution: {integrity: sha512-wrb1JiHsQmK/RhdpfQmDUkgbrGz2Y3VzpmA8R3Jr9lYuaW46f6BrlpUemY+V6tE9Gl5enkOMoLPDxYymKPiERA==} + /@itwin/presentation-hierarchies-react/1.1.1_qnkn5lfpltqtw66hig7mudvuci: + resolution: {integrity: sha512-lVOYZOJxwk/EgmMHpgOl3l6GLBvTHzeXw0312dnwnV2gT/KIaBJ7KyLzNur8CGKPprtOkgu0KZ0wVRGk8j6TAw==} + peerDependencies: + '@itwin/itwinui-react': ^3.0.0 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@itwin/itwinui-react': + optional: true dependencies: - '@itwin/core-bentley': 4.7.4 + '@itwin/core-bentley': 4.9.5 + '@itwin/itwinui-icons-react': 2.8.0_nnrd3gsncyragczmpvfhocinkq + '@itwin/itwinui-illustrations-react': 2.1.0_nnrd3gsncyragczmpvfhocinkq + '@itwin/itwinui-react': 2.12.26_nnrd3gsncyragczmpvfhocinkq + '@itwin/presentation-hierarchies': 1.2.1 + '@itwin/presentation-shared': 1.1.0 + '@itwin/unified-selection': 1.1.0 + classnames: 2.5.1 + immer: 10.1.1 + react: 18.3.1 + react-dom: 18.3.1_react@18.3.1 + react-error-boundary: 4.0.13_react@18.3.1 + rxjs: 7.8.1 + dev: false + + /@itwin/presentation-hierarchies/1.2.1: + resolution: {integrity: sha512-bnfc3unyeUd1N80NZec1ow3wb48AolzZtTwo5BuhEcO378qauwuQfS+lGtM+JD9IO9fyQ5pwtH8IXpt+9XF8gQ==} + dependencies: + '@itwin/core-bentley': 4.9.5 + '@itwin/core-common': 4.9.5_uihgl3rfhguqy2f4jpx67fyjwm + '@itwin/core-geometry': 4.9.5 + '@itwin/presentation-shared': 1.1.0 + natural-compare-lite: 1.4.0 + rxjs: 7.8.1 + dev: false + + /@itwin/presentation-shared/1.1.0: + resolution: {integrity: sha512-H0NiWIYpxPSg4bJdQdSo4epdFUqoza/4UEbRj6nin906Mr2oKWu7Jep9OLbFXTmarMtP+q+5iSlp/eTRhTc/Cg==} + dependencies: + '@itwin/core-bentley': 4.9.5 dev: false /@itwin/property-grid-react/1.10.0_qjr4doayn7cutuokumbiwhomja: @@ -3885,44 +3944,55 @@ packages: - debug dev: false - /@itwin/tree-widget-react/1.2.2_mwt5u2ylvl5wdlvny262vrwmma: - resolution: {integrity: sha512-AJWgeK29NMC8zlHMfpIT0qbOLPQyJ1qmMX6AB/jaebjYipkBzG0HChrJN9vjcdMDcmCCPrnT1/uslQPTY1XUGw==} + /@itwin/tree-widget-react/3.0.1_i672swagn374al3m4ors5guk4q: + resolution: {integrity: sha512-FbfrHXfk9e+YqZqRbzTiALufGZaMThcPVz59bvMXIpnvBLPwo+PVtGe1cL9Hq8lY1XaKqPc3sDiXux1kPww5ug==} peerDependencies: '@itwin/appui-abstract': ^4.0.0 - '@itwin/appui-react': ^4.3.0 - '@itwin/components-react': ^4.3.0 + '@itwin/appui-react': ^4.10.0 + '@itwin/components-react': ^4.10.0 '@itwin/core-frontend': ^4.0.0 - '@itwin/core-react': ^4.3.0 - '@itwin/presentation-components': ^4.0.0 - react: ^17.0.0 - react-dom: ^17.0.0 + '@itwin/core-react': ^4.10.0 + '@itwin/ecschema-metadata': ^4.0.0 + '@itwin/itwinui-react': ^3.11.0 + '@itwin/presentation-components': ^5.0.0 + react: ^17.0.0 || ^18.0.0 + react-dom: ^17.0.0 || ^18.0.0 dependencies: - '@bentley/icons-generic': 1.0.34 '@itwin/appui-abstract': 4.7.4_@itwin+core-bentley@4.7.4 '@itwin/appui-react': 4.15.1_yrqai5hl5gvsf4dek6el5aloii '@itwin/components-react': 4.15.1_jscgs7su4cyo55wt5klvj3iepa '@itwin/core-frontend': 4.7.4_phc4rse3pm3zzqfro3xbf2awbu '@itwin/core-react': 4.15.1_bpptdsfauwdziiwg4uklizbr74 + '@itwin/ecschema-metadata': 4.7.4_jokiwfzdpldlrb2ppvojwoxovq '@itwin/itwinui-icons-react': 2.8.0_nnrd3gsncyragczmpvfhocinkq '@itwin/itwinui-illustrations-react': 2.1.0_nnrd3gsncyragczmpvfhocinkq '@itwin/itwinui-react': 2.12.26_nnrd3gsncyragczmpvfhocinkq '@itwin/presentation-components': 5.4.1_coeiqitrdc3kbyoxwt3ak4fycm + '@itwin/presentation-core-interop': 1.1.1_rll2n26bhzrezeyt23jhdcbtsy + '@itwin/presentation-hierarchies': 1.2.1 + '@itwin/presentation-hierarchies-react': 1.1.1_qnkn5lfpltqtw66hig7mudvuci + '@itwin/presentation-shared': 1.1.0 + '@itwin/unified-selection': 1.1.0 classnames: 2.5.1 - i18next: 10.6.0 react: 18.3.1 react-dom: 18.3.1_react@18.3.1 react-error-boundary: 4.0.13_react@18.3.1 rxjs: 7.8.1 + transitivePeerDependencies: + - '@itwin/core-bentley' + - '@itwin/core-common' + - '@itwin/core-geometry' + - '@itwin/core-quantity' dev: false /@itwin/unified-selection/0.1.0: resolution: {integrity: sha512-1Pe2i3sw5dK4h394uC5wTRWvnXxeBZGv+t9LcG7tQr2L+l0Hv+Ryo5+yTN34kABEhMe2UwSHnBRU8jOGsiorIQ==} - /@itwin/unified-selection/0.4.5: - resolution: {integrity: sha512-zqVHCEDTkaLQlFFdvBqn6VjapQTg8TaaXuNYLAIqZ0kmDCMxaGzcqvw7rJ8XaC6yboHYUe1UcFNBtSizOtSDwQ==} + /@itwin/unified-selection/1.1.0: + resolution: {integrity: sha512-9AE/zTczExDQlSheverk+FPhl/cMVT+PKnnGbN/awDAIxxxpjUTb7+x1eA9fDT7cV2NxbZvDzG3CZxXeXSDG/g==} dependencies: - '@itwin/core-bentley': 4.7.4 - '@itwin/presentation-shared': 0.3.2 + '@itwin/core-bentley': 4.9.5 + '@itwin/presentation-shared': 1.1.0 rxjs: 7.8.1 rxjs-for-await: 1.0.0_rxjs@7.8.1 dev: false @@ -10596,10 +10666,6 @@ packages: transitivePeerDependencies: - encoding - /i18next/10.6.0: - resolution: {integrity: sha512-ycRlN145kQf8EsyDAzMfjqv1ZT1Jwp7P2H/07bP8JLWm+7cSLD4XqlJOvq4mKVS2y2mMIy10lX9ZeYUdQ0qSRw==} - dev: false - /i18next/21.10.0: resolution: {integrity: sha512-YeuIBmFsGjUfO3qBmMOc0rQaun4mIpGKET5WDwvu8lU7gvwpcariZLNtL0Fzj+zazcHUrlXHiptcFhBMFaxzfg==} dependencies: @@ -10654,6 +10720,10 @@ packages: hasBin: true dev: true + /immer/10.1.1: + resolution: {integrity: sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==} + dev: false + /immer/9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} dev: true @@ -13239,7 +13309,6 @@ packages: /natural-compare-lite/1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true /natural-compare/1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} diff --git a/packages/apps/desktop-viewer-test/package.json b/packages/apps/desktop-viewer-test/package.json index 135596d6..e1395a82 100644 --- a/packages/apps/desktop-viewer-test/package.json +++ b/packages/apps/desktop-viewer-test/package.json @@ -35,7 +35,7 @@ "@itwin/appui-abstract": "^4.7.3", "@itwin/appui-layout-react": "^4.3.0", "@itwin/appui-react": "^4.3.0", - "@itwin/unified-selection": "^0.4.5", + "@itwin/unified-selection": "^1.0.0", "@itwin/components-react": "^4.3.0", "@itwin/core-backend": "^4.7.3", "@itwin/core-bentley": "^4.7.3", @@ -72,7 +72,7 @@ "@itwin/presentation-components": "^5.0.0", "@itwin/presentation-frontend": "^4.7.3", "@itwin/property-grid-react": "^1.0.0", - "@itwin/tree-widget-react": "^1.0.0", + "@itwin/tree-widget-react": "^3.0.0", "@itwin/webgl-compatibility": "^4.7.3", "dotenv-flow": "^3.2.0", "electron": "^24.8.5", diff --git a/packages/apps/desktop-viewer-test/src/frontend/components/routes/ViewerRoute.tsx b/packages/apps/desktop-viewer-test/src/frontend/components/routes/ViewerRoute.tsx index 6000d7e2..f0167892 100644 --- a/packages/apps/desktop-viewer-test/src/frontend/components/routes/ViewerRoute.tsx +++ b/packages/apps/desktop-viewer-test/src/frontend/components/routes/ViewerRoute.tsx @@ -16,7 +16,11 @@ import { PropertyGridUiItemsProvider, ShowHideNullValuesSettingsMenuItem, } from "@itwin/property-grid-react"; -import { TreeWidgetUiItemsProvider } from "@itwin/tree-widget-react"; +import { + CategoriesTreeComponent, + createTreeWidget, + ModelsTreeComponent, +} from "@itwin/tree-widget-react"; import React, { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; @@ -55,7 +59,48 @@ export const ViewerRoute = () => { }, }), new ViewerStatusbarItemsProvider(), - new TreeWidgetUiItemsProvider(), + { + id: "TreeWidgetUIProvider", + getWidgets: () => [ + createTreeWidget({ + trees: [ + { + id: ModelsTreeComponent.id, + getLabel: () => ModelsTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + { + id: CategoriesTreeComponent.id, + getLabel: () => CategoriesTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + ], + onPerformanceMeasured: (feature, elapsedTime) => { + console.log(`TreeWidget [${feature}] took ${elapsedTime} ms`); + }, + onFeatureUsed: (feature) => { + console.log(`TreeWidget [${feature}] used`); + }, + }), + ], + }, new PropertyGridUiItemsProvider({ propertyGridProps: { autoExpandChildCategories: true, diff --git a/packages/apps/web-viewer-test/package.json b/packages/apps/web-viewer-test/package.json index 7d96c882..4d27401e 100644 --- a/packages/apps/web-viewer-test/package.json +++ b/packages/apps/web-viewer-test/package.json @@ -7,7 +7,7 @@ "@itwin/appui-abstract": "^4.7.3", "@itwin/appui-layout-react": "^4.3.0", "@itwin/appui-react": "^4.3.0", - "@itwin/unified-selection": "^0.4.5", + "@itwin/unified-selection": "^1.0.0", "@itwin/browser-authorization": "^1.0.1", "@itwin/components-react": "^4.3.0", "@itwin/core-bentley": "^4.7.3", @@ -33,7 +33,7 @@ "@itwin/property-grid-react": "^1.0.0", "@itwin/reality-data-client": "^1.1.0", "@itwin/test-local-extension": "workspace:*", - "@itwin/tree-widget-react": "^1.0.0", + "@itwin/tree-widget-react": "^3.0.0", "@itwin/web-viewer-react": "workspace:*", "@itwin/webgl-compatibility": "^4.7.3", "@remix-run/router": "^1.7.2", diff --git a/packages/apps/web-viewer-test/src/components/home/ViewerHome.tsx b/packages/apps/web-viewer-test/src/components/home/ViewerHome.tsx index b054443f..c9d6e043 100644 --- a/packages/apps/web-viewer-test/src/components/home/ViewerHome.tsx +++ b/packages/apps/web-viewer-test/src/components/home/ViewerHome.tsx @@ -5,8 +5,7 @@ import { AppNotificationManager, ColorTheme } from "@itwin/appui-react"; import { BrowserAuthorizationClient } from "@itwin/browser-authorization"; -// import { LocalExtensionProvider, RemoteExtensionProvider } from "@itwin/core-frontend"; -import { ReactComponent as Itwin } from "../../images/itwin.svg"; +import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; import { MeasureTools, MeasureToolsUiItemsProvider, @@ -20,22 +19,28 @@ import { } from "@itwin/property-grid-react"; // import LocalExtension from "@itwin/test-local-extension"; import { + CategoriesTreeComponent, + createTreeWidget, + ModelsTreeComponent, TreeWidget, - TreeWidgetUiItemsProvider, } from "@itwin/tree-widget-react"; import type { ViewerBackstageItem } from "@itwin/web-viewer-react"; import { - Viewer, BackstageItemsProvider, + Viewer, ViewerContentToolsProvider, ViewerNavigationToolsProvider, ViewerStatusbarItemsProvider, } from "@itwin/web-viewer-react"; import React, { useCallback, useEffect, useMemo, useState } from "react"; +// import { LocalExtensionProvider, RemoteExtensionProvider } from "@itwin/core-frontend"; +import { ReactComponent as Itwin } from "../../images/itwin.svg"; +import { + getSchemaContext, + unifiedSelectionStorage, +} from "../../selectionStorage"; import { history } from "../routing"; -import { ECSchemaRpcInterface } from "@itwin/ecschema-rpcinterface-common"; -import { getSchemaContext, unifiedSelectionStorage } from "../../selectionStorage"; /** * Test a viewer that uses auth configuration provided at startup @@ -128,7 +133,7 @@ const ViewerHome: React.FC = () => { groupPriority: 20, itemPriority: 100, label: "BackstageItems 1", - } + }, ]; return ( @@ -163,7 +168,48 @@ const ViewerHome: React.FC = () => { }, }), new ViewerStatusbarItemsProvider(), - new TreeWidgetUiItemsProvider(), + { + id: "TreeWidgetUIProvider", + getWidgets: () => [ + createTreeWidget({ + trees: [ + { + id: ModelsTreeComponent.id, + getLabel: () => ModelsTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + { + id: CategoriesTreeComponent.id, + getLabel: () => CategoriesTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + ], + onPerformanceMeasured: (feature, elapsedTime) => { + console.log(`TreeWidget [${feature}] took ${elapsedTime} ms`); + }, + onFeatureUsed: (feature) => { + console.log(`TreeWidget [${feature}] used`); + }, + }), + ], + }, new PropertyGridUiItemsProvider({ propertyGridProps: { autoExpandChildCategories: true, @@ -196,7 +242,7 @@ const ViewerHome: React.FC = () => { // }), // ]} backstageItems={backstageItems2} - defaultUiConfig={{cornerButton: }} + defaultUiConfig={{ cornerButton: }} // renderSys={{doIdleWork: true}} selectionStorage={unifiedSelectionStorage} getSchemaContext={getSchemaContext} diff --git a/packages/modules/viewer-react/package.json b/packages/modules/viewer-react/package.json index 3f92137c..1f5d964f 100644 --- a/packages/modules/viewer-react/package.json +++ b/packages/modules/viewer-react/package.json @@ -30,12 +30,12 @@ }, "dependencies": { "@bentley/icons-generic-webfont": "^1.0.15", - "@itwin/presentation-core-interop": "^0.2.3", - "@itwin/presentation-shared": "^0.3.1", + "@itwin/presentation-core-interop": "^1.0.0", + "@itwin/presentation-shared": "^1.0.0", "@itwin/itwinui-illustrations-react": "^2.0.1", "@itwin/itwinui-react": "^2.6.0", "@itwin/reality-data-client": "^1.0.0", - "@itwin/unified-selection": "^0.4.5", + "@itwin/unified-selection": "^1.0.0", "lodash.isequal": "^4.5.0" }, "devDependencies": { diff --git a/packages/templates/cra-template-desktop-viewer/template.json b/packages/templates/cra-template-desktop-viewer/template.json index 7ffaa3da..b7d2e4c0 100644 --- a/packages/templates/cra-template-desktop-viewer/template.json +++ b/packages/templates/cra-template-desktop-viewer/template.json @@ -42,11 +42,11 @@ "@itwin/presentation-common": "^4.7.3", "@itwin/presentation-components": "^4.0.0", "@itwin/presentation-frontend": "^4.7.3", - "@itwin/presentation-core-interop": "^0.2.3", - "@itwin/presentation-shared": "^0.3.1", - "@itwin/unified-selection": "^0.4.5", + "@itwin/presentation-core-interop": "^1.0.0", + "@itwin/presentation-shared": "^1.0.0", + "@itwin/unified-selection": "^1.0.0", "@itwin/property-grid-react": "^1.0.0", - "@itwin/tree-widget-react": "^1.0.0", + "@itwin/tree-widget-react": "^3.0.0", "@itwin/webgl-compatibility": "^4.7.3", "@types/electron-devtools-installer": "^2.2.0", "@types/minimist": "^1.2.0", diff --git a/packages/templates/cra-template-desktop-viewer/template/src/frontend/components/routes/ViewerRoute.tsx b/packages/templates/cra-template-desktop-viewer/template/src/frontend/components/routes/ViewerRoute.tsx index 177dd2e1..ce6aca71 100644 --- a/packages/templates/cra-template-desktop-viewer/template/src/frontend/components/routes/ViewerRoute.tsx +++ b/packages/templates/cra-template-desktop-viewer/template/src/frontend/components/routes/ViewerRoute.tsx @@ -16,7 +16,11 @@ import { PropertyGridUiItemsProvider, ShowHideNullValuesSettingsMenuItem, } from "@itwin/property-grid-react"; -import { TreeWidgetUiItemsProvider } from "@itwin/tree-widget-react"; +import { + CategoriesTreeComponent, + createTreeWidget, + ModelsTreeComponent, +} from "@itwin/tree-widget-react"; import React, { useEffect, useState } from "react"; import { useLocation } from "react-router-dom"; @@ -54,7 +58,42 @@ export const ViewerRoute = () => { }, }), new ViewerStatusbarItemsProvider(), - new TreeWidgetUiItemsProvider(), + { + id: "TreeWidgetUIProvider", + getWidgets: () => [ + createTreeWidget({ + trees: [ + { + id: ModelsTreeComponent.id, + getLabel: () => ModelsTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + { + id: CategoriesTreeComponent.id, + getLabel: () => CategoriesTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + ], + }), + ], + }, new PropertyGridUiItemsProvider({ propertyGridProps: { autoExpandChildCategories: true, diff --git a/packages/templates/cra-template-web-viewer/template.json b/packages/templates/cra-template-web-viewer/template.json index 6cced9da..b84c5457 100644 --- a/packages/templates/cra-template-web-viewer/template.json +++ b/packages/templates/cra-template-web-viewer/template.json @@ -27,11 +27,11 @@ "@itwin/presentation-common": "^4.7.3", "@itwin/presentation-components": "^4.0.0", "@itwin/presentation-frontend": "^4.7.3", - "@itwin/presentation-core-interop": "^0.2.3", - "@itwin/presentation-shared": "^0.3.1", - "@itwin/unified-selection": "^0.4.5", + "@itwin/presentation-core-interop": "^1.0.0", + "@itwin/presentation-shared": "^1.0.0", + "@itwin/unified-selection": "^1.0.0", "@itwin/property-grid-react": "^1.0.0", - "@itwin/tree-widget-react": "^1.0.0", + "@itwin/tree-widget-react": "^3.0.0", "@itwin/web-viewer-react": "^4.0.0", "@itwin/webgl-compatibility": "^4.7.3", "@remix-run/router": "^1.3.2", diff --git a/packages/templates/cra-template-web-viewer/template/src/App.tsx b/packages/templates/cra-template-web-viewer/template/src/App.tsx index 3fae2db1..c1f98413 100644 --- a/packages/templates/cra-template-web-viewer/template/src/App.tsx +++ b/packages/templates/cra-template-web-viewer/template/src/App.tsx @@ -23,8 +23,10 @@ import { ShowHideNullValuesSettingsMenuItem, } from "@itwin/property-grid-react"; import { + CategoriesTreeComponent, + createTreeWidget, + ModelsTreeComponent, TreeWidget, - TreeWidgetUiItemsProvider, } from "@itwin/tree-widget-react"; import { useAccessToken, @@ -174,7 +176,42 @@ const App: React.FC = () => { }, }), new ViewerStatusbarItemsProvider(), - new TreeWidgetUiItemsProvider(), + { + id: "TreeWidgetUIProvider", + getWidgets: () => [ + createTreeWidget({ + trees: [ + { + id: ModelsTreeComponent.id, + getLabel: () => ModelsTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + { + id: CategoriesTreeComponent.id, + getLabel: () => CategoriesTreeComponent.getLabel(), + render: (props) => ( + + ), + }, + ], + }), + ], + }, new PropertyGridUiItemsProvider({ propertyGridProps: { autoExpandChildCategories: true, diff --git a/rush.json b/rush.json index deafe0e4..8b3072a0 100644 --- a/rush.json +++ b/rush.json @@ -2,7 +2,7 @@ "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/rush.schema.json", "rushVersion": "5.112.2", "pnpmVersion": "7.32.2", - "nodeSupportedVersionRange": "^18.12.0 || ^20.9.0", + "nodeSupportedVersionRange": "^18.12.0 || ^20.9.0 || ^22.11.0", "projectFolderMinDepth": 2, "projectFolderMaxDepth": 3, "repository": {