@itwin/core-backend 5.2.0-dev.7 → 5.2.0
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 +56 -1
- package/lib/cjs/BackendHubAccess.d.ts +2 -0
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.d.ts +6 -0
- package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js +6 -0
- 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 +57 -3
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +151 -42
- 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 +4 -0
- 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.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +8 -0
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +22 -0
- 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.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 +54 -3
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +96 -18
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +11 -1
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +5 -0
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +1 -5
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js +0 -6
- 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.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.d.ts +8 -0
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +11 -0
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.d.ts +175 -0
- package/lib/cjs/StashManager.d.ts.map +1 -0
- package/lib/cjs/StashManager.js +306 -0
- package/lib/cjs/StashManager.js.map +1 -0
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +226 -15
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +249 -23
- package/lib/cjs/TxnManager.js.map +1 -1
- 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 +10 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +15 -6
- 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.d.ts +3 -2
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +8 -7
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +145 -36
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +234 -106
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +2 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js +26 -19
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js +11 -3
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.d.ts +51 -38
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +252 -156
- 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 +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.d.ts +1 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +2 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +2 -12
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +49 -45
- 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.d.ts +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +2 -0
- package/lib/esm/BackendHubAccess.d.ts.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.d.ts +6 -0
- package/lib/esm/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/esm/BackendLoggerCategory.js +6 -0
- 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 +57 -3
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +152 -43
- 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 +4 -0
- 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.js.map +1 -1
- package/lib/esm/ECDb.d.ts +8 -0
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +22 -0
- 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.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 +54 -3
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +97 -19
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +11 -1
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +5 -0
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts +1 -5
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js +0 -6
- 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.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.d.ts +8 -0
- package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/esm/SqliteChangesetReader.js +11 -0
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.d.ts +175 -0
- package/lib/esm/StashManager.d.ts.map +1 -0
- package/lib/esm/StashManager.js +301 -0
- package/lib/esm/StashManager.js.map +1 -0
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +226 -15
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +247 -21
- package/lib/esm/TxnManager.js.map +1 -1
- 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 +10 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +13 -5
- 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.d.ts +3 -2
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +8 -7
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +145 -36
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +235 -107
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +2 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js +26 -19
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js +11 -3
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.d.ts +51 -38
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +253 -157
- 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 +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.d.ts +1 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +1 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +2 -12
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +51 -47
- 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.d.ts +5 -1
- package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js +7 -2
- 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/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- 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 +195 -78
- 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 +19 -17
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +410 -59
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +627 -193
- 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.d.ts +46 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +20 -2
- 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 +15 -15
- 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 +128 -58
- 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 +326 -326
- 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.d.ts +2 -0
- package/lib/esm/test/hubaccess/Rebase.test.d.ts.map +1 -0
- package/lib/esm/test/hubaccess/Rebase.test.js +640 -0
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -0
- 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 +44 -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 +20 -20
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +3 -3
- 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.d.ts +16 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +47 -0
- 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 +15 -19
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +248 -118
- 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.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- 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 +3 -3
- 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.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.d.ts +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
|
@@ -6,28 +6,62 @@
|
|
|
6
6
|
* @module Elements
|
|
7
7
|
*/
|
|
8
8
|
import { BisCodeSpec, Code, ElementGeometry, Placement2d, Placement3d, TextAnnotation, TextStyleSettings } from "@itwin/core-common";
|
|
9
|
-
import { AnnotationElement2d, DefinitionElement, GraphicalElement3d } from "../Element";
|
|
9
|
+
import { AnnotationElement2d, DefinitionElement, Drawing, GraphicalElement3d } from "../Element";
|
|
10
10
|
import { assert } from "@itwin/core-bentley";
|
|
11
11
|
import { layoutTextBlock, TextStyleResolver } from "./TextBlockLayout";
|
|
12
12
|
import { appendTextAnnotationGeometry } from "./TextAnnotationGeometry";
|
|
13
|
-
import { ElementDrivesTextAnnotation } from "./ElementDrivesTextAnnotation";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
import { ElementDrivesTextAnnotation, TextAnnotationUsesTextStyleByDefault } from "./ElementDrivesTextAnnotation";
|
|
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;
|
|
23
42
|
}
|
|
24
|
-
function
|
|
25
|
-
|
|
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
|
+
function parseTextAnnotationData(json) {
|
|
51
|
+
if (!json)
|
|
52
|
+
return undefined;
|
|
53
|
+
return validateAndMigrateVersionedJSON(json, TEXT_ANNOTATION_JSON_VERSION, migrateTextAnnotationData);
|
|
54
|
+
}
|
|
55
|
+
function getElementGeometryBuilderParams(iModel, modelId, categoryId, _placementProps, annotationProps, textStyleId, _subCategory) {
|
|
26
56
|
const textBlock = TextAnnotation.fromJSON(annotationProps).textBlock;
|
|
27
|
-
const textStyleResolver = new TextStyleResolver({ textBlock,
|
|
57
|
+
const textStyleResolver = new TextStyleResolver({ textBlock, textStyleId: textStyleId ?? "", iModel });
|
|
28
58
|
const layout = layoutTextBlock({ iModel, textBlock, textStyleResolver });
|
|
29
59
|
const builder = new ElementGeometry.Builder();
|
|
30
|
-
|
|
60
|
+
let scaleFactor = 1;
|
|
61
|
+
const element = iModel.elements.getElement(modelId);
|
|
62
|
+
if (element instanceof Drawing)
|
|
63
|
+
scaleFactor = element.scaleFactor;
|
|
64
|
+
appendTextAnnotationGeometry({ layout, textStyleResolver, scaleFactor, annotationProps: annotationProps ?? {}, builder, categoryId });
|
|
31
65
|
return { entryArray: builder.entries };
|
|
32
66
|
}
|
|
33
67
|
/** An element that displays textual content within a 2d model.
|
|
@@ -38,25 +72,32 @@ function getElementGeometryBuilderParams(iModel, modelId, _placementProps, strin
|
|
|
38
72
|
export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnnotation */ {
|
|
39
73
|
/** @internal */
|
|
40
74
|
static get className() { return "TextAnnotation2d"; }
|
|
41
|
-
/**
|
|
42
|
-
|
|
75
|
+
/**
|
|
76
|
+
* The default [[AnnotationTextStyle]] used by the TextAnnotation2d.
|
|
77
|
+
* @beta
|
|
78
|
+
*/
|
|
79
|
+
defaultTextStyle;
|
|
80
|
+
/** The data associated with the text annotation. */
|
|
81
|
+
_textAnnotationProps;
|
|
43
82
|
/** Extract the textual content, if present.
|
|
44
83
|
* @see [[setAnnotation]] to change it.
|
|
45
84
|
*/
|
|
46
85
|
getAnnotation() {
|
|
47
|
-
|
|
48
|
-
return textAnnotationProps ? TextAnnotation.fromJSON(textAnnotationProps) : undefined;
|
|
86
|
+
return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;
|
|
49
87
|
}
|
|
50
88
|
/** Change the textual content of the `TextAnnotation2d`.
|
|
51
89
|
* @see [[getAnnotation]] to extract the current annotation.
|
|
52
90
|
* @param annotation The new annotation
|
|
53
91
|
*/
|
|
54
92
|
setAnnotation(annotation) {
|
|
55
|
-
this.
|
|
93
|
+
this._textAnnotationProps = annotation.toJSON();
|
|
56
94
|
}
|
|
57
95
|
constructor(props, iModel) {
|
|
58
96
|
super(props, iModel);
|
|
59
|
-
|
|
97
|
+
if (props.defaultTextStyle) {
|
|
98
|
+
this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);
|
|
99
|
+
}
|
|
100
|
+
this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;
|
|
60
101
|
}
|
|
61
102
|
/** Creates a new instance of `TextAnnotation2d` from its JSON representation. */
|
|
62
103
|
static fromJSON(props, iModel) {
|
|
@@ -65,76 +106,96 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
65
106
|
/**
|
|
66
107
|
* Converts the current `TextAnnotation2d` instance to its JSON representation.
|
|
67
108
|
* It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.
|
|
68
|
-
|
|
69
109
|
* @inheritdoc
|
|
70
110
|
*/
|
|
71
111
|
toJSON() {
|
|
72
112
|
const props = super.toJSON();
|
|
73
|
-
props.textAnnotationData = this.
|
|
74
|
-
if (this.
|
|
75
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.placement, this.
|
|
113
|
+
props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;
|
|
114
|
+
if (this._textAnnotationProps) {
|
|
115
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);
|
|
76
116
|
}
|
|
77
117
|
return props;
|
|
78
118
|
}
|
|
79
119
|
/** Creates a new `TextAnnotation2d` instance with the specified properties.
|
|
80
120
|
* @param iModelDb The iModel.
|
|
81
|
-
* @param
|
|
82
|
-
* @
|
|
83
|
-
* @param placement The placement properties for the annotation.
|
|
84
|
-
* @param textAnnotationData Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation2d`. Essentially an empty element if not provided.
|
|
85
|
-
* @param code Optional code for the element.
|
|
121
|
+
* @param arg The arguments for creating the TextAnnotation2d.
|
|
122
|
+
* @beta
|
|
86
123
|
*/
|
|
87
|
-
static create(iModelDb,
|
|
88
|
-
const
|
|
124
|
+
static create(iModelDb, arg) {
|
|
125
|
+
const elementProps = {
|
|
89
126
|
classFullName: this.classFullName,
|
|
90
|
-
textAnnotationData: JSON.stringify(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
127
|
+
textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,
|
|
128
|
+
defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,
|
|
129
|
+
placement: arg.placement,
|
|
130
|
+
model: arg.model,
|
|
131
|
+
category: arg.category,
|
|
132
|
+
code: arg.code ?? Code.createEmpty(),
|
|
95
133
|
};
|
|
96
|
-
return new this(
|
|
134
|
+
return new this(elementProps, iModelDb);
|
|
97
135
|
}
|
|
98
136
|
/**
|
|
99
|
-
* Updates the geometry of the TextAnnotation2d on insert.
|
|
137
|
+
* Updates the geometry of the TextAnnotation2d on insert and validates version.
|
|
100
138
|
* @inheritdoc
|
|
101
139
|
* @beta
|
|
102
140
|
*/
|
|
103
141
|
static onInsert(arg) {
|
|
104
142
|
super.onInsert(arg);
|
|
105
|
-
this.
|
|
143
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
106
144
|
}
|
|
107
145
|
/**
|
|
108
|
-
* Updates the geometry of the TextAnnotation2d on update.
|
|
146
|
+
* Updates the geometry of the TextAnnotation2d on update and validates version.
|
|
109
147
|
* @inheritdoc
|
|
110
148
|
* @beta
|
|
111
149
|
*/
|
|
112
150
|
static onUpdate(arg) {
|
|
113
151
|
super.onUpdate(arg);
|
|
114
|
-
this.
|
|
152
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
115
153
|
}
|
|
116
154
|
/**
|
|
117
155
|
* Populates the `elementGeometryBuilderParams` property in the [TextAnnotation2dProps]($common).
|
|
118
|
-
*
|
|
156
|
+
* Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
|
|
157
|
+
* Also, validates the version of the text annotation data and migrates it if necessary.
|
|
158
|
+
* @beta
|
|
119
159
|
*/
|
|
120
|
-
static
|
|
121
|
-
|
|
122
|
-
|
|
160
|
+
static validateVersionAndUpdateGeometry(arg) {
|
|
161
|
+
const props = arg.props;
|
|
162
|
+
const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);
|
|
163
|
+
if (!props.elementGeometryBuilderParams && textAnnotationData) {
|
|
164
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement2d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);
|
|
123
165
|
}
|
|
124
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(iModelDb, props.model, props.placement ?? Placement2d.fromJSON(), props.textAnnotationData, props.category);
|
|
125
166
|
}
|
|
126
167
|
/**
|
|
127
|
-
*
|
|
168
|
+
* TextAnnotation2d custom HandledProps include 'textAnnotationData'.
|
|
128
169
|
* @inheritdoc
|
|
170
|
+
* @internal
|
|
129
171
|
*/
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
172
|
+
static _customHandledProps = [
|
|
173
|
+
{ propertyName: "textAnnotationData", source: "Class" },
|
|
174
|
+
];
|
|
175
|
+
/**
|
|
176
|
+
* TextAnnotation2d deserializes 'textAnnotationData'.
|
|
177
|
+
* @inheritdoc
|
|
178
|
+
* @beta
|
|
179
|
+
*/
|
|
180
|
+
static deserialize(props) {
|
|
181
|
+
const elProps = super.deserialize(props);
|
|
182
|
+
const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);
|
|
183
|
+
if (textAnnotationData) {
|
|
184
|
+
elProps.textAnnotationData = JSON.stringify(textAnnotationData);
|
|
135
185
|
}
|
|
136
|
-
|
|
137
|
-
|
|
186
|
+
return elProps;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* TextAnnotation2d serializes 'textAnnotationData'.
|
|
190
|
+
* @inheritdoc
|
|
191
|
+
* @beta
|
|
192
|
+
*/
|
|
193
|
+
static serialize(props, iModel) {
|
|
194
|
+
const inst = super.serialize(props, iModel);
|
|
195
|
+
if (props.textAnnotationData !== undefined) {
|
|
196
|
+
inst.textAnnotationData = props.textAnnotationData;
|
|
197
|
+
}
|
|
198
|
+
return inst;
|
|
138
199
|
}
|
|
139
200
|
/** @internal */
|
|
140
201
|
getTextBlocks() {
|
|
@@ -163,25 +224,32 @@ export class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnn
|
|
|
163
224
|
export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnnotation */ {
|
|
164
225
|
/** @internal */
|
|
165
226
|
static get className() { return "TextAnnotation3d"; }
|
|
166
|
-
/**
|
|
167
|
-
|
|
227
|
+
/**
|
|
228
|
+
* The default [[AnnotationTextStyle]] used by the TextAnnotation3d.
|
|
229
|
+
* @beta
|
|
230
|
+
*/
|
|
231
|
+
defaultTextStyle;
|
|
232
|
+
/** The data associated with the text annotation. */
|
|
233
|
+
_textAnnotationProps;
|
|
168
234
|
/** Extract the textual content, if present.
|
|
169
235
|
* @see [[setAnnotation]] to change it.
|
|
170
236
|
*/
|
|
171
237
|
getAnnotation() {
|
|
172
|
-
|
|
173
|
-
return textAnnotationProps ? TextAnnotation.fromJSON(textAnnotationProps) : undefined;
|
|
238
|
+
return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;
|
|
174
239
|
}
|
|
175
240
|
/** Change the textual content of the `TextAnnotation3d`.
|
|
176
241
|
* @see [[getAnnotation]] to extract the current annotation.
|
|
177
242
|
* @param annotation The new annotation
|
|
178
243
|
*/
|
|
179
244
|
setAnnotation(annotation) {
|
|
180
|
-
this.
|
|
245
|
+
this._textAnnotationProps = annotation.toJSON();
|
|
181
246
|
}
|
|
182
247
|
constructor(props, iModel) {
|
|
183
248
|
super(props, iModel);
|
|
184
|
-
|
|
249
|
+
if (props.defaultTextStyle) {
|
|
250
|
+
this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);
|
|
251
|
+
}
|
|
252
|
+
this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;
|
|
185
253
|
}
|
|
186
254
|
/** Creates a new instance of `TextAnnotation3d` from its JSON representation. */
|
|
187
255
|
static fromJSON(props, iModel) {
|
|
@@ -194,71 +262,92 @@ export class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnno
|
|
|
194
262
|
*/
|
|
195
263
|
toJSON() {
|
|
196
264
|
const props = super.toJSON();
|
|
197
|
-
props.textAnnotationData = this.
|
|
198
|
-
if (this.
|
|
199
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.placement, this.
|
|
265
|
+
props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;
|
|
266
|
+
if (this._textAnnotationProps) {
|
|
267
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);
|
|
200
268
|
}
|
|
201
269
|
return props;
|
|
202
270
|
}
|
|
203
271
|
/** Creates a new `TextAnnotation3d` instance with the specified properties.
|
|
204
272
|
* @param iModelDb The iModel.
|
|
205
|
-
* @param
|
|
206
|
-
* @
|
|
207
|
-
* @param placement The placement properties for the annotation.
|
|
208
|
-
* @param textAnnotationData Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation3d`. Essentially an empty element if not provided.
|
|
209
|
-
* @param code Optional code for the element.
|
|
273
|
+
* @param arg The arguments for creating the TextAnnotation3d.
|
|
274
|
+
* @beta
|
|
210
275
|
*/
|
|
211
|
-
static create(iModelDb,
|
|
212
|
-
const
|
|
276
|
+
static create(iModelDb, arg) {
|
|
277
|
+
const elementProps = {
|
|
213
278
|
classFullName: this.classFullName,
|
|
214
|
-
textAnnotationData: JSON.stringify(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
279
|
+
textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,
|
|
280
|
+
defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,
|
|
281
|
+
placement: arg.placement,
|
|
282
|
+
model: arg.model,
|
|
283
|
+
category: arg.category,
|
|
284
|
+
code: arg.code ?? Code.createEmpty(),
|
|
219
285
|
};
|
|
220
|
-
return new this(
|
|
286
|
+
return new this(elementProps, iModelDb);
|
|
221
287
|
}
|
|
222
288
|
/**
|
|
223
|
-
* Updates the geometry of the TextAnnotation3d on insert
|
|
289
|
+
* Updates the geometry of the TextAnnotation3d on insert and validates version..
|
|
224
290
|
* @inheritdoc
|
|
225
291
|
* @beta
|
|
226
292
|
*/
|
|
227
293
|
static onInsert(arg) {
|
|
228
294
|
super.onInsert(arg);
|
|
229
|
-
this.
|
|
295
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
230
296
|
}
|
|
231
297
|
/**
|
|
232
|
-
* Updates the geometry of the TextAnnotation3d on update
|
|
298
|
+
* Updates the geometry of the TextAnnotation3d on update and validates version..
|
|
233
299
|
* @inheritdoc
|
|
234
300
|
* @beta
|
|
235
301
|
*/
|
|
236
302
|
static onUpdate(arg) {
|
|
237
303
|
super.onUpdate(arg);
|
|
238
|
-
this.
|
|
304
|
+
this.validateVersionAndUpdateGeometry(arg);
|
|
239
305
|
}
|
|
240
306
|
/**
|
|
241
307
|
* Populates the `elementGeometryBuilderParams` property in the [TextAnnotation3dProps]($common).
|
|
242
|
-
*
|
|
308
|
+
* Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.
|
|
309
|
+
* Also, validates the version of the text annotation data and migrates it if necessary.
|
|
310
|
+
* @beta
|
|
243
311
|
*/
|
|
244
|
-
static
|
|
245
|
-
|
|
246
|
-
|
|
312
|
+
static validateVersionAndUpdateGeometry(arg) {
|
|
313
|
+
const props = arg.props;
|
|
314
|
+
const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);
|
|
315
|
+
if (!props.elementGeometryBuilderParams && textAnnotationData) {
|
|
316
|
+
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement3d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);
|
|
247
317
|
}
|
|
248
|
-
props.elementGeometryBuilderParams = getElementGeometryBuilderParams(iModelDb, props.model, props.placement ?? Placement3d.fromJSON(), props.textAnnotationData, props.category);
|
|
249
318
|
}
|
|
250
319
|
/**
|
|
251
|
-
*
|
|
320
|
+
* TextAnnotation3d custom HandledProps include 'textAnnotationData'.
|
|
252
321
|
* @inheritdoc
|
|
322
|
+
* @internal
|
|
253
323
|
*/
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
324
|
+
static _customHandledProps = [
|
|
325
|
+
{ propertyName: "textAnnotationData", source: "Class" },
|
|
326
|
+
];
|
|
327
|
+
/**
|
|
328
|
+
* TextAnnotation3d deserializes 'textAnnotationData'.
|
|
329
|
+
* @inheritdoc
|
|
330
|
+
* @beta
|
|
331
|
+
*/
|
|
332
|
+
static deserialize(props) {
|
|
333
|
+
const elProps = super.deserialize(props);
|
|
334
|
+
const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);
|
|
335
|
+
if (textAnnotationData) {
|
|
336
|
+
elProps.textAnnotationData = JSON.stringify(textAnnotationData);
|
|
337
|
+
}
|
|
338
|
+
return elProps;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* TextAnnotation3d serializes 'textAnnotationData'.
|
|
342
|
+
* @inheritdoc
|
|
343
|
+
* @beta
|
|
344
|
+
*/
|
|
345
|
+
static serialize(props, iModel) {
|
|
346
|
+
const inst = super.serialize(props, iModel);
|
|
347
|
+
if (props.textAnnotationData !== undefined) {
|
|
348
|
+
inst.textAnnotationData = props.textAnnotationData;
|
|
259
349
|
}
|
|
260
|
-
|
|
261
|
-
ids.addElement(annotation.textBlock.styleId);
|
|
350
|
+
return inst;
|
|
262
351
|
}
|
|
263
352
|
/** @internal */
|
|
264
353
|
getTextBlocks() {
|
|
@@ -296,6 +385,17 @@ function updateTextBlocks(elem, textBlocks) {
|
|
|
296
385
|
elem.setAnnotation(annotation);
|
|
297
386
|
elem.update();
|
|
298
387
|
}
|
|
388
|
+
/** The version of the JSON stored in `AnnotationTextStyleProps.settings` used by the code.
|
|
389
|
+
* Uses the same semantics as [ECVersion]($ecschema-metadata).
|
|
390
|
+
* @internal
|
|
391
|
+
*/
|
|
392
|
+
export const TEXT_STYLE_SETTINGS_JSON_VERSION = "1.0.0";
|
|
393
|
+
function migrateTextStyleSettings(oldData) {
|
|
394
|
+
if (oldData.version === TEXT_STYLE_SETTINGS_JSON_VERSION)
|
|
395
|
+
return oldData.data;
|
|
396
|
+
// Place migration logic here.
|
|
397
|
+
throw new Error(`Migration for settings from version ${oldData.version} to ${TEXT_STYLE_SETTINGS_JSON_VERSION} failed.`);
|
|
398
|
+
}
|
|
299
399
|
/**
|
|
300
400
|
* The definition element that holds text style information.
|
|
301
401
|
* The style is stored as a [TextStyleSettings]($common).
|
|
@@ -317,7 +417,7 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
317
417
|
super(props, iModel);
|
|
318
418
|
this.description = props.description;
|
|
319
419
|
const settingsProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);
|
|
320
|
-
this.settings = TextStyleSettings.fromJSON(settingsProps);
|
|
420
|
+
this.settings = TextStyleSettings.fromJSON(settingsProps?.data);
|
|
321
421
|
}
|
|
322
422
|
/**
|
|
323
423
|
* Creates a Code for an `AnnotationTextStyle` given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
@@ -325,6 +425,7 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
325
425
|
* @param iModel - The IModelDb.
|
|
326
426
|
* @param definitionModelId - The ID of the DefinitionModel that contains the AnnotationTextStyle and provides the scope for its name.
|
|
327
427
|
* @param name - The AnnotationTextStyle name.
|
|
428
|
+
* @beta
|
|
328
429
|
*/
|
|
329
430
|
static createCode(iModel, definitionModelId, name) {
|
|
330
431
|
const codeSpec = iModel.codeSpecs.getByName(BisCodeSpec.annotationTextStyle);
|
|
@@ -334,18 +435,16 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
334
435
|
* Creates a new instance of `AnnotationTextStyle` with the specified properties.
|
|
335
436
|
*
|
|
336
437
|
* @param iModelDb - The iModelDb.
|
|
337
|
-
* @param
|
|
338
|
-
* @
|
|
339
|
-
* @param settings - Optional text style settings used to create the `AnnotationTextStyle`. Default settings will be used if not provided.
|
|
340
|
-
* @param description - Optional description for the `AnnotationTextStyle`.
|
|
438
|
+
* @param arg - The arguments for creating the AnnotationTextStyle.
|
|
439
|
+
* @beta
|
|
341
440
|
*/
|
|
342
|
-
static create(iModelDb,
|
|
441
|
+
static create(iModelDb, arg) {
|
|
343
442
|
const props = {
|
|
344
443
|
classFullName: this.classFullName,
|
|
345
|
-
model: definitionModelId,
|
|
346
|
-
code: this.createCode(iModelDb, definitionModelId, name).toJSON(),
|
|
347
|
-
description,
|
|
348
|
-
settings: JSON.stringify(settings),
|
|
444
|
+
model: arg.definitionModelId,
|
|
445
|
+
code: this.createCode(iModelDb, arg.definitionModelId, arg.name).toJSON(),
|
|
446
|
+
description: arg.description,
|
|
447
|
+
settings: arg.settings ? JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: arg.settings }) : undefined,
|
|
349
448
|
};
|
|
350
449
|
return new this(props, iModelDb);
|
|
351
450
|
}
|
|
@@ -356,7 +455,7 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
356
455
|
toJSON() {
|
|
357
456
|
const props = super.toJSON();
|
|
358
457
|
props.description = this.description;
|
|
359
|
-
props.settings = JSON.stringify(this.settings.toJSON());
|
|
458
|
+
props.settings = JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: this.settings.toJSON() });
|
|
360
459
|
return props;
|
|
361
460
|
}
|
|
362
461
|
/** Creates a new instance of `AnnotationTextStyle` from its JSON representation. */
|
|
@@ -385,21 +484,50 @@ export class AnnotationTextStyle extends DefinitionElement {
|
|
|
385
484
|
const settingProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);
|
|
386
485
|
if (!settingProps)
|
|
387
486
|
return;
|
|
388
|
-
const settings = TextStyleSettings.fromJSON(settingProps);
|
|
487
|
+
const settings = TextStyleSettings.fromJSON(settingProps.data);
|
|
389
488
|
const errors = settings.getValidationErrors();
|
|
390
489
|
if (errors.length > 0) {
|
|
391
490
|
throw new Error(`Invalid AnnotationTextStyle settings: ${errors.join(", ")}`);
|
|
392
491
|
}
|
|
393
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* AnnotationTextStyle custom HandledProps include 'settings'.
|
|
495
|
+
* @inheritdoc
|
|
496
|
+
* @beta
|
|
497
|
+
*/
|
|
498
|
+
static _customHandledProps = [
|
|
499
|
+
{ propertyName: "settings", source: "Class" },
|
|
500
|
+
];
|
|
501
|
+
/**
|
|
502
|
+
* AnnotationTextStyle deserializes 'settings'.
|
|
503
|
+
* @inheritdoc
|
|
504
|
+
* @beta
|
|
505
|
+
*/
|
|
506
|
+
static deserialize(props) {
|
|
507
|
+
const elProps = super.deserialize(props);
|
|
508
|
+
const settings = this.parseTextStyleSettings(props.row.settings);
|
|
509
|
+
if (settings) {
|
|
510
|
+
elProps.settings = JSON.stringify(settings);
|
|
511
|
+
}
|
|
512
|
+
return elProps;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* AnnotationTextStyle serializes 'settings'.
|
|
516
|
+
* @inheritdoc
|
|
517
|
+
* @beta
|
|
518
|
+
*/
|
|
519
|
+
static serialize(props, iModel) {
|
|
520
|
+
const inst = super.serialize(props, iModel);
|
|
521
|
+
if (props.settings !== undefined) {
|
|
522
|
+
inst.settings = props.settings;
|
|
523
|
+
}
|
|
524
|
+
return inst;
|
|
525
|
+
}
|
|
526
|
+
/** Parses, validates, and potentially migrates the text style settings data from a JSON string. */
|
|
394
527
|
static parseTextStyleSettings(json) {
|
|
395
528
|
if (!json)
|
|
396
529
|
return undefined;
|
|
397
|
-
|
|
398
|
-
return JSON.parse(json);
|
|
399
|
-
}
|
|
400
|
-
catch {
|
|
401
|
-
return undefined;
|
|
402
|
-
}
|
|
530
|
+
return validateAndMigrateVersionedJSON(json, TEXT_STYLE_SETTINGS_JSON_VERSION, migrateTextStyleSettings);
|
|
403
531
|
}
|
|
404
532
|
}
|
|
405
533
|
//# sourceMappingURL=TextAnnotationElement.js.map
|