@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
|
@@ -16,7 +16,6 @@ const core_geometry_1 = require("@itwin/core-geometry");
|
|
|
16
16
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
17
17
|
const LineBreaker = require("linebreak");
|
|
18
18
|
const TextAnnotationElement_1 = require("./TextAnnotationElement");
|
|
19
|
-
const Element_1 = require("../Element");
|
|
20
19
|
/** @internal */
|
|
21
20
|
function createFindTextStyleImpl(iModel) {
|
|
22
21
|
return function findTextStyleImpl(id) {
|
|
@@ -60,11 +59,10 @@ function computeLayoutTextBlockResult(args) {
|
|
|
60
59
|
* @beta
|
|
61
60
|
*/
|
|
62
61
|
function computeGraphemeOffsets(args) {
|
|
63
|
-
const {
|
|
62
|
+
const { source, runLayoutResult, graphemeCharIndexes, iModel } = args;
|
|
64
63
|
const findFontId = args.findFontId ?? ((name, type) => iModel.fonts.findId({ name, type }) ?? 0);
|
|
65
64
|
const computeTextRange = args.computeTextRange ?? ((x) => iModel.computeRangesForText(x));
|
|
66
|
-
|
|
67
|
-
if (source.type !== "text" || runLayoutResult.characterCount === 0) {
|
|
65
|
+
if (!(source instanceof core_common_1.TextRun) || runLayoutResult.characterCount === 0) {
|
|
68
66
|
return [];
|
|
69
67
|
}
|
|
70
68
|
const style = core_common_1.TextStyleSettings.fromJSON(runLayoutResult.textStyle);
|
|
@@ -81,7 +79,7 @@ function scaleRange(range, scale) {
|
|
|
81
79
|
range.high.scaleInPlace(scale);
|
|
82
80
|
}
|
|
83
81
|
/**
|
|
84
|
-
* Applies block level settings (lineSpacingFactor,
|
|
82
|
+
* Applies block level settings (lineSpacingFactor, paragraphSpacingFactor, widthFactor, frame, margins, justification, and leader) to a [TextStyleSettings]($common).
|
|
85
83
|
* These must be set on the block, as they are meaningless on individual paragraphs/runs.
|
|
86
84
|
* However, leaders are a special case and can override the block's leader settings.
|
|
87
85
|
* Setting `isLeader` to `true` makes the [TextBlock]($common) settings not override the leader's settings.
|
|
@@ -92,21 +90,27 @@ function applyBlockSettings(target, source, isLeader = false) {
|
|
|
92
90
|
return target;
|
|
93
91
|
}
|
|
94
92
|
const lineSpacingFactor = source.lineSpacingFactor ?? target.lineSpacingFactor;
|
|
95
|
-
const
|
|
93
|
+
const paragraphSpacingFactor = source.paragraphSpacingFactor ?? target.paragraphSpacingFactor;
|
|
96
94
|
const widthFactor = source.widthFactor ?? target.widthFactor;
|
|
95
|
+
const justification = source.justification ?? target.justification;
|
|
97
96
|
const frame = source.frame ?? target.frame;
|
|
97
|
+
const margins = source.margins ?? target.margins;
|
|
98
98
|
const leader = source.leader ?? target.leader;
|
|
99
99
|
const leaderShouldChange = !isLeader && !target.leaderEquals(leader);
|
|
100
100
|
if (lineSpacingFactor !== target.lineSpacingFactor ||
|
|
101
|
-
|
|
101
|
+
paragraphSpacingFactor !== target.paragraphSpacingFactor ||
|
|
102
102
|
widthFactor !== target.widthFactor ||
|
|
103
|
+
justification !== target.justification ||
|
|
103
104
|
!target.frameEquals(frame) ||
|
|
105
|
+
!target.marginsEqual(margins) ||
|
|
104
106
|
leaderShouldChange) {
|
|
105
107
|
const cloneProps = {
|
|
106
108
|
lineSpacingFactor,
|
|
107
|
-
|
|
109
|
+
paragraphSpacingFactor,
|
|
108
110
|
widthFactor,
|
|
111
|
+
justification,
|
|
109
112
|
frame,
|
|
113
|
+
margins,
|
|
110
114
|
};
|
|
111
115
|
if (leaderShouldChange) {
|
|
112
116
|
cloneProps.leader = leader;
|
|
@@ -116,59 +120,39 @@ function applyBlockSettings(target, source, isLeader = false) {
|
|
|
116
120
|
return target;
|
|
117
121
|
}
|
|
118
122
|
/**
|
|
119
|
-
* Resolves the effective style of TextBlockComponents and Leaders, taking into account overrides
|
|
123
|
+
* Resolves the effective style of TextBlockComponents and Leaders, taking into account overrides of the instance and its parent(s).
|
|
120
124
|
* @beta
|
|
121
125
|
*/
|
|
122
126
|
class TextStyleResolver {
|
|
123
|
-
_textStyles = new Map();
|
|
124
|
-
_findTextStyle;
|
|
125
127
|
/** The resolved style of the TextBlock. */
|
|
126
128
|
blockSettings;
|
|
127
|
-
/** The scale factor of the model containing the TextBlock. */
|
|
128
|
-
scaleFactor;
|
|
129
129
|
constructor(args) {
|
|
130
|
-
|
|
131
|
-
this.
|
|
132
|
-
if (args.modelId) {
|
|
133
|
-
const element = args.iModel.elements.getElement(args.modelId);
|
|
134
|
-
if (element instanceof Element_1.Drawing)
|
|
135
|
-
this.scaleFactor = element.scaleFactor;
|
|
136
|
-
}
|
|
137
|
-
this.blockSettings = this.findTextStyle(args.textBlock.styleId);
|
|
130
|
+
const findTextStyle = args.findTextStyle ?? createFindTextStyleImpl(args.iModel);
|
|
131
|
+
this.blockSettings = findTextStyle(args.textStyleId);
|
|
138
132
|
if (args.textBlock.styleOverrides)
|
|
139
133
|
this.blockSettings = this.blockSettings.clone(args.textBlock.styleOverrides);
|
|
140
134
|
}
|
|
141
|
-
|
|
135
|
+
/**
|
|
136
|
+
* Resolves the effective text style settings for a given TextBlockComponent, applying block-level overrides.
|
|
137
|
+
*/
|
|
138
|
+
resolveSettings(overrides, isLeader = false) {
|
|
142
139
|
let settings = this.blockSettings;
|
|
143
|
-
if (
|
|
144
|
-
settings = settings.clone(
|
|
145
|
-
return settings;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
settings = settings.clone(leader.styleOverrides);
|
|
160
|
-
return applyBlockSettings(settings, this.blockSettings, true);
|
|
161
|
-
}
|
|
162
|
-
/** Resolves the effective style for a [Paragraph]($common). Paragraph should be child of provided TextBlock. */
|
|
163
|
-
resolveParagraphSettings(paragraph) {
|
|
164
|
-
return applyBlockSettings(this.resolveParagraphSettingsImpl(paragraph), this.blockSettings);
|
|
165
|
-
}
|
|
166
|
-
/** Resolves the effective style for a [Run]($common). Run should be child of provided Paragraph and TextBlock. */
|
|
167
|
-
resolveRunSettings(paragraph, run) {
|
|
168
|
-
let settings = this.resolveParagraphSettingsImpl(paragraph);
|
|
169
|
-
if (run.overridesStyle)
|
|
170
|
-
settings = settings.clone(run.styleOverrides);
|
|
171
|
-
return applyBlockSettings(settings, this.blockSettings);
|
|
140
|
+
if (overrides)
|
|
141
|
+
settings = settings.clone(overrides);
|
|
142
|
+
return applyBlockSettings(settings, this.blockSettings, isLeader);
|
|
143
|
+
}
|
|
144
|
+
resolveMarkerText(overrides, index) {
|
|
145
|
+
const markerSettings = overrides.listMarker ?? this.blockSettings.listMarker;
|
|
146
|
+
return (0, core_common_1.getMarkerText)(markerSettings, index);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Computes the indentation based on its style and nesting depth.
|
|
150
|
+
*/
|
|
151
|
+
resolveIndentation(styleOverrides, depth) {
|
|
152
|
+
const overrides = this.resolveSettings(styleOverrides);
|
|
153
|
+
const indentation = overrides.indentation;
|
|
154
|
+
const tabInterval = overrides.tabInterval;
|
|
155
|
+
return indentation + tabInterval * depth;
|
|
172
156
|
}
|
|
173
157
|
}
|
|
174
158
|
exports.TextStyleResolver = TextStyleResolver;
|
|
@@ -182,35 +166,35 @@ class LayoutContext {
|
|
|
182
166
|
this._computeTextRange = _computeTextRange;
|
|
183
167
|
this._findFontId = _findFontId;
|
|
184
168
|
}
|
|
185
|
-
findFontId(name) {
|
|
169
|
+
findFontId(name, type) {
|
|
186
170
|
let fontId = this._fontIds.get(name);
|
|
187
171
|
if (undefined === fontId) {
|
|
188
|
-
this._fontIds.set(name, fontId = this._findFontId(name));
|
|
172
|
+
this._fontIds.set(name, fontId = this._findFontId(name, type));
|
|
189
173
|
}
|
|
190
174
|
return fontId;
|
|
191
175
|
}
|
|
192
176
|
computeRangeForText(chars, style, baselineShift) {
|
|
193
177
|
if (chars.length === 0) {
|
|
194
178
|
return {
|
|
195
|
-
layout: new core_geometry_1.Range2d(0, 0, 0, style.
|
|
179
|
+
layout: new core_geometry_1.Range2d(0, 0, 0, style.textHeight),
|
|
196
180
|
justification: new core_geometry_1.Range2d(),
|
|
197
181
|
};
|
|
198
182
|
}
|
|
199
|
-
const fontId = this.findFontId(style.
|
|
183
|
+
const fontId = this.findFontId(style.font.name, style.font.type);
|
|
200
184
|
const { layout, justification } = this._computeTextRange({
|
|
201
185
|
chars,
|
|
202
186
|
fontId,
|
|
203
187
|
baselineShift,
|
|
204
188
|
bold: style.isBold,
|
|
205
189
|
italic: style.isItalic,
|
|
206
|
-
|
|
190
|
+
textHeight: style.textHeight,
|
|
207
191
|
widthFactor: this.textStyleResolver.blockSettings.widthFactor,
|
|
208
192
|
});
|
|
209
193
|
if ("none" !== baselineShift) {
|
|
210
194
|
const isSub = "subscript" === baselineShift;
|
|
211
195
|
const scale = isSub ? style.subScriptScale : style.superScriptScale;
|
|
212
196
|
const offsetFactor = isSub ? style.subScriptOffsetFactor : style.superScriptOffsetFactor;
|
|
213
|
-
const offset = { x: 0, y: style.
|
|
197
|
+
const offset = { x: 0, y: style.textHeight * offsetFactor };
|
|
214
198
|
scaleRange(layout, scale);
|
|
215
199
|
layout.cloneTranslated(offset, layout);
|
|
216
200
|
scaleRange(justification, scale);
|
|
@@ -259,10 +243,10 @@ class LayoutContext {
|
|
|
259
243
|
layout.extendRange(denominator);
|
|
260
244
|
return { layout, numerator, denominator };
|
|
261
245
|
}
|
|
262
|
-
computeRangeForTabRun(style, source,
|
|
246
|
+
computeRangeForTabRun(style, source, lengthFromLastTab) {
|
|
263
247
|
const interval = source.styleOverrides.tabInterval ?? style.tabInterval;
|
|
264
|
-
const tabEndX = interval -
|
|
265
|
-
const range = new core_geometry_1.Range2d(0, 0, 0, style.
|
|
248
|
+
const tabEndX = interval - lengthFromLastTab % interval;
|
|
249
|
+
const range = new core_geometry_1.Range2d(0, 0, 0, style.textHeight);
|
|
266
250
|
range.extendXY(tabEndX, range.low.y);
|
|
267
251
|
return range;
|
|
268
252
|
}
|
|
@@ -317,9 +301,9 @@ class RunLayout {
|
|
|
317
301
|
this.style = props.style;
|
|
318
302
|
this.fontId = props.fontId;
|
|
319
303
|
}
|
|
320
|
-
static create(source,
|
|
321
|
-
const style = context.textStyleResolver.
|
|
322
|
-
const fontId = context.findFontId(style.
|
|
304
|
+
static create(source, context, cumulativeOverrides) {
|
|
305
|
+
const style = context.textStyleResolver.resolveSettings(cumulativeOverrides);
|
|
306
|
+
const fontId = context.findFontId(style.font.name, style.font.type);
|
|
323
307
|
const charOffset = 0;
|
|
324
308
|
const offsetFromLine = { x: 0, y: 0 };
|
|
325
309
|
let numChars = 0;
|
|
@@ -345,7 +329,7 @@ class RunLayout {
|
|
|
345
329
|
default: { // "linebreak" or "tab"
|
|
346
330
|
// "tab": Tabs rely on the context they are in, so we compute its range later.
|
|
347
331
|
// lineBreak: We do this so that blank lines space correctly without special casing later.
|
|
348
|
-
range = new core_geometry_1.Range2d(0, 0, 0, style.
|
|
332
|
+
range = new core_geometry_1.Range2d(0, 0, 0, style.textHeight);
|
|
349
333
|
break;
|
|
350
334
|
}
|
|
351
335
|
}
|
|
@@ -387,9 +371,8 @@ class RunLayout {
|
|
|
387
371
|
});
|
|
388
372
|
});
|
|
389
373
|
}
|
|
390
|
-
toResult(
|
|
374
|
+
toResult() {
|
|
391
375
|
const result = {
|
|
392
|
-
sourceRunIndex: paragraph.runs.indexOf(this.source),
|
|
393
376
|
fontId: this.fontId,
|
|
394
377
|
characterOffset: this.charOffset,
|
|
395
378
|
characterCount: this.numChars,
|
|
@@ -419,60 +402,109 @@ exports.RunLayout = RunLayout;
|
|
|
419
402
|
class LineLayout {
|
|
420
403
|
source;
|
|
421
404
|
range = new core_geometry_1.Range2d(0, 0, 0, 0);
|
|
405
|
+
runRange = new core_geometry_1.Range2d(0, 0, 0, 0); // Range of all runs excluding marker.
|
|
422
406
|
justificationRange = new core_geometry_1.Range2d(0, 0, 0, 0);
|
|
423
|
-
offsetFromDocument
|
|
407
|
+
offsetFromDocument;
|
|
408
|
+
depth;
|
|
424
409
|
lengthFromLastTab = 0; // Used to track the length from the last tab for tab runs.
|
|
425
410
|
_runs = [];
|
|
426
|
-
|
|
411
|
+
_marker;
|
|
412
|
+
constructor(source, style, context, depth = 0) {
|
|
427
413
|
this.source = source;
|
|
414
|
+
this.depth = depth;
|
|
415
|
+
this.offsetFromDocument = { x: context?.textStyleResolver.resolveIndentation(style, depth) ?? 0, y: 0 };
|
|
428
416
|
}
|
|
429
417
|
/** Compute a string representation, primarily for debugging purposes. */
|
|
430
418
|
stringify() {
|
|
431
419
|
const runs = this._runs.map((run) => run.stringify());
|
|
432
420
|
return `${runs.join("")}`;
|
|
433
421
|
}
|
|
422
|
+
/** Gets the array of RunLayout objects contained in this line. */
|
|
434
423
|
get runs() { return this._runs; }
|
|
424
|
+
/** Indicates whether this line contains any runs. */
|
|
435
425
|
get isEmpty() { return this._runs.length === 0; }
|
|
426
|
+
/** Gets the last RunLayout in this line. */
|
|
436
427
|
get back() {
|
|
437
428
|
(0, core_bentley_1.assert)(!this.isEmpty);
|
|
438
429
|
return this._runs[this._runs.length - 1];
|
|
439
430
|
}
|
|
431
|
+
/**
|
|
432
|
+
* Gets or sets the marker RunLayout for this line, used for lists.
|
|
433
|
+
* A marker is the symbol or character that appears before each list item in a list, bullets, numbers, etc.
|
|
434
|
+
* */
|
|
435
|
+
get marker() { return this._marker; }
|
|
436
|
+
set marker(value) { this._marker = value; }
|
|
440
437
|
append(run) {
|
|
441
438
|
this._runs.push(run);
|
|
442
439
|
this.computeRanges();
|
|
443
440
|
}
|
|
444
441
|
/** Invoked every time a run is appended,. */
|
|
445
442
|
computeRanges() {
|
|
446
|
-
this.
|
|
447
|
-
this.
|
|
448
|
-
|
|
449
|
-
// We want to center each run vertically inside the line.
|
|
443
|
+
this.runRange.low.setZero();
|
|
444
|
+
this.runRange.high.setZero();
|
|
445
|
+
this.lengthFromLastTab = 0;
|
|
450
446
|
let lineHeight = 0;
|
|
447
|
+
let tallestNonFractionRun;
|
|
451
448
|
for (const run of this._runs) {
|
|
452
|
-
|
|
449
|
+
const runHeight = run.range.yLength();
|
|
450
|
+
lineHeight = Math.max(lineHeight, runHeight);
|
|
451
|
+
if (run.source.type !== "fraction" && (!tallestNonFractionRun || runHeight > tallestNonFractionRun.range.yLength())) {
|
|
452
|
+
tallestNonFractionRun = run;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
// // The baseline for the line is the bottom of the tallest non-fraction run, centered in the line.
|
|
456
|
+
let baseline = 0;
|
|
457
|
+
if (tallestNonFractionRun) {
|
|
458
|
+
baseline = (lineHeight + tallestNonFractionRun.range.yLength()) / 2;
|
|
453
459
|
}
|
|
454
460
|
for (const run of this._runs) {
|
|
455
461
|
const runHeight = run.range.yLength();
|
|
456
|
-
|
|
462
|
+
// Vertically align runs: normal text at baseline, fractions visually centered on text or line as appropriate.
|
|
463
|
+
let yOffset = lineHeight - baseline;
|
|
464
|
+
if (run.source.type === "fraction") {
|
|
465
|
+
const denominatorHeight = run.denominatorRange?.yLength() ?? 0;
|
|
466
|
+
if (tallestNonFractionRun && run.style.textHeight <= tallestNonFractionRun.style.textHeight) {
|
|
467
|
+
// Shift fraction to baseline, then down by half the denominator height so it appears centered relative to any non-fraction text of the same height.
|
|
468
|
+
yOffset = (lineHeight - baseline) - denominatorHeight / 2;
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
// If the fraction text height is greater than the largest non-fraction text, just center it in the line.
|
|
472
|
+
yOffset = (lineHeight - runHeight) / 2;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
const runOffset = { x: this.runRange.high.x, y: yOffset };
|
|
457
476
|
run.offsetFromLine = runOffset;
|
|
458
477
|
const runLayoutRange = run.range.cloneTranslated(runOffset);
|
|
459
|
-
this.
|
|
478
|
+
this.runRange.extendRange(runLayoutRange);
|
|
460
479
|
if ("linebreak" !== run.source.type) {
|
|
461
480
|
const runJustificationRange = run.justificationRange?.cloneTranslated(runOffset);
|
|
462
481
|
this.justificationRange.extendRange(runJustificationRange ?? runLayoutRange);
|
|
463
482
|
}
|
|
464
|
-
if (run.source.type
|
|
483
|
+
if ("tab" === run.source.type) {
|
|
465
484
|
this.lengthFromLastTab = 0;
|
|
466
485
|
}
|
|
467
486
|
else {
|
|
468
487
|
this.lengthFromLastTab += run.range.xLength();
|
|
469
488
|
}
|
|
470
489
|
}
|
|
490
|
+
this.range.setFrom(this.runRange);
|
|
491
|
+
if (this._marker) {
|
|
492
|
+
const indentation = this.range.low.x;
|
|
493
|
+
const x = indentation - (this._marker.style.tabInterval / 2) - this._marker.range.xLength();
|
|
494
|
+
const runHeight = this._marker.range.yLength();
|
|
495
|
+
const runOffset = {
|
|
496
|
+
x,
|
|
497
|
+
y: (lineHeight - runHeight) / 2 // Center the marker vertically in the line.
|
|
498
|
+
};
|
|
499
|
+
this._marker.offsetFromLine = runOffset;
|
|
500
|
+
const markerRange = this._marker.range.cloneTranslated(this._marker.offsetFromLine);
|
|
501
|
+
this.range.extendRange(markerRange);
|
|
502
|
+
}
|
|
471
503
|
}
|
|
472
|
-
toResult(
|
|
504
|
+
toResult() {
|
|
473
505
|
return {
|
|
474
|
-
|
|
475
|
-
|
|
506
|
+
runs: this.runs.map((x) => x.toResult()),
|
|
507
|
+
marker: this.marker?.toResult(),
|
|
476
508
|
range: this.range.toJSON(),
|
|
477
509
|
justificationRange: this.justificationRange.toJSON(),
|
|
478
510
|
offsetFromDocument: this.offsetFromDocument,
|
|
@@ -502,12 +534,12 @@ class TextBlockLayout {
|
|
|
502
534
|
this.textRange.high.x = source.width;
|
|
503
535
|
}
|
|
504
536
|
this.populateLines(context);
|
|
505
|
-
this.justifyLines();
|
|
506
|
-
this.applyMargins(
|
|
537
|
+
this.justifyLines(context);
|
|
538
|
+
this.applyMargins(context.textStyleResolver.blockSettings.margins);
|
|
507
539
|
}
|
|
508
540
|
toResult() {
|
|
509
541
|
return {
|
|
510
|
-
lines: this.lines.map((x) => x.toResult(
|
|
542
|
+
lines: this.lines.map((x) => x.toResult()),
|
|
511
543
|
range: this.range.toJSON(),
|
|
512
544
|
};
|
|
513
545
|
}
|
|
@@ -521,72 +553,164 @@ class TextBlockLayout {
|
|
|
521
553
|
}
|
|
522
554
|
populateLines(context) {
|
|
523
555
|
const doc = this.source;
|
|
524
|
-
if (doc.
|
|
556
|
+
if (!doc.children || doc.children.length === 0) {
|
|
525
557
|
return;
|
|
526
558
|
}
|
|
527
|
-
|
|
528
|
-
let
|
|
529
|
-
for (
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
559
|
+
let curLine = new LineLayout(doc.children[0], doc.children[0].styleOverrides, context);
|
|
560
|
+
let childIndex = 0;
|
|
561
|
+
for (const child of doc.children) {
|
|
562
|
+
curLine = this.populateComponent(child, childIndex++, context, doc.width, curLine, doc, doc.styleOverrides);
|
|
563
|
+
}
|
|
564
|
+
if (curLine.runs.length > 0) {
|
|
565
|
+
this.flushLine(context, curLine, doc.styleOverrides);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
populateComponent(component, componentIndex, context, docWidth, curLine, parent, cumulativeOverrides, depth = 0) {
|
|
569
|
+
cumulativeOverrides = { ...cumulativeOverrides, ...component.styleOverrides };
|
|
570
|
+
switch (component.type) {
|
|
571
|
+
case "list": {
|
|
572
|
+
// If we have any runs in the current line, flush it before starting the list.
|
|
573
|
+
if (curLine.runs.length > 0) {
|
|
574
|
+
curLine = this.flushLine(context, curLine, cumulativeOverrides, component.children[0], true, depth + 1);
|
|
575
|
+
}
|
|
576
|
+
else {
|
|
577
|
+
// If not, we need to apply the indentation for the list to the first line.
|
|
578
|
+
curLine.offsetFromDocument.x = context.textStyleResolver.resolveIndentation(cumulativeOverrides, depth + 1);
|
|
579
|
+
curLine.depth = depth + 1;
|
|
543
580
|
}
|
|
544
|
-
//
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
curLine.
|
|
549
|
-
|
|
581
|
+
// Iterate through each list item, setting the marker and populating its contents.
|
|
582
|
+
component.children.forEach((child, index) => {
|
|
583
|
+
const markerContent = context.textStyleResolver.resolveMarkerText(cumulativeOverrides, index + 1);
|
|
584
|
+
const markerRun = core_common_1.TextRun.create({ content: markerContent });
|
|
585
|
+
curLine.marker = RunLayout.create(markerRun, context, cumulativeOverrides);
|
|
586
|
+
curLine = this.populateComponent(child, index, context, docWidth, curLine, component, cumulativeOverrides, depth + 1);
|
|
587
|
+
});
|
|
588
|
+
// Lastly flush the line.
|
|
589
|
+
const nextSibling = parent?.children[componentIndex + 1];
|
|
590
|
+
if (curLine && nextSibling) {
|
|
591
|
+
curLine = this.flushLine(context, curLine, cumulativeOverrides, nextSibling, true, depth);
|
|
550
592
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
//
|
|
555
|
-
|
|
556
|
-
curLine.
|
|
557
|
-
|
|
593
|
+
break;
|
|
594
|
+
}
|
|
595
|
+
case "paragraph": {
|
|
596
|
+
// Iterate through each paragraph child (either a list or a run), populating its contents.
|
|
597
|
+
component.children.forEach((child, index) => {
|
|
598
|
+
curLine = this.populateComponent(child, index, context, docWidth, curLine, component, cumulativeOverrides, depth);
|
|
599
|
+
});
|
|
600
|
+
// Lastly flush the line.
|
|
601
|
+
const nextSibling = parent?.children[componentIndex + 1];
|
|
602
|
+
if (curLine && nextSibling) {
|
|
603
|
+
curLine = this.flushLine(context, curLine, cumulativeOverrides, nextSibling, true, depth);
|
|
558
604
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
605
|
+
break;
|
|
606
|
+
}
|
|
607
|
+
case "text": {
|
|
608
|
+
const layout = RunLayout.create(component, context, cumulativeOverrides);
|
|
609
|
+
// Text can be word-wrapped, so we need to split it into multiple runs if necessary.
|
|
610
|
+
if (docWidth > 0) {
|
|
611
|
+
layout.split(context).forEach(r => { curLine = this.populateRun(curLine, r, context, cumulativeOverrides, docWidth); });
|
|
564
612
|
}
|
|
565
613
|
else {
|
|
566
|
-
|
|
567
|
-
curLine = this.flushLine(context, curLine);
|
|
568
|
-
// Recompute tab shift if applicable
|
|
569
|
-
applyTabShift(run, curLine, context);
|
|
570
|
-
curLine.append(run);
|
|
614
|
+
curLine = this.populateRun(curLine, layout, context, cumulativeOverrides, docWidth);
|
|
571
615
|
}
|
|
616
|
+
break;
|
|
617
|
+
}
|
|
618
|
+
case "fraction":
|
|
619
|
+
case "tab": {
|
|
620
|
+
const layout = RunLayout.create(component, context, cumulativeOverrides);
|
|
621
|
+
curLine = this.populateRun(curLine, layout, context, cumulativeOverrides, docWidth);
|
|
622
|
+
break;
|
|
572
623
|
}
|
|
624
|
+
case "linebreak": {
|
|
625
|
+
const layout = RunLayout.create(component, context, cumulativeOverrides);
|
|
626
|
+
curLine.append(layout);
|
|
627
|
+
curLine = this.flushLine(context, curLine, cumulativeOverrides, undefined, undefined, depth);
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
default: break;
|
|
573
631
|
}
|
|
574
|
-
|
|
575
|
-
|
|
632
|
+
return curLine;
|
|
633
|
+
}
|
|
634
|
+
;
|
|
635
|
+
populateRun(curLine, run, context, cumulativeOverrides, docWidth) {
|
|
636
|
+
// If this is a tab, we need to apply the tab shift first, and then we can treat it like a text run.
|
|
637
|
+
applyTabShift(run, curLine, context);
|
|
638
|
+
// If our width is not set, then we don't have to compute word wrapping, so just append the run, and continue.
|
|
639
|
+
if (docWidth <= 0) {
|
|
640
|
+
curLine.append(run);
|
|
641
|
+
return curLine;
|
|
642
|
+
}
|
|
643
|
+
// If not, we need to determine if we can append this run to the current line without exceeding the document width or if we need to word wrap.
|
|
644
|
+
const runWidth = run.justificationRange?.xLength() ?? run.range.xLength();
|
|
645
|
+
const lineWidth = curLine.runRange.xLength();
|
|
646
|
+
const newWidth = runWidth + lineWidth + curLine.offsetFromDocument.x;
|
|
647
|
+
// If true, then no word wrapping is required, so we can append to the current line.
|
|
648
|
+
if (newWidth < docWidth || core_geometry_1.Geometry.isAlmostEqualNumber(newWidth, docWidth, core_geometry_1.Geometry.smallMetricDistance)) {
|
|
649
|
+
curLine.append(run);
|
|
650
|
+
return curLine;
|
|
651
|
+
}
|
|
652
|
+
// If not, do word wrapping
|
|
653
|
+
if (curLine.runs.length === 0) {
|
|
654
|
+
curLine.append(run);
|
|
655
|
+
// Lastly, flush line
|
|
656
|
+
curLine = this.flushLine(context, curLine, cumulativeOverrides, undefined, undefined, curLine.depth);
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
// First, flush line
|
|
660
|
+
curLine = this.flushLine(context, curLine, cumulativeOverrides, undefined, undefined, curLine.depth);
|
|
661
|
+
// Recompute tab shift if applicable
|
|
662
|
+
applyTabShift(run, curLine, context);
|
|
663
|
+
curLine.append(run);
|
|
664
|
+
}
|
|
665
|
+
return curLine;
|
|
666
|
+
}
|
|
667
|
+
;
|
|
668
|
+
flushLine(context, curLine, cumulativeOverrides, next, newParagraph = false, depth = 0) {
|
|
669
|
+
next = next ?? curLine.source;
|
|
670
|
+
// We want to guarantee that each layout line has at least one run.
|
|
671
|
+
if (curLine.runs.length === 0) {
|
|
672
|
+
if (this.lines.length === 0 || this._back.runs.length === 0) {
|
|
673
|
+
return new LineLayout(next, cumulativeOverrides, context, depth);
|
|
674
|
+
}
|
|
675
|
+
if (curLine.source.type !== "linebreak") {
|
|
676
|
+
const newLine = new LineLayout(next, cumulativeOverrides, context, depth);
|
|
677
|
+
newLine.offsetFromDocument.y -= context.textStyleResolver.blockSettings.paragraphSpacingFactor * context.textStyleResolver.blockSettings.textHeight;
|
|
678
|
+
return newLine;
|
|
679
|
+
}
|
|
680
|
+
const run = curLine.source.clone();
|
|
681
|
+
curLine.append(RunLayout.create(run, context, cumulativeOverrides));
|
|
682
|
+
}
|
|
683
|
+
// Line origin is its baseline.
|
|
684
|
+
const lineOffset = { ...curLine.offsetFromDocument }; // Start with the line's original offset, which includes indentation.
|
|
685
|
+
lineOffset.y -= curLine.range.yLength(); // Shift down the baseline
|
|
686
|
+
// Place it below any existing lines
|
|
687
|
+
if (this.lines.length > 0) {
|
|
688
|
+
lineOffset.y += this._back.offsetFromDocument.y;
|
|
689
|
+
lineOffset.y -= context.textStyleResolver.blockSettings.lineSpacingFactor * context.textStyleResolver.blockSettings.textHeight;
|
|
690
|
+
}
|
|
691
|
+
curLine.offsetFromDocument = lineOffset;
|
|
692
|
+
// Update document range from computed line range and position
|
|
693
|
+
this.textRange.extendRange(curLine.range.cloneTranslated(lineOffset));
|
|
694
|
+
this.lines.push(curLine);
|
|
695
|
+
if (newParagraph) {
|
|
696
|
+
const newLine = new LineLayout(next, cumulativeOverrides, context, depth);
|
|
697
|
+
newLine.offsetFromDocument.y -= context.textStyleResolver.blockSettings.paragraphSpacingFactor * context.textStyleResolver.blockSettings.textHeight;
|
|
698
|
+
return newLine;
|
|
576
699
|
}
|
|
700
|
+
return new LineLayout(next, cumulativeOverrides, context, depth);
|
|
577
701
|
}
|
|
578
|
-
justifyLines() {
|
|
702
|
+
justifyLines(context) {
|
|
579
703
|
// We don't want to justify empty text, or a single line of text whose width is 0. By default text is already left justified.
|
|
580
|
-
if (this.lines.length < 1 || (this.lines.length === 1 && this.source.width === 0) || "left" ===
|
|
704
|
+
if (this.lines.length < 1 || (this.lines.length === 1 && this.source.width === 0) || "left" === context.textStyleResolver.blockSettings.justification) {
|
|
581
705
|
return;
|
|
582
706
|
}
|
|
583
707
|
// This is the minimum width of the document's bounding box.
|
|
584
708
|
const docWidth = this.source.width;
|
|
585
709
|
let minOffset = Number.MAX_VALUE;
|
|
586
710
|
for (const line of this.lines) {
|
|
587
|
-
const lineWidth = line.justificationRange.xLength();
|
|
711
|
+
const lineWidth = line.justificationRange.xLength() + line.offsetFromDocument.x;
|
|
588
712
|
let offset = docWidth - lineWidth;
|
|
589
|
-
if ("center" ===
|
|
713
|
+
if ("center" === context.textStyleResolver.blockSettings.justification) {
|
|
590
714
|
offset = offset / 2;
|
|
591
715
|
}
|
|
592
716
|
line.offsetFromDocument.x += offset;
|
|
@@ -598,34 +722,6 @@ class TextBlockLayout {
|
|
|
598
722
|
this.textRange.high.x += minOffset;
|
|
599
723
|
}
|
|
600
724
|
}
|
|
601
|
-
flushLine(context, line, nextParagraph) {
|
|
602
|
-
nextParagraph = nextParagraph ?? line.source;
|
|
603
|
-
// We want to guarantee that each layout line has at least one run.
|
|
604
|
-
if (line.runs.length === 0) {
|
|
605
|
-
// If we're empty, there should always be a preceding run, and it should be a line break.
|
|
606
|
-
if (this.lines.length === 0 || this._back.runs.length === 0) {
|
|
607
|
-
return new LineLayout(nextParagraph);
|
|
608
|
-
}
|
|
609
|
-
const prevRun = this._back.back.source;
|
|
610
|
-
(0, core_bentley_1.assert)(prevRun.type === "linebreak");
|
|
611
|
-
if (prevRun.type !== "linebreak") {
|
|
612
|
-
return new LineLayout(nextParagraph);
|
|
613
|
-
}
|
|
614
|
-
line.append(RunLayout.create(prevRun.clone(), line.source, context));
|
|
615
|
-
}
|
|
616
|
-
// Line origin is its baseline.
|
|
617
|
-
const lineOffset = { x: 0, y: -line.range.yLength() };
|
|
618
|
-
// Place it below any existing lines
|
|
619
|
-
if (this.lines.length > 0) {
|
|
620
|
-
lineOffset.y += this._back.offsetFromDocument.y;
|
|
621
|
-
lineOffset.y -= context.textStyleResolver.blockSettings.lineSpacingFactor * context.textStyleResolver.blockSettings.lineHeight;
|
|
622
|
-
}
|
|
623
|
-
line.offsetFromDocument = lineOffset;
|
|
624
|
-
// Update document range from computed line range and position
|
|
625
|
-
this.textRange.extendRange(line.range.cloneTranslated(lineOffset));
|
|
626
|
-
this.lines.push(line);
|
|
627
|
-
return new LineLayout(nextParagraph);
|
|
628
|
-
}
|
|
629
725
|
applyMargins(margins) {
|
|
630
726
|
this.range = this.textRange.clone();
|
|
631
727
|
if (this.range.isNull)
|