@itwin/rpcinterface-full-stack-tests 5.13.0-dev.11 → 5.13.0-dev.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/bundled-tests.js +111 -33
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -120494,6 +120494,7 @@ class ViewManager {
|
|
|
120494
120494
|
cursor = "default";
|
|
120495
120495
|
_viewports = [];
|
|
120496
120496
|
decorators = [];
|
|
120497
|
+
_selectedViewportChange = Promise.resolve();
|
|
120497
120498
|
_selectedView;
|
|
120498
120499
|
_invalidateScenes = false;
|
|
120499
120500
|
_skipSceneCreation = false;
|
|
@@ -120621,9 +120622,16 @@ class ViewManager {
|
|
|
120621
120622
|
}
|
|
120622
120623
|
/** @internal */
|
|
120623
120624
|
notifySelectedViewportChanged(previous, current) {
|
|
120624
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)
|
|
120625
|
+
const selectedViewportChange = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)
|
|
120626
|
+
.catch(() => undefined);
|
|
120627
|
+
this._selectedViewportChange = this._selectedViewportChange.then(async () => selectedViewportChange, async () => selectedViewportChange)
|
|
120628
|
+
.then(() => undefined, () => undefined);
|
|
120625
120629
|
this.onSelectedViewportChanged.emit({ previous, current });
|
|
120626
120630
|
}
|
|
120631
|
+
/** @internal */
|
|
120632
|
+
async waitForSelectedViewportChange() {
|
|
120633
|
+
await this._selectedViewportChange;
|
|
120634
|
+
}
|
|
120627
120635
|
/** The "selected view" is the default for certain operations. */
|
|
120628
120636
|
get selectedView() { return this._selectedView; }
|
|
120629
120637
|
/** Get the first opened view. */
|
|
@@ -206450,7 +206458,11 @@ class InteractiveTool extends Tool {
|
|
|
206450
206458
|
async onPostInstall() { }
|
|
206451
206459
|
/** Override Call to reset tool to initial state */
|
|
206452
206460
|
async onReinitialize() { }
|
|
206453
|
-
/** Invoked when the tool becomes no longer active, to perform additional cleanup logic
|
|
206461
|
+
/** Invoked when the tool becomes no longer active, to perform additional cleanup logic.
|
|
206462
|
+
* Cleanup must not assume that the EditCommand associated with the tool is still active: an immediate tool may have finished or
|
|
206463
|
+
* replaced it while this tool remained active. Tools must not start an EditCommand from onCleanup; ToolAdmin owns finishing the active EditCommand during tool cleanup.
|
|
206464
|
+
* @note A ViewTool should never start an EditCommand. An InputCollector may start an EditCommand only if suspending a tool that supports EditManipulators (ex. SelectionTool).
|
|
206465
|
+
*/
|
|
206454
206466
|
async onCleanup() { }
|
|
206455
206467
|
/** Notification of a ViewTool or InputCollector starting and this tool is being suspended.
|
|
206456
206468
|
* @note Applies only to PrimitiveTool and InputCollector, a ViewTool can't be suspended.
|
|
@@ -208624,23 +208636,54 @@ class ToolAdmin {
|
|
|
208624
208636
|
}
|
|
208625
208637
|
/** @internal */
|
|
208626
208638
|
async setPrimitiveTool(newTool) {
|
|
208627
|
-
|
|
208628
|
-
|
|
208629
|
-
|
|
208630
|
-
|
|
208631
|
-
|
|
208639
|
+
return this.setPrimitiveToolInternal(newTool);
|
|
208640
|
+
}
|
|
208641
|
+
async setPrimitiveToolInternal(newTool, pendingFinishCommand) {
|
|
208642
|
+
const oldTool = this._primitiveTool;
|
|
208643
|
+
let ownsOldTool = undefined === oldTool;
|
|
208644
|
+
if (undefined !== oldTool) {
|
|
208645
|
+
let mainError;
|
|
208646
|
+
try {
|
|
208647
|
+
await oldTool.onCleanup();
|
|
208648
|
+
}
|
|
208649
|
+
catch (err) {
|
|
208650
|
+
mainError = (err instanceof Error) ? err : new Error(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err));
|
|
208651
|
+
}
|
|
208652
|
+
try {
|
|
208653
|
+
if (undefined !== pendingFinishCommand)
|
|
208654
|
+
await pendingFinishCommand;
|
|
208655
|
+
else if (undefined !== this._editCommandHandler)
|
|
208656
|
+
await this._editCommandHandler.finishCommand();
|
|
208657
|
+
}
|
|
208658
|
+
catch (err) {
|
|
208659
|
+
// throw finishCommand error if onCleanup succeeded, otherwise log finishCommand failure...
|
|
208660
|
+
if (undefined === mainError)
|
|
208661
|
+
mainError = (err instanceof Error) ? err : new Error(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err));
|
|
208662
|
+
else
|
|
208663
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_4__.FrontendLoggerCategory.Package}.toolAdmin`, err);
|
|
208664
|
+
}
|
|
208665
|
+
finally {
|
|
208666
|
+
// Force-clear stale tool state if either onCleanup or finishCommand failed...
|
|
208667
|
+
ownsOldTool = this._primitiveTool === oldTool;
|
|
208668
|
+
if (ownsOldTool)
|
|
208669
|
+
this._primitiveTool = undefined;
|
|
208670
|
+
}
|
|
208671
|
+
if (undefined !== mainError)
|
|
208672
|
+
throw mainError;
|
|
208632
208673
|
}
|
|
208633
|
-
|
|
208674
|
+
// Do not let a delayed transition overwrite a tool installed by a newer transition.
|
|
208675
|
+
if (ownsOldTool)
|
|
208676
|
+
this._primitiveTool = newTool;
|
|
208634
208677
|
}
|
|
208635
|
-
//
|
|
208636
|
-
|
|
208678
|
+
// Serialize primitive starts and last-viewport cleanup to avoid overlapping transitions.
|
|
208679
|
+
_primitiveToolTransition;
|
|
208637
208680
|
/** @internal */
|
|
208638
208681
|
async startPrimitiveTool(newTool) {
|
|
208639
208682
|
// If another start is in progress wait for it to finish before proceeding.
|
|
208640
|
-
while (undefined !== this.
|
|
208641
|
-
await this.
|
|
208642
|
-
let
|
|
208643
|
-
this.
|
|
208683
|
+
while (undefined !== this._primitiveToolTransition)
|
|
208684
|
+
await this._primitiveToolTransition;
|
|
208685
|
+
let resolveTransition;
|
|
208686
|
+
const transition = this._primitiveToolTransition = new Promise((resolve) => { resolveTransition = resolve; });
|
|
208644
208687
|
try {
|
|
208645
208688
|
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.notifications.outputPrompt("");
|
|
208646
208689
|
await this.exitViewTool();
|
|
@@ -208668,9 +208711,9 @@ class ToolAdmin {
|
|
|
208668
208711
|
this.onActiveToolChanged(activeTool, StartOrResume.Start);
|
|
208669
208712
|
}
|
|
208670
208713
|
finally {
|
|
208671
|
-
|
|
208672
|
-
|
|
208673
|
-
|
|
208714
|
+
resolveTransition?.();
|
|
208715
|
+
if (this._primitiveToolTransition === transition)
|
|
208716
|
+
this._primitiveToolTransition = undefined;
|
|
208674
208717
|
}
|
|
208675
208718
|
}
|
|
208676
208719
|
/** Method used by interactive tools to send updated values to UI components, typically showing tool settings.
|
|
@@ -208917,10 +208960,41 @@ class ToolAdmin {
|
|
|
208917
208960
|
set coordinateLockOverrides(coordLockOvr) { this.toolState.coordLockOvr = coordLockOvr; }
|
|
208918
208961
|
/** @internal */
|
|
208919
208962
|
async callOnCleanup() {
|
|
208920
|
-
|
|
208921
|
-
|
|
208922
|
-
|
|
208923
|
-
|
|
208963
|
+
let pendingFinishCommand;
|
|
208964
|
+
const previousTransition = this._primitiveToolTransition;
|
|
208965
|
+
let resolveTransition;
|
|
208966
|
+
const transition = this._primitiveToolTransition = new Promise((resolve) => { resolveTransition = resolve; });
|
|
208967
|
+
try {
|
|
208968
|
+
// Start the edit-command cleanup before the first await. ViewManager can invoke this method
|
|
208969
|
+
// without awaiting it when the last viewport is dropped.
|
|
208970
|
+
if (undefined !== this._editCommandHandler) {
|
|
208971
|
+
const finishCommand = this._editCommandHandler.finishCommand();
|
|
208972
|
+
// Attach a rejection handler immediately: another cleanup operation may fail before this promise is awaited.
|
|
208973
|
+
pendingFinishCommand = finishCommand.catch((err) => {
|
|
208974
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_4__.FrontendLoggerCategory.Package}.toolAdmin`, err);
|
|
208975
|
+
return "";
|
|
208976
|
+
});
|
|
208977
|
+
}
|
|
208978
|
+
if (undefined !== previousTransition)
|
|
208979
|
+
await previousTransition;
|
|
208980
|
+
if (undefined !== this._viewTool)
|
|
208981
|
+
await this.exitViewTool();
|
|
208982
|
+
if (undefined !== this._inputCollector)
|
|
208983
|
+
await this.exitInputCollector();
|
|
208984
|
+
// Keep cleanup path consistent with other primitive-tool transitions.
|
|
208985
|
+
if (undefined !== this._primitiveTool)
|
|
208986
|
+
await this.setPrimitiveToolInternal(undefined, pendingFinishCommand); // NOTE: ViewManager.setSelectedView will call startDefaultTool if a new view is opened...
|
|
208987
|
+
else if (undefined !== pendingFinishCommand)
|
|
208988
|
+
await pendingFinishCommand;
|
|
208989
|
+
}
|
|
208990
|
+
catch (err) {
|
|
208991
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_4__.FrontendLoggerCategory.Package}.toolAdmin`, err);
|
|
208992
|
+
}
|
|
208993
|
+
finally {
|
|
208994
|
+
resolveTransition?.();
|
|
208995
|
+
if (this._primitiveToolTransition === transition)
|
|
208996
|
+
this._primitiveToolTransition = undefined;
|
|
208997
|
+
}
|
|
208924
208998
|
}
|
|
208925
208999
|
}
|
|
208926
209000
|
/**
|
|
@@ -289911,18 +289985,19 @@ class PolyfaceQuery {
|
|
|
289911
289985
|
*/
|
|
289912
289986
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
289913
289987
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
289988
|
+
// visit all facets and collect normals and edges
|
|
289914
289989
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_29__.IndexedEdgeMatcher();
|
|
289915
289990
|
const vertices = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_34__.Polyface ? source.data.point : undefined;
|
|
289916
289991
|
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_34__.Polyface ? source.createVisitor(1) : source;
|
|
289917
289992
|
visitor.setNumWrap(1);
|
|
289918
|
-
const
|
|
289993
|
+
const facetNormals = [];
|
|
289919
289994
|
let normalCounter = 0;
|
|
289920
289995
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
289921
289996
|
const numEdges = visitor.pointCount - 1;
|
|
289922
289997
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_14__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
289923
289998
|
if (normal === undefined)
|
|
289924
289999
|
return -2;
|
|
289925
|
-
|
|
290000
|
+
facetNormals.push(normal);
|
|
289926
290001
|
for (let i = 0; i < numEdges; i++) {
|
|
289927
290002
|
const edge = edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
289928
290003
|
if (!vertices) // decorate if we don't have vertices to query later
|
|
@@ -289938,21 +290013,24 @@ class PolyfaceQuery {
|
|
|
289938
290013
|
edges.sortAndCollectClusters(manifoldClusters, ignoreBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
289939
290014
|
if (badClusters.length > 0)
|
|
289940
290015
|
return -2;
|
|
289941
|
-
// find angle between facet
|
|
290016
|
+
// find angle between facet normals (dihedral angles)
|
|
289942
290017
|
let numPositive = 0;
|
|
289943
290018
|
let numPlanar = 0;
|
|
289944
290019
|
let numNegative = 0;
|
|
289945
290020
|
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_12__.Vector3d.create();
|
|
289946
290021
|
for (const cluster of manifoldClusters) {
|
|
289947
290022
|
if (Array.isArray(cluster) && cluster.length === 2) {
|
|
289948
|
-
const sideA = cluster[0];
|
|
289949
|
-
const sideB = cluster[1];
|
|
289950
|
-
if (vertices)
|
|
289951
|
-
vertices.vectorIndexIndex(sideA.startVertex, sideA.endVertex, edgeVector)
|
|
289952
|
-
|
|
290023
|
+
const sideA = cluster[0]; // edge on facetA
|
|
290024
|
+
const sideB = cluster[1]; // edge on facetB
|
|
290025
|
+
if (vertices) {
|
|
290026
|
+
if (!vertices.vectorIndexIndex(sideA.startVertex, sideA.endVertex, edgeVector))
|
|
290027
|
+
return -2;
|
|
290028
|
+
}
|
|
290029
|
+
else {
|
|
289953
290030
|
edgeVector.setFrom(sideA.edgeVector);
|
|
289954
|
-
|
|
289955
|
-
const
|
|
290031
|
+
}
|
|
290032
|
+
const facetNormalA = facetNormals[sideA.facetIndex].direction;
|
|
290033
|
+
const facetNormalB = facetNormals[sideB.facetIndex].direction;
|
|
289956
290034
|
const dihedralAngle = facetNormalA.signedAngleTo(facetNormalB, edgeVector);
|
|
289957
290035
|
if (dihedralAngle.isAlmostZero)
|
|
289958
290036
|
numPlanar++;
|
|
@@ -342346,7 +342424,7 @@ class TestContext {
|
|
|
342346
342424
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
342347
342425
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
342348
342426
|
await core_frontend_1.NoRenderApp.startup({
|
|
342349
|
-
applicationVersion: "5.13.0-dev.
|
|
342427
|
+
applicationVersion: "5.13.0-dev.12",
|
|
342350
342428
|
applicationId: this.settings.gprid,
|
|
342351
342429
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
342352
342430
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -367541,7 +367619,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
367541
367619
|
(module) {
|
|
367542
367620
|
|
|
367543
367621
|
"use strict";
|
|
367544
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.13.0-dev.
|
|
367622
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.13.0-dev.12","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s build:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run build:test-worker && vitest --run","cover":"npm run build:test-worker && vitest --run","build:test-worker":"vite build --config ./src/test/worker/vite.config.mts 1>&2","build:workers":"rimraf lib/workers/webpack && vite build --config ./src/workers/ImdlParser/vite.config.mts 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.11","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.10","@vitest/coverage-v8":"^4.1.10","cpx2":"^8.0.0","eslint":"^9.31.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","typescript":"~5.6.2","vite":"^6.4.3","vitest":"^4.1.10","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"~4.3.4","@loaders.gl/draco":"~4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
367545
367623
|
|
|
367546
367624
|
/***/ },
|
|
367547
367625
|
|