@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.
Files changed (400) hide show
  1. package/lib/cjs/BackendHubAccess.js.map +1 -1
  2. package/lib/cjs/BackendLoggerCategory.js.map +1 -1
  3. package/lib/cjs/BisCoreSchema.js.map +1 -1
  4. package/lib/cjs/BlobContainerService.js.map +1 -1
  5. package/lib/cjs/BriefcaseManager.js.map +1 -1
  6. package/lib/cjs/CatalogDb.js.map +1 -1
  7. package/lib/cjs/Category.js.map +1 -1
  8. package/lib/cjs/ChangeSummaryManager.js +2 -2
  9. package/lib/cjs/ChangeSummaryManager.js.map +1 -1
  10. package/lib/cjs/ChangedElementsDb.js.map +1 -1
  11. package/lib/cjs/ChangesetECAdaptor.js +248 -248
  12. package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
  13. package/lib/cjs/ChannelControl.js.map +1 -1
  14. package/lib/cjs/CheckpointManager.js.map +1 -1
  15. package/lib/cjs/ClassRegistry.js +5 -5
  16. package/lib/cjs/ClassRegistry.js.map +1 -1
  17. package/lib/cjs/CloudSqlite.js.map +1 -1
  18. package/lib/cjs/CodeService.js.map +1 -1
  19. package/lib/cjs/CodeSpecs.js.map +1 -1
  20. package/lib/cjs/ConcurrentQuery.js.map +1 -1
  21. package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
  22. package/lib/cjs/DevTools.js.map +1 -1
  23. package/lib/cjs/DisplayStyle.js.map +1 -1
  24. package/lib/cjs/ECDb.js.map +1 -1
  25. package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
  26. package/lib/cjs/ECSqlStatement.js.map +1 -1
  27. package/lib/cjs/Element.js.map +1 -1
  28. package/lib/cjs/ElementAspect.js.map +1 -1
  29. package/lib/cjs/ElementGraphics.js.map +1 -1
  30. package/lib/cjs/ElementTreeWalker.js.map +1 -1
  31. package/lib/cjs/Entity.js.map +1 -1
  32. package/lib/cjs/EntityReferences.js.map +1 -1
  33. package/lib/cjs/ExportGraphics.js.map +1 -1
  34. package/lib/cjs/ExternalSource.js.map +1 -1
  35. package/lib/cjs/FontFile.js.map +1 -1
  36. package/lib/cjs/GeoCoordConfig.js.map +1 -1
  37. package/lib/cjs/GeographicCRSServices.js.map +1 -1
  38. package/lib/cjs/GeometrySummary.js +47 -47
  39. package/lib/cjs/GeometrySummary.js.map +1 -1
  40. package/lib/cjs/IModelDb.js +8 -8
  41. package/lib/cjs/IModelDb.js.map +1 -1
  42. package/lib/cjs/IModelDbFonts.js.map +1 -1
  43. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  44. package/lib/cjs/IModelHost.js.map +1 -1
  45. package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
  46. package/lib/cjs/IModelJsFs.js.map +1 -1
  47. package/lib/cjs/ImageSourceConversion.js.map +1 -1
  48. package/lib/cjs/IpcHost.js.map +1 -1
  49. package/lib/cjs/LineStyle.js.map +1 -1
  50. package/lib/cjs/LocalHub.js +1 -1
  51. package/lib/cjs/LocalHub.js.map +1 -1
  52. package/lib/cjs/LocalhostIpcHost.js.map +1 -1
  53. package/lib/cjs/LockControl.js.map +1 -1
  54. package/lib/cjs/Material.js.map +1 -1
  55. package/lib/cjs/Model.js.map +1 -1
  56. package/lib/cjs/NativeAppStorage.js.map +1 -1
  57. package/lib/cjs/NativeHost.js.map +1 -1
  58. package/lib/cjs/NavigationRelationship.js.map +1 -1
  59. package/lib/cjs/PromiseMemoizer.js.map +1 -1
  60. package/lib/cjs/PropertyStore.js.map +1 -1
  61. package/lib/cjs/Relationship.js.map +1 -1
  62. package/lib/cjs/RpcBackend.js.map +1 -1
  63. package/lib/cjs/SQLiteDb.js.map +1 -1
  64. package/lib/cjs/Schema.js.map +1 -1
  65. package/lib/cjs/SchemaSync.js.map +1 -1
  66. package/lib/cjs/SchemaUtils.js.map +1 -1
  67. package/lib/cjs/SheetIndex.js.map +1 -1
  68. package/lib/cjs/SqliteChangesetReader.js.map +1 -1
  69. package/lib/cjs/SqliteStatement.js.map +1 -1
  70. package/lib/cjs/StashManager.js.map +1 -1
  71. package/lib/cjs/Texture.js.map +1 -1
  72. package/lib/cjs/TileStorage.js.map +1 -1
  73. package/lib/cjs/TxnManager.js.map +1 -1
  74. package/lib/cjs/ViewDefinition.js.map +1 -1
  75. package/lib/cjs/ViewStateHydrator.js.map +1 -1
  76. package/lib/cjs/ViewStore.js.map +1 -1
  77. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  78. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +3 -5
  79. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  80. package/lib/cjs/annotations/FrameGeometry.js.map +1 -1
  81. package/lib/cjs/annotations/LeaderGeometry.js +1 -1
  82. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  83. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  84. package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
  85. package/lib/cjs/annotations/TextAnnotationGeometry.js +24 -17
  86. package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
  87. package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -1
  88. package/lib/cjs/annotations/TextBlockGeometry.js +8 -0
  89. package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
  90. package/lib/cjs/annotations/TextBlockLayout.d.ts +46 -27
  91. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
  92. package/lib/cjs/annotations/TextBlockLayout.js +201 -113
  93. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  94. package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
  95. package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
  96. package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
  97. package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
  98. package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
  99. package/lib/cjs/core-backend.js.map +1 -1
  100. package/lib/cjs/domains/FunctionalElements.js.map +1 -1
  101. package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
  102. package/lib/cjs/domains/GenericElements.js.map +1 -1
  103. package/lib/cjs/domains/GenericSchema.js.map +1 -1
  104. package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
  105. package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
  106. package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
  107. package/lib/cjs/internal/FontFileImpl.js.map +1 -1
  108. package/lib/cjs/internal/HubMock.js.map +1 -1
  109. package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -1
  110. package/lib/cjs/internal/NativePlatform.js.map +1 -1
  111. package/lib/cjs/internal/NoLocks.js.map +1 -1
  112. package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
  113. package/lib/cjs/internal/Symbols.js.map +1 -1
  114. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
  115. package/lib/cjs/internal/annotations/fields.js +3 -5
  116. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  117. package/lib/cjs/internal/cross-package.js.map +1 -1
  118. package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
  119. package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  120. package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
  121. package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  122. package/lib/cjs/rpc/multipart.js.map +1 -1
  123. package/lib/cjs/rpc/tracing.js.map +1 -1
  124. package/lib/cjs/rpc/web/logging.js.map +1 -1
  125. package/lib/cjs/rpc/web/request.js.map +1 -1
  126. package/lib/cjs/rpc/web/response.js.map +1 -1
  127. package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  128. package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  129. package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  130. package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  131. package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  132. package/lib/cjs/workspace/Settings.js.map +1 -1
  133. package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
  134. package/lib/cjs/workspace/Workspace.js.map +1 -1
  135. package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
  136. package/lib/esm/BackendHubAccess.js.map +1 -1
  137. package/lib/esm/BackendLoggerCategory.js.map +1 -1
  138. package/lib/esm/BisCoreSchema.js.map +1 -1
  139. package/lib/esm/BlobContainerService.js.map +1 -1
  140. package/lib/esm/BriefcaseManager.js.map +1 -1
  141. package/lib/esm/CatalogDb.js.map +1 -1
  142. package/lib/esm/Category.js.map +1 -1
  143. package/lib/esm/ChangeSummaryManager.js +2 -2
  144. package/lib/esm/ChangeSummaryManager.js.map +1 -1
  145. package/lib/esm/ChangedElementsDb.js.map +1 -1
  146. package/lib/esm/ChangesetECAdaptor.js +248 -248
  147. package/lib/esm/ChangesetECAdaptor.js.map +1 -1
  148. package/lib/esm/ChannelControl.js.map +1 -1
  149. package/lib/esm/CheckpointManager.js.map +1 -1
  150. package/lib/esm/ClassRegistry.js +5 -5
  151. package/lib/esm/ClassRegistry.js.map +1 -1
  152. package/lib/esm/CloudSqlite.js.map +1 -1
  153. package/lib/esm/CodeService.js.map +1 -1
  154. package/lib/esm/CodeSpecs.js.map +1 -1
  155. package/lib/esm/ConcurrentQuery.js.map +1 -1
  156. package/lib/esm/CustomViewState3dCreator.js.map +1 -1
  157. package/lib/esm/DevTools.js.map +1 -1
  158. package/lib/esm/DisplayStyle.js.map +1 -1
  159. package/lib/esm/ECDb.js.map +1 -1
  160. package/lib/esm/ECSchemaXmlContext.js.map +1 -1
  161. package/lib/esm/ECSqlStatement.js.map +1 -1
  162. package/lib/esm/Element.js.map +1 -1
  163. package/lib/esm/ElementAspect.js.map +1 -1
  164. package/lib/esm/ElementGraphics.js.map +1 -1
  165. package/lib/esm/ElementTreeWalker.js.map +1 -1
  166. package/lib/esm/Entity.js.map +1 -1
  167. package/lib/esm/EntityReferences.js.map +1 -1
  168. package/lib/esm/ExportGraphics.js.map +1 -1
  169. package/lib/esm/ExternalSource.js.map +1 -1
  170. package/lib/esm/FontFile.js.map +1 -1
  171. package/lib/esm/GeoCoordConfig.js.map +1 -1
  172. package/lib/esm/GeographicCRSServices.js.map +1 -1
  173. package/lib/esm/GeometrySummary.js +47 -47
  174. package/lib/esm/GeometrySummary.js.map +1 -1
  175. package/lib/esm/IModelDb.js +8 -8
  176. package/lib/esm/IModelDb.js.map +1 -1
  177. package/lib/esm/IModelDbFonts.js.map +1 -1
  178. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  179. package/lib/esm/IModelHost.js.map +1 -1
  180. package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
  181. package/lib/esm/IModelJsFs.js.map +1 -1
  182. package/lib/esm/ImageSourceConversion.js.map +1 -1
  183. package/lib/esm/IpcHost.js.map +1 -1
  184. package/lib/esm/LineStyle.js.map +1 -1
  185. package/lib/esm/LocalHub.js +1 -1
  186. package/lib/esm/LocalHub.js.map +1 -1
  187. package/lib/esm/LocalhostIpcHost.js.map +1 -1
  188. package/lib/esm/LockControl.js.map +1 -1
  189. package/lib/esm/Material.js.map +1 -1
  190. package/lib/esm/Model.js.map +1 -1
  191. package/lib/esm/NativeAppStorage.js.map +1 -1
  192. package/lib/esm/NativeHost.js.map +1 -1
  193. package/lib/esm/NavigationRelationship.js.map +1 -1
  194. package/lib/esm/PromiseMemoizer.js.map +1 -1
  195. package/lib/esm/PropertyStore.js.map +1 -1
  196. package/lib/esm/Relationship.js.map +1 -1
  197. package/lib/esm/RpcBackend.js.map +1 -1
  198. package/lib/esm/SQLiteDb.js.map +1 -1
  199. package/lib/esm/Schema.js.map +1 -1
  200. package/lib/esm/SchemaSync.js.map +1 -1
  201. package/lib/esm/SchemaUtils.js.map +1 -1
  202. package/lib/esm/SheetIndex.js.map +1 -1
  203. package/lib/esm/SqliteChangesetReader.js.map +1 -1
  204. package/lib/esm/SqliteStatement.js.map +1 -1
  205. package/lib/esm/StashManager.js.map +1 -1
  206. package/lib/esm/Texture.js.map +1 -1
  207. package/lib/esm/TileStorage.js.map +1 -1
  208. package/lib/esm/TxnManager.js.map +1 -1
  209. package/lib/esm/ViewDefinition.js.map +1 -1
  210. package/lib/esm/ViewStateHydrator.js.map +1 -1
  211. package/lib/esm/ViewStore.js.map +1 -1
  212. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  213. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +4 -6
  214. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  215. package/lib/esm/annotations/FrameGeometry.js.map +1 -1
  216. package/lib/esm/annotations/LeaderGeometry.js +1 -1
  217. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  218. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  219. package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
  220. package/lib/esm/annotations/TextAnnotationGeometry.js +24 -17
  221. package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
  222. package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -1
  223. package/lib/esm/annotations/TextBlockGeometry.js +8 -0
  224. package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
  225. package/lib/esm/annotations/TextBlockLayout.d.ts +46 -27
  226. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
  227. package/lib/esm/annotations/TextBlockLayout.js +202 -114
  228. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  229. package/lib/esm/core-backend.js.map +1 -1
  230. package/lib/esm/domains/FunctionalElements.js.map +1 -1
  231. package/lib/esm/domains/FunctionalSchema.js.map +1 -1
  232. package/lib/esm/domains/GenericElements.js.map +1 -1
  233. package/lib/esm/domains/GenericSchema.js.map +1 -1
  234. package/lib/esm/internal/ChangesetConflictArgs.js.map +1 -1
  235. package/lib/esm/internal/ChannelAdmin.js.map +1 -1
  236. package/lib/esm/internal/ElementLRUCache.js.map +1 -1
  237. package/lib/esm/internal/FontFileImpl.js.map +1 -1
  238. package/lib/esm/internal/HubMock.js.map +1 -1
  239. package/lib/esm/internal/IModelDbFontsImpl.js.map +1 -1
  240. package/lib/esm/internal/NativePlatform.js.map +1 -1
  241. package/lib/esm/internal/NoLocks.js.map +1 -1
  242. package/lib/esm/internal/ServerBasedLocks.js.map +1 -1
  243. package/lib/esm/internal/Symbols.js.map +1 -1
  244. package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
  245. package/lib/esm/internal/annotations/fields.js +4 -6
  246. package/lib/esm/internal/annotations/fields.js.map +1 -1
  247. package/lib/esm/internal/cross-package.js.map +1 -1
  248. package/lib/esm/internal/workspace/SettingsImpl.js.map +1 -1
  249. package/lib/esm/internal/workspace/SettingsSchemasImpl.js.map +1 -1
  250. package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
  251. package/lib/esm/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
  252. package/lib/esm/rpc/multipart.js.map +1 -1
  253. package/lib/esm/rpc/tracing.js.map +1 -1
  254. package/lib/esm/rpc/web/logging.js.map +1 -1
  255. package/lib/esm/rpc/web/request.js.map +1 -1
  256. package/lib/esm/rpc/web/response.js.map +1 -1
  257. package/lib/esm/rpc-impl/DevToolsRpcImpl.js.map +1 -1
  258. package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
  259. package/lib/esm/rpc-impl/IModelTileRpcImpl.js.map +1 -1
  260. package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
  261. package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
  262. package/lib/esm/test/AdvancedEqual.js.map +1 -1
  263. package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
  264. package/lib/esm/test/AttachDb.test.js +11 -11
  265. package/lib/esm/test/AttachDb.test.js.map +1 -1
  266. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  267. package/lib/esm/test/GeometryTestUtil.js.map +1 -1
  268. package/lib/esm/test/IModelHost.test.js.map +1 -1
  269. package/lib/esm/test/IModelTestUtils.js.map +1 -1
  270. package/lib/esm/test/ImageSourceConversion.test.js.map +1 -1
  271. package/lib/esm/test/IpcHost.test.js.map +1 -1
  272. package/lib/esm/test/KnownTestLocations.js.map +1 -1
  273. package/lib/esm/test/PrintElementTree.js.map +1 -1
  274. package/lib/esm/test/PropertyDb.test.js.map +1 -1
  275. package/lib/esm/test/RevisionUtility.js.map +1 -1
  276. package/lib/esm/test/SchemaUtils.test.js +25 -25
  277. package/lib/esm/test/SchemaUtils.test.js.map +1 -1
  278. package/lib/esm/test/SequentialLogMatcher.js.map +1 -1
  279. package/lib/esm/test/TestChangeSetUtility.js.map +1 -1
  280. package/lib/esm/test/TestUtils.js.map +1 -1
  281. package/lib/esm/test/annotations/Fields.test.js +42 -40
  282. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  283. package/lib/esm/test/annotations/FrameGeometry.test.js.map +1 -1
  284. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  285. package/lib/esm/test/annotations/TextAnnotation.test.js +1 -1
  286. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  287. package/lib/esm/test/annotations/TextBlock.test.js +417 -54
  288. package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
  289. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/old.config.js.map +1 -1
  290. package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
  291. package/lib/esm/test/categories/Category.test.js.map +1 -1
  292. package/lib/esm/test/codespec/CodeSpec.test.js.map +1 -1
  293. package/lib/esm/test/ecdb/CTE.test.js +88 -88
  294. package/lib/esm/test/ecdb/CTE.test.js.map +1 -1
  295. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +15 -15
  296. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  297. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +15 -15
  298. package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
  299. package/lib/esm/test/ecdb/ECDb.test.js +72 -72
  300. package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
  301. package/lib/esm/test/ecdb/ECDbTestHelper.js.map +1 -1
  302. package/lib/esm/test/ecdb/ECSchemaXmlContext.test.js.map +1 -1
  303. package/lib/esm/test/ecdb/ECSqlAst.test.js +65 -65
  304. package/lib/esm/test/ecdb/ECSqlAst.test.js.map +1 -1
  305. package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
  306. package/lib/esm/test/ecdb/ECSqlReader.test.js +16 -16
  307. package/lib/esm/test/ecdb/ECSqlReader.test.js.map +1 -1
  308. package/lib/esm/test/ecdb/ECSqlStatement.test.js +326 -326
  309. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  310. package/lib/esm/test/ecdb/SqliteStatement.test.js.map +1 -1
  311. package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
  312. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js +21 -21
  313. package/lib/esm/test/ecsql/src/ECSqlTestGenerator.js.map +1 -1
  314. package/lib/esm/test/ecsql/src/ECSqlTestParser.js.map +1 -1
  315. package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
  316. package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
  317. package/lib/esm/test/element/ElementAspect.test.js +22 -22
  318. package/lib/esm/test/element/ElementAspect.test.js.map +1 -1
  319. package/lib/esm/test/element/ElementDependencyGraph.test.js.map +1 -1
  320. package/lib/esm/test/element/ElementRoundTrip.test.js +139 -139
  321. package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
  322. package/lib/esm/test/element/ExcludedElements.test.js.map +1 -1
  323. package/lib/esm/test/element/ExternalSource.test.js.map +1 -1
  324. package/lib/esm/test/element/NullStructArray.test.js +13 -13
  325. package/lib/esm/test/element/NullStructArray.test.js.map +1 -1
  326. package/lib/esm/test/element/UrlLink.test.js.map +1 -1
  327. package/lib/esm/test/font/FontFile.test.js.map +1 -1
  328. package/lib/esm/test/font/IModelDbFonts.test.js.map +1 -1
  329. package/lib/esm/test/hubaccess/ApplyChangeset.test.js +32 -32
  330. package/lib/esm/test/hubaccess/ApplyChangeset.test.js.map +1 -1
  331. package/lib/esm/test/hubaccess/BriefcaseManager.test.js.map +1 -1
  332. package/lib/esm/test/hubaccess/CheckpointManager.test.js.map +1 -1
  333. package/lib/esm/test/hubaccess/Rebase.test.js +33 -33
  334. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  335. package/lib/esm/test/imageData.js.map +1 -1
  336. package/lib/esm/test/imodel/ElementTreeWalker.test.js.map +1 -1
  337. package/lib/esm/test/imodel/GetTextureImage.test.js.map +1 -1
  338. package/lib/esm/test/imodel/IModel.test.js +44 -44
  339. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  340. package/lib/esm/test/imodel/ProjectExtents.test.js.map +1 -1
  341. package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
  342. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  343. package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
  344. package/lib/esm/test/incrementalSchemaLocater/utils/IModelSchemaLocater.js.map +1 -1
  345. package/lib/esm/test/incrementalSchemaLocater/utils/IncrementalTestHelper.js.map +1 -1
  346. package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -1
  347. package/lib/esm/test/index.js.map +1 -1
  348. package/lib/esm/test/misc/DevTools.test.js.map +1 -1
  349. package/lib/esm/test/misc/EntitySubClasses.test.js.map +1 -1
  350. package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
  351. package/lib/esm/test/misc/PromiseMemoizer.test.js.map +1 -1
  352. package/lib/esm/test/native/DgnDbWorker.test.js.map +1 -1
  353. package/lib/esm/test/rpc/response.test.js.map +1 -1
  354. package/lib/esm/test/schema/ClassRegistry.test.js +99 -99
  355. package/lib/esm/test/schema/ClassRegistry.test.js.map +1 -1
  356. package/lib/esm/test/schema/FunctionalDomain.test.js.map +1 -1
  357. package/lib/esm/test/schema/GenericDomain.test.js.map +1 -1
  358. package/lib/esm/test/schema/IModelSchemaContext.test.js.map +1 -1
  359. package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
  360. package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
  361. package/lib/esm/test/standalone/ChangesetReader.test.js +117 -117
  362. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  363. package/lib/esm/test/standalone/CustomViewState3dCreator.test.js.map +1 -1
  364. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  365. package/lib/esm/test/standalone/Drawing.test.js.map +1 -1
  366. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  367. package/lib/esm/test/standalone/ElementMesh.test.js.map +1 -1
  368. package/lib/esm/test/standalone/ExportGraphics.test.js +14 -14
  369. package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
  370. package/lib/esm/test/standalone/GeometryChangeEvents.test.js.map +1 -1
  371. package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
  372. package/lib/esm/test/standalone/HubMock.test.js.map +1 -1
  373. package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -1
  374. package/lib/esm/test/standalone/IModelWrite.test.js +27 -27
  375. package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
  376. package/lib/esm/test/standalone/InlineGeometryPartReferences.test.js.map +1 -1
  377. package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
  378. package/lib/esm/test/standalone/NativeAppStorage.test.js.map +1 -1
  379. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  380. package/lib/esm/test/standalone/RenderTimeline.test.js.map +1 -1
  381. package/lib/esm/test/standalone/SQLiteDb.test.js.map +1 -1
  382. package/lib/esm/test/standalone/SchemaUtils.test.js.map +1 -1
  383. package/lib/esm/test/standalone/SectionDrawing.test.js.map +1 -1
  384. package/lib/esm/test/standalone/ServerBasedLocks.test.js.map +1 -1
  385. package/lib/esm/test/standalone/Setting.test.js.map +1 -1
  386. package/lib/esm/test/standalone/Settings.test.js.map +1 -1
  387. package/lib/esm/test/standalone/SettingsSchemas.test.js.map +1 -1
  388. package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
  389. package/lib/esm/test/standalone/Texture.test.js.map +1 -1
  390. package/lib/esm/test/standalone/TileCache.test.js.map +1 -1
  391. package/lib/esm/test/standalone/TileTree.test.js.map +1 -1
  392. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  393. package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
  394. package/lib/esm/test/standalone/ViewStoreDb.test.js.map +1 -1
  395. package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
  396. package/lib/esm/workspace/Settings.js.map +1 -1
  397. package/lib/esm/workspace/SettingsSchemas.js.map +1 -1
  398. package/lib/esm/workspace/Workspace.js.map +1 -1
  399. package/lib/esm/workspace/WorkspaceEditor.js.map +1 -1
  400. package/package.json +12 -12
@@ -5,7 +5,7 @@
5
5
  /** @packageDocumentation
6
6
  * @module ElementGeometry
7
7
  */
8
- import { TextStyleSettings } from "@itwin/core-common";
8
+ import { getMarkerText, TextRun, TextStyleSettings } from "@itwin/core-common";
9
9
  import { Geometry, Range2d } from "@itwin/core-geometry";
10
10
  import { assert } from "@itwin/core-bentley";
11
11
  import * as LineBreaker from "linebreak";
@@ -53,11 +53,10 @@ export function computeLayoutTextBlockResult(args) {
53
53
  * @beta
54
54
  */
55
55
  export function computeGraphemeOffsets(args) {
56
- const { textBlock, paragraphIndex, runLayoutResult, graphemeCharIndexes, iModel } = args;
56
+ const { source, runLayoutResult, graphemeCharIndexes, iModel } = args;
57
57
  const findFontId = args.findFontId ?? ((name, type) => iModel.fonts.findId({ name, type }) ?? 0);
58
58
  const computeTextRange = args.computeTextRange ?? ((x) => iModel.computeRangesForText(x));
59
- const source = textBlock.paragraphs[paragraphIndex].runs[runLayoutResult.sourceRunIndex];
60
- if (source.type !== "text" || runLayoutResult.characterCount === 0) {
59
+ if (!(source instanceof TextRun) || runLayoutResult.characterCount === 0) {
61
60
  return [];
62
61
  }
63
62
  const style = TextStyleSettings.fromJSON(runLayoutResult.textStyle);
@@ -121,29 +120,27 @@ export class TextStyleResolver {
121
120
  if (args.textBlock.styleOverrides)
122
121
  this.blockSettings = this.blockSettings.clone(args.textBlock.styleOverrides);
123
122
  }
124
- resolveParagraphSettingsImpl(paragraph) {
123
+ /**
124
+ * Resolves the effective text style settings for a given TextBlockComponent, applying block-level overrides.
125
+ */
126
+ resolveSettings(overrides, isLeader = false) {
125
127
  let settings = this.blockSettings;
126
- if (paragraph.overridesStyle)
127
- settings = settings.clone(paragraph.styleOverrides);
128
- return settings;
129
- }
130
- /** Resolves the effective style for a [TextAnnotationLeader]($common). The TextAnnotationLeader should be a sibling of the provided TextBlock. */
131
- resolveTextAnnotationLeaderSettings(leader) {
132
- let settings = this.blockSettings;
133
- if (leader.styleOverrides)
134
- settings = settings.clone(leader.styleOverrides);
135
- return applyBlockSettings(settings, this.blockSettings, true);
136
- }
137
- /** Resolves the effective style for a [Paragraph]($common). Paragraph should be child of provided TextBlock. */
138
- resolveParagraphSettings(paragraph) {
139
- return applyBlockSettings(this.resolveParagraphSettingsImpl(paragraph), this.blockSettings);
140
- }
141
- /** Resolves the effective style for a [Run]($common). Run should be child of provided Paragraph and TextBlock. */
142
- resolveRunSettings(paragraph, run) {
143
- let settings = this.resolveParagraphSettingsImpl(paragraph);
144
- if (run.overridesStyle)
145
- settings = settings.clone(run.styleOverrides);
146
- return applyBlockSettings(settings, this.blockSettings);
128
+ if (overrides)
129
+ settings = settings.clone(overrides);
130
+ return applyBlockSettings(settings, this.blockSettings, isLeader);
131
+ }
132
+ resolveMarkerText(overrides, index) {
133
+ const markerSettings = overrides.listMarker ?? this.blockSettings.listMarker;
134
+ return getMarkerText(markerSettings, index);
135
+ }
136
+ /**
137
+ * Computes the indentation based on its style and nesting depth.
138
+ */
139
+ resolveIndentation(styleOverrides, depth) {
140
+ const overrides = this.resolveSettings(styleOverrides);
141
+ const indentation = overrides.indentation;
142
+ const tabInterval = overrides.tabInterval;
143
+ return indentation + tabInterval * depth;
147
144
  }
148
145
  }
149
146
  class LayoutContext {
@@ -233,9 +230,9 @@ class LayoutContext {
233
230
  layout.extendRange(denominator);
234
231
  return { layout, numerator, denominator };
235
232
  }
236
- computeRangeForTabRun(style, source, length) {
233
+ computeRangeForTabRun(style, source, lengthFromLastTab) {
237
234
  const interval = source.styleOverrides.tabInterval ?? style.tabInterval;
238
- const tabEndX = interval - length % interval;
235
+ const tabEndX = interval - lengthFromLastTab % interval;
239
236
  const range = new Range2d(0, 0, 0, style.lineHeight);
240
237
  range.extendXY(tabEndX, range.low.y);
241
238
  return range;
@@ -291,8 +288,8 @@ export class RunLayout {
291
288
  this.style = props.style;
292
289
  this.fontId = props.fontId;
293
290
  }
294
- static create(source, parentParagraph, context) {
295
- const style = context.textStyleResolver.resolveRunSettings(parentParagraph, source);
291
+ static create(source, context, cumulativeOverrides) {
292
+ const style = context.textStyleResolver.resolveSettings(cumulativeOverrides);
296
293
  const fontId = context.findFontId(style.fontName);
297
294
  const charOffset = 0;
298
295
  const offsetFromLine = { x: 0, y: 0 };
@@ -361,9 +358,8 @@ export class RunLayout {
361
358
  });
362
359
  });
363
360
  }
364
- toResult(paragraph) {
361
+ toResult() {
365
362
  const result = {
366
- sourceRunIndex: paragraph.runs.indexOf(this.source),
367
363
  fontId: this.fontId,
368
364
  characterOffset: this.charOffset,
369
365
  characterCount: this.numChars,
@@ -392,32 +388,47 @@ export class RunLayout {
392
388
  export class LineLayout {
393
389
  source;
394
390
  range = new Range2d(0, 0, 0, 0);
391
+ runRange = new Range2d(0, 0, 0, 0); // Range of all runs excluding marker.
395
392
  justificationRange = new Range2d(0, 0, 0, 0);
396
- offsetFromDocument = { x: 0, y: 0 };
393
+ offsetFromDocument;
394
+ depth;
397
395
  lengthFromLastTab = 0; // Used to track the length from the last tab for tab runs.
398
396
  _runs = [];
399
- constructor(source) {
397
+ _marker;
398
+ constructor(source, style, context, depth = 0) {
400
399
  this.source = source;
400
+ this.depth = depth;
401
+ this.offsetFromDocument = { x: context?.textStyleResolver.resolveIndentation(style, depth) ?? 0, y: 0 };
401
402
  }
402
403
  /** Compute a string representation, primarily for debugging purposes. */
403
404
  stringify() {
404
405
  const runs = this._runs.map((run) => run.stringify());
405
406
  return `${runs.join("")}`;
406
407
  }
408
+ /** Gets the array of RunLayout objects contained in this line. */
407
409
  get runs() { return this._runs; }
410
+ /** Indicates whether this line contains any runs. */
408
411
  get isEmpty() { return this._runs.length === 0; }
412
+ /** Gets the last RunLayout in this line. */
409
413
  get back() {
410
414
  assert(!this.isEmpty);
411
415
  return this._runs[this._runs.length - 1];
412
416
  }
417
+ /**
418
+ * Gets or sets the marker RunLayout for this line, used for lists.
419
+ * A marker is the symbol or character that appears before each list item in a list, bullets, numbers, etc.
420
+ * */
421
+ get marker() { return this._marker; }
422
+ set marker(value) { this._marker = value; }
413
423
  append(run) {
414
424
  this._runs.push(run);
415
425
  this.computeRanges();
416
426
  }
417
427
  /** Invoked every time a run is appended,. */
418
428
  computeRanges() {
419
- this.range.low.setZero();
420
- this.range.high.setZero();
429
+ this.runRange.low.setZero();
430
+ this.runRange.high.setZero();
431
+ this.lengthFromLastTab = 0;
421
432
  // Some runs (fractions) are taller than others.
422
433
  // We want to center each run vertically inside the line.
423
434
  let lineHeight = 0;
@@ -426,26 +437,39 @@ export class LineLayout {
426
437
  }
427
438
  for (const run of this._runs) {
428
439
  const runHeight = run.range.yLength();
429
- const runOffset = { x: this.range.high.x, y: (lineHeight - runHeight) / 2 };
440
+ const runOffset = { x: this.runRange.high.x, y: (lineHeight - runHeight) / 2 };
430
441
  run.offsetFromLine = runOffset;
431
442
  const runLayoutRange = run.range.cloneTranslated(runOffset);
432
- this.range.extendRange(runLayoutRange);
443
+ this.runRange.extendRange(runLayoutRange);
433
444
  if ("linebreak" !== run.source.type) {
434
445
  const runJustificationRange = run.justificationRange?.cloneTranslated(runOffset);
435
446
  this.justificationRange.extendRange(runJustificationRange ?? runLayoutRange);
436
447
  }
437
- if (run.source.type === "tab") {
448
+ if ("tab" === run.source.type) {
438
449
  this.lengthFromLastTab = 0;
439
450
  }
440
451
  else {
441
452
  this.lengthFromLastTab += run.range.xLength();
442
453
  }
443
454
  }
455
+ this.range.setFrom(this.runRange);
456
+ if (this._marker) {
457
+ const indentation = this.range.low.x;
458
+ const x = indentation - (this._marker.style.tabInterval / 2) - this._marker.range.xLength();
459
+ const runHeight = this._marker.range.yLength();
460
+ const runOffset = {
461
+ x,
462
+ y: (lineHeight - runHeight) / 2 // Center the marker vertically in the line.
463
+ };
464
+ this._marker.offsetFromLine = runOffset;
465
+ const markerRange = this._marker.range.cloneTranslated(this._marker.offsetFromLine);
466
+ this.range.extendRange(markerRange);
467
+ }
444
468
  }
445
- toResult(textBlock) {
469
+ toResult() {
446
470
  return {
447
- sourceParagraphIndex: textBlock.paragraphs.indexOf(this.source),
448
- runs: this.runs.map((x) => x.toResult(this.source)),
471
+ runs: this.runs.map((x) => x.toResult()),
472
+ marker: this.marker?.toResult(),
449
473
  range: this.range.toJSON(),
450
474
  justificationRange: this.justificationRange.toJSON(),
451
475
  offsetFromDocument: this.offsetFromDocument,
@@ -479,7 +503,7 @@ export class TextBlockLayout {
479
503
  }
480
504
  toResult() {
481
505
  return {
482
- lines: this.lines.map((x) => x.toResult(this.source)),
506
+ lines: this.lines.map((x) => x.toResult()),
483
507
  range: this.range.toJSON(),
484
508
  };
485
509
  }
@@ -493,59 +517,151 @@ export class TextBlockLayout {
493
517
  }
494
518
  populateLines(context) {
495
519
  const doc = this.source;
496
- if (doc.paragraphs.length === 0) {
520
+ if (!doc.children || doc.children.length === 0) {
497
521
  return;
498
522
  }
499
- const doWrap = doc.width > 0;
500
- let curLine = new LineLayout(doc.paragraphs[0]);
501
- for (let i = 0; i < doc.paragraphs.length; i++) {
502
- const paragraph = doc.paragraphs[i];
503
- if (i > 0) {
504
- curLine = this.flushLine(context, curLine, paragraph);
505
- }
506
- let runs = paragraph.runs.map((run) => RunLayout.create(run, paragraph, context));
507
- if (doWrap) {
508
- runs = runs.map((run) => run.split(context)).flat();
509
- }
510
- for (const run of runs) {
511
- if ("linebreak" === run.source.type) {
512
- curLine.append(run);
513
- curLine = this.flushLine(context, curLine);
514
- continue;
523
+ let curLine = new LineLayout(doc.children[0], doc.children[0].styleOverrides, context);
524
+ let childIndex = 0;
525
+ for (const child of doc.children) {
526
+ curLine = this.populateComponent(child, childIndex++, context, doc.width, curLine, doc, doc.styleOverrides);
527
+ }
528
+ if (curLine.runs.length > 0) {
529
+ this.flushLine(context, curLine, doc.styleOverrides);
530
+ }
531
+ }
532
+ populateComponent(component, componentIndex, context, docWidth, curLine, parent, cumulativeOverrides, depth = 0) {
533
+ cumulativeOverrides = { ...cumulativeOverrides, ...component.styleOverrides };
534
+ switch (component.type) {
535
+ case "list": {
536
+ // If we have any runs in the current line, flush it before starting the list.
537
+ if (curLine.runs.length > 0) {
538
+ curLine = this.flushLine(context, curLine, cumulativeOverrides, component.children[0], true, depth + 1);
515
539
  }
516
- // If this is a tab, we need to apply the tab shift first, and then we can treat it like a text run.
517
- applyTabShift(run, curLine, context);
518
- // If our width is not set (doWrap is false), then we don't have to compute word wrapping, so just append the run, and continue.
519
- if (!doWrap) {
520
- curLine.append(run);
521
- continue;
540
+ else {
541
+ // If not, we need to apply the indentation for the list to the first line.
542
+ curLine.offsetFromDocument.x = context.textStyleResolver.resolveIndentation(cumulativeOverrides, depth + 1);
543
+ curLine.depth = depth + 1;
522
544
  }
523
- // Next, determine if we can append this run to the current line without exceeding the document width
524
- const runWidth = run.range.xLength();
525
- const lineWidth = curLine.range.xLength();
526
- // If true, then no word wrapping is required, so we can append to the current line.
527
- if (runWidth + lineWidth < doc.width || Geometry.isAlmostEqualNumber(runWidth + lineWidth, doc.width, Geometry.smallMetricDistance)) {
528
- curLine.append(run);
529
- continue;
545
+ // Iterate through each list item, setting the marker and populating its contents.
546
+ component.children.forEach((child, index) => {
547
+ const markerContent = context.textStyleResolver.resolveMarkerText(cumulativeOverrides, index + 1);
548
+ const markerRun = TextRun.create({ content: markerContent });
549
+ curLine.marker = RunLayout.create(markerRun, context, cumulativeOverrides);
550
+ curLine = this.populateComponent(child, index, context, docWidth, curLine, component, cumulativeOverrides, depth + 1);
551
+ });
552
+ // Lastly flush the line.
553
+ const nextSibling = parent?.children[componentIndex + 1];
554
+ if (curLine && nextSibling) {
555
+ curLine = this.flushLine(context, curLine, cumulativeOverrides, nextSibling, true, depth);
530
556
  }
531
- // Do word wrapping
532
- if (curLine.runs.length === 0) {
533
- curLine.append(run);
534
- // Lastly, flush line
535
- curLine = this.flushLine(context, curLine);
557
+ break;
558
+ }
559
+ case "paragraph": {
560
+ // Iterate through each paragraph child (either a list or a run), populating its contents.
561
+ component.children.forEach((child, index) => {
562
+ curLine = this.populateComponent(child, index, context, docWidth, curLine, component, cumulativeOverrides, depth);
563
+ });
564
+ // Lastly flush the line.
565
+ const nextSibling = parent?.children[componentIndex + 1];
566
+ if (curLine && nextSibling) {
567
+ curLine = this.flushLine(context, curLine, cumulativeOverrides, nextSibling, true, depth);
568
+ }
569
+ break;
570
+ }
571
+ case "text": {
572
+ const layout = RunLayout.create(component, context, cumulativeOverrides);
573
+ // Text can be word-wrapped, so we need to split it into multiple runs if necessary.
574
+ if (docWidth > 0) {
575
+ layout.split(context).forEach(r => { curLine = this.populateRun(curLine, r, context, cumulativeOverrides, docWidth); });
536
576
  }
537
577
  else {
538
- // First, flush line
539
- curLine = this.flushLine(context, curLine);
540
- // Recompute tab shift if applicable
541
- applyTabShift(run, curLine, context);
542
- curLine.append(run);
578
+ curLine = this.populateRun(curLine, layout, context, cumulativeOverrides, docWidth);
543
579
  }
580
+ break;
544
581
  }
582
+ case "fraction":
583
+ case "tab": {
584
+ const layout = RunLayout.create(component, context, cumulativeOverrides);
585
+ curLine = this.populateRun(curLine, layout, context, cumulativeOverrides, docWidth);
586
+ break;
587
+ }
588
+ case "linebreak": {
589
+ const layout = RunLayout.create(component, context, cumulativeOverrides);
590
+ curLine.append(layout);
591
+ curLine = this.flushLine(context, curLine, cumulativeOverrides, undefined, undefined, depth);
592
+ break;
593
+ }
594
+ default: break;
545
595
  }
546
- if (curLine.runs.length > 0) {
547
- this.flushLine(context, curLine);
596
+ return curLine;
597
+ }
598
+ ;
599
+ populateRun(curLine, run, context, cumulativeOverrides, docWidth) {
600
+ // If this is a tab, we need to apply the tab shift first, and then we can treat it like a text run.
601
+ applyTabShift(run, curLine, context);
602
+ // If our width is not set, then we don't have to compute word wrapping, so just append the run, and continue.
603
+ if (docWidth <= 0) {
604
+ curLine.append(run);
605
+ return curLine;
606
+ }
607
+ // If not, we need to determine if we can append this run to the current line without exceeding the document width or if we need to word wrap.
608
+ const runWidth = run.justificationRange?.xLength() ?? run.range.xLength();
609
+ const lineWidth = curLine.runRange.xLength();
610
+ const newWidth = runWidth + lineWidth + curLine.offsetFromDocument.x;
611
+ // If true, then no word wrapping is required, so we can append to the current line.
612
+ if (newWidth < docWidth || Geometry.isAlmostEqualNumber(newWidth, docWidth, Geometry.smallMetricDistance)) {
613
+ curLine.append(run);
614
+ return curLine;
615
+ }
616
+ // If not, do word wrapping
617
+ if (curLine.runs.length === 0) {
618
+ curLine.append(run);
619
+ // Lastly, flush line
620
+ curLine = this.flushLine(context, curLine, cumulativeOverrides, undefined, undefined, curLine.depth);
548
621
  }
622
+ else {
623
+ // First, flush line
624
+ curLine = this.flushLine(context, curLine, cumulativeOverrides, undefined, undefined, curLine.depth);
625
+ // Recompute tab shift if applicable
626
+ applyTabShift(run, curLine, context);
627
+ curLine.append(run);
628
+ }
629
+ return curLine;
630
+ }
631
+ ;
632
+ flushLine(context, curLine, cumulativeOverrides, next, newParagraph = false, depth = 0) {
633
+ next = next ?? curLine.source;
634
+ // We want to guarantee that each layout line has at least one run.
635
+ if (curLine.runs.length === 0) {
636
+ if (this.lines.length === 0 || this._back.runs.length === 0) {
637
+ return new LineLayout(next, cumulativeOverrides, context, depth);
638
+ }
639
+ if (curLine.source.type !== "linebreak") {
640
+ const newLine = new LineLayout(next, cumulativeOverrides, context, depth);
641
+ newLine.offsetFromDocument.y -= context.textStyleResolver.blockSettings.paragraphSpacingFactor * context.textStyleResolver.blockSettings.lineHeight;
642
+ return newLine;
643
+ }
644
+ const run = curLine.source.clone();
645
+ curLine.append(RunLayout.create(run, context, cumulativeOverrides));
646
+ }
647
+ // Line origin is its baseline.
648
+ const lineOffset = { ...curLine.offsetFromDocument }; // Start with the line's original offset, which includes indentation.
649
+ lineOffset.y -= curLine.range.yLength(); // Shift down the baseline
650
+ // Place it below any existing lines
651
+ if (this.lines.length > 0) {
652
+ lineOffset.y += this._back.offsetFromDocument.y;
653
+ lineOffset.y -= context.textStyleResolver.blockSettings.lineSpacingFactor * context.textStyleResolver.blockSettings.lineHeight;
654
+ }
655
+ curLine.offsetFromDocument = lineOffset;
656
+ // Update document range from computed line range and position
657
+ this.textRange.extendRange(curLine.range.cloneTranslated(lineOffset));
658
+ this.lines.push(curLine);
659
+ if (newParagraph) {
660
+ const newLine = new LineLayout(next, cumulativeOverrides, context, depth);
661
+ newLine.offsetFromDocument.y -= context.textStyleResolver.blockSettings.paragraphSpacingFactor * context.textStyleResolver.blockSettings.lineHeight;
662
+ return newLine;
663
+ }
664
+ return new LineLayout(next, cumulativeOverrides, context, depth);
549
665
  }
550
666
  justifyLines() {
551
667
  // We don't want to justify empty text, or a single line of text whose width is 0. By default text is already left justified.
@@ -556,7 +672,7 @@ export class TextBlockLayout {
556
672
  const docWidth = this.source.width;
557
673
  let minOffset = Number.MAX_VALUE;
558
674
  for (const line of this.lines) {
559
- const lineWidth = line.justificationRange.xLength();
675
+ const lineWidth = line.justificationRange.xLength() + line.offsetFromDocument.x;
560
676
  let offset = docWidth - lineWidth;
561
677
  if ("center" === this.source.justification) {
562
678
  offset = offset / 2;
@@ -570,34 +686,6 @@ export class TextBlockLayout {
570
686
  this.textRange.high.x += minOffset;
571
687
  }
572
688
  }
573
- flushLine(context, line, nextParagraph) {
574
- nextParagraph = nextParagraph ?? line.source;
575
- // We want to guarantee that each layout line has at least one run.
576
- if (line.runs.length === 0) {
577
- // If we're empty, there should always be a preceding run, and it should be a line break.
578
- if (this.lines.length === 0 || this._back.runs.length === 0) {
579
- return new LineLayout(nextParagraph);
580
- }
581
- const prevRun = this._back.back.source;
582
- assert(prevRun.type === "linebreak");
583
- if (prevRun.type !== "linebreak") {
584
- return new LineLayout(nextParagraph);
585
- }
586
- line.append(RunLayout.create(prevRun.clone(), line.source, context));
587
- }
588
- // Line origin is its baseline.
589
- const lineOffset = { x: 0, y: -line.range.yLength() };
590
- // Place it below any existing lines
591
- if (this.lines.length > 0) {
592
- lineOffset.y += this._back.offsetFromDocument.y;
593
- lineOffset.y -= context.textStyleResolver.blockSettings.lineSpacingFactor * context.textStyleResolver.blockSettings.lineHeight;
594
- }
595
- line.offsetFromDocument = lineOffset;
596
- // Update document range from computed line range and position
597
- this.textRange.extendRange(line.range.cloneTranslated(lineOffset));
598
- this.lines.push(line);
599
- return new LineLayout(nextParagraph);
600
- }
601
689
  applyMargins(margins) {
602
690
  this.range = this.textRange.clone();
603
691
  if (this.range.isNull)