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