@itwin/ecschema-rpcinterface-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 +110 -32
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -100488,6 +100488,7 @@ class ViewManager {
|
|
|
100488
100488
|
cursor = "default";
|
|
100489
100489
|
_viewports = [];
|
|
100490
100490
|
decorators = [];
|
|
100491
|
+
_selectedViewportChange = Promise.resolve();
|
|
100491
100492
|
_selectedView;
|
|
100492
100493
|
_invalidateScenes = false;
|
|
100493
100494
|
_skipSceneCreation = false;
|
|
@@ -100615,9 +100616,16 @@ class ViewManager {
|
|
|
100615
100616
|
}
|
|
100616
100617
|
/** @internal */
|
|
100617
100618
|
notifySelectedViewportChanged(previous, current) {
|
|
100618
|
-
_IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)
|
|
100619
|
+
const selectedViewportChange = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.onSelectedViewportChanged(previous, current)
|
|
100620
|
+
.catch(() => undefined);
|
|
100621
|
+
this._selectedViewportChange = this._selectedViewportChange.then(async () => selectedViewportChange, async () => selectedViewportChange)
|
|
100622
|
+
.then(() => undefined, () => undefined);
|
|
100619
100623
|
this.onSelectedViewportChanged.emit({ previous, current });
|
|
100620
100624
|
}
|
|
100625
|
+
/** @internal */
|
|
100626
|
+
async waitForSelectedViewportChange() {
|
|
100627
|
+
await this._selectedViewportChange;
|
|
100628
|
+
}
|
|
100621
100629
|
/** The "selected view" is the default for certain operations. */
|
|
100622
100630
|
get selectedView() { return this._selectedView; }
|
|
100623
100631
|
/** Get the first opened view. */
|
|
@@ -186444,7 +186452,11 @@ class InteractiveTool extends Tool {
|
|
|
186444
186452
|
async onPostInstall() { }
|
|
186445
186453
|
/** Override Call to reset tool to initial state */
|
|
186446
186454
|
async onReinitialize() { }
|
|
186447
|
-
/** Invoked when the tool becomes no longer active, to perform additional cleanup logic
|
|
186455
|
+
/** Invoked when the tool becomes no longer active, to perform additional cleanup logic.
|
|
186456
|
+
* Cleanup must not assume that the EditCommand associated with the tool is still active: an immediate tool may have finished or
|
|
186457
|
+
* replaced it while this tool remained active. Tools must not start an EditCommand from onCleanup; ToolAdmin owns finishing the active EditCommand during tool cleanup.
|
|
186458
|
+
* @note A ViewTool should never start an EditCommand. An InputCollector may start an EditCommand only if suspending a tool that supports EditManipulators (ex. SelectionTool).
|
|
186459
|
+
*/
|
|
186448
186460
|
async onCleanup() { }
|
|
186449
186461
|
/** Notification of a ViewTool or InputCollector starting and this tool is being suspended.
|
|
186450
186462
|
* @note Applies only to PrimitiveTool and InputCollector, a ViewTool can't be suspended.
|
|
@@ -188618,23 +188630,54 @@ class ToolAdmin {
|
|
|
188618
188630
|
}
|
|
188619
188631
|
/** @internal */
|
|
188620
188632
|
async setPrimitiveTool(newTool) {
|
|
188621
|
-
|
|
188622
|
-
|
|
188623
|
-
|
|
188624
|
-
|
|
188625
|
-
|
|
188633
|
+
return this.setPrimitiveToolInternal(newTool);
|
|
188634
|
+
}
|
|
188635
|
+
async setPrimitiveToolInternal(newTool, pendingFinishCommand) {
|
|
188636
|
+
const oldTool = this._primitiveTool;
|
|
188637
|
+
let ownsOldTool = undefined === oldTool;
|
|
188638
|
+
if (undefined !== oldTool) {
|
|
188639
|
+
let mainError;
|
|
188640
|
+
try {
|
|
188641
|
+
await oldTool.onCleanup();
|
|
188642
|
+
}
|
|
188643
|
+
catch (err) {
|
|
188644
|
+
mainError = (err instanceof Error) ? err : new Error(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err));
|
|
188645
|
+
}
|
|
188646
|
+
try {
|
|
188647
|
+
if (undefined !== pendingFinishCommand)
|
|
188648
|
+
await pendingFinishCommand;
|
|
188649
|
+
else if (undefined !== this._editCommandHandler)
|
|
188650
|
+
await this._editCommandHandler.finishCommand();
|
|
188651
|
+
}
|
|
188652
|
+
catch (err) {
|
|
188653
|
+
// throw finishCommand error if onCleanup succeeded, otherwise log finishCommand failure...
|
|
188654
|
+
if (undefined === mainError)
|
|
188655
|
+
mainError = (err instanceof Error) ? err : new Error(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err));
|
|
188656
|
+
else
|
|
188657
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_4__.FrontendLoggerCategory.Package}.toolAdmin`, err);
|
|
188658
|
+
}
|
|
188659
|
+
finally {
|
|
188660
|
+
// Force-clear stale tool state if either onCleanup or finishCommand failed...
|
|
188661
|
+
ownsOldTool = this._primitiveTool === oldTool;
|
|
188662
|
+
if (ownsOldTool)
|
|
188663
|
+
this._primitiveTool = undefined;
|
|
188664
|
+
}
|
|
188665
|
+
if (undefined !== mainError)
|
|
188666
|
+
throw mainError;
|
|
188626
188667
|
}
|
|
188627
|
-
|
|
188668
|
+
// Do not let a delayed transition overwrite a tool installed by a newer transition.
|
|
188669
|
+
if (ownsOldTool)
|
|
188670
|
+
this._primitiveTool = newTool;
|
|
188628
188671
|
}
|
|
188629
|
-
//
|
|
188630
|
-
|
|
188672
|
+
// Serialize primitive starts and last-viewport cleanup to avoid overlapping transitions.
|
|
188673
|
+
_primitiveToolTransition;
|
|
188631
188674
|
/** @internal */
|
|
188632
188675
|
async startPrimitiveTool(newTool) {
|
|
188633
188676
|
// If another start is in progress wait for it to finish before proceeding.
|
|
188634
|
-
while (undefined !== this.
|
|
188635
|
-
await this.
|
|
188636
|
-
let
|
|
188637
|
-
this.
|
|
188677
|
+
while (undefined !== this._primitiveToolTransition)
|
|
188678
|
+
await this._primitiveToolTransition;
|
|
188679
|
+
let resolveTransition;
|
|
188680
|
+
const transition = this._primitiveToolTransition = new Promise((resolve) => { resolveTransition = resolve; });
|
|
188638
188681
|
try {
|
|
188639
188682
|
_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.notifications.outputPrompt("");
|
|
188640
188683
|
await this.exitViewTool();
|
|
@@ -188662,9 +188705,9 @@ class ToolAdmin {
|
|
|
188662
188705
|
this.onActiveToolChanged(activeTool, StartOrResume.Start);
|
|
188663
188706
|
}
|
|
188664
188707
|
finally {
|
|
188665
|
-
|
|
188666
|
-
|
|
188667
|
-
|
|
188708
|
+
resolveTransition?.();
|
|
188709
|
+
if (this._primitiveToolTransition === transition)
|
|
188710
|
+
this._primitiveToolTransition = undefined;
|
|
188668
188711
|
}
|
|
188669
188712
|
}
|
|
188670
188713
|
/** Method used by interactive tools to send updated values to UI components, typically showing tool settings.
|
|
@@ -188911,10 +188954,41 @@ class ToolAdmin {
|
|
|
188911
188954
|
set coordinateLockOverrides(coordLockOvr) { this.toolState.coordLockOvr = coordLockOvr; }
|
|
188912
188955
|
/** @internal */
|
|
188913
188956
|
async callOnCleanup() {
|
|
188914
|
-
|
|
188915
|
-
|
|
188916
|
-
|
|
188917
|
-
|
|
188957
|
+
let pendingFinishCommand;
|
|
188958
|
+
const previousTransition = this._primitiveToolTransition;
|
|
188959
|
+
let resolveTransition;
|
|
188960
|
+
const transition = this._primitiveToolTransition = new Promise((resolve) => { resolveTransition = resolve; });
|
|
188961
|
+
try {
|
|
188962
|
+
// Start the edit-command cleanup before the first await. ViewManager can invoke this method
|
|
188963
|
+
// without awaiting it when the last viewport is dropped.
|
|
188964
|
+
if (undefined !== this._editCommandHandler) {
|
|
188965
|
+
const finishCommand = this._editCommandHandler.finishCommand();
|
|
188966
|
+
// Attach a rejection handler immediately: another cleanup operation may fail before this promise is awaited.
|
|
188967
|
+
pendingFinishCommand = finishCommand.catch((err) => {
|
|
188968
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_4__.FrontendLoggerCategory.Package}.toolAdmin`, err);
|
|
188969
|
+
return "";
|
|
188970
|
+
});
|
|
188971
|
+
}
|
|
188972
|
+
if (undefined !== previousTransition)
|
|
188973
|
+
await previousTransition;
|
|
188974
|
+
if (undefined !== this._viewTool)
|
|
188975
|
+
await this.exitViewTool();
|
|
188976
|
+
if (undefined !== this._inputCollector)
|
|
188977
|
+
await this.exitInputCollector();
|
|
188978
|
+
// Keep cleanup path consistent with other primitive-tool transitions.
|
|
188979
|
+
if (undefined !== this._primitiveTool)
|
|
188980
|
+
await this.setPrimitiveToolInternal(undefined, pendingFinishCommand); // NOTE: ViewManager.setSelectedView will call startDefaultTool if a new view is opened...
|
|
188981
|
+
else if (undefined !== pendingFinishCommand)
|
|
188982
|
+
await pendingFinishCommand;
|
|
188983
|
+
}
|
|
188984
|
+
catch (err) {
|
|
188985
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(`${_common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_4__.FrontendLoggerCategory.Package}.toolAdmin`, err);
|
|
188986
|
+
}
|
|
188987
|
+
finally {
|
|
188988
|
+
resolveTransition?.();
|
|
188989
|
+
if (this._primitiveToolTransition === transition)
|
|
188990
|
+
this._primitiveToolTransition = undefined;
|
|
188991
|
+
}
|
|
188918
188992
|
}
|
|
188919
188993
|
}
|
|
188920
188994
|
/**
|
|
@@ -269905,18 +269979,19 @@ class PolyfaceQuery {
|
|
|
269905
269979
|
*/
|
|
269906
269980
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
269907
269981
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
269982
|
+
// visit all facets and collect normals and edges
|
|
269908
269983
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_29__.IndexedEdgeMatcher();
|
|
269909
269984
|
const vertices = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_34__.Polyface ? source.data.point : undefined;
|
|
269910
269985
|
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_34__.Polyface ? source.createVisitor(1) : source;
|
|
269911
269986
|
visitor.setNumWrap(1);
|
|
269912
|
-
const
|
|
269987
|
+
const facetNormals = [];
|
|
269913
269988
|
let normalCounter = 0;
|
|
269914
269989
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
269915
269990
|
const numEdges = visitor.pointCount - 1;
|
|
269916
269991
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_14__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
269917
269992
|
if (normal === undefined)
|
|
269918
269993
|
return -2;
|
|
269919
|
-
|
|
269994
|
+
facetNormals.push(normal);
|
|
269920
269995
|
for (let i = 0; i < numEdges; i++) {
|
|
269921
269996
|
const edge = edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
269922
269997
|
if (!vertices) // decorate if we don't have vertices to query later
|
|
@@ -269932,21 +270007,24 @@ class PolyfaceQuery {
|
|
|
269932
270007
|
edges.sortAndCollectClusters(manifoldClusters, ignoreBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
269933
270008
|
if (badClusters.length > 0)
|
|
269934
270009
|
return -2;
|
|
269935
|
-
// find angle between facet
|
|
270010
|
+
// find angle between facet normals (dihedral angles)
|
|
269936
270011
|
let numPositive = 0;
|
|
269937
270012
|
let numPlanar = 0;
|
|
269938
270013
|
let numNegative = 0;
|
|
269939
270014
|
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_12__.Vector3d.create();
|
|
269940
270015
|
for (const cluster of manifoldClusters) {
|
|
269941
270016
|
if (Array.isArray(cluster) && cluster.length === 2) {
|
|
269942
|
-
const sideA = cluster[0];
|
|
269943
|
-
const sideB = cluster[1];
|
|
269944
|
-
if (vertices)
|
|
269945
|
-
vertices.vectorIndexIndex(sideA.startVertex, sideA.endVertex, edgeVector)
|
|
269946
|
-
|
|
270017
|
+
const sideA = cluster[0]; // edge on facetA
|
|
270018
|
+
const sideB = cluster[1]; // edge on facetB
|
|
270019
|
+
if (vertices) {
|
|
270020
|
+
if (!vertices.vectorIndexIndex(sideA.startVertex, sideA.endVertex, edgeVector))
|
|
270021
|
+
return -2;
|
|
270022
|
+
}
|
|
270023
|
+
else {
|
|
269947
270024
|
edgeVector.setFrom(sideA.edgeVector);
|
|
269948
|
-
|
|
269949
|
-
const
|
|
270025
|
+
}
|
|
270026
|
+
const facetNormalA = facetNormals[sideA.facetIndex].direction;
|
|
270027
|
+
const facetNormalB = facetNormals[sideB.facetIndex].direction;
|
|
269950
270028
|
const dihedralAngle = facetNormalA.signedAngleTo(facetNormalB, edgeVector);
|
|
269951
270029
|
if (dihedralAngle.isAlmostZero)
|
|
269952
270030
|
numPlanar++;
|
|
@@ -334382,7 +334460,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
334382
334460
|
(module) {
|
|
334383
334461
|
|
|
334384
334462
|
"use strict";
|
|
334385
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.13.0-dev.
|
|
334463
|
+
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"}}');
|
|
334386
334464
|
|
|
334387
334465
|
/***/ }
|
|
334388
334466
|
|