@itwin/core-backend 5.3.0-dev.2 → 5.3.0-dev.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +2 -2
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CatalogDb.js.map +1 -1
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +2 -2
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +248 -248
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +5 -5
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +12 -9
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +2 -2
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +4 -4
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +2 -2
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +2 -2
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +47 -47
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +20 -9
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +2 -2
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +1 -2
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +9 -17
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.js.map +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.js.map +1 -1
- package/lib/cjs/Material.d.ts +1 -1
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +2 -2
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/StashManager.js.map +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.d.ts +1 -1
- package/lib/cjs/TileStorage.d.ts.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +2 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +10 -2
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +1 -1
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +2 -2
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +7 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +25 -0
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js +6 -6
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +4 -4
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +122 -21
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +298 -63
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js +3 -3
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.d.ts +2 -2
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +52 -25
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.js.map +1 -1
- package/lib/cjs/internal/HubMock.js.map +1 -1
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/cjs/internal/NativePlatform.js.map +1 -1
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +1 -0
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BlobContainerService.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +2 -2
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CatalogDb.js.map +1 -1
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangeSummaryManager.js +2 -2
- package/lib/esm/ChangeSummaryManager.js.map +1 -1
- package/lib/esm/ChangedElementsDb.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +248 -248
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChannelControl.js.map +1 -1
- package/lib/esm/CheckpointManager.js.map +1 -1
- package/lib/esm/ClassRegistry.js +5 -5
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.d.ts +12 -9
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeService.js.map +1 -1
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/CustomViewState3dCreator.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +2 -2
- package/lib/esm/DisplayStyle.d.ts.map +1 -1
- package/lib/esm/DisplayStyle.js +4 -4
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.js +1 -1
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSchemaXmlContext.js.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +2 -2
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +2 -2
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/EntityReferences.js.map +1 -1
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/FontFile.js.map +1 -1
- package/lib/esm/GeoCoordConfig.js.map +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/GeometrySummary.js +47 -47
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +20 -9
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelDbFonts.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/esm/IModelElementCloneContext.js +2 -2
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +1 -2
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +10 -18
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/ImageSourceConversion.js.map +1 -1
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/LocalHub.js +1 -1
- package/lib/esm/LocalHub.js.map +1 -1
- package/lib/esm/LocalhostIpcHost.js.map +1 -1
- package/lib/esm/LockControl.js.map +1 -1
- package/lib/esm/Material.d.ts +1 -1
- package/lib/esm/Material.d.ts.map +1 -1
- package/lib/esm/Material.js +2 -2
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/NativeAppStorage.js.map +1 -1
- package/lib/esm/NativeHost.js.map +1 -1
- package/lib/esm/NavigationRelationship.js.map +1 -1
- package/lib/esm/PromiseMemoizer.js.map +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/RpcBackend.js.map +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/Schema.js.map +1 -1
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SchemaUtils.js.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/StashManager.js.map +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TileStorage.d.ts +1 -1
- package/lib/esm/TileStorage.d.ts.map +1 -1
- package/lib/esm/TileStorage.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +2 -0
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +10 -2
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +1 -1
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +2 -2
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStateHydrator.js.map +1 -1
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +7 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +25 -0
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js +6 -6
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +4 -4
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +122 -21
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +298 -64
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js +3 -3
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.d.ts +2 -2
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +52 -25
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/FunctionalSchema.js.map +1 -1
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/domains/GenericSchema.js.map +1 -1
- package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- package/lib/esm/internal/FontFileImpl.js.map +1 -1
- package/lib/esm/internal/HubMock.js.map +1 -1
- package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
- package/lib/esm/internal/NativePlatform.js.map +1 -1
- package/lib/esm/internal/NoLocks.js.map +1 -1
- package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +1 -0
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/esm/rpc/multipart.js.map +1 -1
- package/lib/esm/rpc/tracing.js.map +1 -1
- package/lib/esm/rpc/web/logging.js.map +1 -1
- package/lib/esm/rpc/web/request.js.map +1 -1
- package/lib/esm/rpc/web/response.js.map +1 -1
- package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/AdvancedEqual.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js +1 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/AttachDb.test.js +11 -11
- package/lib/esm/test/AttachDb.test.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts +93 -0
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -0
- package/lib/esm/test/ElementDrivesElement.test.js +862 -0
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -0
- package/lib/esm/test/ElementLRUCache.test.js +13 -0
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/GeometryTestUtil.js.map +1 -1
- package/lib/esm/test/IModelHost.test.js +17 -11
- package/lib/esm/test/IModelHost.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/KnownTestLocations.js.map +1 -1
- package/lib/esm/test/PrintElementTree.js.map +1 -1
- package/lib/esm/test/PropertyDb.test.js.map +1 -1
- package/lib/esm/test/RevisionUtility.js.map +1 -1
- package/lib/esm/test/SchemaUtils.test.js +25 -25
- package/lib/esm/test/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
- package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +229 -90
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js +4 -4
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +8 -8
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +402 -36
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +218 -151
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/categories/Category.test.js.map +1 -1
- package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
- package/lib/esm/test/ecdb/CTE.test.js +88 -88
- package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +17 -17
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +72 -72
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
- package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
- package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
- package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +359 -328
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
- package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementAspect.test.js +22 -22
- package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
- package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
- package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
- package/lib/esm/test/element/NullStructArray.test.js +13 -13
- package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
- package/lib/esm/test/element/UrlLink.test.js.map +1 -1
- package/lib/esm/test/font/FontFile.test.js.map +1 -1
- package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
- package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
- package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +103 -35
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/imageData.js.map +1 -1
- package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
- package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +89 -44
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -1
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/misc/DevTools.test.js.map +1 -1
- package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
- package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
- package/lib/esm/test/rpc/response.test.js.map +1 -1
- package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
- package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
- package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
- package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
- package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +164 -170
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
- package/lib/esm/test/standalone/DisplayStyle.test.js +6 -6
- package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
- package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementGraphics.test.js +75 -6
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderMaterialElement.test.js +4 -4
- package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
- package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
- package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
- package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
- package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
- package/lib/esm/test/standalone/Setting.test.js.map +1 -1
- package/lib/esm/test/standalone/Settings.test.js.map +1 -1
- package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Texture.test.js.map +1 -1
- package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
- package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +16 -18
|
@@ -21,9 +21,9 @@ function isIntlSupported() {
|
|
|
21
21
|
}
|
|
22
22
|
function findTextStyleImpl(id) {
|
|
23
23
|
if (id === "0x42") {
|
|
24
|
-
return TextStyleSettings.fromJSON({ lineSpacingFactor: 12,
|
|
24
|
+
return TextStyleSettings.fromJSON({ lineSpacingFactor: 12, font: { name: "block" }, isBold: true });
|
|
25
25
|
}
|
|
26
|
-
return TextStyleSettings.fromJSON({ lineSpacingFactor: 1,
|
|
26
|
+
return TextStyleSettings.fromJSON({ lineSpacingFactor: 1, font: { name: "other" } });
|
|
27
27
|
}
|
|
28
28
|
describe("layoutTextBlock", () => {
|
|
29
29
|
describe("resolves TextStyleSettings", () => {
|
|
@@ -39,13 +39,13 @@ describe("layoutTextBlock", () => {
|
|
|
39
39
|
expect(tb.lines.length).to.equal(1);
|
|
40
40
|
expect(tb.lines[0].runs.length).to.equal(1);
|
|
41
41
|
const runStyle = tb.lines[0].runs[0].style;
|
|
42
|
-
expect(runStyle.
|
|
42
|
+
expect(runStyle.font.name).to.equal("block");
|
|
43
43
|
expect(runStyle.lineSpacingFactor).to.equal(12);
|
|
44
44
|
expect(runStyle.isBold).to.be.true;
|
|
45
45
|
});
|
|
46
46
|
it("inherits style overrides from Paragraph when Run has no style overrides", () => {
|
|
47
47
|
const textBlock = TextBlock.create();
|
|
48
|
-
textBlock.appendParagraph({ styleOverrides: {
|
|
48
|
+
textBlock.appendParagraph({ styleOverrides: { font: { name: "paragraph" } } });
|
|
49
49
|
textBlock.appendRun(TextRun.create({ content: "test" }));
|
|
50
50
|
const tb = doLayout(textBlock, {
|
|
51
51
|
textStyleId: "0x42",
|
|
@@ -54,13 +54,13 @@ describe("layoutTextBlock", () => {
|
|
|
54
54
|
expect(tb.lines.length).to.equal(1);
|
|
55
55
|
expect(tb.lines[0].runs.length).to.equal(1);
|
|
56
56
|
const runStyle = tb.lines[0].runs[0].style;
|
|
57
|
-
expect(runStyle.
|
|
57
|
+
expect(runStyle.font.name).to.equal("paragraph");
|
|
58
58
|
expect(runStyle.isBold).to.be.true;
|
|
59
59
|
});
|
|
60
60
|
it("uses Run style overrides when Run has overrides", () => {
|
|
61
61
|
const textBlock = TextBlock.create();
|
|
62
|
-
textBlock.appendParagraph({ styleOverrides: { lineSpacingFactor: 55,
|
|
63
|
-
textBlock.appendRun(TextRun.create({ content: "test", styleOverrides: { lineSpacingFactor: 99,
|
|
62
|
+
textBlock.appendParagraph({ styleOverrides: { lineSpacingFactor: 55, font: { name: "paragraph" } } });
|
|
63
|
+
textBlock.appendRun(TextRun.create({ content: "test", styleOverrides: { lineSpacingFactor: 99, font: { name: "run" } } }));
|
|
64
64
|
const tb = doLayout(textBlock, {
|
|
65
65
|
textStyleId: "0x42",
|
|
66
66
|
findTextStyle: findTextStyleImpl,
|
|
@@ -68,13 +68,13 @@ describe("layoutTextBlock", () => {
|
|
|
68
68
|
expect(tb.lines.length).to.equal(1);
|
|
69
69
|
expect(tb.lines[0].runs.length).to.equal(1);
|
|
70
70
|
const runStyle = tb.lines[0].runs[0].style;
|
|
71
|
-
expect(runStyle.
|
|
71
|
+
expect(runStyle.font.name).to.equal("run");
|
|
72
72
|
expect(runStyle.isBold).to.be.true;
|
|
73
73
|
});
|
|
74
74
|
it("still uses TextBlock specific styles when Run has style overrides", () => {
|
|
75
75
|
// Some style settings make sense on a TextBlock, so they are always applied from the TextBlock, even if the Run has a style override.
|
|
76
76
|
const textBlock = TextBlock.create();
|
|
77
|
-
const run = TextRun.create({ content: "test", styleOverrides: { lineSpacingFactor: 99,
|
|
77
|
+
const run = TextRun.create({ content: "test", styleOverrides: { lineSpacingFactor: 99, font: { name: "run" } } });
|
|
78
78
|
textBlock.appendParagraph();
|
|
79
79
|
textBlock.appendRun(run);
|
|
80
80
|
const tb = doLayout(textBlock, {
|
|
@@ -87,9 +87,9 @@ describe("layoutTextBlock", () => {
|
|
|
87
87
|
expect(runStyle.lineSpacingFactor).to.equal(12);
|
|
88
88
|
});
|
|
89
89
|
it("inherits overrides from TextBlock, Paragraph and Run when there is no styleId", () => {
|
|
90
|
-
const textBlock = TextBlock.create({ styleOverrides: { widthFactor: 34,
|
|
91
|
-
const run = TextRun.create({ content: "test", styleOverrides: { widthFactor: 78,
|
|
92
|
-
textBlock.appendParagraph({ styleOverrides: {
|
|
90
|
+
const textBlock = TextBlock.create({ styleOverrides: { widthFactor: 34, textHeight: 3, lineSpacingFactor: 12, paragraphSpacingFactor: 2, isBold: true } });
|
|
91
|
+
const run = TextRun.create({ content: "test", styleOverrides: { widthFactor: 78, font: { name: "override" }, leader: { wantElbow: true } } });
|
|
92
|
+
textBlock.appendParagraph({ styleOverrides: { textHeight: 56, paragraphSpacingFactor: 25, color: 0xff0000, frame: { shape: "octagon" } } });
|
|
93
93
|
textBlock.appendRun(run);
|
|
94
94
|
const tb = doLayout(textBlock, {
|
|
95
95
|
findTextStyle: findTextStyleImpl,
|
|
@@ -99,22 +99,23 @@ describe("layoutTextBlock", () => {
|
|
|
99
99
|
const runStyle = tb.lines[0].runs[0].style;
|
|
100
100
|
// widthFactor is always taken from the TextBlock, even if the Run has overrides
|
|
101
101
|
expect(runStyle.widthFactor).to.equal(34);
|
|
102
|
-
//
|
|
103
|
-
expect(runStyle.
|
|
102
|
+
// paragraphSpacingFactor is always taken from the TextBlock, even if the Run has overrides
|
|
103
|
+
expect(runStyle.paragraphSpacingFactor).to.equal(2);
|
|
104
104
|
// lineSpacingFactor is always taken from the TextBlock, even if the Run has overrides
|
|
105
105
|
expect(runStyle.lineSpacingFactor).to.equal(12);
|
|
106
106
|
// frame settings are always taken from the TextBlock, even if the Paragraph or Run has overrides
|
|
107
107
|
expect(runStyle.frame.shape).to.equal("none");
|
|
108
108
|
// leader settings are always taken from the TextBlock, even if the Paragraph or Run has overrides
|
|
109
109
|
expect(runStyle.leader.wantElbow).to.be.false;
|
|
110
|
-
expect(runStyle.
|
|
110
|
+
expect(runStyle.font.name).to.equal("override");
|
|
111
111
|
expect(runStyle.color).to.equal(0xff0000);
|
|
112
112
|
expect(runStyle.isBold).to.be.true;
|
|
113
|
+
expect(runStyle.textHeight).to.equal(56);
|
|
113
114
|
});
|
|
114
115
|
it("does not inherit overrides in TextBlock or Paragraph when Run has same propertied overriden - unless they are TextBlock specific settings", () => {
|
|
115
|
-
const textBlock = TextBlock.create({ styleOverrides: { widthFactor: 34,
|
|
116
|
-
const run = TextRun.create({ content: "test", styleOverrides: { widthFactor: 78,
|
|
117
|
-
textBlock.appendParagraph({ styleOverrides: {
|
|
116
|
+
const textBlock = TextBlock.create({ styleOverrides: { widthFactor: 34, margins: { left: 3 }, textHeight: 3, lineSpacingFactor: 12, paragraphSpacingFactor: 2, isBold: true, justification: "center" } });
|
|
117
|
+
const run = TextRun.create({ content: "test", styleOverrides: { widthFactor: 78, margins: { left: 4, right: 3 }, textHeight: 6, paragraphSpacingFactor: 25, lineSpacingFactor: 24, font: { name: "override" }, isBold: false, justification: "right" } });
|
|
118
|
+
textBlock.appendParagraph({ styleOverrides: { textHeight: 56, paragraphSpacingFactor: 50, color: 0xff0000, justification: "left" } });
|
|
118
119
|
textBlock.appendRun(run);
|
|
119
120
|
const tb = doLayout(textBlock, {
|
|
120
121
|
textStyleId: "0x42",
|
|
@@ -125,19 +126,25 @@ describe("layoutTextBlock", () => {
|
|
|
125
126
|
const runStyle = tb.lines[0].runs[0].style;
|
|
126
127
|
// widthFactor is always taken from the TextBlock, even if the Run has a styleId or overrides
|
|
127
128
|
expect(runStyle.widthFactor).to.equal(34);
|
|
128
|
-
//
|
|
129
|
-
expect(runStyle.
|
|
129
|
+
// paragraphSpacingFactor is always taken from the TextBlock, even if the Run has overrides
|
|
130
|
+
expect(runStyle.paragraphSpacingFactor).to.equal(2);
|
|
130
131
|
// lineSpacingFactor is always taken from the TextBlock, even if the Run has a styleId or overrides
|
|
131
132
|
expect(runStyle.lineSpacingFactor).to.equal(12);
|
|
132
|
-
|
|
133
|
+
// margins are always taken from the TextBlock, even if the Paragraph or Run has overrides
|
|
134
|
+
expect(runStyle.margins.left).to.equal(3);
|
|
135
|
+
expect(runStyle.margins.right).to.equal(0);
|
|
136
|
+
// justification is always taken from the TextBlock, even if the Paragraph or Run has overrides
|
|
137
|
+
expect(runStyle.justification).to.equal("center");
|
|
138
|
+
expect(runStyle.font.name).to.equal("override");
|
|
133
139
|
expect(runStyle.color).to.equal(0xff0000);
|
|
134
140
|
expect(runStyle.isBold).to.be.false;
|
|
141
|
+
expect(runStyle.textHeight).to.equal(6);
|
|
135
142
|
});
|
|
136
143
|
it("takes child overrides over parent overrides", () => {
|
|
137
144
|
//...unless they are TextBlock specific as covered in other tests
|
|
138
|
-
const textBlock = TextBlock.create({ styleOverrides: {
|
|
139
|
-
const run = TextRun.create({ content: "test", styleOverrides: {
|
|
140
|
-
textBlock.appendParagraph({ styleOverrides: {
|
|
145
|
+
const textBlock = TextBlock.create({ styleOverrides: { font: { name: "grandparent" } } });
|
|
146
|
+
const run = TextRun.create({ content: "test", styleOverrides: { font: { name: "child" } } });
|
|
147
|
+
textBlock.appendParagraph({ styleOverrides: { font: { name: "parent" } } });
|
|
141
148
|
textBlock.appendRun(run);
|
|
142
149
|
const tb = doLayout(textBlock, {
|
|
143
150
|
findTextStyle: findTextStyleImpl,
|
|
@@ -145,7 +152,7 @@ describe("layoutTextBlock", () => {
|
|
|
145
152
|
expect(tb.lines.length).to.equal(1);
|
|
146
153
|
expect(tb.lines[0].runs.length).to.equal(1);
|
|
147
154
|
const runStyle = tb.lines[0].runs[0].style;
|
|
148
|
-
expect(runStyle.
|
|
155
|
+
expect(runStyle.font.name).to.equal("child");
|
|
149
156
|
});
|
|
150
157
|
});
|
|
151
158
|
it("has consistent data when converted to a layout result", function () {
|
|
@@ -153,14 +160,14 @@ describe("layoutTextBlock", () => {
|
|
|
153
160
|
this.skip();
|
|
154
161
|
}
|
|
155
162
|
// Initialize a new TextBlockLayout object
|
|
156
|
-
const textBlock = TextBlock.create({ width: 50, styleOverrides: { widthFactor: 34, color: 0x00ff00,
|
|
163
|
+
const textBlock = TextBlock.create({ width: 50, styleOverrides: { widthFactor: 34, color: 0x00ff00, font: { name: "arial" } } });
|
|
157
164
|
const run0 = TextRun.create({
|
|
158
165
|
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus pretium mi sit amet magna malesuada, at venenatis ante eleifend.",
|
|
159
|
-
styleOverrides: {
|
|
166
|
+
styleOverrides: { textHeight: 56, color: 0xff0000 },
|
|
160
167
|
});
|
|
161
168
|
const run1 = TextRun.create({
|
|
162
169
|
content: "Donec sit amet semper sapien. Nullam commodo, libero a accumsan lacinia, metus enim pharetra lacus, eu facilisis sem nisi eu dui.",
|
|
163
|
-
styleOverrides: { widthFactor: 78,
|
|
170
|
+
styleOverrides: { widthFactor: 78, font: { name: "run1" } },
|
|
164
171
|
});
|
|
165
172
|
const run2 = TextRun.create({
|
|
166
173
|
content: "Duis dui quam, suscipit quis feugiat id, fermentum ut augue. Mauris iaculis odio rhoncus lorem eleifend, posuere viverra turpis elementum.",
|
|
@@ -255,48 +262,115 @@ describe("layoutTextBlock", () => {
|
|
|
255
262
|
expect(marginRange.low.y).to.equal(layoutRange.low.y - (margins.bottom ?? 0));
|
|
256
263
|
expect(marginRange.high.y).to.equal(layoutRange.high.y + (margins.top ?? 0));
|
|
257
264
|
};
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return
|
|
265
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor: 0 } });
|
|
266
|
+
textBlock.appendRun(makeTextRun("abc"));
|
|
267
|
+
textBlock.appendRun(makeTextRun("defg"));
|
|
268
|
+
const marginStyleCallback = (margins) => {
|
|
269
|
+
return () => TextStyleSettings.fromJSON({ margins: { ...margins } });
|
|
263
270
|
};
|
|
264
|
-
let
|
|
265
|
-
|
|
271
|
+
let layout = doLayout(textBlock, {
|
|
272
|
+
findTextStyle: marginStyleCallback({}),
|
|
273
|
+
});
|
|
266
274
|
// Margins should be 0 by default
|
|
267
275
|
expect(layout.range.isAlmostEqual(layout.textRange)).to.be.true;
|
|
268
276
|
expectMargins(layout.textRange, layout.range, {});
|
|
269
277
|
// All margins should be applied to the range
|
|
270
|
-
|
|
271
|
-
|
|
278
|
+
layout = doLayout(textBlock, {
|
|
279
|
+
findTextStyle: marginStyleCallback({ left: 1, right: 2, top: 3, bottom: 4 }),
|
|
280
|
+
});
|
|
272
281
|
expectMargins(layout.textRange, layout.range, { left: 1, right: 2, top: 3, bottom: 4 });
|
|
273
282
|
// Just horizontal margins should be applied
|
|
274
|
-
|
|
275
|
-
|
|
283
|
+
layout = doLayout(textBlock, {
|
|
284
|
+
findTextStyle: marginStyleCallback({ left: 1, right: 2 }),
|
|
285
|
+
});
|
|
276
286
|
expectMargins(layout.textRange, layout.range, { left: 1, right: 2 });
|
|
277
287
|
// Just vertical margins should be applied
|
|
278
|
-
|
|
279
|
-
|
|
288
|
+
layout = doLayout(textBlock, {
|
|
289
|
+
findTextStyle: marginStyleCallback({ top: 1, bottom: 2 }),
|
|
290
|
+
});
|
|
280
291
|
expectMargins(layout.textRange, layout.range, { top: 1, bottom: 2 });
|
|
281
292
|
});
|
|
282
293
|
describe("range", () => {
|
|
283
|
-
|
|
294
|
+
const round = (num, numDecimalPlaces) => {
|
|
295
|
+
const multiplier = Math.pow(100, numDecimalPlaces);
|
|
296
|
+
return Math.round(num * multiplier) / multiplier;
|
|
297
|
+
};
|
|
298
|
+
it("aligns text of the same size on the bottom of the line", () => {
|
|
284
299
|
const textBlock = TextBlock.create();
|
|
285
|
-
const
|
|
286
|
-
const
|
|
300
|
+
const run1 = TextRun.create({ content: "abc" });
|
|
301
|
+
const run2 = TextRun.create({ content: "defg" });
|
|
302
|
+
textBlock.appendRun(run1);
|
|
303
|
+
textBlock.appendRun(run2);
|
|
304
|
+
const layout = doLayout(textBlock);
|
|
305
|
+
const run1Layout = layout.lines[0].runs[0];
|
|
306
|
+
const run2Layout = layout.lines[0].runs[1];
|
|
307
|
+
expect(run1Layout.range.yLength()).to.equal(1);
|
|
308
|
+
expect(run2Layout.range.yLength()).to.equal(1);
|
|
309
|
+
expect(run1Layout.offsetFromLine.y).to.equal(0);
|
|
310
|
+
expect(run2Layout.offsetFromLine.y).to.equal(0);
|
|
311
|
+
});
|
|
312
|
+
it("aligns text of varying sizes to the baseline of the largest text", () => {
|
|
313
|
+
const textBlock = TextBlock.create();
|
|
314
|
+
const smallText = TextRun.create({ content: "small", styleOverrides: { textHeight: 1 } });
|
|
315
|
+
const largeText = TextRun.create({ content: "large", styleOverrides: { textHeight: 3 } });
|
|
316
|
+
textBlock.appendRun(smallText);
|
|
317
|
+
textBlock.appendRun(largeText);
|
|
318
|
+
const layout = doLayout(textBlock);
|
|
319
|
+
const smallLayout = layout.lines[0].runs[0];
|
|
320
|
+
const largeLayout = layout.lines[0].runs[1];
|
|
321
|
+
expect(smallLayout.range.yLength()).to.equal(1);
|
|
322
|
+
expect(largeLayout.range.yLength()).to.equal(3);
|
|
323
|
+
expect(largeLayout.offsetFromLine.y).to.equal(0);
|
|
324
|
+
expect(smallLayout.offsetFromLine.y).to.equal(0);
|
|
325
|
+
});
|
|
326
|
+
it("aligns text to center based on height of the largest stacked fraction", () => {
|
|
327
|
+
const textBlock = TextBlock.create();
|
|
328
|
+
const fractionRun = FractionRun.create({ numerator: "1", denominator: "2", styleOverrides: { textHeight: 4 } });
|
|
329
|
+
const textRun = TextRun.create({ content: "text", styleOverrides: { textHeight: 2 } });
|
|
287
330
|
textBlock.appendRun(fractionRun);
|
|
288
331
|
textBlock.appendRun(textRun);
|
|
289
332
|
const layout = doLayout(textBlock);
|
|
290
333
|
const fractionLayout = layout.lines[0].runs[0];
|
|
291
334
|
const textLayout = layout.lines[0].runs[1];
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
expect(textLayout.
|
|
297
|
-
|
|
335
|
+
expect(round(fractionLayout.range.yLength(), 2)).to.equal(7);
|
|
336
|
+
expect(textLayout.range.yLength()).to.equal(2);
|
|
337
|
+
// Fraction should be defining the line height
|
|
338
|
+
expect(fractionLayout.offsetFromLine.y).to.equal(0);
|
|
339
|
+
expect(round(textLayout.offsetFromLine.y, 2)).to.equal(2.5);
|
|
340
|
+
});
|
|
341
|
+
it("aligns the largest non-fraction text to the center based on height of stacked fraction and aligns all other text to the baseline", () => {
|
|
342
|
+
const textBlock = TextBlock.create();
|
|
343
|
+
const smallText = TextRun.create({ content: "s", styleOverrides: { textHeight: 1 } });
|
|
344
|
+
const mediumText = TextRun.create({ content: "m", styleOverrides: { textHeight: 2 } });
|
|
345
|
+
const fraction = FractionRun.create({ numerator: "1", denominator: "2", styleOverrides: { textHeight: 4 } });
|
|
346
|
+
textBlock.appendRun(smallText);
|
|
347
|
+
textBlock.appendRun(mediumText);
|
|
348
|
+
textBlock.appendRun(fraction);
|
|
349
|
+
const layout = doLayout(textBlock);
|
|
350
|
+
const smallLayout = layout.lines[0].runs[0];
|
|
351
|
+
const mediumLayout = layout.lines[0].runs[1];
|
|
352
|
+
const fractionLayout = layout.lines[0].runs[2];
|
|
353
|
+
expect(smallLayout.range.yLength()).to.equal(1);
|
|
354
|
+
expect(mediumLayout.range.yLength()).to.equal(2);
|
|
355
|
+
expect(round(fractionLayout.range.yLength(), 2)).to.equal(7);
|
|
356
|
+
expect(round(mediumLayout.offsetFromLine.y, 2)).to.equal(2.5);
|
|
357
|
+
expect(round(smallLayout.offsetFromLine.y, 2)).to.equal(2.5);
|
|
298
358
|
expect(fractionLayout.offsetFromLine.y).to.equal(0);
|
|
299
|
-
|
|
359
|
+
});
|
|
360
|
+
it("aligns fractions to the baseline of same sized text", () => {
|
|
361
|
+
const textBlock = TextBlock.create();
|
|
362
|
+
const text = TextRun.create({ content: "t", styleOverrides: { textHeight: 3 } });
|
|
363
|
+
const fraction = FractionRun.create({ numerator: "1", denominator: "2", styleOverrides: { textHeight: 3 } });
|
|
364
|
+
textBlock.appendRun(text);
|
|
365
|
+
textBlock.appendRun(fraction);
|
|
366
|
+
const layout = doLayout(textBlock);
|
|
367
|
+
const textLayout = layout.lines[0].runs[0];
|
|
368
|
+
const fractionLayout = layout.lines[0].runs[1];
|
|
369
|
+
expect(textLayout.range.yLength()).to.equal(3);
|
|
370
|
+
expect(round(fractionLayout.range.yLength(), 2)).to.equal(5.25);
|
|
371
|
+
expect(round(textLayout.offsetFromLine.y, 3)).to.equal(1.125);
|
|
372
|
+
// Slightly lower than text baseline so that the fraction appears centered on the text
|
|
373
|
+
expect(round(fractionLayout.offsetFromLine.y, 3)).to.equal(0.075);
|
|
300
374
|
});
|
|
301
375
|
it("produces one line per paragraph if document width <= 0", () => {
|
|
302
376
|
const lineSpacingFactor = 0.5;
|
|
@@ -338,8 +412,8 @@ describe("layoutTextBlock", () => {
|
|
|
338
412
|
});
|
|
339
413
|
it("produces a new line for each LineBreakRun", () => {
|
|
340
414
|
const lineSpacingFactor = 0.5;
|
|
341
|
-
const
|
|
342
|
-
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor,
|
|
415
|
+
const textHeight = 1;
|
|
416
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, textHeight } });
|
|
343
417
|
textBlock.appendRun(TextRun.create({ content: "abc" }));
|
|
344
418
|
textBlock.appendRun(LineBreakRun.create());
|
|
345
419
|
textBlock.appendRun(TextRun.create({ content: "def" }));
|
|
@@ -355,12 +429,12 @@ describe("layoutTextBlock", () => {
|
|
|
355
429
|
expect(tb.range.high.x).to.equal(6);
|
|
356
430
|
expect(tb.range.high.y).to.equal(0);
|
|
357
431
|
// paragraphSpacingFactor should not be applied to linebreaks, but lineSpacingFactor should.
|
|
358
|
-
expect(tb.range.low.y).to.equal(-(lineSpacingFactor * 2 +
|
|
432
|
+
expect(tb.range.low.y).to.equal(-(lineSpacingFactor * 2 + textHeight * 3));
|
|
359
433
|
});
|
|
360
434
|
it("applies tab shifts", () => {
|
|
361
|
-
const
|
|
435
|
+
const textHeight = 1;
|
|
362
436
|
const tabInterval = 6;
|
|
363
|
-
const textBlock = TextBlock.create({ styleOverrides: {
|
|
437
|
+
const textBlock = TextBlock.create({ styleOverrides: { textHeight, tabInterval } });
|
|
364
438
|
// Appends a line that looks like `stringOne` TAB `stringTwo` LINEBREAK
|
|
365
439
|
const appendLine = (stringOne, stringTwo, wantLineBreak = true) => {
|
|
366
440
|
if (stringOne.length > 0)
|
|
@@ -390,9 +464,9 @@ describe("layoutTextBlock", () => {
|
|
|
390
464
|
});
|
|
391
465
|
});
|
|
392
466
|
it("applies consecutive tab shifts", () => {
|
|
393
|
-
const
|
|
467
|
+
const textHeight = 1;
|
|
394
468
|
const tabInterval = 6;
|
|
395
|
-
const textBlock = TextBlock.create({ styleOverrides: {
|
|
469
|
+
const textBlock = TextBlock.create({ styleOverrides: { textHeight, tabInterval } });
|
|
396
470
|
// line 0: ----->----->----->LINEBREAK
|
|
397
471
|
textBlock.appendRun(TabRun.create({ styleOverrides: { tabInterval } }));
|
|
398
472
|
textBlock.appendRun(TabRun.create({ styleOverrides: { tabInterval } }));
|
|
@@ -431,12 +505,12 @@ describe("layoutTextBlock", () => {
|
|
|
431
505
|
expect(line3.runs.length).to.equal(7);
|
|
432
506
|
expect(line3.range.xLength()).to.equal(7 + 3 + 7, `Multiple tabs with different intervals should be applied correctly`);
|
|
433
507
|
});
|
|
434
|
-
it("computes ranges based on custom line spacing,
|
|
508
|
+
it("computes ranges based on custom line spacing, text height, and indentation", () => {
|
|
435
509
|
const lineSpacingFactor = 2;
|
|
436
|
-
const
|
|
510
|
+
const textHeight = 3;
|
|
437
511
|
const paragraphSpacingFactor = 13;
|
|
438
512
|
const indentation = 7;
|
|
439
|
-
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor,
|
|
513
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, textHeight, paragraphSpacingFactor, indentation } });
|
|
440
514
|
textBlock.appendRun(TextRun.create({ content: "abc" }));
|
|
441
515
|
textBlock.appendRun(LineBreakRun.create());
|
|
442
516
|
textBlock.appendRun(TextRun.create({ content: "def" }));
|
|
@@ -455,25 +529,25 @@ describe("layoutTextBlock", () => {
|
|
|
455
529
|
|
|
456
530
|
Where ↵ = LineBreak, ¶ = ParagraphBreak, ⇥ = indentation
|
|
457
531
|
|
|
458
|
-
We have 3 lines each `
|
|
532
|
+
We have 3 lines each `textHeight` high, plus 2 line breaks in between each `textHeight*lineSpacingFactor` high.
|
|
459
533
|
No paragraph spacing should be applied since there is one paragraph.
|
|
460
534
|
*/
|
|
461
535
|
expect(tb.range.low.x).to.equal(7);
|
|
462
536
|
expect(tb.range.high.x).to.equal(6 + 7); // 7 for indentation, 6 for the length of "defghi"
|
|
463
537
|
expect(tb.range.high.y).to.equal(0);
|
|
464
|
-
expect(tb.range.low.y).to.equal(-(
|
|
465
|
-
expect(tb.lines[0].offsetFromDocument.y).to.equal(-
|
|
466
|
-
expect(tb.lines[1].offsetFromDocument.y).to.equal(tb.lines[0].offsetFromDocument.y - (
|
|
467
|
-
expect(tb.lines[2].offsetFromDocument.y).to.equal(tb.lines[1].offsetFromDocument.y - (
|
|
538
|
+
expect(tb.range.low.y).to.equal(-(textHeight * 3 + (textHeight * lineSpacingFactor) * 2));
|
|
539
|
+
expect(tb.lines[0].offsetFromDocument.y).to.equal(-textHeight);
|
|
540
|
+
expect(tb.lines[1].offsetFromDocument.y).to.equal(tb.lines[0].offsetFromDocument.y - (textHeight + textHeight * lineSpacingFactor));
|
|
541
|
+
expect(tb.lines[2].offsetFromDocument.y).to.equal(tb.lines[1].offsetFromDocument.y - (textHeight + textHeight * lineSpacingFactor));
|
|
468
542
|
tb.lines.forEach((line) => expect(line.offsetFromDocument.x).to.equal(7));
|
|
469
543
|
});
|
|
470
544
|
it("computes paragraph spacing and indentation", () => {
|
|
471
545
|
const lineSpacingFactor = 2;
|
|
472
|
-
const
|
|
546
|
+
const textHeight = 3;
|
|
473
547
|
const paragraphSpacingFactor = 13;
|
|
474
548
|
const indentation = 7;
|
|
475
549
|
const tabInterval = 5;
|
|
476
|
-
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor,
|
|
550
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, textHeight, paragraphSpacingFactor, indentation, tabInterval } });
|
|
477
551
|
const p1 = textBlock.appendParagraph();
|
|
478
552
|
p1.children.push(TextRun.create({ content: "abc" })); // Line 1
|
|
479
553
|
p1.children.push(LineBreakRun.create());
|
|
@@ -498,33 +572,33 @@ describe("layoutTextBlock", () => {
|
|
|
498
572
|
Where ↵ = LineBreak, ¶ = ParagraphBreak, → = tabInterval/2, ⇥ = indentation
|
|
499
573
|
|
|
500
574
|
We have:
|
|
501
|
-
6 lines each `
|
|
502
|
-
5 line breaks in between each `
|
|
503
|
-
4 paragraph breaks in between each `
|
|
575
|
+
6 lines each `textHeight` high
|
|
576
|
+
5 line breaks in between each `textHeight*lineSpacingFactor` high
|
|
577
|
+
4 paragraph breaks in between each `textHeight*paragraphSpacingFactor` high
|
|
504
578
|
*/
|
|
505
579
|
expect(tb.range.low.x).to.equal(7); // 7 for indentation
|
|
506
580
|
expect(tb.range.high.x).to.equal(7 + 5 + 11); // 7 for indentation, 5 for the tab stop, 11 for the length of "list item 1"
|
|
507
581
|
expect(tb.range.high.y).to.equal(0);
|
|
508
|
-
expect(tb.range.low.y).to.equal(-(
|
|
582
|
+
expect(tb.range.low.y).to.equal(-(textHeight * 6 + (textHeight * lineSpacingFactor) * 5 + (textHeight * paragraphSpacingFactor) * 4));
|
|
509
583
|
// Cumulative vertical offsets to help make the test more readable.
|
|
510
|
-
let offsetY = -
|
|
584
|
+
let offsetY = -textHeight;
|
|
511
585
|
let offsetX = indentation;
|
|
512
586
|
expect(tb.lines[0].offsetFromDocument.y).to.equal(offsetY);
|
|
513
587
|
expect(tb.lines[0].offsetFromDocument.x).to.equal(offsetX);
|
|
514
|
-
offsetY -= (
|
|
588
|
+
offsetY -= (textHeight + textHeight * lineSpacingFactor);
|
|
515
589
|
expect(tb.lines[1].offsetFromDocument.y).to.equal(offsetY);
|
|
516
590
|
expect(tb.lines[1].offsetFromDocument.x).to.equal(offsetX);
|
|
517
|
-
offsetY -= (
|
|
591
|
+
offsetY -= (textHeight + textHeight * lineSpacingFactor + textHeight * paragraphSpacingFactor);
|
|
518
592
|
expect(tb.lines[2].offsetFromDocument.y).to.equal(offsetY);
|
|
519
593
|
expect(tb.lines[2].offsetFromDocument.x).to.equal(offsetX);
|
|
520
594
|
offsetX += tabInterval; // List items are indented using tabInterval.
|
|
521
|
-
offsetY -= (
|
|
595
|
+
offsetY -= (textHeight + textHeight * lineSpacingFactor + textHeight * paragraphSpacingFactor);
|
|
522
596
|
expect(tb.lines[3].offsetFromDocument.y).to.equal(offsetY);
|
|
523
597
|
expect(tb.lines[3].offsetFromDocument.x).to.equal(offsetX);
|
|
524
|
-
offsetY -= (
|
|
598
|
+
offsetY -= (textHeight + textHeight * lineSpacingFactor + textHeight * paragraphSpacingFactor);
|
|
525
599
|
expect(tb.lines[4].offsetFromDocument.y).to.equal(offsetY);
|
|
526
600
|
expect(tb.lines[4].offsetFromDocument.x).to.equal(offsetX);
|
|
527
|
-
offsetY -= (
|
|
601
|
+
offsetY -= (textHeight + textHeight * lineSpacingFactor + textHeight * paragraphSpacingFactor);
|
|
528
602
|
expect(tb.lines[5].offsetFromDocument.y).to.equal(offsetY);
|
|
529
603
|
expect(tb.lines[5].offsetFromDocument.x).to.equal(offsetX);
|
|
530
604
|
});
|
|
@@ -536,7 +610,7 @@ describe("layoutTextBlock", () => {
|
|
|
536
610
|
if (!isIntlSupported()) {
|
|
537
611
|
this.skip();
|
|
538
612
|
}
|
|
539
|
-
const block = TextBlock.create({ width: 3, styleOverrides: {
|
|
613
|
+
const block = TextBlock.create({ width: 3, styleOverrides: { textHeight: 1, lineSpacingFactor: 0 } });
|
|
540
614
|
function expectBlockRange(width, height) {
|
|
541
615
|
const layout = doLayout(block);
|
|
542
616
|
expectRange(width, height, layout.range);
|
|
@@ -560,7 +634,7 @@ describe("layoutTextBlock", () => {
|
|
|
560
634
|
if (!isIntlSupported()) {
|
|
561
635
|
this.skip();
|
|
562
636
|
}
|
|
563
|
-
const block = TextBlock.create({ styleOverrides: {
|
|
637
|
+
const block = TextBlock.create({ styleOverrides: { textHeight: 1, lineSpacingFactor: 0 } });
|
|
564
638
|
function expectBlockRange(width, height) {
|
|
565
639
|
const layout = doLayout(block);
|
|
566
640
|
expectRange(width, height, layout.range);
|
|
@@ -575,7 +649,7 @@ describe("layoutTextBlock", () => {
|
|
|
575
649
|
});
|
|
576
650
|
it("computes range for list markers and list items based on indentation", function () {
|
|
577
651
|
const lineSpacingFactor = 2;
|
|
578
|
-
const
|
|
652
|
+
const textHeight = 3;
|
|
579
653
|
const paragraphSpacingFactor = 13;
|
|
580
654
|
const indentation = 7;
|
|
581
655
|
const tabInterval = 5;
|
|
@@ -649,7 +723,7 @@ describe("layoutTextBlock", () => {
|
|
|
649
723
|
]
|
|
650
724
|
}
|
|
651
725
|
];
|
|
652
|
-
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor,
|
|
726
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, textHeight, paragraphSpacingFactor, indentation, tabInterval } });
|
|
653
727
|
const p1 = textBlock.appendParagraph();
|
|
654
728
|
p1.children.push(List.create({ children: listChildren }));
|
|
655
729
|
/* Final TextBlock should look like:
|
|
@@ -664,23 +738,23 @@ describe("layoutTextBlock", () => {
|
|
|
664
738
|
Where ↵ = LineBreak, ¶ = ParagraphBreak, → = tab, → = tabInterval/2, ⇥ = indentation
|
|
665
739
|
|
|
666
740
|
We have:
|
|
667
|
-
7 lines each `
|
|
668
|
-
6 line breaks in between each `
|
|
669
|
-
6 paragraph breaks in between each `
|
|
741
|
+
7 lines each `textHeight` high
|
|
742
|
+
6 line breaks in between each `textHeight*lineSpacingFactor` high
|
|
743
|
+
6 paragraph breaks in between each `textHeight*paragraphSpacingFactor` high
|
|
670
744
|
*/
|
|
671
745
|
const tb = doLayout(textBlock);
|
|
672
746
|
expect(tb.lines.length).to.equal(7);
|
|
673
747
|
expect(tb.range.low.x).to.equal(7 + 5 - 5 / 2 - 2); // indentation + tabInterval - tabInterval/2 (for marker offset) + 2 (for the marker "1." justification, it's 2 characters wide)
|
|
674
748
|
expect(tb.range.high.x).to.equal(7 + 3 * 5 + 21); // 7 for indentation, 3 * 5 for the most nested tab stops, 21 for the length of "Rhode Island Greening"
|
|
675
749
|
expect(tb.range.high.y).to.equal(0);
|
|
676
|
-
expect(tb.range.low.y).to.equal(-(
|
|
750
|
+
expect(tb.range.low.y).to.equal(-(textHeight * 7 + (textHeight * lineSpacingFactor) * 6 + (textHeight * paragraphSpacingFactor) * 6));
|
|
677
751
|
// Cumulative vertical offsets to help make the test more readable.
|
|
678
|
-
let offsetY = -
|
|
752
|
+
let offsetY = -textHeight;
|
|
679
753
|
for (const line of tb.lines) {
|
|
680
754
|
expect(line.offsetFromDocument.y).to.equal(offsetY);
|
|
681
755
|
expect(line.marker).to.not.be.undefined;
|
|
682
|
-
expect(line.marker?.offsetFromLine.y).to.equal((
|
|
683
|
-
offsetY -= (
|
|
756
|
+
expect(line.marker?.offsetFromLine.y).to.equal((textHeight - line.marker.range.yLength()) / 2);
|
|
757
|
+
offsetY -= (textHeight + textHeight * lineSpacingFactor + textHeight * paragraphSpacingFactor);
|
|
684
758
|
}
|
|
685
759
|
let markerXLength = tb.lines[0].marker.range.xLength();
|
|
686
760
|
let inset = indentation + tabInterval;
|
|
@@ -712,12 +786,16 @@ describe("layoutTextBlock", () => {
|
|
|
712
786
|
this.skip();
|
|
713
787
|
}
|
|
714
788
|
const block = TextBlock.create({ styleOverrides: { lineSpacingFactor: 0 } });
|
|
715
|
-
function expectBlockRange(width, height) {
|
|
716
|
-
const layout = doLayout(block
|
|
789
|
+
function expectBlockRange(width, height, justification) {
|
|
790
|
+
const layout = doLayout(block, {
|
|
791
|
+
findTextStyle: () => TextStyleSettings.fromJSON({ justification })
|
|
792
|
+
});
|
|
717
793
|
expectRange(width, height, layout.range);
|
|
718
794
|
}
|
|
719
|
-
function expectLineOffset(offset, lineIndex) {
|
|
720
|
-
const layout = doLayout(block
|
|
795
|
+
function expectLineOffset(offset, lineIndex, justification) {
|
|
796
|
+
const layout = doLayout(block, {
|
|
797
|
+
findTextStyle: () => TextStyleSettings.fromJSON({ justification }),
|
|
798
|
+
});
|
|
721
799
|
expect(layout.lines.length).least(lineIndex + 1);
|
|
722
800
|
const line = layout.lines[lineIndex];
|
|
723
801
|
expect(line.offsetFromDocument.y).to.equal(-(lineIndex + 1));
|
|
@@ -727,65 +805,53 @@ describe("layoutTextBlock", () => {
|
|
|
727
805
|
block.appendRun(makeTextRun("abc"));
|
|
728
806
|
block.appendRun(makeTextRun("defg"));
|
|
729
807
|
// 1 line of text with width 0: left, right, center justification.
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
expectBlockRange(7, 1);
|
|
735
|
-
expectLineOffset(0, 0);
|
|
736
|
-
block.justification = "center";
|
|
737
|
-
expectBlockRange(7, 1);
|
|
738
|
-
expectLineOffset(0, 0);
|
|
808
|
+
expectBlockRange(7, 1, "left");
|
|
809
|
+
expectLineOffset(0, 0, "left");
|
|
810
|
+
expectBlockRange(7, 1, "right");
|
|
811
|
+
expectLineOffset(0, 0, "right");
|
|
812
|
+
expectBlockRange(7, 1, "center");
|
|
813
|
+
expectLineOffset(0, 0, "center");
|
|
739
814
|
// 1 line of text from a width greater than number of characters: left, right, center justification.
|
|
740
815
|
block.width = 10;
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
expectBlockRange(10, 1);
|
|
746
|
-
expectLineOffset(
|
|
747
|
-
block.justification = "center";
|
|
748
|
-
expectBlockRange(10, 1);
|
|
749
|
-
expectLineOffset(1.5, 0); // 1.5 = (10 - 7) / 2
|
|
816
|
+
expectBlockRange(10, 1, "left");
|
|
817
|
+
expectLineOffset(0, 0, "left");
|
|
818
|
+
expectBlockRange(10, 1, "right");
|
|
819
|
+
expectLineOffset(3, 0, "right"); // 3 = 10 - 7
|
|
820
|
+
expectBlockRange(10, 1, "center");
|
|
821
|
+
expectLineOffset(1.5, 0, "center"); // 1.5 = (10 - 7) / 2
|
|
750
822
|
// 2 line of text from a width less than number of characters: left, right, center justification.
|
|
751
|
-
block.justification = "left";
|
|
752
823
|
block.width = 4;
|
|
753
|
-
expectBlockRange(4, 2);
|
|
754
|
-
expectLineOffset(0, 0);
|
|
755
|
-
expectLineOffset(0, 1);
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
expectLineOffset(1,
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
expectLineOffset(0.5, 0);
|
|
763
|
-
expectLineOffset(0, 1);
|
|
824
|
+
expectBlockRange(4, 2, "left");
|
|
825
|
+
expectLineOffset(0, 0, "left");
|
|
826
|
+
expectLineOffset(0, 1, "left");
|
|
827
|
+
expectBlockRange(4, 2, "right");
|
|
828
|
+
expectLineOffset(1, 0, "right");
|
|
829
|
+
expectLineOffset(0, 1, "right");
|
|
830
|
+
expectBlockRange(4, 2, "center");
|
|
831
|
+
expectLineOffset(0.5, 0, "center");
|
|
832
|
+
expectLineOffset(0, 1, "center");
|
|
764
833
|
// Testing text longer the the width of the text block.
|
|
765
834
|
block.width = 2;
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
expectLineOffset(0,
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
expectLineOffset(-1, 0);
|
|
773
|
-
expectLineOffset(-2, 1);
|
|
835
|
+
expectBlockRange(4, 2, "left");
|
|
836
|
+
expectLineOffset(0, 0, "left");
|
|
837
|
+
expectLineOffset(0, 1, "left");
|
|
838
|
+
expectBlockRange(4, 2, "right");
|
|
839
|
+
expectLineOffset(-1, 0, "right");
|
|
840
|
+
expectLineOffset(-2, 1, "right");
|
|
774
841
|
block.appendRun(makeTextRun("123456789"));
|
|
775
|
-
expectBlockRange(9, 3);
|
|
776
|
-
expectLineOffset(-1, 0);
|
|
777
|
-
expectLineOffset(-2, 1);
|
|
778
|
-
expectLineOffset(-7, 2);
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
expectLineOffset(-
|
|
782
|
-
expectLineOffset(-
|
|
783
|
-
expectLineOffset(-3.5, 2);
|
|
842
|
+
expectBlockRange(9, 3, "right");
|
|
843
|
+
expectLineOffset(-1, 0, "right");
|
|
844
|
+
expectLineOffset(-2, 1, "right");
|
|
845
|
+
expectLineOffset(-7, 2, "right");
|
|
846
|
+
expectBlockRange(9, 3, "center");
|
|
847
|
+
expectLineOffset(-0.5, 0, "center");
|
|
848
|
+
expectLineOffset(-1, 1, "center");
|
|
849
|
+
expectLineOffset(-3.5, 2, "center");
|
|
784
850
|
});
|
|
785
851
|
});
|
|
786
852
|
describe("word-wrapping", () => {
|
|
787
853
|
function expectLines(input, width, expectedLines) {
|
|
788
|
-
const textBlock = TextBlock.create({ styleOverrides: { paragraphSpacingFactor: 0, lineSpacingFactor: 0,
|
|
854
|
+
const textBlock = TextBlock.create({ styleOverrides: { paragraphSpacingFactor: 0, lineSpacingFactor: 0, textHeight: 1 } });
|
|
789
855
|
textBlock.width = width;
|
|
790
856
|
const run = makeTextRun(input);
|
|
791
857
|
textBlock.appendRun(run);
|
|
@@ -888,8 +954,8 @@ describe("layoutTextBlock", () => {
|
|
|
888
954
|
if (!isIntlSupported()) {
|
|
889
955
|
this.skip();
|
|
890
956
|
}
|
|
891
|
-
const
|
|
892
|
-
const textBlock = TextBlock.create({ styleOverrides: {
|
|
957
|
+
const textHeight = 1;
|
|
958
|
+
const textBlock = TextBlock.create({ styleOverrides: { textHeight } });
|
|
893
959
|
// line 0: -->-->------> LINEBREAK
|
|
894
960
|
textBlock.appendRun(TabRun.create({ styleOverrides: { tabInterval: 3 } }));
|
|
895
961
|
textBlock.appendRun(TabRun.create({ styleOverrides: { tabInterval: 3 } }));
|
|
@@ -1043,7 +1109,7 @@ describe("layoutTextBlock", () => {
|
|
|
1043
1109
|
if (!isIntlSupported()) {
|
|
1044
1110
|
this.skip();
|
|
1045
1111
|
}
|
|
1046
|
-
const block = TextBlock.create({ styleOverrides: {
|
|
1112
|
+
const block = TextBlock.create({ styleOverrides: { textHeight: 1, lineSpacingFactor: 0 } });
|
|
1047
1113
|
block.appendRun(makeTextRun("abc defg"));
|
|
1048
1114
|
const layout1 = doLayout(block);
|
|
1049
1115
|
let width = layout1.range.xLength();
|
|
@@ -1057,7 +1123,7 @@ describe("layoutTextBlock", () => {
|
|
|
1057
1123
|
if (!isIntlSupported()) {
|
|
1058
1124
|
this.skip();
|
|
1059
1125
|
}
|
|
1060
|
-
const textBlock = TextBlock.create({ styleOverrides: { indentation: 2, tabInterval: 3,
|
|
1126
|
+
const textBlock = TextBlock.create({ styleOverrides: { indentation: 2, tabInterval: 3, textHeight: 1, lineSpacingFactor: 0, paragraphSpacingFactor: 0 } });
|
|
1061
1127
|
/* Final TextBlock should look like:
|
|
1062
1128
|
⇥→1.→Lorem ipsum dolor sit amet, consectetur adipiscing elit¶ | Inset by 5
|
|
1063
1129
|
⇥→2.→sed do¶ | Inset by 5
|
|
@@ -1234,7 +1300,7 @@ describe("layoutTextBlock", () => {
|
|
|
1234
1300
|
expect(iModel.fonts.findId({ name: "Consolas" })).to.be.undefined;
|
|
1235
1301
|
function test(fontName, expectedFontId) {
|
|
1236
1302
|
const textBlock = TextBlock.create();
|
|
1237
|
-
textBlock.appendRun(TextRun.create({ styleOverrides: { fontName } }));
|
|
1303
|
+
textBlock.appendRun(TextRun.create({ styleOverrides: { font: { name: fontName } } }));
|
|
1238
1304
|
const textStyleResolver = new TextStyleResolver({ textBlock, textStyleId: "", iModel });
|
|
1239
1305
|
const layout = layoutTextBlock({ textBlock, iModel, textStyleResolver });
|
|
1240
1306
|
const run = layout.lines[0].runs[0];
|
|
@@ -1250,7 +1316,7 @@ describe("layoutTextBlock", () => {
|
|
|
1250
1316
|
function computeDimensions(args) {
|
|
1251
1317
|
const textBlock = TextBlock.create({
|
|
1252
1318
|
styleOverrides: {
|
|
1253
|
-
|
|
1319
|
+
textHeight: args.height,
|
|
1254
1320
|
widthFactor: args.width,
|
|
1255
1321
|
},
|
|
1256
1322
|
});
|
|
@@ -1259,7 +1325,7 @@ describe("layoutTextBlock", () => {
|
|
|
1259
1325
|
styleOverrides: {
|
|
1260
1326
|
isBold: args.bold,
|
|
1261
1327
|
isItalic: args.italic,
|
|
1262
|
-
|
|
1328
|
+
font: { name: args.font ?? "Vera" },
|
|
1263
1329
|
},
|
|
1264
1330
|
}));
|
|
1265
1331
|
const textStyleResolver = new TextStyleResolver({ textBlock, textStyleId: "", iModel });
|
|
@@ -1291,7 +1357,7 @@ describe("layoutTextBlock", () => {
|
|
|
1291
1357
|
italic: false,
|
|
1292
1358
|
fontId: 1,
|
|
1293
1359
|
widthFactor: 1,
|
|
1294
|
-
|
|
1360
|
+
textHeight: 1,
|
|
1295
1361
|
baselineShift: "none",
|
|
1296
1362
|
});
|
|
1297
1363
|
}
|
|
@@ -1524,10 +1590,11 @@ describe("produceTextBlockGeometry", () => {
|
|
|
1524
1590
|
function makeGeometryWithMargins(anchor, margins) {
|
|
1525
1591
|
const runs = [makeText()];
|
|
1526
1592
|
const block = makeTextBlock(runs);
|
|
1527
|
-
block.margins = margins;
|
|
1528
1593
|
const annotation = TextAnnotation.fromJSON({ textBlock: block.toJSON() });
|
|
1529
1594
|
annotation.anchor = anchor;
|
|
1530
|
-
const layout = doLayout(block
|
|
1595
|
+
const layout = doLayout(block, {
|
|
1596
|
+
findTextStyle: () => TextStyleSettings.fromJSON({ margins: { ...margins } }),
|
|
1597
|
+
});
|
|
1531
1598
|
const geom = produceTextBlockGeometry(layout, annotation.computeTransform(layout.range)).entries;
|
|
1532
1599
|
return geom[1].text;
|
|
1533
1600
|
}
|