@itwin/core-backend 5.2.0-dev.31 → 5.2.0-dev.33
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/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.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.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.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.js +8 -8
- 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.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.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.js.map +1 -1
- 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.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +3 -5
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js +24 -17
- 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 +8 -0
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.d.ts +46 -27
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +201 -113
- 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 +3 -5
- 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.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.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.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.js +8 -8
- 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.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.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.js.map +1 -1
- 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.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +4 -6
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +1 -1
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js +24 -17
- 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 +8 -0
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.d.ts +46 -27
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +202 -114
- 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 +4 -6
- 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.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 +42 -40
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +417 -54
- 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 +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 +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 +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.js +33 -33
- 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 +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.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 +117 -117
- 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.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.js.map +1 -1
- package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +12 -12
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { expect } from "chai";
|
|
6
6
|
import { computeGraphemeOffsets, layoutTextBlock, TextStyleResolver } from "../../annotations/TextBlockLayout";
|
|
7
7
|
import { Geometry } from "@itwin/core-geometry";
|
|
8
|
-
import { ColorDef, FontType, FractionRun, LineBreakRun, Paragraph, TabRun, TextAnnotation, TextBlock, TextRun, TextStyleSettings } from "@itwin/core-common";
|
|
8
|
+
import { ColorDef, FontType, FractionRun, LineBreakRun, List, ListMarkerEnumerator, Paragraph, TabRun, TextAnnotation, TextBlock, TextRun, TextStyleSettings } from "@itwin/core-common";
|
|
9
9
|
import { IModelTestUtils } from "../IModelTestUtils";
|
|
10
10
|
import { ProcessDetector } from "@itwin/core-bentley";
|
|
11
11
|
import { produceTextBlockGeometry } from "../../core-backend";
|
|
@@ -45,10 +45,8 @@ describe("layoutTextBlock", () => {
|
|
|
45
45
|
});
|
|
46
46
|
it("inherits style overrides from Paragraph when Run has no style overrides", () => {
|
|
47
47
|
const textBlock = TextBlock.create();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
textBlock.paragraphs.push(paragraph);
|
|
51
|
-
textBlock.appendRun(run);
|
|
48
|
+
textBlock.appendParagraph({ styleOverrides: { fontName: "paragraph" } });
|
|
49
|
+
textBlock.appendRun(TextRun.create({ content: "test" }));
|
|
52
50
|
const tb = doLayout(textBlock, {
|
|
53
51
|
textStyleId: "0x42",
|
|
54
52
|
findTextStyle: findTextStyleImpl,
|
|
@@ -61,10 +59,8 @@ describe("layoutTextBlock", () => {
|
|
|
61
59
|
});
|
|
62
60
|
it("uses Run style overrides when Run has overrides", () => {
|
|
63
61
|
const textBlock = TextBlock.create();
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
textBlock.paragraphs.push(paragraph);
|
|
67
|
-
textBlock.appendRun(run);
|
|
62
|
+
textBlock.appendParagraph({ styleOverrides: { lineSpacingFactor: 55, fontName: "paragraph" } });
|
|
63
|
+
textBlock.appendRun(TextRun.create({ content: "test", styleOverrides: { lineSpacingFactor: 99, fontName: "run" } }));
|
|
68
64
|
const tb = doLayout(textBlock, {
|
|
69
65
|
textStyleId: "0x42",
|
|
70
66
|
findTextStyle: findTextStyleImpl,
|
|
@@ -76,7 +72,7 @@ describe("layoutTextBlock", () => {
|
|
|
76
72
|
expect(runStyle.isBold).to.be.true;
|
|
77
73
|
});
|
|
78
74
|
it("still uses TextBlock specific styles when Run has style overrides", () => {
|
|
79
|
-
// Some style settings
|
|
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.
|
|
80
76
|
const textBlock = TextBlock.create();
|
|
81
77
|
const run = TextRun.create({ content: "test", styleOverrides: { lineSpacingFactor: 99, fontName: "run" } });
|
|
82
78
|
textBlock.appendParagraph();
|
|
@@ -92,9 +88,8 @@ describe("layoutTextBlock", () => {
|
|
|
92
88
|
});
|
|
93
89
|
it("inherits overrides from TextBlock, Paragraph and Run when there is no styleId", () => {
|
|
94
90
|
const textBlock = TextBlock.create({ styleOverrides: { widthFactor: 34, lineHeight: 3, lineSpacingFactor: 12, isBold: true } });
|
|
95
|
-
const paragraph = Paragraph.create({ styleOverrides: { lineHeight: 56, color: 0xff0000, frame: { shape: "octagon" } } });
|
|
96
91
|
const run = TextRun.create({ content: "test", styleOverrides: { widthFactor: 78, fontName: "override", leader: { wantElbow: true } } });
|
|
97
|
-
textBlock.
|
|
92
|
+
textBlock.appendParagraph({ styleOverrides: { lineHeight: 56, color: 0xff0000, frame: { shape: "octagon" } } });
|
|
98
93
|
textBlock.appendRun(run);
|
|
99
94
|
const tb = doLayout(textBlock, {
|
|
100
95
|
findTextStyle: findTextStyleImpl,
|
|
@@ -118,9 +113,8 @@ describe("layoutTextBlock", () => {
|
|
|
118
113
|
});
|
|
119
114
|
it("does not inherit overrides in TextBlock or Paragraph when Run has same propertied overriden - unless they are TextBlock specific settings", () => {
|
|
120
115
|
const textBlock = TextBlock.create({ styleOverrides: { widthFactor: 34, lineHeight: 3, lineSpacingFactor: 12, isBold: true } });
|
|
121
|
-
const paragraph = Paragraph.create({ styleOverrides: { lineHeight: 56, color: 0xff0000 } });
|
|
122
116
|
const run = TextRun.create({ content: "test", styleOverrides: { widthFactor: 78, lineHeight: 6, lineSpacingFactor: 24, fontName: "override", isBold: false } });
|
|
123
|
-
textBlock.
|
|
117
|
+
textBlock.appendParagraph({ styleOverrides: { lineHeight: 56, color: 0xff0000 } });
|
|
124
118
|
textBlock.appendRun(run);
|
|
125
119
|
const tb = doLayout(textBlock, {
|
|
126
120
|
textStyleId: "0x42",
|
|
@@ -142,9 +136,8 @@ describe("layoutTextBlock", () => {
|
|
|
142
136
|
it("takes child overrides over parent overrides", () => {
|
|
143
137
|
//...unless they are TextBlock specific as covered in other tests
|
|
144
138
|
const textBlock = TextBlock.create({ styleOverrides: { fontName: "grandparent" } });
|
|
145
|
-
const paragraph = Paragraph.create({ styleOverrides: { fontName: "parent" } });
|
|
146
139
|
const run = TextRun.create({ content: "test", styleOverrides: { fontName: "child" } });
|
|
147
|
-
textBlock.
|
|
140
|
+
textBlock.appendParagraph({ styleOverrides: { fontName: "parent" } });
|
|
148
141
|
textBlock.appendRun(run);
|
|
149
142
|
const tb = doLayout(textBlock, {
|
|
150
143
|
findTextStyle: findTextStyleImpl,
|
|
@@ -199,8 +192,6 @@ describe("layoutTextBlock", () => {
|
|
|
199
192
|
for (let i = 0; i < result.lines.length; i++) {
|
|
200
193
|
const resultLine = result.lines[i];
|
|
201
194
|
const originalLine = textBlockLayout.lines[i];
|
|
202
|
-
// Source paragraph index matches
|
|
203
|
-
expect(resultLine.sourceParagraphIndex).to.equal(textBlock.paragraphs.indexOf(originalLine.source));
|
|
204
195
|
// Ranges match
|
|
205
196
|
expect(resultLine.range).to.deep.equal(originalLine.range.toJSON());
|
|
206
197
|
expect(resultLine.justificationRange).to.deep.equal(originalLine.justificationRange.toJSON());
|
|
@@ -209,8 +200,6 @@ describe("layoutTextBlock", () => {
|
|
|
209
200
|
for (let j = 0; j < resultLine.runs.length; j++) {
|
|
210
201
|
const resultRun = resultLine.runs[j];
|
|
211
202
|
const originalRun = originalLine.runs[j];
|
|
212
|
-
// Source run index matches
|
|
213
|
-
expect(resultRun.sourceRunIndex).to.equal(textBlock.paragraphs[resultLine.sourceParagraphIndex].runs.indexOf(originalRun.source));
|
|
214
203
|
// FontId matches
|
|
215
204
|
expect(resultRun.fontId).to.equal(originalRun.fontId);
|
|
216
205
|
// Offsets match
|
|
@@ -250,7 +239,7 @@ describe("layoutTextBlock", () => {
|
|
|
250
239
|
expect(resultRun.denominatorRange).to.deep.equal(originalRun.denominatorRange.toJSON());
|
|
251
240
|
}
|
|
252
241
|
// Check that the result string matches what we expect
|
|
253
|
-
const inputRun =
|
|
242
|
+
const inputRun = originalRun.source;
|
|
254
243
|
if (inputRun.type === "text") {
|
|
255
244
|
const resultText = inputRun.content.substring(resultRun.characterOffset, resultRun.characterOffset + resultRun.characterCount);
|
|
256
245
|
const originalText = inputRun.content.substring(originalRun.charOffset, originalRun.charOffset + originalRun.numChars);
|
|
@@ -310,7 +299,9 @@ describe("layoutTextBlock", () => {
|
|
|
310
299
|
expect(round(textLayout.offsetFromLine.y, 3)).to.equal(.375);
|
|
311
300
|
});
|
|
312
301
|
it("produces one line per paragraph if document width <= 0", () => {
|
|
313
|
-
const
|
|
302
|
+
const lineSpacingFactor = 0.5;
|
|
303
|
+
const paragraphSpacingFactor = 0.25;
|
|
304
|
+
const textBlock = TextBlock.create({ styleOverrides: { paragraphSpacingFactor, lineSpacingFactor } });
|
|
314
305
|
for (let i = 0; i < 4; i++) {
|
|
315
306
|
const layout = doLayout(textBlock);
|
|
316
307
|
if (i === 0) {
|
|
@@ -319,7 +310,7 @@ describe("layoutTextBlock", () => {
|
|
|
319
310
|
else {
|
|
320
311
|
expect(layout.lines.length).to.equal(i);
|
|
321
312
|
expect(layout.range.low.x).to.equal(0);
|
|
322
|
-
expect(layout.range.low.y).to.equal(-i - (
|
|
313
|
+
expect(layout.range.low.y).to.equal(-i - ((i - 1) * (lineSpacingFactor + paragraphSpacingFactor)));
|
|
323
314
|
expect(layout.range.high.x).to.equal(i * 3);
|
|
324
315
|
expect(layout.range.high.y).to.equal(0);
|
|
325
316
|
}
|
|
@@ -341,7 +332,7 @@ describe("layoutTextBlock", () => {
|
|
|
341
332
|
}
|
|
342
333
|
const p = textBlock.appendParagraph();
|
|
343
334
|
for (let j = 0; j <= i; j++) {
|
|
344
|
-
p.
|
|
335
|
+
p.children.push(TextRun.create({ content: "Run" }));
|
|
345
336
|
}
|
|
346
337
|
}
|
|
347
338
|
});
|
|
@@ -363,6 +354,7 @@ describe("layoutTextBlock", () => {
|
|
|
363
354
|
expect(tb.range.low.x).to.equal(0);
|
|
364
355
|
expect(tb.range.high.x).to.equal(6);
|
|
365
356
|
expect(tb.range.high.y).to.equal(0);
|
|
357
|
+
// paragraphSpacingFactor should not be applied to linebreaks, but lineSpacingFactor should.
|
|
366
358
|
expect(tb.range.low.y).to.equal(-(lineSpacingFactor * 2 + lineHeight * 3));
|
|
367
359
|
});
|
|
368
360
|
it("applies tab shifts", () => {
|
|
@@ -379,15 +371,15 @@ describe("layoutTextBlock", () => {
|
|
|
379
371
|
if (wantLineBreak)
|
|
380
372
|
textBlock.appendRun(LineBreakRun.create());
|
|
381
373
|
};
|
|
382
|
-
// The extra
|
|
383
|
-
appendLine("", "a");
|
|
384
|
-
appendLine("", "bc");
|
|
385
|
-
appendLine("a", "a");
|
|
386
|
-
appendLine("bc", "bc");
|
|
387
|
-
appendLine("cde", "cde");
|
|
388
|
-
appendLine("cdefg", "cde"); // this one is the max tab distance before needing to move to the next tab stop
|
|
389
|
-
appendLine("cdefgh", "cde"); // This one should push to the next tab stop.
|
|
390
|
-
appendLine("cdefghi", "cde", false); // This one should push to the next tab stop.
|
|
374
|
+
// The extra comments are intentional to show where the tab stops should be.
|
|
375
|
+
appendLine("", /*______*/ "a");
|
|
376
|
+
appendLine("", /*______*/ "bc");
|
|
377
|
+
appendLine("a", /*_____*/ "a");
|
|
378
|
+
appendLine("bc", /*____*/ "bc");
|
|
379
|
+
appendLine("cde", /*___*/ "cde");
|
|
380
|
+
appendLine("cdefg", /*_*/ "cde"); // this one is the max tab distance before needing to move to the next tab stop
|
|
381
|
+
appendLine("cdefgh", /*______*/ "cde"); // This one should push to the next tab stop.
|
|
382
|
+
appendLine("cdefghi", /*_____*/ "cde", false); // This one should push to the next tab stop.
|
|
391
383
|
const tb = doLayout(textBlock);
|
|
392
384
|
tb.lines.forEach((line, index) => {
|
|
393
385
|
const firstTextRun = (line.runs[0].source.type === "text") ? line.runs[0] : undefined;
|
|
@@ -431,7 +423,7 @@ describe("layoutTextBlock", () => {
|
|
|
431
423
|
const line2 = tb.lines[2];
|
|
432
424
|
const line3 = tb.lines[3];
|
|
433
425
|
expect(line0.runs.length).to.equal(4);
|
|
434
|
-
expect(line0.range.xLength()).to.equal(3 * tabInterval, `Lines with
|
|
426
|
+
expect(line0.range.xLength()).to.equal(3 * tabInterval, `Lines with tabs should have the correct range length`);
|
|
435
427
|
expect(line1.runs.length).to.equal(4);
|
|
436
428
|
expect(line1.range.xLength()).to.equal(2 * tabInterval, `Tabs should be applied correctly when they are at the end of a line`);
|
|
437
429
|
expect(line2.runs.length).to.equal(5);
|
|
@@ -439,10 +431,12 @@ describe("layoutTextBlock", () => {
|
|
|
439
431
|
expect(line3.runs.length).to.equal(7);
|
|
440
432
|
expect(line3.range.xLength()).to.equal(7 + 3 + 7, `Multiple tabs with different intervals should be applied correctly`);
|
|
441
433
|
});
|
|
442
|
-
it("computes ranges based on custom line spacing
|
|
434
|
+
it("computes ranges based on custom line spacing, line height, and indentation", () => {
|
|
443
435
|
const lineSpacingFactor = 2;
|
|
444
436
|
const lineHeight = 3;
|
|
445
|
-
const
|
|
437
|
+
const paragraphSpacingFactor = 13;
|
|
438
|
+
const indentation = 7;
|
|
439
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, lineHeight, paragraphSpacingFactor, indentation } });
|
|
446
440
|
textBlock.appendRun(TextRun.create({ content: "abc" }));
|
|
447
441
|
textBlock.appendRun(LineBreakRun.create());
|
|
448
442
|
textBlock.appendRun(TextRun.create({ content: "def" }));
|
|
@@ -454,15 +448,85 @@ describe("layoutTextBlock", () => {
|
|
|
454
448
|
expect(tb.lines[0].runs.length).to.equal(2);
|
|
455
449
|
expect(tb.lines[1].runs.length).to.equal(3);
|
|
456
450
|
expect(tb.lines[2].runs.length).to.equal(1);
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
451
|
+
/* Final TextBlock should look like:
|
|
452
|
+
⇥abc↵
|
|
453
|
+
⇥defghi↵
|
|
454
|
+
⇥jkl
|
|
455
|
+
|
|
456
|
+
Where ↵ = LineBreak, ¶ = ParagraphBreak, ⇥ = indentation
|
|
457
|
+
|
|
458
|
+
We have 3 lines each `lineHeight` high, plus 2 line breaks in between each `lineHeight*lineSpacingFactor` high.
|
|
459
|
+
No paragraph spacing should be applied since there is one paragraph.
|
|
460
|
+
*/
|
|
461
|
+
expect(tb.range.low.x).to.equal(7);
|
|
462
|
+
expect(tb.range.high.x).to.equal(6 + 7); // 7 for indentation, 6 for the length of "defghi"
|
|
460
463
|
expect(tb.range.high.y).to.equal(0);
|
|
461
464
|
expect(tb.range.low.y).to.equal(-(lineHeight * 3 + (lineHeight * lineSpacingFactor) * 2));
|
|
462
465
|
expect(tb.lines[0].offsetFromDocument.y).to.equal(-lineHeight);
|
|
463
466
|
expect(tb.lines[1].offsetFromDocument.y).to.equal(tb.lines[0].offsetFromDocument.y - (lineHeight + lineHeight * lineSpacingFactor));
|
|
464
467
|
expect(tb.lines[2].offsetFromDocument.y).to.equal(tb.lines[1].offsetFromDocument.y - (lineHeight + lineHeight * lineSpacingFactor));
|
|
465
|
-
|
|
468
|
+
tb.lines.forEach((line) => expect(line.offsetFromDocument.x).to.equal(7));
|
|
469
|
+
});
|
|
470
|
+
it("computes paragraph spacing and indentation", () => {
|
|
471
|
+
const lineSpacingFactor = 2;
|
|
472
|
+
const lineHeight = 3;
|
|
473
|
+
const paragraphSpacingFactor = 13;
|
|
474
|
+
const indentation = 7;
|
|
475
|
+
const tabInterval = 5;
|
|
476
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, lineHeight, paragraphSpacingFactor, indentation, tabInterval } });
|
|
477
|
+
const p1 = textBlock.appendParagraph();
|
|
478
|
+
p1.children.push(TextRun.create({ content: "abc" })); // Line 1
|
|
479
|
+
p1.children.push(LineBreakRun.create());
|
|
480
|
+
p1.children.push(TextRun.create({ content: "def" })); // Line 2
|
|
481
|
+
const p2 = textBlock.appendParagraph();
|
|
482
|
+
p2.children.push(TextRun.create({ content: "ghi" })); // Line 3
|
|
483
|
+
const list = List.create();
|
|
484
|
+
list.children.push(Paragraph.create({ children: [{ type: "text", content: "list item 1" }] })); // Line 4
|
|
485
|
+
list.children.push(Paragraph.create({ children: [{ type: "text", content: "list item 2" }] })); // Line 5
|
|
486
|
+
list.children.push(Paragraph.create({ children: [{ type: "text", content: "list item 3" }] })); // Line 6
|
|
487
|
+
p2.children.push(list);
|
|
488
|
+
const tb = doLayout(textBlock);
|
|
489
|
+
expect(tb.lines.length).to.equal(6);
|
|
490
|
+
/* Final TextBlock should look like:
|
|
491
|
+
⇥abc↵
|
|
492
|
+
⇥def¶
|
|
493
|
+
⇥ghi¶
|
|
494
|
+
⇥→1. list item 1¶
|
|
495
|
+
⇥→2. list item 2¶
|
|
496
|
+
⇥→3. list item 3
|
|
497
|
+
|
|
498
|
+
Where ↵ = LineBreak, ¶ = ParagraphBreak, → = tabInterval/2, ⇥ = indentation
|
|
499
|
+
|
|
500
|
+
We have:
|
|
501
|
+
6 lines each `lineHeight` high
|
|
502
|
+
5 line breaks in between each `lineHeight*lineSpacingFactor` high
|
|
503
|
+
4 paragraph breaks in between each `lineHeight*paragraphSpacingFactor` high
|
|
504
|
+
*/
|
|
505
|
+
expect(tb.range.low.x).to.equal(7); // 7 for indentation
|
|
506
|
+
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
|
+
expect(tb.range.high.y).to.equal(0);
|
|
508
|
+
expect(tb.range.low.y).to.equal(-(lineHeight * 6 + (lineHeight * lineSpacingFactor) * 5 + (lineHeight * paragraphSpacingFactor) * 4));
|
|
509
|
+
// Cumulative vertical offsets to help make the test more readable.
|
|
510
|
+
let offsetY = -lineHeight;
|
|
511
|
+
let offsetX = indentation;
|
|
512
|
+
expect(tb.lines[0].offsetFromDocument.y).to.equal(offsetY);
|
|
513
|
+
expect(tb.lines[0].offsetFromDocument.x).to.equal(offsetX);
|
|
514
|
+
offsetY -= (lineHeight + lineHeight * lineSpacingFactor);
|
|
515
|
+
expect(tb.lines[1].offsetFromDocument.y).to.equal(offsetY);
|
|
516
|
+
expect(tb.lines[1].offsetFromDocument.x).to.equal(offsetX);
|
|
517
|
+
offsetY -= (lineHeight + lineHeight * lineSpacingFactor + lineHeight * paragraphSpacingFactor);
|
|
518
|
+
expect(tb.lines[2].offsetFromDocument.y).to.equal(offsetY);
|
|
519
|
+
expect(tb.lines[2].offsetFromDocument.x).to.equal(offsetX);
|
|
520
|
+
offsetX += tabInterval; // List items are indented using tabInterval.
|
|
521
|
+
offsetY -= (lineHeight + lineHeight * lineSpacingFactor + lineHeight * paragraphSpacingFactor);
|
|
522
|
+
expect(tb.lines[3].offsetFromDocument.y).to.equal(offsetY);
|
|
523
|
+
expect(tb.lines[3].offsetFromDocument.x).to.equal(offsetX);
|
|
524
|
+
offsetY -= (lineHeight + lineHeight * lineSpacingFactor + lineHeight * paragraphSpacingFactor);
|
|
525
|
+
expect(tb.lines[4].offsetFromDocument.y).to.equal(offsetY);
|
|
526
|
+
expect(tb.lines[4].offsetFromDocument.x).to.equal(offsetX);
|
|
527
|
+
offsetY -= (lineHeight + lineHeight * lineSpacingFactor + lineHeight * paragraphSpacingFactor);
|
|
528
|
+
expect(tb.lines[5].offsetFromDocument.y).to.equal(offsetY);
|
|
529
|
+
expect(tb.lines[5].offsetFromDocument.x).to.equal(offsetX);
|
|
466
530
|
});
|
|
467
531
|
function expectRange(width, height, range) {
|
|
468
532
|
expect(range.xLength()).to.equal(width);
|
|
@@ -509,6 +573,140 @@ describe("layoutTextBlock", () => {
|
|
|
509
573
|
block.width = 10;
|
|
510
574
|
expectBlockRange(10, 2);
|
|
511
575
|
});
|
|
576
|
+
it("computes range for list markers and list items based on indentation", function () {
|
|
577
|
+
const lineSpacingFactor = 2;
|
|
578
|
+
const lineHeight = 3;
|
|
579
|
+
const paragraphSpacingFactor = 13;
|
|
580
|
+
const indentation = 7;
|
|
581
|
+
const tabInterval = 5;
|
|
582
|
+
const listChildren = [
|
|
583
|
+
{
|
|
584
|
+
children: [
|
|
585
|
+
{
|
|
586
|
+
type: "text",
|
|
587
|
+
content: "Oranges",
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
children: [
|
|
593
|
+
{
|
|
594
|
+
type: "text",
|
|
595
|
+
content: "Apples",
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
type: "list",
|
|
599
|
+
styleOverrides: { listMarker: { enumerator: ListMarkerEnumerator.Bullet } },
|
|
600
|
+
children: [
|
|
601
|
+
{
|
|
602
|
+
children: [
|
|
603
|
+
{
|
|
604
|
+
type: "text",
|
|
605
|
+
content: "Red",
|
|
606
|
+
}
|
|
607
|
+
]
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
children: [
|
|
611
|
+
{
|
|
612
|
+
type: "text",
|
|
613
|
+
content: "Green",
|
|
614
|
+
},
|
|
615
|
+
{
|
|
616
|
+
type: "list",
|
|
617
|
+
styleOverrides: { listMarker: { enumerator: ListMarkerEnumerator.RomanNumeral, case: "lower", terminator: "period" } },
|
|
618
|
+
children: [
|
|
619
|
+
{
|
|
620
|
+
children: [
|
|
621
|
+
{
|
|
622
|
+
type: "text",
|
|
623
|
+
content: "Granny Smith",
|
|
624
|
+
}
|
|
625
|
+
]
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
children: [
|
|
629
|
+
{
|
|
630
|
+
type: "text",
|
|
631
|
+
content: "Rhode Island Greening",
|
|
632
|
+
}
|
|
633
|
+
]
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
children: [
|
|
641
|
+
{
|
|
642
|
+
type: "text",
|
|
643
|
+
content: "Yellow",
|
|
644
|
+
}
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
]
|
|
648
|
+
}
|
|
649
|
+
]
|
|
650
|
+
}
|
|
651
|
+
];
|
|
652
|
+
const textBlock = TextBlock.create({ styleOverrides: { lineSpacingFactor, lineHeight, paragraphSpacingFactor, indentation, tabInterval } });
|
|
653
|
+
const p1 = textBlock.appendParagraph();
|
|
654
|
+
p1.children.push(List.create({ children: listChildren }));
|
|
655
|
+
/* Final TextBlock should look like:
|
|
656
|
+
→1.→Oranges¶
|
|
657
|
+
→2.→Apples¶
|
|
658
|
+
→→•→Red¶
|
|
659
|
+
→→•→Green¶
|
|
660
|
+
→ →→i. →Granny Smith¶
|
|
661
|
+
→ →→ii.→Rhode Island Greening¶
|
|
662
|
+
→→•→Yellow
|
|
663
|
+
|
|
664
|
+
Where ↵ = LineBreak, ¶ = ParagraphBreak, → = tab, → = tabInterval/2, ⇥ = indentation
|
|
665
|
+
|
|
666
|
+
We have:
|
|
667
|
+
7 lines each `lineHeight` high
|
|
668
|
+
6 line breaks in between each `lineHeight*lineSpacingFactor` high
|
|
669
|
+
6 paragraph breaks in between each `lineHeight*paragraphSpacingFactor` high
|
|
670
|
+
*/
|
|
671
|
+
const tb = doLayout(textBlock);
|
|
672
|
+
expect(tb.lines.length).to.equal(7);
|
|
673
|
+
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
|
+
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
|
+
expect(tb.range.high.y).to.equal(0);
|
|
676
|
+
expect(tb.range.low.y).to.equal(-(lineHeight * 7 + (lineHeight * lineSpacingFactor) * 6 + (lineHeight * paragraphSpacingFactor) * 6));
|
|
677
|
+
// Cumulative vertical offsets to help make the test more readable.
|
|
678
|
+
let offsetY = -lineHeight;
|
|
679
|
+
for (const line of tb.lines) {
|
|
680
|
+
expect(line.offsetFromDocument.y).to.equal(offsetY);
|
|
681
|
+
expect(line.marker).to.not.be.undefined;
|
|
682
|
+
expect(line.marker?.offsetFromLine.y).to.equal((lineHeight - line.marker.range.yLength()) / 2);
|
|
683
|
+
offsetY -= (lineHeight + lineHeight * lineSpacingFactor + lineHeight * paragraphSpacingFactor);
|
|
684
|
+
}
|
|
685
|
+
let markerXLength = tb.lines[0].marker.range.xLength();
|
|
686
|
+
let inset = indentation + tabInterval;
|
|
687
|
+
expect(tb.lines[0].offsetFromDocument.x).to.equal(inset); // →Oranges
|
|
688
|
+
expect(markerXLength).to.equal(2); // "1." is 2 characters wide
|
|
689
|
+
expect(tb.lines[0].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
690
|
+
markerXLength = tb.lines[1].marker.range.xLength();
|
|
691
|
+
expect(tb.lines[1].offsetFromDocument.x).to.equal(inset); // →Apples
|
|
692
|
+
expect(tb.lines[1].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
693
|
+
markerXLength = tb.lines[2].marker.range.xLength();
|
|
694
|
+
inset = indentation + tabInterval * 2;
|
|
695
|
+
expect(tb.lines[2].offsetFromDocument.x).to.equal(indentation + tabInterval * 2); // →→Red
|
|
696
|
+
expect(tb.lines[2].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
697
|
+
markerXLength = tb.lines[3].marker.range.xLength();
|
|
698
|
+
expect(tb.lines[3].offsetFromDocument.x).to.equal(indentation + tabInterval * 2); // →→Green
|
|
699
|
+
expect(tb.lines[3].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
700
|
+
markerXLength = tb.lines[4].marker.range.xLength();
|
|
701
|
+
expect(tb.lines[4].offsetFromDocument.x).to.equal(indentation + tabInterval * 3); // →→→Granny Smith
|
|
702
|
+
expect(tb.lines[4].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
703
|
+
markerXLength = tb.lines[5].marker.range.xLength();
|
|
704
|
+
expect(tb.lines[5].offsetFromDocument.x).to.equal(indentation + tabInterval * 3); // →→→Rhode Island Greening
|
|
705
|
+
expect(tb.lines[5].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
706
|
+
markerXLength = tb.lines[6].marker.range.xLength();
|
|
707
|
+
expect(tb.lines[6].offsetFromDocument.x).to.equal(indentation + tabInterval * 2); // →→Yellow
|
|
708
|
+
expect(tb.lines[6].marker.offsetFromLine.x).to.equal(0 - markerXLength - (tabInterval / 2));
|
|
709
|
+
});
|
|
512
710
|
it("justifies lines", function () {
|
|
513
711
|
if (!isIntlSupported()) {
|
|
514
712
|
this.skip();
|
|
@@ -587,12 +785,13 @@ describe("layoutTextBlock", () => {
|
|
|
587
785
|
});
|
|
588
786
|
describe("word-wrapping", () => {
|
|
589
787
|
function expectLines(input, width, expectedLines) {
|
|
590
|
-
const textBlock = TextBlock.create();
|
|
788
|
+
const textBlock = TextBlock.create({ styleOverrides: { paragraphSpacingFactor: 0, lineSpacingFactor: 0, lineHeight: 1 } });
|
|
591
789
|
textBlock.width = width;
|
|
592
790
|
const run = makeTextRun(input);
|
|
593
791
|
textBlock.appendRun(run);
|
|
594
792
|
const layout = doLayout(textBlock);
|
|
595
|
-
|
|
793
|
+
const content = run.stringify();
|
|
794
|
+
expect(layout.lines.every((line) => line.runs.every((r) => r.source.stringify() === content))).to.be.true;
|
|
596
795
|
const actual = layout.lines.map((line) => line.runs.map((runLayout) => runLayout.source.content.substring(runLayout.charOffset, runLayout.charOffset + runLayout.numChars)).join(""));
|
|
597
796
|
expect(actual).to.deep.equal(expectedLines);
|
|
598
797
|
return layout;
|
|
@@ -854,6 +1053,56 @@ describe("layoutTextBlock", () => {
|
|
|
854
1053
|
const layout2 = doLayout(block);
|
|
855
1054
|
expect(layout2.range.yLength()).to.equal(1);
|
|
856
1055
|
});
|
|
1056
|
+
it("wraps list items and applies indentation/insets for narrow text block width", function () {
|
|
1057
|
+
if (!isIntlSupported()) {
|
|
1058
|
+
this.skip();
|
|
1059
|
+
}
|
|
1060
|
+
const textBlock = TextBlock.create({ styleOverrides: { indentation: 2, tabInterval: 3, lineHeight: 1, lineSpacingFactor: 0, paragraphSpacingFactor: 0 } });
|
|
1061
|
+
/* Final TextBlock should look like:
|
|
1062
|
+
⇥→1.→Lorem ipsum dolor sit amet, consectetur adipiscing elit¶ | Inset by 5
|
|
1063
|
+
⇥→2.→sed do¶ | Inset by 5
|
|
1064
|
+
⇥→→a.→eiusmod tempor¶ | Inset by 8
|
|
1065
|
+
⇥→→b.→incididunt ut labore et dolore magna aliqua | Inset by 8
|
|
1066
|
+
|
|
1067
|
+
Where ↵ = LineBreak, ¶ = ParagraphBreak, → = tab, → = tabInterval/2, ⇥ = indentation
|
|
1068
|
+
*/
|
|
1069
|
+
// Create nested list structure
|
|
1070
|
+
const list = List.create();
|
|
1071
|
+
list.children.push(Paragraph.create({ children: [TextRun.create({ content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit" })] }));
|
|
1072
|
+
const apples = Paragraph.create({ children: [TextRun.create({ content: "sed do" })] });
|
|
1073
|
+
const subList = List.create({ styleOverrides: { listMarker: { enumerator: ListMarkerEnumerator.Letter, case: "lower", terminator: "period" } } });
|
|
1074
|
+
subList.children.push(Paragraph.create({ children: [TextRun.create({ content: "eiusmod tempor" })] }));
|
|
1075
|
+
subList.children.push(Paragraph.create({ children: [TextRun.create({ content: "incididunt ut labore et dolore magna aliqua" })] }));
|
|
1076
|
+
apples.children.push(subList);
|
|
1077
|
+
list.children.push(apples);
|
|
1078
|
+
textBlock.appendParagraph().children.push(list);
|
|
1079
|
+
function expectLayout(width, expected) {
|
|
1080
|
+
textBlock.width = width;
|
|
1081
|
+
const layout = doLayout(textBlock);
|
|
1082
|
+
// Check that each line is wrapped to width
|
|
1083
|
+
const minWidth = Math.max(19, width); // 19 for the width of the longest word with inset: "⇥→→b.→incididunt "
|
|
1084
|
+
if (width > 0) {
|
|
1085
|
+
layout.lines.forEach((line) => {
|
|
1086
|
+
expect(line.justificationRange.xLength() + line.offsetFromDocument.x).to.be.at.most(minWidth);
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
expect(layout.stringify()).to.equal(expected);
|
|
1090
|
+
// Top-level items should have indentation + tabInterval
|
|
1091
|
+
let inset = 2 + 3;
|
|
1092
|
+
layout.lines.forEach((line) => {
|
|
1093
|
+
if (line.stringify().includes("eiusmod"))
|
|
1094
|
+
inset += 3; // SubList items should have increased indentation
|
|
1095
|
+
expect(line.offsetFromDocument.x).to.equal(inset);
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
// Check indentation/insets for each line, indentation: 2, tabInterval: 5
|
|
1099
|
+
expectLayout(0, "Lorem ipsum dolor sit amet, consectetur adipiscing elit\nsed do\neiusmod tempor\nincididunt ut labore et dolore magna aliqua");
|
|
1100
|
+
expectLayout(70, "Lorem ipsum dolor sit amet, consectetur adipiscing elit\nsed do\neiusmod tempor\nincididunt ut labore et dolore magna aliqua");
|
|
1101
|
+
expectLayout(40, "Lorem ipsum dolor sit amet, \nconsectetur adipiscing elit\nsed do\neiusmod tempor\nincididunt ut labore et dolore \nmagna aliqua");
|
|
1102
|
+
// TODO: layout should not pay attention to trailing whitespace when wrapping. I'll do this in another PR.
|
|
1103
|
+
expectLayout(21, "Lorem ipsum \ndolor sit amet, \nconsectetur \nadipiscing elit\nsed do\neiusmod \ntempor\nincididunt \nut labore et \ndolore magna \naliqua");
|
|
1104
|
+
expectLayout(15, "Lorem \nipsum \ndolor sit \namet, \nconsectetur \nadipiscing \nelit\nsed do\neiusmod \ntempor\nincididunt \nut \nlabore \net \ndolore \nmagna \naliqua");
|
|
1105
|
+
});
|
|
857
1106
|
});
|
|
858
1107
|
describe("grapheme offsets", () => {
|
|
859
1108
|
function getLayoutResultAndStyleResolver(textBlock) {
|
|
@@ -872,13 +1121,13 @@ describe("layoutTextBlock", () => {
|
|
|
872
1121
|
const fractionRun = FractionRun.create({ numerator: "1", denominator: "2" });
|
|
873
1122
|
textBlock.appendRun(fractionRun);
|
|
874
1123
|
const { textStyleResolver, result } = getLayoutResultAndStyleResolver(textBlock);
|
|
1124
|
+
const source = textBlock.children[0]; // FractionRun is not a TextRun
|
|
875
1125
|
const args = {
|
|
876
|
-
|
|
1126
|
+
source,
|
|
877
1127
|
iModel: {},
|
|
878
1128
|
textStyleResolver,
|
|
879
1129
|
findFontId: () => 0,
|
|
880
1130
|
computeTextRange: computeTextRangeAsStringLength,
|
|
881
|
-
paragraphIndex: result.lines[0].sourceParagraphIndex,
|
|
882
1131
|
runLayoutResult: result.lines[0].runs[0],
|
|
883
1132
|
graphemeCharIndexes: [0],
|
|
884
1133
|
};
|
|
@@ -890,13 +1139,13 @@ describe("layoutTextBlock", () => {
|
|
|
890
1139
|
const textRun = TextRun.create({ content: "" });
|
|
891
1140
|
textBlock.appendRun(textRun);
|
|
892
1141
|
const { textStyleResolver, result } = getLayoutResultAndStyleResolver(textBlock);
|
|
1142
|
+
const source = textBlock.children[0]; // FractionRun is not a TextRun
|
|
893
1143
|
const args = {
|
|
894
|
-
|
|
1144
|
+
source,
|
|
895
1145
|
iModel: {},
|
|
896
1146
|
textStyleResolver,
|
|
897
1147
|
findFontId: () => 0,
|
|
898
1148
|
computeTextRange: computeTextRangeAsStringLength,
|
|
899
|
-
paragraphIndex: result.lines[0].sourceParagraphIndex,
|
|
900
1149
|
runLayoutResult: result.lines[0].runs[0],
|
|
901
1150
|
graphemeCharIndexes: [0], // Supply a grapheme index even though there is no text
|
|
902
1151
|
};
|
|
@@ -908,13 +1157,13 @@ describe("layoutTextBlock", () => {
|
|
|
908
1157
|
const textRun = TextRun.create({ content: "hello" });
|
|
909
1158
|
textBlock.appendRun(textRun);
|
|
910
1159
|
const { textStyleResolver, result } = getLayoutResultAndStyleResolver(textBlock);
|
|
1160
|
+
const source = textBlock.children[0].children[0];
|
|
911
1161
|
const args = {
|
|
912
|
-
|
|
1162
|
+
source,
|
|
913
1163
|
iModel: {},
|
|
914
1164
|
textStyleResolver,
|
|
915
1165
|
findFontId: () => 0,
|
|
916
1166
|
computeTextRange: computeTextRangeAsStringLength,
|
|
917
|
-
paragraphIndex: result.lines[0].sourceParagraphIndex,
|
|
918
1167
|
runLayoutResult: result.lines[0].runs[0],
|
|
919
1168
|
graphemeCharIndexes: [0, 1, 2, 3, 4],
|
|
920
1169
|
};
|
|
@@ -929,13 +1178,13 @@ describe("layoutTextBlock", () => {
|
|
|
929
1178
|
const textRun = TextRun.create({ content: "अनुच्छेद" });
|
|
930
1179
|
textBlock.appendRun(textRun);
|
|
931
1180
|
const { textStyleResolver, result } = getLayoutResultAndStyleResolver(textBlock);
|
|
1181
|
+
const source = textBlock.children[0].children[0];
|
|
932
1182
|
const args = {
|
|
933
|
-
|
|
1183
|
+
source,
|
|
934
1184
|
iModel: {},
|
|
935
1185
|
textStyleResolver,
|
|
936
1186
|
findFontId: () => 0,
|
|
937
1187
|
computeTextRange: computeTextRangeAsStringLength,
|
|
938
|
-
paragraphIndex: result.lines[0].sourceParagraphIndex,
|
|
939
1188
|
runLayoutResult: result.lines[0].runs[0],
|
|
940
1189
|
graphemeCharIndexes: [0, 1, 3, 7],
|
|
941
1190
|
};
|
|
@@ -951,13 +1200,13 @@ describe("layoutTextBlock", () => {
|
|
|
951
1200
|
const textRun = TextRun.create({ content: "👨👦" });
|
|
952
1201
|
textBlock.appendRun(textRun);
|
|
953
1202
|
const { textStyleResolver, result } = getLayoutResultAndStyleResolver(textBlock);
|
|
1203
|
+
const source = textBlock.children[0].children[0];
|
|
954
1204
|
const args = {
|
|
955
|
-
|
|
1205
|
+
source,
|
|
956
1206
|
iModel: {},
|
|
957
1207
|
textStyleResolver,
|
|
958
1208
|
findFontId: () => 0,
|
|
959
1209
|
computeTextRange: computeTextRangeAsStringLength,
|
|
960
|
-
paragraphIndex: result.lines[0].sourceParagraphIndex,
|
|
961
1210
|
runLayoutResult: result.lines[0].runs[0],
|
|
962
1211
|
graphemeCharIndexes: [0],
|
|
963
1212
|
};
|
|
@@ -1101,10 +1350,18 @@ describe("produceTextBlockGeometry", () => {
|
|
|
1101
1350
|
const layout = doLayout(block);
|
|
1102
1351
|
return produceTextBlockGeometry(layout, annotation.computeTransform(layout.range)).entries;
|
|
1103
1352
|
}
|
|
1353
|
+
function makeListGeometry(children) {
|
|
1354
|
+
const textBlock = TextBlock.create();
|
|
1355
|
+
const p1 = textBlock.appendParagraph();
|
|
1356
|
+
p1.children.push(List.create({ children }));
|
|
1357
|
+
const annotation = TextAnnotation.fromJSON({ textBlock: textBlock.toJSON() });
|
|
1358
|
+
const layout = doLayout(textBlock);
|
|
1359
|
+
return produceTextBlockGeometry(layout, annotation.computeTransform(layout.range)).entries;
|
|
1360
|
+
}
|
|
1104
1361
|
it("produces an empty array for an empty text block", () => {
|
|
1105
1362
|
expect(makeGeometry([])).to.deep.equal([]);
|
|
1106
1363
|
});
|
|
1107
|
-
it("produces an empty array for a block consisting
|
|
1364
|
+
it("produces an empty array for a block consisting of line breaks", () => {
|
|
1108
1365
|
expect(makeGeometry([makeBreak(), makeBreak(), makeBreak()])).to.deep.equal([]);
|
|
1109
1366
|
});
|
|
1110
1367
|
it("produces one appearance entry if all runs use subcategory color", () => {
|
|
@@ -1157,6 +1414,112 @@ describe("produceTextBlockGeometry", () => {
|
|
|
1157
1414
|
"text",
|
|
1158
1415
|
]);
|
|
1159
1416
|
});
|
|
1417
|
+
it("produces entries for list markers", () => {
|
|
1418
|
+
/* Final TextBlock should look like:
|
|
1419
|
+
1. Oranges // Oranges -> default "subcategory" text
|
|
1420
|
+
2. Apples // Apples -> Switch to red text
|
|
1421
|
+
• Red
|
|
1422
|
+
• Green // Green -> Switch to green text, not including the bullet.
|
|
1423
|
+
i. Granny Smith
|
|
1424
|
+
ii. Rhode Island Greening
|
|
1425
|
+
• Yellow // Yellow -> Back to red text
|
|
1426
|
+
|
|
1427
|
+
We have:
|
|
1428
|
+
7 lines each containing one TextString for the list marker and one for the text,
|
|
1429
|
+
4 appearance overrides
|
|
1430
|
+
*/
|
|
1431
|
+
const listChildren = [
|
|
1432
|
+
{
|
|
1433
|
+
children: [
|
|
1434
|
+
{
|
|
1435
|
+
type: "text",
|
|
1436
|
+
content: "Oranges",
|
|
1437
|
+
}
|
|
1438
|
+
]
|
|
1439
|
+
},
|
|
1440
|
+
{
|
|
1441
|
+
children: [
|
|
1442
|
+
{
|
|
1443
|
+
type: "text",
|
|
1444
|
+
content: "Apples",
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
type: "list",
|
|
1448
|
+
styleOverrides: { listMarker: { enumerator: ListMarkerEnumerator.Bullet }, color: ColorDef.red.tbgr },
|
|
1449
|
+
children: [
|
|
1450
|
+
{
|
|
1451
|
+
children: [
|
|
1452
|
+
{
|
|
1453
|
+
type: "text",
|
|
1454
|
+
content: "Red",
|
|
1455
|
+
}
|
|
1456
|
+
]
|
|
1457
|
+
},
|
|
1458
|
+
{
|
|
1459
|
+
styleOverrides: { color: ColorDef.green.tbgr },
|
|
1460
|
+
children: [
|
|
1461
|
+
{
|
|
1462
|
+
type: "text",
|
|
1463
|
+
content: "Green",
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
type: "list",
|
|
1467
|
+
styleOverrides: { listMarker: { enumerator: ListMarkerEnumerator.RomanNumeral, case: "lower", terminator: "period" } },
|
|
1468
|
+
children: [
|
|
1469
|
+
{
|
|
1470
|
+
children: [
|
|
1471
|
+
{
|
|
1472
|
+
type: "text",
|
|
1473
|
+
content: "Granny Smith",
|
|
1474
|
+
}
|
|
1475
|
+
]
|
|
1476
|
+
},
|
|
1477
|
+
{
|
|
1478
|
+
children: [
|
|
1479
|
+
{
|
|
1480
|
+
type: "text",
|
|
1481
|
+
content: "Rhode Island Greening",
|
|
1482
|
+
}
|
|
1483
|
+
]
|
|
1484
|
+
}
|
|
1485
|
+
]
|
|
1486
|
+
}
|
|
1487
|
+
]
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
children: [
|
|
1491
|
+
{
|
|
1492
|
+
type: "text",
|
|
1493
|
+
content: "Yellow",
|
|
1494
|
+
}
|
|
1495
|
+
]
|
|
1496
|
+
}
|
|
1497
|
+
]
|
|
1498
|
+
}
|
|
1499
|
+
]
|
|
1500
|
+
}
|
|
1501
|
+
];
|
|
1502
|
+
const entries = makeListGeometry(listChildren);
|
|
1503
|
+
expect(entries.length).to.equal(14 + 4); // 14 text strings + 4 appearance entry
|
|
1504
|
+
expect(entries[0].color).to.equal("subcategory");
|
|
1505
|
+
expect(entries[1].text?.text).to.equal("1.");
|
|
1506
|
+
expect(entries[2].text?.text).to.equal("Oranges");
|
|
1507
|
+
expect(entries[3].text?.text).to.equal("2.");
|
|
1508
|
+
expect(entries[4].text?.text).to.equal("Apples");
|
|
1509
|
+
expect(entries[5].color).to.equal(ColorDef.red.tbgr);
|
|
1510
|
+
expect(entries[6].text?.text).to.equal("•");
|
|
1511
|
+
expect(entries[7].text?.text).to.equal("Red");
|
|
1512
|
+
expect(entries[8].text?.text).to.equal("•");
|
|
1513
|
+
expect(entries[9].color).to.equal(ColorDef.green.tbgr);
|
|
1514
|
+
expect(entries[10].text?.text).to.equal("Green");
|
|
1515
|
+
expect(entries[11].text?.text).to.equal("i.");
|
|
1516
|
+
expect(entries[12].text?.text).to.equal("Granny Smith");
|
|
1517
|
+
expect(entries[13].text?.text).to.equal("ii.");
|
|
1518
|
+
expect(entries[14].text?.text).to.equal("Rhode Island Greening");
|
|
1519
|
+
expect(entries[15].color).to.equal(ColorDef.red.tbgr);
|
|
1520
|
+
expect(entries[16].text?.text).to.equal("•");
|
|
1521
|
+
expect(entries[17].text?.text).to.equal("Yellow");
|
|
1522
|
+
});
|
|
1160
1523
|
it("offsets geometry entries by margins", () => {
|
|
1161
1524
|
function makeGeometryWithMargins(anchor, margins) {
|
|
1162
1525
|
const runs = [makeText()];
|
|
@@ -1199,5 +1562,5 @@ describe("produceTextBlockGeometry", () => {
|
|
|
1199
1562
|
});
|
|
1200
1563
|
});
|
|
1201
1564
|
// Ignoring the text strings from the spell checker
|
|
1202
|
-
// cspell:ignore jklmnop vwxyz defg hijk ghij klmno pqrstu Tanuki aabb eeff nggg amet adipiscing elit Phasellus pretium malesuada venenatis eleifend Donec sapien Nullam commodo accumsan lacinia metus enim pharetra lacus facilisis Duis suscipit quis feugiat fermentum ut augue Mauris iaculis odio rhoncus lorem viverra turpis elementum posuere Consolas अनुच्छेद cdefg cdefgh cdefghi
|
|
1565
|
+
// cspell:ignore jklmnop vwxyz defg hijk ghij klmno pqrstu Tanuki aabb eeff nggg amet adipiscing elit Phasellus pretium malesuada venenatis eleifend Donec sapien Nullam commodo accumsan lacinia metus enim pharetra lacus facilisis Duis suscipit quis feugiat fermentum ut augue Mauris iaculis odio rhoncus lorem viverra turpis elementum posuere Consolas अनुच्छेद cdefg cdefgh cdefghi eiusmod tempor incididunt ut labore et dolore magna aliqua sed defghi
|
|
1203
1566
|
//# sourceMappingURL=TextBlock.test.js.map
|