@itwin/ecschema-rpcinterface-tests 5.0.0-dev.84 → 5.0.0-dev.85

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.
@@ -43636,9 +43636,10 @@ class TextAnnotation {
43636
43636
  * The anchor point is computed as specified by this annotation's [[anchor]] setting. For example, if the text block is anchored
43637
43637
  * at the bottom left, then the transform will be relative to the bottom-left corner of `textBlockExtents`.
43638
43638
  * The text block will be rotated around the fixed anchor point according to [[orientation]], then translated by [[offset]].
43639
- * The anchor point will coincide with (0, 0, 0).
43640
- * @param boundingBox A box fully containing the [[textBlock]].
43639
+ * The anchor point will coincide with (0, 0, 0) unless an [[offset]] is present.
43640
+ * @param boundingBox A box fully containing the [[textBlock]]. This range should include the margins.
43641
43641
  * @see [[computeAnchorPoint]] to compute the transform's anchor point.
43642
+ * @see [computeLayoutTextBlockResult]($backend) to lay out a `TextBlock`.
43642
43643
  */
43643
43644
  computeTransform(boundingBox) {
43644
43645
  const anchorPt = this.computeAnchorPoint(boundingBox);
@@ -43947,6 +43948,7 @@ class Paragraph extends TextBlockComponent {
43947
43948
  return this.runs.every((run, index) => run.equals(other.runs[index]));
43948
43949
  }
43949
43950
  }
43951
+ ;
43950
43952
  /** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content in the form of [[Run]]s.
43951
43953
  * You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].
43952
43954
  * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
@@ -43961,12 +43963,21 @@ class TextBlock extends TextBlockComponent {
43961
43963
  width;
43962
43964
  /** The alignment of the document's content. */
43963
43965
  justification;
43966
+ /** The margins of the document. */
43967
+ margins;
43964
43968
  /** The ordered list of paragraphs within the document. */
43965
43969
  paragraphs;
43966
43970
  constructor(props) {
43967
43971
  super(props);
43968
43972
  this.width = props.width ?? 0;
43969
43973
  this.justification = props.justification ?? "left";
43974
+ // Assign default margins if not provided
43975
+ this.margins = {
43976
+ left: props.margins?.left ?? 0,
43977
+ right: props.margins?.right ?? 0,
43978
+ top: props.margins?.top ?? 0,
43979
+ bottom: props.margins?.bottom ?? 0,
43980
+ };
43970
43981
  this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];
43971
43982
  }
43972
43983
  toJSON() {
@@ -43974,6 +43985,7 @@ class TextBlock extends TextBlockComponent {
43974
43985
  ...super.toJSON(),
43975
43986
  width: this.width,
43976
43987
  justification: this.justification,
43988
+ margins: this.margins,
43977
43989
  paragraphs: this.paragraphs.map((x) => x.toJSON()),
43978
43990
  };
43979
43991
  }
@@ -44032,6 +44044,9 @@ class TextBlock extends TextBlockComponent {
44032
44044
  if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {
44033
44045
  return false;
44034
44046
  }
44047
+ const marginsAreEqual = Object.entries(this.margins).every(([key, value]) => value === other.margins[key]);
44048
+ if (!marginsAreEqual)
44049
+ return false;
44035
44050
  return this.paragraphs.every((paragraph, index) => paragraph.equals(other.paragraphs[index]));
44036
44051
  }
44037
44052
  }
@@ -72265,6 +72280,7 @@ class AccuDraw {
72265
72280
  _tolerance = 0; // computed view based indexing tolerance
72266
72281
  _percentChanged = 0; // Compass animation state
72267
72282
  _threshold = 0; // Threshold for automatic x/y field focus change.
72283
+ _lastSnapDetail;
72268
72284
  /** @internal */
72269
72285
  planePt = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(); // same as origin unless non-zero locked z value
72270
72286
  _rawDelta = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d(); // used by rect fix point
@@ -72324,6 +72340,10 @@ class AccuDraw {
72324
72340
  autoFocusFields = true;
72325
72341
  /** When true fully specifying a point by entering both distance and angle in polar mode or XY[Z] in rectangular mode, the point is automatically accepted */
72326
72342
  autoPointPlacement = false;
72343
+ /** When true and axisIndexing is allowed the current point is adjusted to the tangent or binormal vector from the last snap when within a close tolerance
72344
+ * @beta
72345
+ */
72346
+ snapIndexing = true;
72327
72347
  /** Get distance round off settings */
72328
72348
  get distanceRoundOff() { return this._distanceRoundOff; }
72329
72349
  /** Get angle round off settings */
@@ -72481,6 +72501,34 @@ class AccuDraw {
72481
72501
  }
72482
72502
  return false;
72483
72503
  }
72504
+ updateLastSnapDetail(vp, fromSnap) {
72505
+ if (!this.snapIndexing || !this.axisIndexing || this.flags.indexLocked || LockedStates.NONE_LOCKED !== this.locked) {
72506
+ this._lastSnapDetail = undefined;
72507
+ return;
72508
+ }
72509
+ if (!fromSnap) {
72510
+ if (this._lastSnapDetail?.deselect)
72511
+ this._lastSnapDetail = undefined;
72512
+ else if (this._lastSnapDetail)
72513
+ this._lastSnapDetail.deselect = false; // Allow moving cursor back to previous snap to clear it...
72514
+ return;
72515
+ }
72516
+ const snap = _AccuSnap__WEBPACK_IMPORTED_MODULE_3__.TentativeOrAccuSnap.getCurrentSnap();
72517
+ if (undefined === snap || this.origin.isAlmostEqual(snap.getPoint()))
72518
+ return;
72519
+ if (this._lastSnapDetail && this._lastSnapDetail.sourceId === snap.sourceId && this._lastSnapDetail.point.isAlmostEqual(snap.getPoint())) {
72520
+ if (false === this._lastSnapDetail.deselect)
72521
+ this._lastSnapDetail.deselect = true; // Stop indexing to previous snap...
72522
+ return; // Don't compute rotation if location hasn't changed...
72523
+ }
72524
+ const isTentative = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tentativePoint.isSnapped;
72525
+ if (this._lastSnapDetail?.isTentative && !isTentative)
72526
+ return; // Don't update snap from tentative unless it's another tentative to support holding a snap location in a dense drawing...
72527
+ const rotation = AccuDraw.getSnapRotation(snap, vp);
72528
+ if (undefined === rotation)
72529
+ return;
72530
+ this._lastSnapDetail = { point: snap.getPoint().clone(), matrix: rotation, sourceId: snap.sourceId, isTentative };
72531
+ }
72484
72532
  /** @internal */
72485
72533
  adjustPoint(pointActive, vp, fromSnap) {
72486
72534
  if (!this.isEnabled)
@@ -72499,6 +72547,7 @@ class AccuDraw {
72499
72547
  this.flags.redrawCompass = true;
72500
72548
  }
72501
72549
  else if (this.isActive) {
72550
+ this.updateLastSnapDetail(vp, fromSnap);
72502
72551
  const lastPt = this.point.clone();
72503
72552
  this.fixPoint(pointActive, vp);
72504
72553
  pointChanged = !lastPt.isExactEqual(this.point);
@@ -73658,6 +73707,7 @@ class AccuDraw {
73658
73707
  }
73659
73708
  /** @internal */
73660
73709
  onPrimitiveToolInstall() {
73710
+ this._lastSnapDetail = undefined;
73661
73711
  if (!this.isEnabled)
73662
73712
  return false;
73663
73713
  this.onEventCommon();
@@ -73899,6 +73949,14 @@ class AccuDraw {
73899
73949
  }
73900
73950
  }
73901
73951
  }
73952
+ if (undefined !== this._lastSnapDetail && undefined === snap) {
73953
+ if (this._lastSnapDetail.indexed) {
73954
+ graphic.setSymbology(colorIndex, colorIndex, 2, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Code5);
73955
+ graphic.addLineString([this.point, this._lastSnapDetail.point]);
73956
+ }
73957
+ graphic.setSymbology(colorIndex, colorIndex, 8, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid);
73958
+ graphic.addPointString([this._lastSnapDetail.point]);
73959
+ }
73902
73960
  }
73903
73961
  /** @internal */
73904
73962
  testDecorationHit(id) { return id === this._acsPickId; }
@@ -74525,6 +74583,62 @@ class AccuDraw {
74525
74583
  this.newFocus = ((Math.abs(this._rawDelta.x) > Math.abs(this._rawDelta.y)) ? ItemField.X_Item : ItemField.Y_Item);
74526
74584
  }
74527
74585
  }
74586
+ fixPointLastSnapDetail(vp) {
74587
+ if (undefined === this._lastSnapDetail)
74588
+ return;
74589
+ this._lastSnapDetail.indexed = undefined;
74590
+ if (!this.axisIndexing || this.flags.indexLocked || LockedStates.NONE_LOCKED !== this.locked || this.indexed & LockedStates.DIST_BM || _AccuSnap__WEBPACK_IMPORTED_MODULE_3__.TentativeOrAccuSnap.isHot)
74591
+ return; // Don't adjust point if already adjusted or indexing is disabled...
74592
+ const minMag = AccuDraw.getMinPolarMag(this.point);
74593
+ const tmpVec = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(this.planePt, this.point);
74594
+ if (tmpVec.magnitude() < minMag)
74595
+ return; // Current point is at compass origin...
74596
+ if (!this.hardConstructionPlane(this._rawPointOnPlane, this._lastSnapDetail.point, this.point, this.axes.z, vp, true))
74597
+ return;
74598
+ const snapDelta = this._rawPointOnPlane.vectorTo(this.point);
74599
+ if (snapDelta.magnitude() < minMag)
74600
+ return; // Haven't moved far enough away from snap point...
74601
+ const snapRayX = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Ray3d.createCapture(this._rawPointOnPlane, this._lastSnapDetail.matrix.rowX());
74602
+ const snapRayY = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Ray3d.createCapture(this._rawPointOnPlane, this._lastSnapDetail.matrix.rowY());
74603
+ const snapDeltaX = snapDelta.dotProduct(snapRayX.direction);
74604
+ const snapDeltaY = snapDelta.dotProduct(snapRayY.direction);
74605
+ let rayS;
74606
+ if (snapDeltaX < this._tolerance && snapDeltaX > -this._tolerance)
74607
+ rayS = snapRayY;
74608
+ else if (snapDeltaY < this._tolerance && snapDeltaY > -this._tolerance)
74609
+ rayS = snapRayX;
74610
+ else
74611
+ return;
74612
+ const rayA = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Ray3d.createCapture(this.planePt, tmpVec);
74613
+ const detail = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Ray3d.closestApproachRay3dRay3d(rayA, rayS);
74614
+ if (_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.CurveCurveApproachType.Intersection !== detail.approachType)
74615
+ return;
74616
+ this.planePt.vectorTo(detail.detailA.point, tmpVec);
74617
+ _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(tmpVec.dotProduct(this.axes.x), tmpVec.dotProduct(this.axes.y), this._rawDelta);
74618
+ const xyCorrection = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Vector2d();
74619
+ if (this.indexed & LockedStates.X_BM) {
74620
+ xyCorrection.x -= this._rawDelta.x;
74621
+ this._rawDelta.x = 0.0;
74622
+ }
74623
+ else if (this.indexed & LockedStates.Y_BM) {
74624
+ xyCorrection.y -= this._rawDelta.y;
74625
+ this._rawDelta.y = 0.0;
74626
+ }
74627
+ if (this._rawDelta.magnitude() < minMag)
74628
+ return; // Don't accept adjustment back to compass origin...
74629
+ detail.detailA.point.plus2Scaled(this.axes.x, xyCorrection.x, this.axes.y, xyCorrection.y, this._rawPointOnPlane);
74630
+ if (this.point.distance(this._rawPointOnPlane) > (1.5 * this._tolerance))
74631
+ return; // Don't accept adjustment if distance is too great such as from nearly parallel vectors...
74632
+ if (CompassMode.Polar === this.compassMode) {
74633
+ this._distance = this.origin.distance(this._rawPointOnPlane);
74634
+ }
74635
+ else {
74636
+ this.delta.x = this._rawDelta.x;
74637
+ this.delta.y = this._rawDelta.y;
74638
+ }
74639
+ this.point.setFrom(this._rawPointOnPlane);
74640
+ this._lastSnapDetail.indexed = true;
74641
+ }
74528
74642
  fixPoint(pointActive, vp) {
74529
74643
  if (this.isActive && ((vp !== this.currentView) || this.flags.rotationNeedsUpdate)) {
74530
74644
  this.currentView = vp;
@@ -74557,6 +74671,7 @@ class AccuDraw {
74557
74671
  this.fixPointPolar(vp);
74558
74672
  else
74559
74673
  this.fixPointRectangular(vp);
74674
+ this.fixPointLastSnapDetail(vp);
74560
74675
  pointActive.setFrom(this.point);
74561
74676
  }
74562
74677
  else if (CompassMode.Rectangular === this.compassMode) {
@@ -74687,8 +74802,10 @@ class AccuDraw {
74687
74802
  }
74688
74803
  /** @internal */
74689
74804
  onPostButtonEvent(ev) {
74690
- if (_tools_Tool__WEBPACK_IMPORTED_MODULE_8__.BeButton.Data !== ev.button || !ev.isDown || !this.isEnabled)
74805
+ if (_tools_Tool__WEBPACK_IMPORTED_MODULE_8__.BeButton.Data !== ev.button || !ev.isDown || !this.isEnabled) {
74806
+ this._lastSnapDetail = undefined;
74691
74807
  return false;
74808
+ }
74692
74809
  this.onEventCommon();
74693
74810
  if (this.flags.ignoreDataButton) {
74694
74811
  // NOTE: Ignore this data point, was used to terminate a viewing command or input collector...
@@ -310786,7 +310903,7 @@ var loadLanguages = instance.loadLanguages;
310786
310903
  /***/ ((module) => {
310787
310904
 
310788
310905
  "use strict";
310789
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.84","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","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","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","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","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:*"},"//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":{"@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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","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/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
310906
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.85","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","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","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","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","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:*"},"//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":{"@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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","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/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
310790
310907
 
310791
310908
  /***/ })
310792
310909