@itwin/rpcinterface-full-stack-tests 5.13.0-dev.1 → 5.13.0-dev.2
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 +97 -23
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -105332,7 +105332,7 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
|
|
|
105332
105332
|
*/
|
|
105333
105333
|
async pushChanges(description) {
|
|
105334
105334
|
this.requireTimeline();
|
|
105335
|
-
return _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description);
|
|
105335
|
+
return this.changeset = await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.pushChanges(this.key, description);
|
|
105336
105336
|
}
|
|
105337
105337
|
/** The current graphical editing scope, if one is in progress.
|
|
105338
105338
|
* @see [[enterEditingScope]] to begin graphical editing.
|
|
@@ -207453,8 +207453,17 @@ class ToolAdmin {
|
|
|
207453
207453
|
}
|
|
207454
207454
|
/** Handler for keyboard events. */
|
|
207455
207455
|
static _keyEventHandler = (ev) => {
|
|
207456
|
-
|
|
207456
|
+
// we don't want repeated keyboard events. If we keep them they interfere with replacing mouse motion events, since they come as a stream.
|
|
207457
|
+
if (!ev.repeat) {
|
|
207458
|
+
// Suppress default browser behavior for iTwin.js Ctrl shortcuts (Z, Y, C, X, V, F2) on keydown when focus allows.
|
|
207459
|
+
if (ev.type === "keydown" && !ev.isComposing && !ev.defaultPrevented) {
|
|
207460
|
+
if (_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.toolAdmin.isCtrlKeyShortcut(ev) && _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.toolAdmin.isFocusValidForShortcuts()) {
|
|
207461
|
+
if (_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.toolAdmin.shouldPreventCtrlDefault(ev))
|
|
207462
|
+
ev.preventDefault();
|
|
207463
|
+
}
|
|
207464
|
+
}
|
|
207457
207465
|
ToolAdmin.addEvent(ev);
|
|
207466
|
+
}
|
|
207458
207467
|
};
|
|
207459
207468
|
/** Handler for modifier key transitions captured before focused UI elements can stop propagation. */
|
|
207460
207469
|
static _keyEventCaptureHandler = async (event) => {
|
|
@@ -208251,9 +208260,6 @@ class ToolAdmin {
|
|
|
208251
208260
|
static isContextMenuOpen() {
|
|
208252
208261
|
return document.querySelector(".core-context-menu-opened") !== null;
|
|
208253
208262
|
}
|
|
208254
|
-
static isElement(target) {
|
|
208255
|
-
return target instanceof Element;
|
|
208256
|
-
}
|
|
208257
208263
|
static isEditable(element) {
|
|
208258
208264
|
const tagName = element.tagName.toLowerCase();
|
|
208259
208265
|
const editableTags = ["input", "textarea", "select"];
|
|
@@ -208263,6 +208269,11 @@ class ToolAdmin {
|
|
|
208263
208269
|
return true;
|
|
208264
208270
|
return false;
|
|
208265
208271
|
}
|
|
208272
|
+
/** Check if there is currently an active text selection on the page. */
|
|
208273
|
+
static hasActiveTextSelection() {
|
|
208274
|
+
const selection = window.getSelection();
|
|
208275
|
+
return selection !== null && selection.toString().length > 0;
|
|
208276
|
+
}
|
|
208266
208277
|
static getModifierKey(event) {
|
|
208267
208278
|
switch (event.key) {
|
|
208268
208279
|
case "Alt": return _Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.Alt;
|
|
@@ -208271,22 +208282,75 @@ class ToolAdmin {
|
|
|
208271
208282
|
}
|
|
208272
208283
|
return _Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.None;
|
|
208273
208284
|
}
|
|
208285
|
+
/** Check if focus allows shortcuts to run — i.e., focus is Home or AccuDraw, or focus is not on an editable element and context menu is not open.
|
|
208286
|
+
* Called synchronously in _keyEventHandler to decide whether to call preventDefault(), and in onKeyTransition to gate shortcut processing.
|
|
208287
|
+
* @return true to allow shortcuts
|
|
208288
|
+
*/
|
|
208289
|
+
isFocusValidForShortcuts() {
|
|
208290
|
+
// Always allow shortcuts when focus is Home (document.body) or AccuDraw has focus
|
|
208291
|
+
if (ToolAdmin.isFocusHome() || undefined !== _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.getFocusItem())
|
|
208292
|
+
return true;
|
|
208293
|
+
// Block shortcuts when context menu is open or focus is on an editable element
|
|
208294
|
+
if (ToolAdmin.isContextMenuOpen())
|
|
208295
|
+
return false;
|
|
208296
|
+
const active = document.activeElement;
|
|
208297
|
+
if (active !== null && ToolAdmin.isEditable(active))
|
|
208298
|
+
return false;
|
|
208299
|
+
return true;
|
|
208300
|
+
}
|
|
208301
|
+
/** Check if a key is part of a Ctrl key shortcut handled by iTwin.js (Ctrl+Z, Ctrl+Y, Ctrl+C, Ctrl+X, Ctrl+V, Ctrl+F2).
|
|
208302
|
+
* @note Subclasses can override to add custom Ctrl shortcuts and handle them with onCtrlKeyPressed.
|
|
208303
|
+
* @return true if key is a Ctrl key shortcut
|
|
208304
|
+
*/
|
|
208305
|
+
isCtrlKeyShortcut(keyEvent) {
|
|
208306
|
+
if (!keyEvent.ctrlKey || keyEvent.altKey || keyEvent.metaKey)
|
|
208307
|
+
return false;
|
|
208308
|
+
const lower = keyEvent.key.toLowerCase();
|
|
208309
|
+
return (lower === "z" || lower === "y" || lower === "c" || lower === "x" || lower === "v" || lower === "f2");
|
|
208310
|
+
}
|
|
208311
|
+
/** Determine if the default browser action should be prevented for a Ctrl key shortcut.
|
|
208312
|
+
* By default, allows browser copy/cut of selected text to work naturally, and prevents paste.
|
|
208313
|
+
* Only called when focus is valid for shortcuts (Home, AccuDraw, not on an editable element, context menu not open).
|
|
208314
|
+
* @note This is called from _keyEventHandler to decide whether to call preventDefault().
|
|
208315
|
+
* @note Subclasses can override to customize preventDefault behavior for Ctrl shortcuts.
|
|
208316
|
+
* @return true if preventDefault() should be called; false to allow browser default
|
|
208317
|
+
*/
|
|
208318
|
+
shouldPreventCtrlDefault(keyEvent) {
|
|
208319
|
+
const lower = keyEvent.key.toLowerCase();
|
|
208320
|
+
// For copy/cut, only prevent if no active text selection (allow browser to handle text operations)
|
|
208321
|
+
if (lower === "c" || lower === "x") {
|
|
208322
|
+
return !ToolAdmin.hasActiveTextSelection();
|
|
208323
|
+
}
|
|
208324
|
+
// Prevent default for all other iTwin.js shortcuts (z, y, v, F2, custom)
|
|
208325
|
+
// Caller already checked that focus is valid for shortcuts, so v (paste) should be prevented
|
|
208326
|
+
return true;
|
|
208327
|
+
}
|
|
208274
208328
|
/** Process key down events while the Ctrl key is pressed */
|
|
208275
208329
|
async onCtrlKeyPressed(keyEvent) {
|
|
208276
208330
|
let handled = false;
|
|
208277
208331
|
let result = false;
|
|
208278
|
-
switch (keyEvent.key) {
|
|
208332
|
+
switch (keyEvent.key.toLowerCase()) {
|
|
208279
208333
|
case "z":
|
|
208280
|
-
case "Z":
|
|
208281
208334
|
result = await this.doUndoOperation();
|
|
208282
208335
|
handled = true;
|
|
208283
208336
|
break;
|
|
208284
208337
|
case "y":
|
|
208285
|
-
case "Y":
|
|
208286
208338
|
result = await this.doRedoOperation();
|
|
208287
208339
|
handled = true;
|
|
208288
208340
|
break;
|
|
208289
|
-
case "
|
|
208341
|
+
case "c":
|
|
208342
|
+
case "x":
|
|
208343
|
+
// If browser already handled copy/cut (text was selected, so default was not prevented),
|
|
208344
|
+
// mark as handled to skip processShortcutKey.
|
|
208345
|
+
if (!keyEvent.defaultPrevented) {
|
|
208346
|
+
handled = true;
|
|
208347
|
+
}
|
|
208348
|
+
break;
|
|
208349
|
+
case "v":
|
|
208350
|
+
// Paste is prevented when focus is valid for shortcuts; processShortcutKey can handle Ctrl+V.
|
|
208351
|
+
// When not prevented (e.g., in editable element), browser handles naturally.
|
|
208352
|
+
break;
|
|
208353
|
+
case "f2":
|
|
208290
208354
|
result = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.uiAdmin.showKeyinPalette();
|
|
208291
208355
|
handled = true;
|
|
208292
208356
|
break;
|
|
@@ -208300,27 +208364,22 @@ class ToolAdmin {
|
|
|
208300
208364
|
return false;
|
|
208301
208365
|
}
|
|
208302
208366
|
/** Event for every key down and up transition.
|
|
208303
|
-
* @note Called before
|
|
208367
|
+
* @note Called before Ctrl shortcut and focus checks in onKeyTransition.
|
|
208368
|
+
* For custom Ctrl shortcuts, override isCtrlKeyShortcut and onCtrlKeyPressed.
|
|
208369
|
+
* For other shortcuts, override processShortcutKey.
|
|
208304
208370
|
* @return true if handled and no further processing of event should occur.
|
|
208305
208371
|
*/
|
|
208306
208372
|
processKeyboardEvent(keyEvent, _wentDown) {
|
|
208307
|
-
if (ToolAdmin.isFocusHome() || undefined !== _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.getFocusItem())
|
|
208308
|
-
return false; // Focus is Home or AccuDraw, allow shortcuts...
|
|
208309
|
-
if (keyEvent.defaultPrevented || keyEvent.isComposing)
|
|
208310
|
-
return true; // Respect UI handling / IME composition; don't process shortcuts
|
|
208311
208373
|
// NOTE: Provide a convenient way for the user to move focus to Home to use shortcuts.
|
|
208312
208374
|
// Escape is the only practical choice with its default behavior that can cancel/close/blur.
|
|
208313
208375
|
// Intentionally not checking wentDown as some ui elements stop propagation of down but not up (moving to capture is not a good option).
|
|
208314
208376
|
// Apps that want to use Escape to start the default tool still can with Home focus in processShortcutKey.
|
|
208315
|
-
|
|
208377
|
+
// Let AccuDraw handle Escape when it has focus—AccuDrawViewportUI.onKeyboardEvent manages this directly.
|
|
208378
|
+
if (keyEvent.key === "Escape" && _ToolSettings__WEBPACK_IMPORTED_MODULE_14__.ToolSettings.escapeMovesFocusToHome && !ToolAdmin.isFocusHome() && undefined === _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.getFocusItem()) {
|
|
208316
208379
|
ToolAdmin.setFocusHome();
|
|
208317
208380
|
return true;
|
|
208318
208381
|
}
|
|
208319
|
-
|
|
208320
|
-
return true; // Don't allow shortcuts if context menu is open...
|
|
208321
|
-
if (ToolAdmin.isElement(keyEvent.target) && ToolAdmin.isEditable(keyEvent.target))
|
|
208322
|
-
return true; // Don't allow shortcuts when event target is editable...
|
|
208323
|
-
return false;
|
|
208382
|
+
return false; // Not handled; continue processing
|
|
208324
208383
|
}
|
|
208325
208384
|
/** Need to check for modifier changes on capture phase as a ui element that calls stopPropagation
|
|
208326
208385
|
* prevents onKeyTransition from being called when bubbling.
|
|
@@ -208334,9 +208393,24 @@ class ToolAdmin {
|
|
|
208334
208393
|
/** Event for every key down and up transition. */
|
|
208335
208394
|
async onKeyTransition(event, wentDown) {
|
|
208336
208395
|
const keyEvent = event.ev;
|
|
208396
|
+
// Respect IME composition; don't process shortcuts
|
|
208397
|
+
if (keyEvent.isComposing)
|
|
208398
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes;
|
|
208337
208399
|
if (this.processKeyboardEvent(keyEvent, wentDown))
|
|
208338
208400
|
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes;
|
|
208339
|
-
if
|
|
208401
|
+
// Respect if any other handler has handled this event, except for Ctrl shortcuts we manage ourselves.
|
|
208402
|
+
// _keyEventHandler calls preventDefault() for our Ctrl shortcuts, but defaultPrevented should not block them.
|
|
208403
|
+
// For all other keys, defaultPrevented signals that another UI handler has claimed the event.
|
|
208404
|
+
// Exception: AccuDraw's input fields call preventDefault() but still want shortcuts to flow through.
|
|
208405
|
+
const isCtrlShortcut = wentDown && this.isCtrlKeyShortcut(keyEvent);
|
|
208406
|
+
const hasAccuDrawFocus = undefined !== _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.accuDraw.getFocusItem();
|
|
208407
|
+
if (keyEvent.defaultPrevented && !isCtrlShortcut && !hasAccuDrawFocus)
|
|
208408
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.Yes; // Respect other UI handling
|
|
208409
|
+
// Check if focus is valid for shortcuts (Home, AccuDraw, not editable, no context menu)
|
|
208410
|
+
if (!this.isFocusValidForShortcuts())
|
|
208411
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_13__.EventHandled.No; // Focus is on an editable element or context menu is open; don't allow shortcuts
|
|
208412
|
+
// Process Ctrl shortcuts if focus is valid
|
|
208413
|
+
if (isCtrlShortcut) {
|
|
208340
208414
|
const { handled, result } = await this.onCtrlKeyPressed(keyEvent);
|
|
208341
208415
|
if (handled)
|
|
208342
208416
|
return result;
|
|
@@ -342151,7 +342225,7 @@ class TestContext {
|
|
|
342151
342225
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
342152
342226
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
342153
342227
|
await core_frontend_1.NoRenderApp.startup({
|
|
342154
|
-
applicationVersion: "5.13.0-dev.
|
|
342228
|
+
applicationVersion: "5.13.0-dev.2",
|
|
342155
342229
|
applicationId: this.settings.gprid,
|
|
342156
342230
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
342157
342231
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -366988,7 +367062,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
366988
367062
|
(module) {
|
|
366989
367063
|
|
|
366990
367064
|
"use strict";
|
|
366991
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.13.0-dev.
|
|
367065
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.13.0-dev.2","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.10","@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","glob":"^13.0.6","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","vitest":"^4.1.10","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"}}');
|
|
366992
367066
|
|
|
366993
367067
|
/***/ },
|
|
366994
367068
|
|