@itwin/ecschema-rpcinterface-tests 5.1.0-dev.64 → 5.1.0-dev.65

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.
@@ -27432,6 +27432,8 @@ __webpack_require__.r(__webpack_exports__);
27432
27432
  */
27433
27433
  var CommonLoggerCategory;
27434
27434
  (function (CommonLoggerCategory) {
27435
+ /** The logger category used by common APIs relating to text annotations. */
27436
+ CommonLoggerCategory["Annotations"] = "core-common.Annotations";
27435
27437
  /** The logger category used by common classes relating to ElementProps. */
27436
27438
  CommonLoggerCategory["ElementProps"] = "core-common.ElementProps";
27437
27439
  /** The logger category used by common classes relating to Geometry. */
@@ -43383,6 +43385,7 @@ class TextAnnotation {
43383
43385
  "use strict";
43384
43386
  __webpack_require__.r(__webpack_exports__);
43385
43387
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
43388
+ /* harmony export */ FieldRun: () => (/* binding */ FieldRun),
43386
43389
  /* harmony export */ FractionRun: () => (/* binding */ FractionRun),
43387
43390
  /* harmony export */ LineBreakRun: () => (/* binding */ LineBreakRun),
43388
43391
  /* harmony export */ Paragraph: () => (/* binding */ Paragraph),
@@ -43475,6 +43478,7 @@ var Run;
43475
43478
  case "fraction": return FractionRun.create(props);
43476
43479
  case "tab": return TabRun.create(props);
43477
43480
  case "linebreak": return LineBreakRun.create(props);
43481
+ case "field": return FieldRun.create(props);
43478
43482
  }
43479
43483
  }
43480
43484
  Run.fromJSON = fromJSON;
@@ -43618,6 +43622,113 @@ class TabRun extends TextBlockComponent {
43618
43622
  return other instanceof TabRun && super.equals(other);
43619
43623
  }
43620
43624
  }
43625
+ /** A [[Run]] that displays the formatted value of a property of some [Element]($backend).
43626
+ * When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,
43627
+ * a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that
43628
+ * whenever the source element specified by [[propertyHost]] is modified, the field(s) in the `ITextAnnotation` element are automatically
43629
+ * recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or
43630
+ * property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].
43631
+ * A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.
43632
+ * @beta
43633
+ */
43634
+ class FieldRun extends TextBlockComponent {
43635
+ /** Display string used to signal an error in computing the field's value. */
43636
+ static invalidContentIndicator = "####";
43637
+ /** Discriminator field for the [[Run]] union. */
43638
+ type = "field";
43639
+ /** The element and BIS class containing the property described by [[propertyPath]]. */
43640
+ propertyHost;
43641
+ /** Describes how to obtain the property value from [[propertyHost]]. */
43642
+ propertyPath;
43643
+ /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]]. */
43644
+ formatter;
43645
+ _cachedContent;
43646
+ /** The field's most recently evaluated display string. */
43647
+ get cachedContent() {
43648
+ return this._cachedContent;
43649
+ }
43650
+ /** @internal Used by core-backend when re-evaluating field content. */
43651
+ setCachedContent(content) {
43652
+ this._cachedContent = content ?? FieldRun.invalidContentIndicator;
43653
+ }
43654
+ constructor(props) {
43655
+ super(props);
43656
+ this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;
43657
+ this.propertyHost = props.propertyHost;
43658
+ this.propertyPath = props.propertyPath;
43659
+ this.formatter = props.formatter;
43660
+ }
43661
+ /** Create a FieldRun from its JSON representation. */
43662
+ static create(props) {
43663
+ return new FieldRun({
43664
+ ...props,
43665
+ propertyHost: { ...props.propertyHost },
43666
+ propertyPath: structuredClone(props.propertyPath),
43667
+ formatter: structuredClone(props.formatter),
43668
+ });
43669
+ }
43670
+ /** Convert the FieldRun to its JSON representation. */
43671
+ toJSON() {
43672
+ const json = {
43673
+ ...super.toJSON(),
43674
+ type: "field",
43675
+ propertyHost: { ...this.propertyHost },
43676
+ propertyPath: structuredClone(this.propertyPath),
43677
+ };
43678
+ if (this.cachedContent !== FieldRun.invalidContentIndicator) {
43679
+ json.cachedContent = this.cachedContent;
43680
+ }
43681
+ if (this.formatter) {
43682
+ json.formatter = structuredClone(this.formatter);
43683
+ }
43684
+ return json;
43685
+ }
43686
+ /** Create a deep copy of this FieldRun. */
43687
+ clone() {
43688
+ return new FieldRun(this.toJSON());
43689
+ }
43690
+ /** Convert this FieldRun to a simple string representation. */
43691
+ stringify() {
43692
+ return this.cachedContent;
43693
+ }
43694
+ /** Returns true if `this` is equivalent to `other`. */
43695
+ equals(other) {
43696
+ if (!(other instanceof FieldRun) || !super.equals(other)) {
43697
+ return false;
43698
+ }
43699
+ if (this.propertyHost.elementId !== other.propertyHost.elementId ||
43700
+ this.propertyHost.className !== other.propertyHost.className ||
43701
+ this.propertyHost.schemaName !== other.propertyHost.schemaName) {
43702
+ return false;
43703
+ }
43704
+ if (this.propertyPath.propertyName !== other.propertyPath.propertyName) {
43705
+ return false;
43706
+ }
43707
+ const thisAccessors = this.propertyPath.accessors ?? [];
43708
+ const otherAccessors = other.propertyPath.accessors ?? [];
43709
+ const thisJsonAccessors = this.propertyPath.jsonAccessors ?? [];
43710
+ const otherJsonAccessors = other.propertyPath.jsonAccessors ?? [];
43711
+ if (thisAccessors.length !== otherAccessors.length || thisJsonAccessors.length !== otherJsonAccessors.length) {
43712
+ return false;
43713
+ }
43714
+ if (!thisAccessors.every((value, index) => value === otherAccessors[index])) {
43715
+ return false;
43716
+ }
43717
+ if (!thisJsonAccessors.every((value, index) => value === otherJsonAccessors[index])) {
43718
+ return false;
43719
+ }
43720
+ if (this.formatter && other.formatter) {
43721
+ // ###TODO better comparison of formatter objects.
43722
+ if (JSON.stringify(this.formatter) !== JSON.stringify(other.formatter)) {
43723
+ return false;
43724
+ }
43725
+ }
43726
+ else if (this.formatter || other.formatter) {
43727
+ return false;
43728
+ }
43729
+ return true;
43730
+ }
43731
+ }
43621
43732
  /** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.
43622
43733
  * @beta
43623
43734
  */
@@ -44183,6 +44294,7 @@ __webpack_require__.r(__webpack_exports__);
44183
44294
  /* harmony export */ FeatureOverrides: () => (/* reexport safe */ _FeatureSymbology__WEBPACK_IMPORTED_MODULE_36__.FeatureOverrides),
44184
44295
  /* harmony export */ FeatureTable: () => (/* reexport safe */ _FeatureTable__WEBPACK_IMPORTED_MODULE_37__.FeatureTable),
44185
44296
  /* harmony export */ FeatureTableHeader: () => (/* reexport safe */ _tile_IModelTileIO__WEBPACK_IMPORTED_MODULE_154__.FeatureTableHeader),
44297
+ /* harmony export */ FieldRun: () => (/* reexport safe */ _annotation_TextBlock__WEBPACK_IMPORTED_MODULE_3__.FieldRun),
44186
44298
  /* harmony export */ FillDisplay: () => (/* reexport safe */ _GeometryParams__WEBPACK_IMPORTED_MODULE_58__.FillDisplay),
44187
44299
  /* harmony export */ FillFlags: () => (/* reexport safe */ _GraphicParams__WEBPACK_IMPORTED_MODULE_61__.FillFlags),
44188
44300
  /* harmony export */ FontMap: () => (/* reexport safe */ _Fonts__WEBPACK_IMPORTED_MODULE_38__.FontMap),
@@ -67834,14 +67946,21 @@ class ECClass extends _SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem {
67834
67946
  return this.traverseBaseClasses((thisSchemaItem, thatSchemaItemOrKey) => _SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(thisSchemaItem, thatSchemaItemOrKey), targetClass);
67835
67947
  }
67836
67948
  }
67837
- /**
67838
- * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.
67839
- * @param targetClass The class to check.
67840
- */
67841
- isSync(targetClass) {
67842
- if (_SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(this, targetClass))
67843
- return true;
67844
- return this.traverseBaseClassesSync((thisSchemaItem, thatSchemaItemOrKey) => _SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(thisSchemaItem, thatSchemaItemOrKey), targetClass);
67949
+ /** @internal */
67950
+ isSync(targetClass, schemaName) {
67951
+ if (schemaName !== undefined) {
67952
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof (targetClass) === "string", "Expected targetClass of type string because schemaName was specified");
67953
+ const key = new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaItemKey(targetClass, new _SchemaKey__WEBPACK_IMPORTED_MODULE_5__.SchemaKey(schemaName));
67954
+ if (_SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(this, key))
67955
+ return true;
67956
+ return this.traverseBaseClassesSync((thisSchemaItem, thatSchemaItemOrKey) => _SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(thisSchemaItem, thatSchemaItemOrKey), key);
67957
+ }
67958
+ else {
67959
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(ECClass.isECClass(targetClass), "Expected targetClass to be of type ECClass");
67960
+ if (_SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(this, targetClass))
67961
+ return true;
67962
+ return this.traverseBaseClassesSync((thisSchemaItem, thatSchemaItemOrKey) => _SchemaItem__WEBPACK_IMPORTED_MODULE_9__.SchemaItem.equalByKey(thisSchemaItem, thatSchemaItemOrKey), targetClass);
67963
+ }
67845
67964
  }
67846
67965
  /**
67847
67966
  * @internal
@@ -318001,7 +318120,7 @@ var loadLanguages = instance.loadLanguages;
318001
318120
  /***/ ((module) => {
318002
318121
 
318003
318122
  "use strict";
318004
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.64","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","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":{"@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/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@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.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","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"}}');
318123
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.65","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","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":{"@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/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@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.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","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"}}');
318005
318124
 
318006
318125
  /***/ })
318007
318126