@itwin/core-backend 5.3.0-dev.2 → 5.3.0-dev.23
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/CHANGELOG.md +34 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +2 -2
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +2 -2
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +248 -248
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +5 -5
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +12 -9
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +2 -2
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +4 -4
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +2 -2
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +2 -2
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +20 -9
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +2 -2
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +1 -2
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +9 -17
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.d.ts +1 -1
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +2 -2
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.js.map +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.d.ts +1 -1
- package/lib/cjs/TileStorage.d.ts.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +2 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +10 -2
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +1 -1
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +2 -2
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +7 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +25 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js +6 -6
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +4 -4
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +122 -21
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +298 -63
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js +3 -3
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.d.ts +2 -2
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +52 -25
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +1 -0
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +2 -2
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +2 -2
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangedElementsDb.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +248 -248
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +5 -5
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.d.ts +12 -9
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/CustomViewState3dCreator.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +2 -2
- package/lib/esm/DisplayStyle.d.ts.map +1 -1
- package/lib/esm/DisplayStyle.js +4 -4
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.js +1 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +2 -2
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +2 -2
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/FontFile.js.map +1 -1
- package/lib/esm/GeoCoordConfig.js.map +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/GeometrySummary.js +47 -47
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +20 -9
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/esm/IModelElementCloneContext.js +2 -2
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +1 -2
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +10 -18
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.js +1 -1
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.d.ts +1 -1
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +2 -2
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeAppStorage.js.map +1 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.js.map +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.d.ts +1 -1
- package/lib/esm/TileStorage.d.ts.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +2 -0
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +10 -2
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +1 -1
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +2 -2
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +7 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +25 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js +6 -6
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +4 -4
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +122 -21
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +298 -64
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js +3 -3
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.d.ts +2 -2
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +52 -25
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/domains/GenericSchema.js.map +1 -1
- package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +1 -0
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js +1 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts +93 -0
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -0
- package/lib/esm/test/ElementDrivesElement.test.js +862 -0
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -0
- package/lib/esm/test/ElementLRUCache.test.js +13 -0
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js +17 -11
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/KnownTestLocations.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/PropertyDb.test.js.map +1 -1
- package/lib/esm/test/RevisionUtility.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +25 -25
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +229 -90
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js +4 -4
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +8 -8
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +402 -36
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +218 -151
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
- package/lib/esm/test/ecdb/CTE.test.js +88 -88
- package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +17 -17
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +72 -72
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
- package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +359 -328
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +22 -22
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +13 -13
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +103 -35
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +89 -44
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -1
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/misc/DevTools.test.js.map +1 -1
- package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +164 -170
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DisplayStyle.test.js +6 -6
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementGraphics.test.js +75 -6
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +4 -4
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/Setting.test.js.map +1 -1
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +16 -18
|
@@ -7,25 +7,58 @@
|
|
|
7
7
|
* @module Elements
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.AnnotationTextStyle = exports.TextAnnotation3d = exports.TextAnnotation2d = void 0;
|
|
10
|
+
exports.AnnotationTextStyle = exports.TEXT_STYLE_SETTINGS_JSON_VERSION = exports.TextAnnotation3d = exports.TextAnnotation2d = exports.TEXT_ANNOTATION_JSON_VERSION = void 0;
|
|
11
|
+
exports.parseTextAnnotationData = parseTextAnnotationData;
|
|
11
12
|
const core_common_1 = require("@itwin/core-common");
|
|
12
13
|
const Element_1 = require("../Element");
|
|
13
14
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
14
15
|
const TextBlockLayout_1 = require("./TextBlockLayout");
|
|
15
16
|
const TextAnnotationGeometry_1 = require("./TextAnnotationGeometry");
|
|
16
17
|
const ElementDrivesTextAnnotation_1 = require("./ElementDrivesTextAnnotation");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const semver = require("semver");
|
|
19
|
+
/** The version of the JSON stored in `TextAnnotation2d/3dProps.textAnnotationData` used by the code.
|
|
20
|
+
* Uses the same semantics as [ECVersion]($ecschema-metadata).
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
exports.TEXT_ANNOTATION_JSON_VERSION = "1.0.0";
|
|
24
|
+
function validateAndMigrateVersionedJSON(json, currentVersion, migrate) {
|
|
25
|
+
let parsed;
|
|
20
26
|
try {
|
|
21
|
-
|
|
27
|
+
parsed = JSON.parse(json);
|
|
22
28
|
}
|
|
23
29
|
catch {
|
|
24
30
|
return undefined;
|
|
25
31
|
}
|
|
32
|
+
const version = parsed.version;
|
|
33
|
+
if (typeof version !== "string" || !semver.valid(version))
|
|
34
|
+
throw new Error("JSON version is missing or invalid.");
|
|
35
|
+
if (typeof parsed.data !== "object" || parsed.data === null)
|
|
36
|
+
throw new Error("JSON data is missing or invalid.");
|
|
37
|
+
// Newer
|
|
38
|
+
if (semver.gt(version, currentVersion))
|
|
39
|
+
throw new Error(`JSON version ${parsed.version} is newer than supported version ${currentVersion}. Application update required to understand data.`);
|
|
40
|
+
// Older
|
|
41
|
+
if (semver.lt(version, currentVersion)) {
|
|
42
|
+
parsed.data = migrate(parsed);
|
|
43
|
+
parsed.version = currentVersion;
|
|
44
|
+
}
|
|
45
|
+
return parsed;
|
|
46
|
+
}
|
|
47
|
+
function migrateTextAnnotationData(oldData) {
|
|
48
|
+
if (oldData.version === exports.TEXT_ANNOTATION_JSON_VERSION)
|
|
49
|
+
return oldData.data;
|
|
50
|
+
// Place migration logic here.
|
|
51
|
+
throw new Error(`Migration for textAnnotationData from version ${oldData.version} to ${exports.TEXT_ANNOTATION_JSON_VERSION} failed.`);
|
|
52
|
+
}
|
|
53
|
+
/** Parses, validates, and potentially migrates the text annotation data from a JSON string.
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
function parseTextAnnotationData(json) {
|
|
57
|
+
if (!json)
|
|
58
|
+
return undefined;
|
|
59
|
+
return validateAndMigrateVersionedJSON(json, exports.TEXT_ANNOTATION_JSON_VERSION, migrateTextAnnotationData);
|
|
26
60
|
}
|
|
27
|
-
function getElementGeometryBuilderParams(iModel, modelId,
|
|
28
|
-
const annotationProps = parseTextAnnotationData(stringifiedAnnotationProps);
|
|
61
|
+
function getElementGeometryBuilderParams(iModel, modelId, categoryId, _placementProps, annotationProps, textStyleId, _subCategory) {
|
|
29
62
|
const textBlock = core_common_1.TextAnnotation.fromJSON(annotationProps).textBlock;
|
|
30
63
|
const textStyleResolver = new TextBlockLayout_1.TextStyleResolver({ textBlock, textStyleId: textStyleId ?? "", iModel });
|
|
31
64
|
const layout = (0, TextBlockLayout_1.layoutTextBlock)({ iModel, textBlock, textStyleResolver });
|
|
@@ -50,28 +83,27 @@ class TextAnnotation2d extends Element_1.AnnotationElement2d /* implements IText
|
|
|
50
83
|
* @beta
|
|
51
84
|
*/
|
|
52
85
|
defaultTextStyle;
|
|
53
|
-
/**
|
|
54
|
-
|
|
86
|
+
/** The data associated with the text annotation. */
|
|
87
|
+
_textAnnotationProps;
|
|
55
88
|
/** Extract the textual content, if present.
|
|
56
89
|
* @see [[setAnnotation]] to change it.
|
|
57
90
|
*/
|
|
58
91
|
getAnnotation() {
|
|
59
|
-
|
|
60
|
-
return textAnnotationProps ? core_common_1.TextAnnotation.fromJSON(textAnnotationProps) : undefined;
|
|
92
|
+
return this._textAnnotationProps ? core_common_1.TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;
|
|
61
93
|
}
|
|
62
94
|
/** Change the textual content of the `TextAnnotation2d`.
|
|
63
95
|
* @see [[getAnnotation]] to extract the current annotation.
|
|
64
96
|
* @param annotation The new annotation
|
|
65
97
|
*/
|
|
66
98
|
setAnnotation(annotation) {
|
|
67
|
-
this.
|
|
99
|
+
this._textAnnotationProps = annotation.toJSON();
|
|
68
100
|
}
|
|
69
101
|
constructor(props, iModel) {
|
|
70
102
|
super(props, iModel);
|
|
71
103
|
if (props.defaultTextStyle) {
|
|
72
104
|
this.defaultTextStyle = new ElementDrivesTextAnnotation_1.TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);
|
|
73
105
|
}
|
|
74
|
-
this.
|
|
106
|
+
this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;
|
|
75
107
|
}
|
|
76
108
|
/** Creates a new instance of `TextAnnotation2d` from its JSON representation. */
|
|
77
109
|
static fromJSON(props, iModel) {
|
|
@@ -80,14 +112,13 @@ class TextAnnotation2d extends Element_1.AnnotationElement2d /* implements IText
|
|
|
80
112
|
/**
|
|
81
113
|
* Converts the current `TextAnnotation2d` instance to its JSON representation.
|
|
82
114
|
* It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.
|
|
83
|
-
|
|
84
115
|
* @inheritdoc
|
|
85
116
|
*/
|
|
86
117
|
toJSON() {
|
|
87
118
|
const props = super.toJSON();
|
|
88
|
-
props.textAnnotationData = this.
|
|
89
|
-
if (this.
|
|
90
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.
|
|
119
|
+
props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: exports.TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;
|
|
120
|
+
if (this._textAnnotationProps) {
|
|
121
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);
|
|
91
122
|
}
|
|
92
123
|
return props;
|
|
93
124
|
}
|
|
@@ -99,7 +130,7 @@ class TextAnnotation2d extends Element_1.AnnotationElement2d /* implements IText
|
|
|
99
130
|
static create(iModelDb, arg) {
|
|
100
131
|
const elementProps = {
|
|
101
132
|
classFullName: this.classFullName,
|
|
102
|
-
textAnnotationData: JSON.stringify(arg.
|
|
133
|
+
textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: exports.TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,
|
|
103
134
|
defaultTextStyle: arg.defaultTextStyleId ? new ElementDrivesTextAnnotation_1.TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,
|
|
104
135
|
placement: arg.placement,
|
|
105
136
|
model: arg.model,
|
|
@@ -109,32 +140,68 @@ class TextAnnotation2d extends Element_1.AnnotationElement2d /* implements IText
|
|
|
109
140
|
return new this(elementProps, iModelDb);
|
|
110
141
|
}
|
|
111
142
|
/**
|
|
112
|
-
* Updates the geometry of the TextAnnotation2d on insert.
|
|
143
|
+
* Updates the geometry of the TextAnnotation2d on insert and validates version.
|
|
113
144
|
* @inheritdoc
|
|
114
145
|
* @beta
|
|
115
146
|
*/
|
|
116
147
|
static onInsert(arg) {
|
|
117
148
|
super.onInsert(arg);
|
|
118
|
-
this.
|
|
149
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
119
150
|
}
|
|
120
151
|
/**
|
|
121
|
-
* Updates the geometry of the TextAnnotation2d on update.
|
|
152
|
+
* Updates the geometry of the TextAnnotation2d on update and validates version.
|
|
122
153
|
* @inheritdoc
|
|
123
154
|
* @beta
|
|
124
155
|
*/
|
|
125
156
|
static onUpdate(arg) {
|
|
126
157
|
super.onUpdate(arg);
|
|
127
|
-
this.
|
|
158
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
128
159
|
}
|
|
129
160
|
/**
|
|
130
161
|
* Populates the `elementGeometryBuilderParams` property in the [TextAnnotation2dProps]($common).
|
|
131
|
-
*
|
|
162
|
+
* Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
|
|
163
|
+
* Also, validates the version of the text annotation data and migrates it if necessary.
|
|
164
|
+
* @beta
|
|
132
165
|
*/
|
|
133
|
-
static
|
|
134
|
-
|
|
135
|
-
|
|
166
|
+
static validateVersionAndUpdateGeometry(arg) {
|
|
167
|
+
const props = arg.props;
|
|
168
|
+
const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);
|
|
169
|
+
if (!props.elementGeometryBuilderParams && textAnnotationData) {
|
|
170
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? core_common_1.Placement2d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* TextAnnotation2d custom HandledProps include 'textAnnotationData'.
|
|
175
|
+
* @inheritdoc
|
|
176
|
+
* @internal
|
|
177
|
+
*/
|
|
178
|
+
static _customHandledProps = [
|
|
179
|
+
{ propertyName: "textAnnotationData", source: "Class" },
|
|
180
|
+
];
|
|
181
|
+
/**
|
|
182
|
+
* TextAnnotation2d deserializes 'textAnnotationData'.
|
|
183
|
+
* @inheritdoc
|
|
184
|
+
* @beta
|
|
185
|
+
*/
|
|
186
|
+
static deserialize(props) {
|
|
187
|
+
const elProps = super.deserialize(props);
|
|
188
|
+
const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);
|
|
189
|
+
if (textAnnotationData) {
|
|
190
|
+
elProps.textAnnotationData = JSON.stringify(textAnnotationData);
|
|
136
191
|
}
|
|
137
|
-
|
|
192
|
+
return elProps;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* TextAnnotation2d serializes 'textAnnotationData'.
|
|
196
|
+
* @inheritdoc
|
|
197
|
+
* @beta
|
|
198
|
+
*/
|
|
199
|
+
static serialize(props, iModel) {
|
|
200
|
+
const inst = super.serialize(props, iModel);
|
|
201
|
+
if (props.textAnnotationData !== undefined) {
|
|
202
|
+
inst.textAnnotationData = props.textAnnotationData;
|
|
203
|
+
}
|
|
204
|
+
return inst;
|
|
138
205
|
}
|
|
139
206
|
/** @internal */
|
|
140
207
|
getTextBlocks() {
|
|
@@ -154,6 +221,19 @@ class TextAnnotation2d extends Element_1.AnnotationElement2d /* implements IText
|
|
|
154
221
|
super.onUpdated(arg);
|
|
155
222
|
ElementDrivesTextAnnotation_1.ElementDrivesTextAnnotation.updateFieldDependencies(arg.id, arg.iModel);
|
|
156
223
|
}
|
|
224
|
+
collectReferenceIds(referenceIds) {
|
|
225
|
+
super.collectReferenceIds(referenceIds);
|
|
226
|
+
collectReferenceIds(this, referenceIds);
|
|
227
|
+
}
|
|
228
|
+
/** @internal */
|
|
229
|
+
static async onCloned(context, srcProps, dstProps) {
|
|
230
|
+
await super.onCloned(context, srcProps, dstProps);
|
|
231
|
+
const srcElem = TextAnnotation2d.fromJSON(srcProps, context.sourceDb);
|
|
232
|
+
ElementDrivesTextAnnotation_1.ElementDrivesTextAnnotation.remapFields(srcElem, context);
|
|
233
|
+
const anno = srcElem.getAnnotation();
|
|
234
|
+
dstProps.textAnnotationData = anno ? JSON.stringify({ version: exports.TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;
|
|
235
|
+
return remapTextStyle(context, srcElem, dstProps);
|
|
236
|
+
}
|
|
157
237
|
}
|
|
158
238
|
exports.TextAnnotation2d = TextAnnotation2d;
|
|
159
239
|
/** An element that displays textual content within a 3d model.
|
|
@@ -169,28 +249,27 @@ class TextAnnotation3d extends Element_1.GraphicalElement3d /* implements ITextA
|
|
|
169
249
|
* @beta
|
|
170
250
|
*/
|
|
171
251
|
defaultTextStyle;
|
|
172
|
-
/**
|
|
173
|
-
|
|
252
|
+
/** The data associated with the text annotation. */
|
|
253
|
+
_textAnnotationProps;
|
|
174
254
|
/** Extract the textual content, if present.
|
|
175
255
|
* @see [[setAnnotation]] to change it.
|
|
176
256
|
*/
|
|
177
257
|
getAnnotation() {
|
|
178
|
-
|
|
179
|
-
return textAnnotationProps ? core_common_1.TextAnnotation.fromJSON(textAnnotationProps) : undefined;
|
|
258
|
+
return this._textAnnotationProps ? core_common_1.TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;
|
|
180
259
|
}
|
|
181
260
|
/** Change the textual content of the `TextAnnotation3d`.
|
|
182
261
|
* @see [[getAnnotation]] to extract the current annotation.
|
|
183
262
|
* @param annotation The new annotation
|
|
184
263
|
*/
|
|
185
264
|
setAnnotation(annotation) {
|
|
186
|
-
this.
|
|
265
|
+
this._textAnnotationProps = annotation.toJSON();
|
|
187
266
|
}
|
|
188
267
|
constructor(props, iModel) {
|
|
189
268
|
super(props, iModel);
|
|
190
269
|
if (props.defaultTextStyle) {
|
|
191
270
|
this.defaultTextStyle = new ElementDrivesTextAnnotation_1.TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);
|
|
192
271
|
}
|
|
193
|
-
this.
|
|
272
|
+
this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;
|
|
194
273
|
}
|
|
195
274
|
/** Creates a new instance of `TextAnnotation3d` from its JSON representation. */
|
|
196
275
|
static fromJSON(props, iModel) {
|
|
@@ -203,9 +282,9 @@ class TextAnnotation3d extends Element_1.GraphicalElement3d /* implements ITextA
|
|
|
203
282
|
*/
|
|
204
283
|
toJSON() {
|
|
205
284
|
const props = super.toJSON();
|
|
206
|
-
props.textAnnotationData = this.
|
|
207
|
-
if (this.
|
|
208
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.
|
|
285
|
+
props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: exports.TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;
|
|
286
|
+
if (this._textAnnotationProps) {
|
|
287
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);
|
|
209
288
|
}
|
|
210
289
|
return props;
|
|
211
290
|
}
|
|
@@ -217,7 +296,7 @@ class TextAnnotation3d extends Element_1.GraphicalElement3d /* implements ITextA
|
|
|
217
296
|
static create(iModelDb, arg) {
|
|
218
297
|
const elementProps = {
|
|
219
298
|
classFullName: this.classFullName,
|
|
220
|
-
textAnnotationData: JSON.stringify(arg.
|
|
299
|
+
textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: exports.TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,
|
|
221
300
|
defaultTextStyle: arg.defaultTextStyleId ? new ElementDrivesTextAnnotation_1.TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,
|
|
222
301
|
placement: arg.placement,
|
|
223
302
|
model: arg.model,
|
|
@@ -227,32 +306,68 @@ class TextAnnotation3d extends Element_1.GraphicalElement3d /* implements ITextA
|
|
|
227
306
|
return new this(elementProps, iModelDb);
|
|
228
307
|
}
|
|
229
308
|
/**
|
|
230
|
-
* Updates the geometry of the TextAnnotation3d on insert
|
|
309
|
+
* Updates the geometry of the TextAnnotation3d on insert and validates version..
|
|
231
310
|
* @inheritdoc
|
|
232
311
|
* @beta
|
|
233
312
|
*/
|
|
234
313
|
static onInsert(arg) {
|
|
235
314
|
super.onInsert(arg);
|
|
236
|
-
this.
|
|
315
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
237
316
|
}
|
|
238
317
|
/**
|
|
239
|
-
* Updates the geometry of the TextAnnotation3d on update
|
|
318
|
+
* Updates the geometry of the TextAnnotation3d on update and validates version..
|
|
240
319
|
* @inheritdoc
|
|
241
320
|
* @beta
|
|
242
321
|
*/
|
|
243
322
|
static onUpdate(arg) {
|
|
244
323
|
super.onUpdate(arg);
|
|
245
|
-
this.
|
|
324
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
246
325
|
}
|
|
247
326
|
/**
|
|
248
327
|
* Populates the `elementGeometryBuilderParams` property in the [TextAnnotation3dProps]($common).
|
|
249
|
-
*
|
|
328
|
+
* Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
|
|
329
|
+
* Also, validates the version of the text annotation data and migrates it if necessary.
|
|
330
|
+
* @beta
|
|
250
331
|
*/
|
|
251
|
-
static
|
|
252
|
-
|
|
253
|
-
|
|
332
|
+
static validateVersionAndUpdateGeometry(arg) {
|
|
333
|
+
const props = arg.props;
|
|
334
|
+
const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);
|
|
335
|
+
if (!props.elementGeometryBuilderParams && textAnnotationData) {
|
|
336
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? core_common_1.Placement3d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* TextAnnotation3d custom HandledProps include 'textAnnotationData'.
|
|
341
|
+
* @inheritdoc
|
|
342
|
+
* @internal
|
|
343
|
+
*/
|
|
344
|
+
static _customHandledProps = [
|
|
345
|
+
{ propertyName: "textAnnotationData", source: "Class" },
|
|
346
|
+
];
|
|
347
|
+
/**
|
|
348
|
+
* TextAnnotation3d deserializes 'textAnnotationData'.
|
|
349
|
+
* @inheritdoc
|
|
350
|
+
* @beta
|
|
351
|
+
*/
|
|
352
|
+
static deserialize(props) {
|
|
353
|
+
const elProps = super.deserialize(props);
|
|
354
|
+
const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);
|
|
355
|
+
if (textAnnotationData) {
|
|
356
|
+
elProps.textAnnotationData = JSON.stringify(textAnnotationData);
|
|
254
357
|
}
|
|
255
|
-
|
|
358
|
+
return elProps;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* TextAnnotation3d serializes 'textAnnotationData'.
|
|
362
|
+
* @inheritdoc
|
|
363
|
+
* @beta
|
|
364
|
+
*/
|
|
365
|
+
static serialize(props, iModel) {
|
|
366
|
+
const inst = super.serialize(props, iModel);
|
|
367
|
+
if (props.textAnnotationData !== undefined) {
|
|
368
|
+
inst.textAnnotationData = props.textAnnotationData;
|
|
369
|
+
}
|
|
370
|
+
return inst;
|
|
256
371
|
}
|
|
257
372
|
/** @internal */
|
|
258
373
|
getTextBlocks() {
|
|
@@ -272,8 +387,42 @@ class TextAnnotation3d extends Element_1.GraphicalElement3d /* implements ITextA
|
|
|
272
387
|
super.onUpdated(arg);
|
|
273
388
|
ElementDrivesTextAnnotation_1.ElementDrivesTextAnnotation.updateFieldDependencies(arg.id, arg.iModel);
|
|
274
389
|
}
|
|
390
|
+
collectReferenceIds(referenceIds) {
|
|
391
|
+
super.collectReferenceIds(referenceIds);
|
|
392
|
+
collectReferenceIds(this, referenceIds);
|
|
393
|
+
}
|
|
394
|
+
/** @internal */
|
|
395
|
+
static async onCloned(context, srcProps, dstProps) {
|
|
396
|
+
await super.onCloned(context, srcProps, dstProps);
|
|
397
|
+
const srcElem = TextAnnotation3d.fromJSON(srcProps, context.sourceDb);
|
|
398
|
+
ElementDrivesTextAnnotation_1.ElementDrivesTextAnnotation.remapFields(srcElem, context);
|
|
399
|
+
const anno = srcElem.getAnnotation();
|
|
400
|
+
dstProps.textAnnotationData = anno ? JSON.stringify({ version: exports.TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;
|
|
401
|
+
return remapTextStyle(context, srcElem, dstProps);
|
|
402
|
+
}
|
|
275
403
|
}
|
|
276
404
|
exports.TextAnnotation3d = TextAnnotation3d;
|
|
405
|
+
async function remapTextStyle(context, srcElem, dstProps) {
|
|
406
|
+
const dstStyleId = await AnnotationTextStyle.remapTextStyleId(srcElem.defaultTextStyle?.id ?? core_bentley_1.Id64.invalid, context);
|
|
407
|
+
dstProps.defaultTextStyle = core_bentley_1.Id64.isValid(dstStyleId) ? new ElementDrivesTextAnnotation_1.TextAnnotationUsesTextStyleByDefault(dstStyleId).toJSON() : undefined;
|
|
408
|
+
}
|
|
409
|
+
function collectReferenceIds(elem, referenceIds) {
|
|
410
|
+
const style = elem.defaultTextStyle?.id;
|
|
411
|
+
if (style && core_bentley_1.Id64.isValidId64(style)) {
|
|
412
|
+
referenceIds.addElement(style);
|
|
413
|
+
}
|
|
414
|
+
const block = elem.getAnnotation()?.textBlock;
|
|
415
|
+
if (block) {
|
|
416
|
+
for (const { child } of (0, core_common_1.traverseTextBlockComponent)(block)) {
|
|
417
|
+
if (child.type === "field") {
|
|
418
|
+
const hostId = child.propertyHost.elementId;
|
|
419
|
+
if (core_bentley_1.Id64.isValidId64(hostId)) {
|
|
420
|
+
referenceIds.addElement(hostId);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
277
426
|
function getTextBlocks(elem) {
|
|
278
427
|
const annotation = elem.getAnnotation();
|
|
279
428
|
return annotation ? [{ textBlock: annotation.textBlock, id: undefined }] : [];
|
|
@@ -289,7 +438,17 @@ function updateTextBlocks(elem, textBlocks) {
|
|
|
289
438
|
}
|
|
290
439
|
annotation.textBlock = textBlocks[0].textBlock;
|
|
291
440
|
elem.setAnnotation(annotation);
|
|
292
|
-
|
|
441
|
+
}
|
|
442
|
+
/** The version of the JSON stored in `AnnotationTextStyleProps.settings` used by the code.
|
|
443
|
+
* Uses the same semantics as [ECVersion]($ecschema-metadata).
|
|
444
|
+
* @internal
|
|
445
|
+
*/
|
|
446
|
+
exports.TEXT_STYLE_SETTINGS_JSON_VERSION = "1.0.0";
|
|
447
|
+
function migrateTextStyleSettings(oldData) {
|
|
448
|
+
if (oldData.version === exports.TEXT_STYLE_SETTINGS_JSON_VERSION)
|
|
449
|
+
return oldData.data;
|
|
450
|
+
// Place migration logic here.
|
|
451
|
+
throw new Error(`Migration for settings from version ${oldData.version} to ${exports.TEXT_STYLE_SETTINGS_JSON_VERSION} failed.`);
|
|
293
452
|
}
|
|
294
453
|
/**
|
|
295
454
|
* The definition element that holds text style information.
|
|
@@ -312,7 +471,7 @@ class AnnotationTextStyle extends Element_1.DefinitionElement {
|
|
|
312
471
|
super(props, iModel);
|
|
313
472
|
this.description = props.description;
|
|
314
473
|
const settingsProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);
|
|
315
|
-
this.settings = core_common_1.TextStyleSettings.fromJSON(settingsProps);
|
|
474
|
+
this.settings = core_common_1.TextStyleSettings.fromJSON(settingsProps?.data);
|
|
316
475
|
}
|
|
317
476
|
/**
|
|
318
477
|
* Creates a Code for an `AnnotationTextStyle` given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
@@ -320,6 +479,7 @@ class AnnotationTextStyle extends Element_1.DefinitionElement {
|
|
|
320
479
|
* @param iModel - The IModelDb.
|
|
321
480
|
* @param definitionModelId - The ID of the DefinitionModel that contains the AnnotationTextStyle and provides the scope for its name.
|
|
322
481
|
* @param name - The AnnotationTextStyle name.
|
|
482
|
+
* @beta
|
|
323
483
|
*/
|
|
324
484
|
static createCode(iModel, definitionModelId, name) {
|
|
325
485
|
const codeSpec = iModel.codeSpecs.getByName(core_common_1.BisCodeSpec.annotationTextStyle);
|
|
@@ -329,18 +489,16 @@ class AnnotationTextStyle extends Element_1.DefinitionElement {
|
|
|
329
489
|
* Creates a new instance of `AnnotationTextStyle` with the specified properties.
|
|
330
490
|
*
|
|
331
491
|
* @param iModelDb - The iModelDb.
|
|
332
|
-
* @param
|
|
333
|
-
* @
|
|
334
|
-
* @param settings - Optional text style settings used to create the `AnnotationTextStyle`. Default settings will be used if not provided.
|
|
335
|
-
* @param description - Optional description for the `AnnotationTextStyle`.
|
|
492
|
+
* @param arg - The arguments for creating the AnnotationTextStyle.
|
|
493
|
+
* @beta
|
|
336
494
|
*/
|
|
337
|
-
static create(iModelDb,
|
|
495
|
+
static create(iModelDb, arg) {
|
|
338
496
|
const props = {
|
|
339
497
|
classFullName: this.classFullName,
|
|
340
|
-
model: definitionModelId,
|
|
341
|
-
code: this.createCode(iModelDb, definitionModelId, name).toJSON(),
|
|
342
|
-
description,
|
|
343
|
-
settings: JSON.stringify(settings),
|
|
498
|
+
model: arg.definitionModelId,
|
|
499
|
+
code: this.createCode(iModelDb, arg.definitionModelId, arg.name).toJSON(),
|
|
500
|
+
description: arg.description,
|
|
501
|
+
settings: arg.settings ? JSON.stringify({ version: exports.TEXT_STYLE_SETTINGS_JSON_VERSION, data: arg.settings }) : undefined,
|
|
344
502
|
};
|
|
345
503
|
return new this(props, iModelDb);
|
|
346
504
|
}
|
|
@@ -351,7 +509,7 @@ class AnnotationTextStyle extends Element_1.DefinitionElement {
|
|
|
351
509
|
toJSON() {
|
|
352
510
|
const props = super.toJSON();
|
|
353
511
|
props.description = this.description;
|
|
354
|
-
props.settings = JSON.stringify(this.settings.toJSON());
|
|
512
|
+
props.settings = JSON.stringify({ version: exports.TEXT_STYLE_SETTINGS_JSON_VERSION, data: this.settings.toJSON() });
|
|
355
513
|
return props;
|
|
356
514
|
}
|
|
357
515
|
/** Creates a new instance of `AnnotationTextStyle` from its JSON representation. */
|
|
@@ -380,21 +538,98 @@ class AnnotationTextStyle extends Element_1.DefinitionElement {
|
|
|
380
538
|
const settingProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);
|
|
381
539
|
if (!settingProps)
|
|
382
540
|
return;
|
|
383
|
-
const settings = core_common_1.TextStyleSettings.fromJSON(settingProps);
|
|
541
|
+
const settings = core_common_1.TextStyleSettings.fromJSON(settingProps.data);
|
|
384
542
|
const errors = settings.getValidationErrors();
|
|
385
543
|
if (errors.length > 0) {
|
|
386
544
|
throw new Error(`Invalid AnnotationTextStyle settings: ${errors.join(", ")}`);
|
|
387
545
|
}
|
|
388
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* AnnotationTextStyle custom HandledProps include 'settings'.
|
|
549
|
+
* @inheritdoc
|
|
550
|
+
* @beta
|
|
551
|
+
*/
|
|
552
|
+
static _customHandledProps = [
|
|
553
|
+
{ propertyName: "settings", source: "Class" },
|
|
554
|
+
];
|
|
555
|
+
/**
|
|
556
|
+
* AnnotationTextStyle deserializes 'settings'.
|
|
557
|
+
* @inheritdoc
|
|
558
|
+
* @beta
|
|
559
|
+
*/
|
|
560
|
+
static deserialize(props) {
|
|
561
|
+
const elProps = super.deserialize(props);
|
|
562
|
+
const settings = this.parseTextStyleSettings(props.row.settings);
|
|
563
|
+
if (settings) {
|
|
564
|
+
elProps.settings = JSON.stringify(settings);
|
|
565
|
+
}
|
|
566
|
+
return elProps;
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* AnnotationTextStyle serializes 'settings'.
|
|
570
|
+
* @inheritdoc
|
|
571
|
+
* @beta
|
|
572
|
+
*/
|
|
573
|
+
static serialize(props, iModel) {
|
|
574
|
+
const inst = super.serialize(props, iModel);
|
|
575
|
+
if (props.settings !== undefined) {
|
|
576
|
+
inst.settings = props.settings;
|
|
577
|
+
}
|
|
578
|
+
return inst;
|
|
579
|
+
}
|
|
580
|
+
/** Parses, validates, and potentially migrates the text style settings data from a JSON string. */
|
|
389
581
|
static parseTextStyleSettings(json) {
|
|
390
582
|
if (!json)
|
|
391
583
|
return undefined;
|
|
392
|
-
|
|
393
|
-
|
|
584
|
+
return validateAndMigrateVersionedJSON(json, exports.TEXT_STYLE_SETTINGS_JSON_VERSION, migrateTextStyleSettings);
|
|
585
|
+
}
|
|
586
|
+
/** When copying an element from one iModel to another, returns the Id of the AnnotationTextStyle in the `context`'s target iModel
|
|
587
|
+
* corresponding to `sourceTextStyleId`, or [Id64.invalid]($bentley) if no corresponding text style exists.
|
|
588
|
+
* If a text style with the same [Code]($common) exists in the target iModel, the style Id will be remapped to refer to that style.
|
|
589
|
+
* Otherwise, a copy of the style will be imported into the target iModel and its element Id returned.
|
|
590
|
+
* Implementations of [[ITextAnnotation]] should invoke this function when implementing their [[Element.onCloned]] method.
|
|
591
|
+
* @throws Error if an attempt to import the text style failed.
|
|
592
|
+
*/
|
|
593
|
+
static async remapTextStyleId(sourceTextStyleId, context) {
|
|
594
|
+
// No remapping necessary if there's no text style or we're not copying to a different iModel.
|
|
595
|
+
if (!core_bentley_1.Id64.isValid(sourceTextStyleId) || !context.isBetweenIModels) {
|
|
596
|
+
return sourceTextStyleId;
|
|
394
597
|
}
|
|
395
|
-
|
|
396
|
-
|
|
598
|
+
// If the style's already been remapped, we're finished.
|
|
599
|
+
let dstStyleId = context.findTargetElementId(sourceTextStyleId);
|
|
600
|
+
if (core_bentley_1.Id64.isValid(dstStyleId)) {
|
|
601
|
+
return dstStyleId;
|
|
602
|
+
}
|
|
603
|
+
// Look up the style. It really ought to exist.
|
|
604
|
+
const srcStyle = context.sourceDb.elements.tryGetElement(sourceTextStyleId);
|
|
605
|
+
if (!srcStyle) {
|
|
606
|
+
return core_bentley_1.Id64.invalid;
|
|
607
|
+
}
|
|
608
|
+
// If a style with the same code exists in the target iModel, remap to that one.
|
|
609
|
+
dstStyleId = context.targetDb.elements.queryElementIdByCode(srcStyle.code);
|
|
610
|
+
if (undefined !== dstStyleId) {
|
|
611
|
+
return dstStyleId;
|
|
612
|
+
}
|
|
613
|
+
// Copy the style into the target iModel and remap its Id.
|
|
614
|
+
const dstStyleProps = await context.cloneElement(srcStyle);
|
|
615
|
+
dstStyleId = context.targetDb.elements.insertElement(dstStyleProps);
|
|
616
|
+
context.remapElement(sourceTextStyleId, dstStyleId);
|
|
617
|
+
return dstStyleId;
|
|
618
|
+
}
|
|
619
|
+
static async onCloned(context, srcProps, dstProps) {
|
|
620
|
+
await super.onCloned(context, srcProps, dstProps);
|
|
621
|
+
if (!context.isBetweenIModels) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
const settingsProps = AnnotationTextStyle.parseTextStyleSettings(srcProps.settings);
|
|
625
|
+
const font = core_common_1.TextStyleSettings.fromJSON(settingsProps?.data).font;
|
|
626
|
+
const fontsToEmbed = [];
|
|
627
|
+
for (const file of context.sourceDb.fonts.queryEmbeddedFontFiles()) {
|
|
628
|
+
if (file.type === font.type && file.faces.some((face) => face.familyName === font.name)) {
|
|
629
|
+
fontsToEmbed.push(file);
|
|
630
|
+
}
|
|
397
631
|
}
|
|
632
|
+
await Promise.all(fontsToEmbed.map(async (file) => context.targetDb.fonts.embedFontFile({ file })));
|
|
398
633
|
}
|
|
399
634
|
}
|
|
400
635
|
exports.AnnotationTextStyle = AnnotationTextStyle;
|