@itwin/rpcinterface-full-stack-tests 5.9.0-dev.10 → 5.9.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 +58 -7
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -220372,12 +220372,26 @@ class ToolAdmin {
|
|
|
220372
220372
|
if (!ev.repeat) // we don't want repeated keyboard events. If we keep them they interfere with replacing mouse motion events, since they come as a stream.
|
|
220373
220373
|
ToolAdmin.addEvent(ev);
|
|
220374
220374
|
};
|
|
220375
|
+
/** Handler for modifier key transitions captured before focused UI elements can stop propagation. */
|
|
220376
|
+
static _keyEventCaptureHandler = async (event) => {
|
|
220377
|
+
const ev = event;
|
|
220378
|
+
if (!ev.repeat) {
|
|
220379
|
+
try {
|
|
220380
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.toolAdmin.onKeyTransitionCaptured(ev);
|
|
220381
|
+
}
|
|
220382
|
+
catch (err) {
|
|
220383
|
+
await ToolAdmin.exceptionHandler(err);
|
|
220384
|
+
}
|
|
220385
|
+
}
|
|
220386
|
+
};
|
|
220375
220387
|
/** @internal */
|
|
220376
220388
|
onInitialized() {
|
|
220377
220389
|
if (typeof document === "undefined")
|
|
220378
220390
|
return; // if document isn't defined, we're probably running in a test environment. At any rate, we can't have interactive tools.
|
|
220379
220391
|
this._idleTool = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.create("Idle");
|
|
220380
220392
|
["keydown", "keyup"].forEach((type) => {
|
|
220393
|
+
document.addEventListener(type, ToolAdmin._keyEventCaptureHandler, true);
|
|
220394
|
+
ToolAdmin._removals.push(() => document.removeEventListener(type, ToolAdmin._keyEventCaptureHandler, true));
|
|
220381
220395
|
document.addEventListener(type, ToolAdmin._keyEventHandler, false);
|
|
220382
220396
|
ToolAdmin._removals.push(() => document.removeEventListener(type, ToolAdmin._keyEventHandler, false));
|
|
220383
220397
|
});
|
|
@@ -221141,6 +221155,15 @@ class ToolAdmin {
|
|
|
221141
221155
|
this.updateDynamics(undefined, undefined, true); // Don't wait for motion to update dynamics...
|
|
221142
221156
|
}
|
|
221143
221157
|
}
|
|
221158
|
+
get _isFocusHome() {
|
|
221159
|
+
return (document.body === document.activeElement);
|
|
221160
|
+
}
|
|
221161
|
+
_setFocusHome() {
|
|
221162
|
+
const element = document.activeElement;
|
|
221163
|
+
if (element && element !== document.body)
|
|
221164
|
+
element.blur();
|
|
221165
|
+
document.body.focus();
|
|
221166
|
+
}
|
|
221144
221167
|
static getModifierKey(event) {
|
|
221145
221168
|
switch (event.key) {
|
|
221146
221169
|
case "Alt": return _Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.Alt;
|
|
@@ -221171,17 +221194,41 @@ class ToolAdmin {
|
|
|
221171
221194
|
}
|
|
221172
221195
|
return { handled, result };
|
|
221173
221196
|
}
|
|
221174
|
-
/**
|
|
221197
|
+
/** Sub-classes should override to process shortcut key events.
|
|
221198
|
+
* @return true if handled and no further processing of event should occur.
|
|
221199
|
+
*/
|
|
221175
221200
|
async processShortcutKey(_keyEvent, _wentDown) {
|
|
221176
221201
|
return false;
|
|
221177
221202
|
}
|
|
221178
|
-
/** Event for every key down and up transition.
|
|
221179
|
-
|
|
221180
|
-
|
|
221203
|
+
/** Event for every key down and up transition.
|
|
221204
|
+
* @note Called before processShortcutKey.
|
|
221205
|
+
* @return true if handled and no further processing of event should occur.
|
|
221206
|
+
*/
|
|
221207
|
+
processKeyboardEvent(keyEvent, _wentDown) {
|
|
221208
|
+
if (this._isFocusHome || undefined !== _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.getFocusItem())
|
|
221209
|
+
return false; // Focus is Home or AccuDraw, allow shortcuts...
|
|
221210
|
+
// NOTE: Provide a convenient way for the user to move focus to Home to use shortcuts.
|
|
221211
|
+
// Escape is the only practical choice with its default behavior that can cancel/close/blur.
|
|
221212
|
+
// Intentionally not checking wentDown as some ui elements stop propagation of down but not up (moving to capture is not a good option).
|
|
221213
|
+
// Apps that want to use Escape to start the default tool still can with Home focus in processShortcutKey.
|
|
221214
|
+
if (keyEvent.key === "Escape" && _ToolSettings__WEBPACK_IMPORTED_MODULE_14__.ToolSettings.escapeMovesFocusToHome && !keyEvent.defaultPrevented && !keyEvent.isComposing)
|
|
221215
|
+
this._setFocusHome();
|
|
221216
|
+
return true;
|
|
221217
|
+
}
|
|
221218
|
+
/** Need to check for modifier changes on capture phase as a ui element that calls stopPropagation
|
|
221219
|
+
* prevents onKeyTransition from being called when bubbling.
|
|
221220
|
+
*/
|
|
221221
|
+
async onKeyTransitionCaptured(keyEvent) {
|
|
221181
221222
|
this.currentInputState.setKeyQualifiers(keyEvent);
|
|
221182
221223
|
const modifierKey = ToolAdmin.getModifierKey(keyEvent);
|
|
221183
221224
|
if (_Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.None !== modifierKey)
|
|
221184
|
-
return this.onModifierKeyTransition(
|
|
221225
|
+
return this.onModifierKeyTransition("keydown" === keyEvent.type, modifierKey, keyEvent);
|
|
221226
|
+
}
|
|
221227
|
+
/** Event for every key down and up transition. */
|
|
221228
|
+
async onKeyTransition(event, wentDown) {
|
|
221229
|
+
const keyEvent = event.ev;
|
|
221230
|
+
if (this.processKeyboardEvent(keyEvent, wentDown))
|
|
221231
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes;
|
|
221185
221232
|
if (wentDown && keyEvent.ctrlKey) {
|
|
221186
221233
|
const { handled, result } = await this.onCtrlKeyPressed(keyEvent);
|
|
221187
221234
|
if (handled)
|
|
@@ -222076,6 +222123,10 @@ class ToolSettings {
|
|
|
222076
222123
|
* @beta
|
|
222077
222124
|
*/
|
|
222078
222125
|
static enableVolumeSelection = false;
|
|
222126
|
+
/** If true, pressing Escape key sets focus to Home to allow shortcuts to be used.
|
|
222127
|
+
* @beta
|
|
222128
|
+
*/
|
|
222129
|
+
static escapeMovesFocusToHome = true;
|
|
222079
222130
|
}
|
|
222080
222131
|
|
|
222081
222132
|
|
|
@@ -349894,7 +349945,7 @@ class TestContext {
|
|
|
349894
349945
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
349895
349946
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
349896
349947
|
await core_frontend_1.NoRenderApp.startup({
|
|
349897
|
-
applicationVersion: "5.9.0-dev.
|
|
349948
|
+
applicationVersion: "5.9.0-dev.12",
|
|
349898
349949
|
applicationId: this.settings.gprid,
|
|
349899
349950
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
349900
349951
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -377169,7 +377220,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
377169
377220
|
/***/ ((module) => {
|
|
377170
377221
|
|
|
377171
377222
|
"use strict";
|
|
377172
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.9.0-dev.
|
|
377223
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.9.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 webpackWorkers && npm run -s copy: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:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","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 webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 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.9","@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/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.5.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//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"}}');
|
|
377173
377224
|
|
|
377174
377225
|
/***/ }),
|
|
377175
377226
|
|