@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
|
@@ -5,24 +5,56 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Elements
|
|
7
7
|
*/
|
|
8
|
-
import { BisCodeSpec, Code, ElementGeometry, Placement2d, Placement3d, TextAnnotation, TextStyleSettings } from "@itwin/core-common";
|
|
8
|
+
import { BisCodeSpec, Code, ElementGeometry, Placement2d, Placement3d, TextAnnotation, TextStyleSettings, traverseTextBlockComponent } from "@itwin/core-common";
|
|
9
9
|
import { AnnotationElement2d, DefinitionElement, Drawing, GraphicalElement3d } from "../Element";
|
|
10
|
-
import { assert } from "@itwin/core-bentley";
|
|
10
|
+
import { assert, Id64 } from "@itwin/core-bentley";
|
|
11
11
|
import { layoutTextBlock, TextStyleResolver } from "./TextBlockLayout";
|
|
12
12
|
import { appendTextAnnotationGeometry } from "./TextAnnotationGeometry";
|
|
13
13
|
import { ElementDrivesTextAnnotation, TextAnnotationUsesTextStyleByDefault } from "./ElementDrivesTextAnnotation";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import * as semver from "semver";
|
|
15
|
+
/** The version of the JSON stored in `TextAnnotation2d/3dProps.textAnnotationData` used by the code.
|
|
16
|
+
* Uses the same semantics as [ECVersion]($ecschema-metadata).
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
export const TEXT_ANNOTATION_JSON_VERSION = "1.0.0";
|
|
20
|
+
function validateAndMigrateVersionedJSON(json, currentVersion, migrate) {
|
|
21
|
+
let parsed;
|
|
17
22
|
try {
|
|
18
|
-
|
|
23
|
+
parsed = JSON.parse(json);
|
|
19
24
|
}
|
|
20
25
|
catch {
|
|
21
26
|
return undefined;
|
|
22
27
|
}
|
|
28
|
+
const version = parsed.version;
|
|
29
|
+
if (typeof version !== "string" || !semver.valid(version))
|
|
30
|
+
throw new Error("JSON version is missing or invalid.");
|
|
31
|
+
if (typeof parsed.data !== "object" || parsed.data === null)
|
|
32
|
+
throw new Error("JSON data is missing or invalid.");
|
|
33
|
+
// Newer
|
|
34
|
+
if (semver.gt(version, currentVersion))
|
|
35
|
+
throw new Error(`JSON version ${parsed.version} is newer than supported version ${currentVersion}. Application update required to understand data.`);
|
|
36
|
+
// Older
|
|
37
|
+
if (semver.lt(version, currentVersion)) {
|
|
38
|
+
parsed.data = migrate(parsed);
|
|
39
|
+
parsed.version = currentVersion;
|
|
40
|
+
}
|
|
41
|
+
return parsed;
|
|
42
|
+
}
|
|
43
|
+
function migrateTextAnnotationData(oldData) {
|
|
44
|
+
if (oldData.version === TEXT_ANNOTATION_JSON_VERSION)
|
|
45
|
+
return oldData.data;
|
|
46
|
+
// Place migration logic here.
|
|
47
|
+
throw new Error(`Migration for textAnnotationData from version ${oldData.version} to ${TEXT_ANNOTATION_JSON_VERSION} failed.`);
|
|
48
|
+
}
|
|
49
|
+
/** Parses, validates, and potentially migrates the text annotation data from a JSON string.
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export function parseTextAnnotationData(json) {
|
|
53
|
+
if (!json)
|
|
54
|
+
return undefined;
|
|
55
|
+
return validateAndMigrateVersionedJSON(json, TEXT_ANNOTATION_JSON_VERSION, migrateTextAnnotationData);
|
|
23
56
|
}
|
|
24
|
-
function getElementGeometryBuilderParams(iModel, modelId,
|
|
25
|
-
const annotationProps = parseTextAnnotationData(stringifiedAnnotationProps);
|
|
57
|
+
function getElementGeometryBuilderParams(iModel, modelId, categoryId, _placementProps, annotationProps, textStyleId, _subCategory) {
|
|
26
58
|
const textBlock = TextAnnotation.fromJSON(annotationProps).textBlock;
|
|
27
59
|
const textStyleResolver = new TextStyleResolver({ textBlock, textStyleId: textStyleId ?? "", iModel });
|
|
28
60
|
const layout = layoutTextBlock({ iModel, textBlock, textStyleResolver });
|
|
@@ -47,28 +79,27 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
47
79
|
* @beta
|
|
48
80
|
*/
|
|
49
81
|
defaultTextStyle;
|
|
50
|
-
/**
|
|
51
|
-
|
|
82
|
+
/** The data associated with the text annotation. */
|
|
83
|
+
_textAnnotationProps;
|
|
52
84
|
/** Extract the textual content, if present.
|
|
53
85
|
* @see [[setAnnotation]] to change it.
|
|
54
86
|
*/
|
|
55
87
|
getAnnotation() {
|
|
56
|
-
|
|
57
|
-
return textAnnotationProps ? TextAnnotation.fromJSON(textAnnotationProps) : undefined;
|
|
88
|
+
return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;
|
|
58
89
|
}
|
|
59
90
|
/** Change the textual content of the `TextAnnotation2d`.
|
|
60
91
|
* @see [[getAnnotation]] to extract the current annotation.
|
|
61
92
|
* @param annotation The new annotation
|
|
62
93
|
*/
|
|
63
94
|
setAnnotation(annotation) {
|
|
64
|
-
this.
|
|
95
|
+
this._textAnnotationProps = annotation.toJSON();
|
|
65
96
|
}
|
|
66
97
|
constructor(props, iModel) {
|
|
67
98
|
super(props, iModel);
|
|
68
99
|
if (props.defaultTextStyle) {
|
|
69
100
|
this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);
|
|
70
101
|
}
|
|
71
|
-
this.
|
|
102
|
+
this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;
|
|
72
103
|
}
|
|
73
104
|
/** Creates a new instance of `TextAnnotation2d` from its JSON representation. */
|
|
74
105
|
static fromJSON(props, iModel) {
|
|
@@ -77,14 +108,13 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
77
108
|
/**
|
|
78
109
|
* Converts the current `TextAnnotation2d` instance to its JSON representation.
|
|
79
110
|
* It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.
|
|
80
|
-
|
|
81
111
|
* @inheritdoc
|
|
82
112
|
*/
|
|
83
113
|
toJSON() {
|
|
84
114
|
const props = super.toJSON();
|
|
85
|
-
props.textAnnotationData = this.
|
|
86
|
-
if (this.
|
|
87
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.
|
|
115
|
+
props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;
|
|
116
|
+
if (this._textAnnotationProps) {
|
|
117
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);
|
|
88
118
|
}
|
|
89
119
|
return props;
|
|
90
120
|
}
|
|
@@ -96,7 +126,7 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
96
126
|
static create(iModelDb, arg) {
|
|
97
127
|
const elementProps = {
|
|
98
128
|
classFullName: this.classFullName,
|
|
99
|
-
textAnnotationData: JSON.stringify(arg.
|
|
129
|
+
textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,
|
|
100
130
|
defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,
|
|
101
131
|
placement: arg.placement,
|
|
102
132
|
model: arg.model,
|
|
@@ -106,32 +136,68 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
106
136
|
return new this(elementProps, iModelDb);
|
|
107
137
|
}
|
|
108
138
|
/**
|
|
109
|
-
* Updates the geometry of the TextAnnotation2d on insert.
|
|
139
|
+
* Updates the geometry of the TextAnnotation2d on insert and validates version.
|
|
110
140
|
* @inheritdoc
|
|
111
141
|
* @beta
|
|
112
142
|
*/
|
|
113
143
|
static onInsert(arg) {
|
|
114
144
|
super.onInsert(arg);
|
|
115
|
-
this.
|
|
145
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
116
146
|
}
|
|
117
147
|
/**
|
|
118
|
-
* Updates the geometry of the TextAnnotation2d on update.
|
|
148
|
+
* Updates the geometry of the TextAnnotation2d on update and validates version.
|
|
119
149
|
* @inheritdoc
|
|
120
150
|
* @beta
|
|
121
151
|
*/
|
|
122
152
|
static onUpdate(arg) {
|
|
123
153
|
super.onUpdate(arg);
|
|
124
|
-
this.
|
|
154
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
125
155
|
}
|
|
126
156
|
/**
|
|
127
157
|
* Populates the `elementGeometryBuilderParams` property in the [TextAnnotation2dProps]($common).
|
|
128
|
-
*
|
|
158
|
+
* Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
|
|
159
|
+
* Also, validates the version of the text annotation data and migrates it if necessary.
|
|
160
|
+
* @beta
|
|
129
161
|
*/
|
|
130
|
-
static
|
|
131
|
-
|
|
132
|
-
|
|
162
|
+
static validateVersionAndUpdateGeometry(arg) {
|
|
163
|
+
const props = arg.props;
|
|
164
|
+
const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);
|
|
165
|
+
if (!props.elementGeometryBuilderParams && textAnnotationData) {
|
|
166
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement2d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* TextAnnotation2d custom HandledProps include 'textAnnotationData'.
|
|
171
|
+
* @inheritdoc
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
static _customHandledProps = [
|
|
175
|
+
{ propertyName: "textAnnotationData", source: "Class" },
|
|
176
|
+
];
|
|
177
|
+
/**
|
|
178
|
+
* TextAnnotation2d deserializes 'textAnnotationData'.
|
|
179
|
+
* @inheritdoc
|
|
180
|
+
* @beta
|
|
181
|
+
*/
|
|
182
|
+
static deserialize(props) {
|
|
183
|
+
const elProps = super.deserialize(props);
|
|
184
|
+
const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);
|
|
185
|
+
if (textAnnotationData) {
|
|
186
|
+
elProps.textAnnotationData = JSON.stringify(textAnnotationData);
|
|
133
187
|
}
|
|
134
|
-
|
|
188
|
+
return elProps;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* TextAnnotation2d serializes 'textAnnotationData'.
|
|
192
|
+
* @inheritdoc
|
|
193
|
+
* @beta
|
|
194
|
+
*/
|
|
195
|
+
static serialize(props, iModel) {
|
|
196
|
+
const inst = super.serialize(props, iModel);
|
|
197
|
+
if (props.textAnnotationData !== undefined) {
|
|
198
|
+
inst.textAnnotationData = props.textAnnotationData;
|
|
199
|
+
}
|
|
200
|
+
return inst;
|
|
135
201
|
}
|
|
136
202
|
/** @internal */
|
|
137
203
|
getTextBlocks() {
|
|
@@ -151,6 +217,19 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
151
217
|
super.onUpdated(arg);
|
|
152
218
|
ElementDrivesTextAnnotation.updateFieldDependencies(arg.id, arg.iModel);
|
|
153
219
|
}
|
|
220
|
+
collectReferenceIds(referenceIds) {
|
|
221
|
+
super.collectReferenceIds(referenceIds);
|
|
222
|
+
collectReferenceIds(this, referenceIds);
|
|
223
|
+
}
|
|
224
|
+
/** @internal */
|
|
225
|
+
static async onCloned(context, srcProps, dstProps) {
|
|
226
|
+
await super.onCloned(context, srcProps, dstProps);
|
|
227
|
+
const srcElem = TextAnnotation2d.fromJSON(srcProps, context.sourceDb);
|
|
228
|
+
ElementDrivesTextAnnotation.remapFields(srcElem, context);
|
|
229
|
+
const anno = srcElem.getAnnotation();
|
|
230
|
+
dstProps.textAnnotationData = anno ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;
|
|
231
|
+
return remapTextStyle(context, srcElem, dstProps);
|
|
232
|
+
}
|
|
154
233
|
}
|
|
155
234
|
/** An element that displays textual content within a 3d model.
|
|
156
235
|
* The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed.
|
|
@@ -165,28 +244,27 @@ export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnno
|
|
|
165
244
|
* @beta
|
|
166
245
|
*/
|
|
167
246
|
defaultTextStyle;
|
|
168
|
-
/**
|
|
169
|
-
|
|
247
|
+
/** The data associated with the text annotation. */
|
|
248
|
+
_textAnnotationProps;
|
|
170
249
|
/** Extract the textual content, if present.
|
|
171
250
|
* @see [[setAnnotation]] to change it.
|
|
172
251
|
*/
|
|
173
252
|
getAnnotation() {
|
|
174
|
-
|
|
175
|
-
return textAnnotationProps ? TextAnnotation.fromJSON(textAnnotationProps) : undefined;
|
|
253
|
+
return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;
|
|
176
254
|
}
|
|
177
255
|
/** Change the textual content of the `TextAnnotation3d`.
|
|
178
256
|
* @see [[getAnnotation]] to extract the current annotation.
|
|
179
257
|
* @param annotation The new annotation
|
|
180
258
|
*/
|
|
181
259
|
setAnnotation(annotation) {
|
|
182
|
-
this.
|
|
260
|
+
this._textAnnotationProps = annotation.toJSON();
|
|
183
261
|
}
|
|
184
262
|
constructor(props, iModel) {
|
|
185
263
|
super(props, iModel);
|
|
186
264
|
if (props.defaultTextStyle) {
|
|
187
265
|
this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);
|
|
188
266
|
}
|
|
189
|
-
this.
|
|
267
|
+
this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;
|
|
190
268
|
}
|
|
191
269
|
/** Creates a new instance of `TextAnnotation3d` from its JSON representation. */
|
|
192
270
|
static fromJSON(props, iModel) {
|
|
@@ -199,9 +277,9 @@ export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnno
|
|
|
199
277
|
*/
|
|
200
278
|
toJSON() {
|
|
201
279
|
const props = super.toJSON();
|
|
202
|
-
props.textAnnotationData = this.
|
|
203
|
-
if (this.
|
|
204
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.
|
|
280
|
+
props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;
|
|
281
|
+
if (this._textAnnotationProps) {
|
|
282
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);
|
|
205
283
|
}
|
|
206
284
|
return props;
|
|
207
285
|
}
|
|
@@ -213,7 +291,7 @@ export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnno
|
|
|
213
291
|
static create(iModelDb, arg) {
|
|
214
292
|
const elementProps = {
|
|
215
293
|
classFullName: this.classFullName,
|
|
216
|
-
textAnnotationData: JSON.stringify(arg.
|
|
294
|
+
textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,
|
|
217
295
|
defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,
|
|
218
296
|
placement: arg.placement,
|
|
219
297
|
model: arg.model,
|
|
@@ -223,32 +301,68 @@ export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnno
|
|
|
223
301
|
return new this(elementProps, iModelDb);
|
|
224
302
|
}
|
|
225
303
|
/**
|
|
226
|
-
* Updates the geometry of the TextAnnotation3d on insert
|
|
304
|
+
* Updates the geometry of the TextAnnotation3d on insert and validates version..
|
|
227
305
|
* @inheritdoc
|
|
228
306
|
* @beta
|
|
229
307
|
*/
|
|
230
308
|
static onInsert(arg) {
|
|
231
309
|
super.onInsert(arg);
|
|
232
|
-
this.
|
|
310
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
233
311
|
}
|
|
234
312
|
/**
|
|
235
|
-
* Updates the geometry of the TextAnnotation3d on update
|
|
313
|
+
* Updates the geometry of the TextAnnotation3d on update and validates version..
|
|
236
314
|
* @inheritdoc
|
|
237
315
|
* @beta
|
|
238
316
|
*/
|
|
239
317
|
static onUpdate(arg) {
|
|
240
318
|
super.onUpdate(arg);
|
|
241
|
-
this.
|
|
319
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
242
320
|
}
|
|
243
321
|
/**
|
|
244
322
|
* Populates the `elementGeometryBuilderParams` property in the [TextAnnotation3dProps]($common).
|
|
245
|
-
*
|
|
323
|
+
* Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
|
|
324
|
+
* Also, validates the version of the text annotation data and migrates it if necessary.
|
|
325
|
+
* @beta
|
|
246
326
|
*/
|
|
247
|
-
static
|
|
248
|
-
|
|
249
|
-
|
|
327
|
+
static validateVersionAndUpdateGeometry(arg) {
|
|
328
|
+
const props = arg.props;
|
|
329
|
+
const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);
|
|
330
|
+
if (!props.elementGeometryBuilderParams && textAnnotationData) {
|
|
331
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement3d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* TextAnnotation3d custom HandledProps include 'textAnnotationData'.
|
|
336
|
+
* @inheritdoc
|
|
337
|
+
* @internal
|
|
338
|
+
*/
|
|
339
|
+
static _customHandledProps = [
|
|
340
|
+
{ propertyName: "textAnnotationData", source: "Class" },
|
|
341
|
+
];
|
|
342
|
+
/**
|
|
343
|
+
* TextAnnotation3d deserializes 'textAnnotationData'.
|
|
344
|
+
* @inheritdoc
|
|
345
|
+
* @beta
|
|
346
|
+
*/
|
|
347
|
+
static deserialize(props) {
|
|
348
|
+
const elProps = super.deserialize(props);
|
|
349
|
+
const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);
|
|
350
|
+
if (textAnnotationData) {
|
|
351
|
+
elProps.textAnnotationData = JSON.stringify(textAnnotationData);
|
|
352
|
+
}
|
|
353
|
+
return elProps;
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* TextAnnotation3d serializes 'textAnnotationData'.
|
|
357
|
+
* @inheritdoc
|
|
358
|
+
* @beta
|
|
359
|
+
*/
|
|
360
|
+
static serialize(props, iModel) {
|
|
361
|
+
const inst = super.serialize(props, iModel);
|
|
362
|
+
if (props.textAnnotationData !== undefined) {
|
|
363
|
+
inst.textAnnotationData = props.textAnnotationData;
|
|
250
364
|
}
|
|
251
|
-
|
|
365
|
+
return inst;
|
|
252
366
|
}
|
|
253
367
|
/** @internal */
|
|
254
368
|
getTextBlocks() {
|
|
@@ -268,6 +382,40 @@ export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnno
|
|
|
268
382
|
super.onUpdated(arg);
|
|
269
383
|
ElementDrivesTextAnnotation.updateFieldDependencies(arg.id, arg.iModel);
|
|
270
384
|
}
|
|
385
|
+
collectReferenceIds(referenceIds) {
|
|
386
|
+
super.collectReferenceIds(referenceIds);
|
|
387
|
+
collectReferenceIds(this, referenceIds);
|
|
388
|
+
}
|
|
389
|
+
/** @internal */
|
|
390
|
+
static async onCloned(context, srcProps, dstProps) {
|
|
391
|
+
await super.onCloned(context, srcProps, dstProps);
|
|
392
|
+
const srcElem = TextAnnotation3d.fromJSON(srcProps, context.sourceDb);
|
|
393
|
+
ElementDrivesTextAnnotation.remapFields(srcElem, context);
|
|
394
|
+
const anno = srcElem.getAnnotation();
|
|
395
|
+
dstProps.textAnnotationData = anno ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;
|
|
396
|
+
return remapTextStyle(context, srcElem, dstProps);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
async function remapTextStyle(context, srcElem, dstProps) {
|
|
400
|
+
const dstStyleId = await AnnotationTextStyle.remapTextStyleId(srcElem.defaultTextStyle?.id ?? Id64.invalid, context);
|
|
401
|
+
dstProps.defaultTextStyle = Id64.isValid(dstStyleId) ? new TextAnnotationUsesTextStyleByDefault(dstStyleId).toJSON() : undefined;
|
|
402
|
+
}
|
|
403
|
+
function collectReferenceIds(elem, referenceIds) {
|
|
404
|
+
const style = elem.defaultTextStyle?.id;
|
|
405
|
+
if (style && Id64.isValidId64(style)) {
|
|
406
|
+
referenceIds.addElement(style);
|
|
407
|
+
}
|
|
408
|
+
const block = elem.getAnnotation()?.textBlock;
|
|
409
|
+
if (block) {
|
|
410
|
+
for (const { child } of traverseTextBlockComponent(block)) {
|
|
411
|
+
if (child.type === "field") {
|
|
412
|
+
const hostId = child.propertyHost.elementId;
|
|
413
|
+
if (Id64.isValidId64(hostId)) {
|
|
414
|
+
referenceIds.addElement(hostId);
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
271
419
|
}
|
|
272
420
|
function getTextBlocks(elem) {
|
|
273
421
|
const annotation = elem.getAnnotation();
|
|
@@ -284,7 +432,17 @@ function updateTextBlocks(elem, textBlocks) {
|
|
|
284
432
|
}
|
|
285
433
|
annotation.textBlock = textBlocks[0].textBlock;
|
|
286
434
|
elem.setAnnotation(annotation);
|
|
287
|
-
|
|
435
|
+
}
|
|
436
|
+
/** The version of the JSON stored in `AnnotationTextStyleProps.settings` used by the code.
|
|
437
|
+
* Uses the same semantics as [ECVersion]($ecschema-metadata).
|
|
438
|
+
* @internal
|
|
439
|
+
*/
|
|
440
|
+
export const TEXT_STYLE_SETTINGS_JSON_VERSION = "1.0.0";
|
|
441
|
+
function migrateTextStyleSettings(oldData) {
|
|
442
|
+
if (oldData.version === TEXT_STYLE_SETTINGS_JSON_VERSION)
|
|
443
|
+
return oldData.data;
|
|
444
|
+
// Place migration logic here.
|
|
445
|
+
throw new Error(`Migration for settings from version ${oldData.version} to ${TEXT_STYLE_SETTINGS_JSON_VERSION} failed.`);
|
|
288
446
|
}
|
|
289
447
|
/**
|
|
290
448
|
* The definition element that holds text style information.
|
|
@@ -307,7 +465,7 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
307
465
|
super(props, iModel);
|
|
308
466
|
this.description = props.description;
|
|
309
467
|
const settingsProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);
|
|
310
|
-
this.settings = TextStyleSettings.fromJSON(settingsProps);
|
|
468
|
+
this.settings = TextStyleSettings.fromJSON(settingsProps?.data);
|
|
311
469
|
}
|
|
312
470
|
/**
|
|
313
471
|
* Creates a Code for an `AnnotationTextStyle` given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
@@ -315,6 +473,7 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
315
473
|
* @param iModel - The IModelDb.
|
|
316
474
|
* @param definitionModelId - The ID of the DefinitionModel that contains the AnnotationTextStyle and provides the scope for its name.
|
|
317
475
|
* @param name - The AnnotationTextStyle name.
|
|
476
|
+
* @beta
|
|
318
477
|
*/
|
|
319
478
|
static createCode(iModel, definitionModelId, name) {
|
|
320
479
|
const codeSpec = iModel.codeSpecs.getByName(BisCodeSpec.annotationTextStyle);
|
|
@@ -324,18 +483,16 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
324
483
|
* Creates a new instance of `AnnotationTextStyle` with the specified properties.
|
|
325
484
|
*
|
|
326
485
|
* @param iModelDb - The iModelDb.
|
|
327
|
-
* @param
|
|
328
|
-
* @
|
|
329
|
-
* @param settings - Optional text style settings used to create the `AnnotationTextStyle`. Default settings will be used if not provided.
|
|
330
|
-
* @param description - Optional description for the `AnnotationTextStyle`.
|
|
486
|
+
* @param arg - The arguments for creating the AnnotationTextStyle.
|
|
487
|
+
* @beta
|
|
331
488
|
*/
|
|
332
|
-
static create(iModelDb,
|
|
489
|
+
static create(iModelDb, arg) {
|
|
333
490
|
const props = {
|
|
334
491
|
classFullName: this.classFullName,
|
|
335
|
-
model: definitionModelId,
|
|
336
|
-
code: this.createCode(iModelDb, definitionModelId, name).toJSON(),
|
|
337
|
-
description,
|
|
338
|
-
settings: JSON.stringify(settings),
|
|
492
|
+
model: arg.definitionModelId,
|
|
493
|
+
code: this.createCode(iModelDb, arg.definitionModelId, arg.name).toJSON(),
|
|
494
|
+
description: arg.description,
|
|
495
|
+
settings: arg.settings ? JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: arg.settings }) : undefined,
|
|
339
496
|
};
|
|
340
497
|
return new this(props, iModelDb);
|
|
341
498
|
}
|
|
@@ -346,7 +503,7 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
346
503
|
toJSON() {
|
|
347
504
|
const props = super.toJSON();
|
|
348
505
|
props.description = this.description;
|
|
349
|
-
props.settings = JSON.stringify(this.settings.toJSON());
|
|
506
|
+
props.settings = JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: this.settings.toJSON() });
|
|
350
507
|
return props;
|
|
351
508
|
}
|
|
352
509
|
/** Creates a new instance of `AnnotationTextStyle` from its JSON representation. */
|
|
@@ -375,21 +532,98 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
375
532
|
const settingProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);
|
|
376
533
|
if (!settingProps)
|
|
377
534
|
return;
|
|
378
|
-
const settings = TextStyleSettings.fromJSON(settingProps);
|
|
535
|
+
const settings = TextStyleSettings.fromJSON(settingProps.data);
|
|
379
536
|
const errors = settings.getValidationErrors();
|
|
380
537
|
if (errors.length > 0) {
|
|
381
538
|
throw new Error(`Invalid AnnotationTextStyle settings: ${errors.join(", ")}`);
|
|
382
539
|
}
|
|
383
540
|
}
|
|
541
|
+
/**
|
|
542
|
+
* AnnotationTextStyle custom HandledProps include 'settings'.
|
|
543
|
+
* @inheritdoc
|
|
544
|
+
* @beta
|
|
545
|
+
*/
|
|
546
|
+
static _customHandledProps = [
|
|
547
|
+
{ propertyName: "settings", source: "Class" },
|
|
548
|
+
];
|
|
549
|
+
/**
|
|
550
|
+
* AnnotationTextStyle deserializes 'settings'.
|
|
551
|
+
* @inheritdoc
|
|
552
|
+
* @beta
|
|
553
|
+
*/
|
|
554
|
+
static deserialize(props) {
|
|
555
|
+
const elProps = super.deserialize(props);
|
|
556
|
+
const settings = this.parseTextStyleSettings(props.row.settings);
|
|
557
|
+
if (settings) {
|
|
558
|
+
elProps.settings = JSON.stringify(settings);
|
|
559
|
+
}
|
|
560
|
+
return elProps;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* AnnotationTextStyle serializes 'settings'.
|
|
564
|
+
* @inheritdoc
|
|
565
|
+
* @beta
|
|
566
|
+
*/
|
|
567
|
+
static serialize(props, iModel) {
|
|
568
|
+
const inst = super.serialize(props, iModel);
|
|
569
|
+
if (props.settings !== undefined) {
|
|
570
|
+
inst.settings = props.settings;
|
|
571
|
+
}
|
|
572
|
+
return inst;
|
|
573
|
+
}
|
|
574
|
+
/** Parses, validates, and potentially migrates the text style settings data from a JSON string. */
|
|
384
575
|
static parseTextStyleSettings(json) {
|
|
385
576
|
if (!json)
|
|
386
577
|
return undefined;
|
|
387
|
-
|
|
388
|
-
|
|
578
|
+
return validateAndMigrateVersionedJSON(json, TEXT_STYLE_SETTINGS_JSON_VERSION, migrateTextStyleSettings);
|
|
579
|
+
}
|
|
580
|
+
/** When copying an element from one iModel to another, returns the Id of the AnnotationTextStyle in the `context`'s target iModel
|
|
581
|
+
* corresponding to `sourceTextStyleId`, or [Id64.invalid]($bentley) if no corresponding text style exists.
|
|
582
|
+
* 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.
|
|
583
|
+
* Otherwise, a copy of the style will be imported into the target iModel and its element Id returned.
|
|
584
|
+
* Implementations of [[ITextAnnotation]] should invoke this function when implementing their [[Element.onCloned]] method.
|
|
585
|
+
* @throws Error if an attempt to import the text style failed.
|
|
586
|
+
*/
|
|
587
|
+
static async remapTextStyleId(sourceTextStyleId, context) {
|
|
588
|
+
// No remapping necessary if there's no text style or we're not copying to a different iModel.
|
|
589
|
+
if (!Id64.isValid(sourceTextStyleId) || !context.isBetweenIModels) {
|
|
590
|
+
return sourceTextStyleId;
|
|
389
591
|
}
|
|
390
|
-
|
|
391
|
-
|
|
592
|
+
// If the style's already been remapped, we're finished.
|
|
593
|
+
let dstStyleId = context.findTargetElementId(sourceTextStyleId);
|
|
594
|
+
if (Id64.isValid(dstStyleId)) {
|
|
595
|
+
return dstStyleId;
|
|
596
|
+
}
|
|
597
|
+
// Look up the style. It really ought to exist.
|
|
598
|
+
const srcStyle = context.sourceDb.elements.tryGetElement(sourceTextStyleId);
|
|
599
|
+
if (!srcStyle) {
|
|
600
|
+
return Id64.invalid;
|
|
601
|
+
}
|
|
602
|
+
// If a style with the same code exists in the target iModel, remap to that one.
|
|
603
|
+
dstStyleId = context.targetDb.elements.queryElementIdByCode(srcStyle.code);
|
|
604
|
+
if (undefined !== dstStyleId) {
|
|
605
|
+
return dstStyleId;
|
|
606
|
+
}
|
|
607
|
+
// Copy the style into the target iModel and remap its Id.
|
|
608
|
+
const dstStyleProps = await context.cloneElement(srcStyle);
|
|
609
|
+
dstStyleId = context.targetDb.elements.insertElement(dstStyleProps);
|
|
610
|
+
context.remapElement(sourceTextStyleId, dstStyleId);
|
|
611
|
+
return dstStyleId;
|
|
612
|
+
}
|
|
613
|
+
static async onCloned(context, srcProps, dstProps) {
|
|
614
|
+
await super.onCloned(context, srcProps, dstProps);
|
|
615
|
+
if (!context.isBetweenIModels) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
const settingsProps = AnnotationTextStyle.parseTextStyleSettings(srcProps.settings);
|
|
619
|
+
const font = TextStyleSettings.fromJSON(settingsProps?.data).font;
|
|
620
|
+
const fontsToEmbed = [];
|
|
621
|
+
for (const file of context.sourceDb.fonts.queryEmbeddedFontFiles()) {
|
|
622
|
+
if (file.type === font.type && file.faces.some((face) => face.familyName === font.name)) {
|
|
623
|
+
fontsToEmbed.push(file);
|
|
624
|
+
}
|
|
392
625
|
}
|
|
626
|
+
await Promise.all(fontsToEmbed.map(async (file) => context.targetDb.fonts.embedFontFile({ file })));
|
|
393
627
|
}
|
|
394
628
|
}
|
|
395
629
|
//# sourceMappingURL=TextAnnotationElement.js.map
|