@itwin/core-common 5.2.0-dev.8 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -1
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/AuthorizationClient.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.d.ts +2 -0
- package/lib/cjs/BriefcaseTypes.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/CatalogIModel.js.map +1 -1
- package/lib/cjs/CesiumIonAssets.js.map +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangedEntities.js.map +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorByName.js.map +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/ContourDisplay.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSchemaProps.js.map +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +32 -6
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts.map +1 -1
- package/lib/cjs/FeatureSymbology.js +0 -2
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryContainment.js.map +1 -1
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSLColor.js.map +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelError.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/ITwinCoreErrors.js.map +1 -1
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelClipGroup.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/ModelProps.js.map +1 -1
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanProjectionSettings.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderPolyline.js.map +1 -1
- package/lib/cjs/RenderTexture.js.map +1 -1
- package/lib/cjs/RgbColor.js.map +1 -1
- package/lib/cjs/RpcInterface.js.map +1 -1
- package/lib/cjs/RpcManager.js.map +1 -1
- package/lib/cjs/SessionProps.js.map +1 -1
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/Thumbnail.js.map +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.js +1 -1
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -1
- package/lib/cjs/annotation/TextBlock.d.ts +111 -126
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlock.js +234 -142
- package/lib/cjs/annotation/TextBlock.js.map +1 -1
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.d.ts +3 -5
- package/lib/cjs/annotation/TextBlockLayoutResult.d.ts.map +1 -1
- package/lib/cjs/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/cjs/annotation/TextField.d.ts +86 -0
- package/lib/cjs/annotation/TextField.d.ts.map +1 -0
- package/lib/cjs/annotation/TextField.js +10 -0
- package/lib/cjs/annotation/TextField.js.map +1 -0
- package/lib/cjs/annotation/TextStyle.d.ts +125 -35
- package/lib/cjs/annotation/TextStyle.d.ts.map +1 -1
- package/lib/cjs/annotation/TextStyle.js +105 -46
- package/lib/cjs/annotation/TextStyle.js.map +1 -1
- package/lib/cjs/core-common.d.ts +1 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +1 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/domains/FunctionalElementProps.js.map +1 -1
- package/lib/cjs/domains/GenericElementProps.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/BoundingSphere.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js.map +1 -1
- package/lib/cjs/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js.map +1 -1
- package/lib/cjs/geometry/GeodeticDatum.js.map +1 -1
- package/lib/cjs/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/ImageGraphic.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Placement.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/internal/BackendTypes.js.map +1 -1
- package/lib/cjs/internal/PackedFeatureTable.js.map +1 -1
- package/lib/cjs/internal/RenderMaterialParams.js.map +1 -1
- package/lib/cjs/internal/RenderMesh.js.map +1 -1
- package/lib/cjs/internal/RenderTextureParams.js.map +1 -1
- package/lib/cjs/internal/Snapping.js.map +1 -1
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts +18 -0
- package/lib/cjs/internal/annotations/FieldFormatter.d.ts.map +1 -0
- package/lib/cjs/internal/annotations/FieldFormatter.js +66 -0
- package/lib/cjs/internal/annotations/FieldFormatter.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +1 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -1
- package/lib/cjs/internal/cross-package.js +4 -1
- package/lib/cjs/internal/cross-package.js.map +1 -1
- package/lib/cjs/ipc/IpcSession.js.map +1 -1
- package/lib/cjs/ipc/IpcSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/TestRpcManager.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/OpenAPI.js.map +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/cjs/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/cjs/tile/B3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/CompositeTileIO.js.map +1 -1
- package/lib/cjs/tile/ElementGraphics.js.map +1 -1
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/PntsTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AmbientOcclusion.js.map +1 -1
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/AuthorizationClient.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/Base64EncodedString.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/BriefcaseTypes.d.ts +2 -0
- package/lib/esm/BriefcaseTypes.d.ts.map +1 -1
- package/lib/esm/BriefcaseTypes.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/CatalogIModel.js.map +1 -1
- package/lib/esm/CesiumIonAssets.js.map +1 -1
- package/lib/esm/ChangedElements.js.map +1 -1
- package/lib/esm/ChangedEntities.js.map +1 -1
- package/lib/esm/ChangesetProps.js.map +1 -1
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorByName.js.map +1 -1
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/CommonLoggerCategory.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/ContourDisplay.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSchemaProps.js.map +1 -1
- package/lib/esm/ECSqlReader.js.map +1 -1
- package/lib/esm/ECSqlTypes.js.map +1 -1
- package/lib/esm/ElementMesh.js.map +1 -1
- package/lib/esm/ElementProps.d.ts +32 -6
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EmphasizeElementsProps.js.map +1 -1
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/EntityReference.js.map +1 -1
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureIndex.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts.map +1 -1
- package/lib/esm/FeatureSymbology.js +0 -2
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Fonts.js.map +1 -1
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GenericInstanceFilter.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryContainment.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/GeometrySummary.js.map +1 -1
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GraphicParams.js.map +1 -1
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSLColor.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/Hilite.js.map +1 -1
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelError.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/ITwinCoreErrors.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js.map +1 -1
- package/lib/esm/LinePixels.js.map +1 -1
- package/lib/esm/Localization.js.map +1 -1
- package/lib/esm/MapImagerySettings.js.map +1 -1
- package/lib/esm/MapLayerSettings.js.map +1 -1
- package/lib/esm/MassProperties.js.map +1 -1
- package/lib/esm/MaterialProps.js.map +1 -1
- package/lib/esm/ModelClipGroup.js.map +1 -1
- package/lib/esm/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/ModelProps.js.map +1 -1
- package/lib/esm/NativeAppProps.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanProjectionSettings.js.map +1 -1
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.js.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/RenderMaterial.js.map +1 -1
- package/lib/esm/RenderPolyline.js.map +1 -1
- package/lib/esm/RenderTexture.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/RpcManager.js.map +1 -1
- package/lib/esm/SessionProps.js.map +1 -1
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js.map +1 -1
- package/lib/esm/TerrainSettings.js.map +1 -1
- package/lib/esm/TextureMapping.js.map +1 -1
- package/lib/esm/TextureProps.js.map +1 -1
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Thumbnail.js.map +1 -1
- package/lib/esm/TileProps.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/TxnAction.js.map +1 -1
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/ViewProps.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotation/TextAnnotation.js +1 -1
- package/lib/esm/annotation/TextAnnotation.js.map +1 -1
- package/lib/esm/annotation/TextBlock.d.ts +111 -126
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlock.js +230 -141
- package/lib/esm/annotation/TextBlock.js.map +1 -1
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.d.ts +3 -5
- package/lib/esm/annotation/TextBlockLayoutResult.d.ts.map +1 -1
- package/lib/esm/annotation/TextBlockLayoutResult.js.map +1 -1
- package/lib/esm/annotation/TextField.d.ts +86 -0
- package/lib/esm/annotation/TextField.d.ts.map +1 -0
- package/lib/esm/annotation/TextField.js +9 -0
- package/lib/esm/annotation/TextField.js.map +1 -0
- package/lib/esm/annotation/TextStyle.d.ts +125 -35
- package/lib/esm/annotation/TextStyle.d.ts.map +1 -1
- package/lib/esm/annotation/TextStyle.js +104 -45
- package/lib/esm/annotation/TextStyle.js.map +1 -1
- package/lib/esm/core-common.d.ts +1 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +1 -0
- package/lib/esm/core-common.js.map +1 -1
- package/lib/esm/domains/FunctionalElementProps.js.map +1 -1
- package/lib/esm/domains/GenericElementProps.js.map +1 -1
- package/lib/esm/geometry/AdditionalTransform.js.map +1 -1
- package/lib/esm/geometry/AreaPattern.js.map +1 -1
- package/lib/esm/geometry/BoundingSphere.js.map +1 -1
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js.map +1 -1
- package/lib/esm/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/esm/geometry/FrustumPlanes.js.map +1 -1
- package/lib/esm/geometry/GeodeticDatum.js.map +1 -1
- package/lib/esm/geometry/GeodeticEllipsoid.js.map +1 -1
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/ImageGraphic.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Placement.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/internal/BackendTypes.js.map +1 -1
- package/lib/esm/internal/PackedFeatureTable.js.map +1 -1
- package/lib/esm/internal/RenderMaterialParams.js.map +1 -1
- package/lib/esm/internal/RenderMesh.js.map +1 -1
- package/lib/esm/internal/RenderTextureParams.js.map +1 -1
- package/lib/esm/internal/Snapping.js.map +1 -1
- package/lib/esm/internal/annotations/FieldFormatter.d.ts +18 -0
- package/lib/esm/internal/annotations/FieldFormatter.d.ts.map +1 -0
- package/lib/esm/internal/annotations/FieldFormatter.js +62 -0
- package/lib/esm/internal/annotations/FieldFormatter.js.map +1 -0
- package/lib/esm/internal/cross-package.d.ts +1 -0
- package/lib/esm/internal/cross-package.d.ts.map +1 -1
- package/lib/esm/internal/cross-package.js +1 -0
- package/lib/esm/internal/cross-package.js.map +1 -1
- package/lib/esm/ipc/IpcSession.js.map +1 -1
- package/lib/esm/ipc/IpcSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/TestRpcManager.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcConstants.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/esm/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/esm/rpc/core/RpcOperation.js.map +1 -1
- package/lib/esm/rpc/core/RpcPendingQueue.js.map +1 -1
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js.map +1 -1
- package/lib/esm/rpc/core/RpcRegistry.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRequestContext.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/core/RpcSessionInvocation.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/OpenAPI.js.map +1 -1
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcProtocol.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcRequest.js.map +1 -1
- package/lib/esm/rpc/web/multipart/RpcMultipartParser.js.map +1 -1
- package/lib/esm/tile/B3dmTileIO.js.map +1 -1
- package/lib/esm/tile/CompositeTileIO.js.map +1 -1
- package/lib/esm/tile/ElementGraphics.js.map +1 -1
- package/lib/esm/tile/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/PntsTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +6 -6
|
@@ -5,26 +5,36 @@
|
|
|
5
5
|
/** @packageDocumentation
|
|
6
6
|
* @module Annotation
|
|
7
7
|
*/
|
|
8
|
-
import { TextStyleSettings } from "./TextStyle";
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import { ListMarkerEnumerator, TextStyleSettings } from "./TextStyle";
|
|
9
|
+
function clearStyleOverrides(component, options) {
|
|
10
|
+
component.styleOverrides = {};
|
|
11
|
+
if (!options?.preserveChildrenOverrides) {
|
|
12
|
+
for (const child of component.children) {
|
|
13
|
+
child.clearStyleOverrides(options);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s and [[StructuralTextBlockComponent]]s.
|
|
19
|
+
* The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents.
|
|
20
|
+
* Each component can specify an optional [[styleOverrides]] to customize that formatting.
|
|
11
21
|
* @beta
|
|
12
22
|
*/
|
|
13
23
|
export class TextBlockComponent {
|
|
14
24
|
_styleOverrides;
|
|
15
25
|
/** @internal */
|
|
16
26
|
constructor(props) {
|
|
17
|
-
this._styleOverrides =
|
|
27
|
+
this._styleOverrides = structuredClone(props?.styleOverrides ?? {});
|
|
18
28
|
}
|
|
19
|
-
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend)
|
|
20
|
-
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.
|
|
29
|
+
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).
|
|
30
|
+
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.font.name` to "Comic Sans".
|
|
21
31
|
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
22
32
|
*/
|
|
23
33
|
get styleOverrides() {
|
|
24
34
|
return this._styleOverrides;
|
|
25
35
|
}
|
|
26
36
|
set styleOverrides(overrides) {
|
|
27
|
-
this._styleOverrides =
|
|
37
|
+
this._styleOverrides = structuredClone(overrides);
|
|
28
38
|
}
|
|
29
39
|
/** Reset any [[styleOverrides]] applied to this component. */
|
|
30
40
|
clearStyleOverrides(_options) {
|
|
@@ -45,23 +55,14 @@ export class TextBlockComponent {
|
|
|
45
55
|
/** Convert this component to its JSON representation. */
|
|
46
56
|
toJSON() {
|
|
47
57
|
return {
|
|
48
|
-
styleOverrides:
|
|
58
|
+
styleOverrides: structuredClone(this.styleOverrides),
|
|
49
59
|
};
|
|
50
60
|
}
|
|
51
61
|
/** Returns true if `this` is equivalent to `other`. */
|
|
52
62
|
equals(other) {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
for (const name of myKeys) {
|
|
59
|
-
const key = name;
|
|
60
|
-
if (this.styleOverrides[key] !== other.styleOverrides[key]) {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return true;
|
|
63
|
+
const mySettings = TextStyleSettings.fromJSON(this.styleOverrides);
|
|
64
|
+
const otherSettings = TextStyleSettings.fromJSON(other.styleOverrides);
|
|
65
|
+
return mySettings.equals(otherSettings);
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
/** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span
|
|
@@ -72,15 +73,15 @@ export class TextBlockComponent {
|
|
|
72
73
|
export var Run;
|
|
73
74
|
(function (Run) {
|
|
74
75
|
/** Create a run from its JSON representation.
|
|
75
|
-
* @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.
|
|
76
|
+
* @see [[TextRun.create]], [[FractionRun.create]], [[FieldRun.create]], [[TabRun.create]], and [[LineBreakRun.create]] to create a run directly.
|
|
76
77
|
*/
|
|
77
78
|
function fromJSON(props) {
|
|
78
79
|
switch (props.type) {
|
|
79
|
-
case "
|
|
80
|
+
case "field": return FieldRun.create(props);
|
|
80
81
|
case "fraction": return FractionRun.create(props);
|
|
81
|
-
case "tab": return TabRun.create(props);
|
|
82
82
|
case "linebreak": return LineBreakRun.create(props);
|
|
83
|
-
case "
|
|
83
|
+
case "tab": return TabRun.create(props);
|
|
84
|
+
case "text": return TextRun.create(props);
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
Run.fromJSON = fromJSON;
|
|
@@ -112,7 +113,10 @@ export class TextRun extends TextBlockComponent {
|
|
|
112
113
|
};
|
|
113
114
|
}
|
|
114
115
|
static create(props) {
|
|
115
|
-
return new TextRun(props);
|
|
116
|
+
return new TextRun({ ...props, type: "text" });
|
|
117
|
+
}
|
|
118
|
+
get isEmpty() {
|
|
119
|
+
return this.stringify().length === 0;
|
|
116
120
|
}
|
|
117
121
|
/** Simply returns [[content]]. */
|
|
118
122
|
stringify() {
|
|
@@ -150,7 +154,10 @@ export class FractionRun extends TextBlockComponent {
|
|
|
150
154
|
return new FractionRun(this.toJSON());
|
|
151
155
|
}
|
|
152
156
|
static create(props) {
|
|
153
|
-
return new FractionRun(props);
|
|
157
|
+
return new FractionRun({ ...props, type: "fraction" });
|
|
158
|
+
}
|
|
159
|
+
get isEmpty() {
|
|
160
|
+
return this.stringify().length === 0;
|
|
154
161
|
}
|
|
155
162
|
/** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */
|
|
156
163
|
stringify(options) {
|
|
@@ -177,11 +184,14 @@ export class LineBreakRun extends TextBlockComponent {
|
|
|
177
184
|
};
|
|
178
185
|
}
|
|
179
186
|
static create(props) {
|
|
180
|
-
return new LineBreakRun(props);
|
|
187
|
+
return new LineBreakRun({ ...props, type: "linebreak" });
|
|
181
188
|
}
|
|
182
189
|
clone() {
|
|
183
190
|
return new LineBreakRun(this.toJSON());
|
|
184
191
|
}
|
|
192
|
+
get isEmpty() {
|
|
193
|
+
return this.stringify().length === 0;
|
|
194
|
+
}
|
|
185
195
|
/** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */
|
|
186
196
|
stringify(options) {
|
|
187
197
|
return options?.lineBreak ?? " ";
|
|
@@ -209,6 +219,9 @@ export class TabRun extends TextBlockComponent {
|
|
|
209
219
|
static create(props) {
|
|
210
220
|
return new TabRun(props);
|
|
211
221
|
}
|
|
222
|
+
get isEmpty() {
|
|
223
|
+
return this.stringify().length === 0;
|
|
224
|
+
}
|
|
212
225
|
/**
|
|
213
226
|
* Converts a [[TabRun]] to its string representation.
|
|
214
227
|
* If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.
|
|
@@ -227,7 +240,8 @@ export class TabRun extends TextBlockComponent {
|
|
|
227
240
|
/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).
|
|
228
241
|
* When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,
|
|
229
242
|
* a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that
|
|
230
|
-
* whenever the source element specified by [[propertyHost]] is modified
|
|
243
|
+
* whenever the source element specified by [[propertyHost]] is modified or the `ITextAnnotation` element is inserted or updated in the iModel,
|
|
244
|
+
* the field(s) in the `ITextAnnotation` element are automatically
|
|
231
245
|
* recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or
|
|
232
246
|
* property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].
|
|
233
247
|
* A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.
|
|
@@ -242,8 +256,10 @@ export class FieldRun extends TextBlockComponent {
|
|
|
242
256
|
propertyHost;
|
|
243
257
|
/** Describes how to obtain the property value from [[propertyHost]]. */
|
|
244
258
|
propertyPath;
|
|
245
|
-
/** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].
|
|
246
|
-
|
|
259
|
+
/** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].
|
|
260
|
+
* The specific options used depend upon the [[FieldPropertyType]].
|
|
261
|
+
*/
|
|
262
|
+
formatOptions;
|
|
247
263
|
_cachedContent;
|
|
248
264
|
/** The field's most recently evaluated display string. */
|
|
249
265
|
get cachedContent() {
|
|
@@ -258,7 +274,7 @@ export class FieldRun extends TextBlockComponent {
|
|
|
258
274
|
this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;
|
|
259
275
|
this.propertyHost = props.propertyHost;
|
|
260
276
|
this.propertyPath = props.propertyPath;
|
|
261
|
-
this.
|
|
277
|
+
this.formatOptions = props.formatOptions;
|
|
262
278
|
}
|
|
263
279
|
/** Create a FieldRun from its JSON representation. */
|
|
264
280
|
static create(props) {
|
|
@@ -266,7 +282,8 @@ export class FieldRun extends TextBlockComponent {
|
|
|
266
282
|
...props,
|
|
267
283
|
propertyHost: { ...props.propertyHost },
|
|
268
284
|
propertyPath: structuredClone(props.propertyPath),
|
|
269
|
-
|
|
285
|
+
formatOptions: structuredClone(props.formatOptions),
|
|
286
|
+
type: "field",
|
|
270
287
|
});
|
|
271
288
|
}
|
|
272
289
|
/** Convert the FieldRun to its JSON representation. */
|
|
@@ -280,8 +297,8 @@ export class FieldRun extends TextBlockComponent {
|
|
|
280
297
|
if (this.cachedContent !== FieldRun.invalidContentIndicator) {
|
|
281
298
|
json.cachedContent = this.cachedContent;
|
|
282
299
|
}
|
|
283
|
-
if (this.
|
|
284
|
-
json.
|
|
300
|
+
if (this.formatOptions) {
|
|
301
|
+
json.formatOptions = structuredClone(this.formatOptions);
|
|
285
302
|
}
|
|
286
303
|
return json;
|
|
287
304
|
}
|
|
@@ -289,6 +306,9 @@ export class FieldRun extends TextBlockComponent {
|
|
|
289
306
|
clone() {
|
|
290
307
|
return new FieldRun(this.toJSON());
|
|
291
308
|
}
|
|
309
|
+
get isEmpty() {
|
|
310
|
+
return this.stringify().length === 0;
|
|
311
|
+
}
|
|
292
312
|
/** Convert this FieldRun to a simple string representation. */
|
|
293
313
|
stringify() {
|
|
294
314
|
return this.cachedContent;
|
|
@@ -308,194 +328,263 @@ export class FieldRun extends TextBlockComponent {
|
|
|
308
328
|
}
|
|
309
329
|
const thisAccessors = this.propertyPath.accessors ?? [];
|
|
310
330
|
const otherAccessors = other.propertyPath.accessors ?? [];
|
|
311
|
-
|
|
312
|
-
const otherJsonAccessors = other.propertyPath.jsonAccessors ?? [];
|
|
313
|
-
if (thisAccessors.length !== otherAccessors.length || thisJsonAccessors.length !== otherJsonAccessors.length) {
|
|
331
|
+
if (thisAccessors.length !== otherAccessors.length) {
|
|
314
332
|
return false;
|
|
315
333
|
}
|
|
316
334
|
if (!thisAccessors.every((value, index) => value === otherAccessors[index])) {
|
|
317
335
|
return false;
|
|
318
336
|
}
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
// ###TODO better comparison of formatter objects.
|
|
324
|
-
if (JSON.stringify(this.formatter) !== JSON.stringify(other.formatter)) {
|
|
337
|
+
if (this.formatOptions && other.formatOptions) {
|
|
338
|
+
// We anticipate new formatting options being added in the future.
|
|
339
|
+
// So to account for properties we don't know about, just compare the string representations.
|
|
340
|
+
if (JSON.stringify(this.formatOptions) !== JSON.stringify(other.formatOptions)) {
|
|
325
341
|
return false;
|
|
326
342
|
}
|
|
327
343
|
}
|
|
328
|
-
else if (this.
|
|
344
|
+
else if (this.formatOptions || other.formatOptions) {
|
|
329
345
|
return false;
|
|
330
346
|
}
|
|
331
347
|
return true;
|
|
332
348
|
}
|
|
333
349
|
}
|
|
334
|
-
/** A collection of [[Run]]s
|
|
350
|
+
/** A collection of [[Run]]s and [[List]]s. Paragraphs can be appended to [[List]]s and [[TextBlock]]s.
|
|
351
|
+
* Each paragraph is laid out on a separate line. If included in a [[List]], the paragraph will be treated as a list item.
|
|
335
352
|
* @beta
|
|
336
353
|
*/
|
|
337
354
|
export class Paragraph extends TextBlockComponent {
|
|
338
|
-
|
|
339
|
-
|
|
355
|
+
type = "paragraph";
|
|
356
|
+
children;
|
|
340
357
|
constructor(props) {
|
|
341
358
|
super(props);
|
|
342
|
-
this.
|
|
359
|
+
this.children = props?.children?.map((child) => child.type === "list" ? List.create(child) : Run.fromJSON(child)) ?? [];
|
|
360
|
+
}
|
|
361
|
+
/** Create a paragraph from its JSON representation. */
|
|
362
|
+
static create(props) {
|
|
363
|
+
return new Paragraph(props);
|
|
364
|
+
}
|
|
365
|
+
clearStyleOverrides(options) {
|
|
366
|
+
clearStyleOverrides(this, options);
|
|
367
|
+
}
|
|
368
|
+
get isEmpty() {
|
|
369
|
+
return this.children.length === 0;
|
|
370
|
+
}
|
|
371
|
+
clone() {
|
|
372
|
+
return new Paragraph(this.toJSON());
|
|
343
373
|
}
|
|
344
374
|
toJSON() {
|
|
345
375
|
return {
|
|
346
376
|
...super.toJSON(),
|
|
347
|
-
|
|
377
|
+
children: this.children.map((child) => child.toJSON()),
|
|
348
378
|
};
|
|
349
379
|
}
|
|
350
|
-
/**
|
|
380
|
+
/** Compute a string representation of this paragraph by concatenating the string representations of all of its children. */
|
|
381
|
+
stringify(options, context) {
|
|
382
|
+
return this.children.map((x, index) => (index > 0 && x.type === "list") ? `${options?.paragraphBreak ?? " "}${x.stringify(options, context)}` : x.stringify(options, context)).join("") ?? "";
|
|
383
|
+
}
|
|
384
|
+
equals(other) {
|
|
385
|
+
return (other instanceof Paragraph) && super.equals(other);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
/** A collection of list items ([[Paragraph]]s). Lists can be appended to [[Paragraph]]s.
|
|
389
|
+
* Lists will be laid out on a new line. Each item in a list is laid out on a separate line.
|
|
390
|
+
* @beta
|
|
391
|
+
*/
|
|
392
|
+
export class List extends TextBlockComponent {
|
|
393
|
+
type = "list";
|
|
394
|
+
children;
|
|
395
|
+
constructor(props) {
|
|
396
|
+
super(props);
|
|
397
|
+
this.children = props?.children?.map((child) => Paragraph.create(child)) ?? [];
|
|
398
|
+
}
|
|
399
|
+
/** Create a list from its JSON representation. */
|
|
351
400
|
static create(props) {
|
|
352
|
-
return new
|
|
401
|
+
return new List({ ...props, type: "list" });
|
|
402
|
+
}
|
|
403
|
+
clearStyleOverrides(options) {
|
|
404
|
+
clearStyleOverrides(this, options);
|
|
405
|
+
}
|
|
406
|
+
get isEmpty() {
|
|
407
|
+
return this.children.length === 0;
|
|
353
408
|
}
|
|
354
409
|
clone() {
|
|
355
|
-
return new
|
|
410
|
+
return new List(this.toJSON());
|
|
356
411
|
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
if (options?.preserveChildrenOverrides)
|
|
364
|
-
return;
|
|
365
|
-
for (const run of this.runs) {
|
|
366
|
-
run.clearStyleOverrides();
|
|
367
|
-
}
|
|
412
|
+
toJSON() {
|
|
413
|
+
return {
|
|
414
|
+
...super.toJSON(),
|
|
415
|
+
type: "list",
|
|
416
|
+
children: this.children.map((run) => run.toJSON()),
|
|
417
|
+
};
|
|
368
418
|
}
|
|
369
|
-
/** Compute a string representation of this
|
|
370
|
-
stringify(options) {
|
|
371
|
-
|
|
419
|
+
/** Compute a string representation of this list by concatenating the string representations of all of its [[children]]. */
|
|
420
|
+
stringify(options, context) {
|
|
421
|
+
const children = this.children.map((x, index) => {
|
|
422
|
+
const depth = context?.depth ?? 0;
|
|
423
|
+
const marker = getMarkerText(this.styleOverrides.listMarker ?? TextStyleSettings.defaultProps.listMarker, index + 1);
|
|
424
|
+
const tab = (options?.tabsAsSpaces ? " ".repeat(options.tabsAsSpaces) : "\t").repeat(depth);
|
|
425
|
+
return `${tab}${marker}${options?.listMarkerBreak ?? " "}${x.stringify(options, { depth: depth + 1 })}`;
|
|
426
|
+
});
|
|
427
|
+
return children.join(options?.paragraphBreak ?? " ") ?? "";
|
|
372
428
|
}
|
|
373
429
|
equals(other) {
|
|
374
|
-
|
|
375
|
-
return false;
|
|
376
|
-
}
|
|
377
|
-
if (this.runs.length !== other.runs.length || !super.equals(other)) {
|
|
378
|
-
return false;
|
|
379
|
-
}
|
|
380
|
-
return this.runs.every((run, index) => run.equals(other.runs[index]));
|
|
430
|
+
return (other instanceof List) && super.equals(other);
|
|
381
431
|
}
|
|
382
432
|
}
|
|
383
|
-
|
|
384
|
-
/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content in the form of [[Run]]s.
|
|
385
|
-
* You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].
|
|
433
|
+
/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.
|
|
386
434
|
* No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
|
|
387
435
|
* @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
|
|
388
436
|
* @beta
|
|
389
437
|
*/
|
|
390
438
|
export class TextBlock extends TextBlockComponent {
|
|
391
|
-
|
|
392
|
-
* @note Assigning to this property retains all style overrides on the TextBlock and its child components.
|
|
393
|
-
* Call [[clearStyleOverrides]] to clear the TextBlock's and optionally all children's style overrides.
|
|
394
|
-
*/
|
|
395
|
-
styleId;
|
|
439
|
+
children;
|
|
396
440
|
/** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.
|
|
397
441
|
* A value less than or equal to zero indicates no wrapping is to be applied.
|
|
398
442
|
* Default: 0
|
|
399
443
|
*/
|
|
400
444
|
width;
|
|
401
|
-
/** The alignment of the document's content. */
|
|
402
|
-
justification;
|
|
403
|
-
/** The margins of the document. */
|
|
404
|
-
margins;
|
|
405
|
-
/** The ordered list of paragraphs within the document. */
|
|
406
|
-
paragraphs;
|
|
407
445
|
constructor(props) {
|
|
408
446
|
super(props);
|
|
409
|
-
this.styleId = props.styleId;
|
|
410
447
|
this.width = props.width ?? 0;
|
|
411
|
-
this.
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
right: props.margins?.right ?? 0,
|
|
416
|
-
top: props.margins?.top ?? 0,
|
|
417
|
-
bottom: props.margins?.bottom ?? 0,
|
|
418
|
-
};
|
|
419
|
-
this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];
|
|
448
|
+
this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];
|
|
449
|
+
}
|
|
450
|
+
clearStyleOverrides(options) {
|
|
451
|
+
clearStyleOverrides(this, options);
|
|
420
452
|
}
|
|
421
453
|
toJSON() {
|
|
422
454
|
return {
|
|
423
455
|
...super.toJSON(),
|
|
424
|
-
styleId: this.styleId,
|
|
425
456
|
width: this.width,
|
|
426
|
-
|
|
427
|
-
margins: this.margins,
|
|
428
|
-
paragraphs: this.paragraphs.map((x) => x.toJSON()),
|
|
457
|
+
children: this.children.map((x) => x.toJSON()),
|
|
429
458
|
};
|
|
430
459
|
}
|
|
431
460
|
/** Create a text block from its JSON representation. */
|
|
432
461
|
static create(props) {
|
|
433
|
-
return new TextBlock(props);
|
|
434
|
-
}
|
|
435
|
-
/** Create an empty text block containing no [[paragraphs]] and an empty [[styleId]]. */
|
|
436
|
-
static createEmpty() {
|
|
437
|
-
return TextBlock.create({ styleId: "" });
|
|
462
|
+
return new TextBlock(props ?? {});
|
|
438
463
|
}
|
|
439
464
|
/** Returns true if every paragraph in this text block is empty. */
|
|
440
465
|
get isEmpty() {
|
|
441
|
-
return this.
|
|
466
|
+
return !this.children || this.children.every((child) => child.isEmpty);
|
|
442
467
|
}
|
|
443
468
|
clone() {
|
|
444
469
|
return new TextBlock(this.toJSON());
|
|
445
470
|
}
|
|
446
|
-
/**
|
|
447
|
-
* Clears any [[styleOverrides]] applied to this TextBlock.
|
|
448
|
-
* Will also clear [[styleOverrides]] from all child components unless [[ClearTextStyleOptions.preserveChildrenOverrides]] is `true`.
|
|
449
|
-
*/
|
|
450
|
-
clearStyleOverrides(options) {
|
|
451
|
-
super.clearStyleOverrides();
|
|
452
|
-
if (options?.preserveChildrenOverrides)
|
|
453
|
-
return;
|
|
454
|
-
for (const paragraph of this.paragraphs) {
|
|
455
|
-
paragraph.clearStyleOverrides();
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
471
|
+
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[children]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
459
472
|
stringify(options) {
|
|
460
|
-
return this.
|
|
473
|
+
return this.children.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? " ") || "";
|
|
461
474
|
}
|
|
462
475
|
/** Add and return a new paragraph.
|
|
463
476
|
* By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.
|
|
464
|
-
* @param seedFromLast If true and [[
|
|
477
|
+
* @param seedFromLast If true and [[children]] is not empty, the new paragraph will inherit the style overrides of the last child in this block.
|
|
478
|
+
* @note Be sure you pass in [[ParagraphProps]] and not [[Paragraph]] or style overrides will be ignored.
|
|
465
479
|
*/
|
|
466
|
-
appendParagraph(seedFromLast = false) {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
}
|
|
472
|
-
const paragraph = Paragraph.create({
|
|
473
|
-
styleOverrides
|
|
474
|
-
});
|
|
475
|
-
this.paragraphs.push(paragraph);
|
|
480
|
+
appendParagraph(props, seedFromLast = false) {
|
|
481
|
+
const seed = seedFromLast ? this.children[this.children.length - 1] : undefined;
|
|
482
|
+
const styleOverrides = { ...seed?.styleOverrides, ...props?.styleOverrides };
|
|
483
|
+
const paragraph = Paragraph.create({ ...props, styleOverrides });
|
|
484
|
+
this.children.push(paragraph);
|
|
476
485
|
return paragraph;
|
|
477
486
|
}
|
|
478
487
|
/** Append a run to the last [[Paragraph]] in this block.
|
|
479
|
-
* If the block contains no [[
|
|
488
|
+
* If the block contains no [[children]], a new [[Paragraph]] will first be created using [[appendParagraph]].
|
|
480
489
|
*/
|
|
481
490
|
appendRun(run) {
|
|
482
|
-
const paragraph = this.
|
|
483
|
-
paragraph.
|
|
491
|
+
const paragraph = this.children[this.children.length - 1] ?? this.appendParagraph();
|
|
492
|
+
paragraph.children.push(run);
|
|
484
493
|
}
|
|
485
494
|
equals(other) {
|
|
486
495
|
if (!(other instanceof TextBlock)) {
|
|
487
496
|
return false;
|
|
488
497
|
}
|
|
489
|
-
if (
|
|
498
|
+
if (!super.equals(other)) {
|
|
490
499
|
return false;
|
|
491
500
|
}
|
|
492
|
-
if (this.width !== other.width
|
|
501
|
+
if (this.width !== other.width) {
|
|
493
502
|
return false;
|
|
494
503
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
504
|
+
if (this.children && other.children) {
|
|
505
|
+
if (this.children.length !== other.children.length) {
|
|
506
|
+
return false;
|
|
507
|
+
}
|
|
508
|
+
return this.children.every((child, index) => other.children && child.equals(other.children[index]));
|
|
509
|
+
}
|
|
510
|
+
return true;
|
|
499
511
|
}
|
|
500
512
|
}
|
|
513
|
+
/**
|
|
514
|
+
* Recursively traverses a [[StructuralTextBlockComponent]] tree, yielding each child component along with its parent container.
|
|
515
|
+
* This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.
|
|
516
|
+
*
|
|
517
|
+
* @param parent The root container whose children should be traversed.
|
|
518
|
+
* @returns An IterableIterator yielding objects with the child component and its parent container.
|
|
519
|
+
* @beta
|
|
520
|
+
*/
|
|
521
|
+
export function* traverseTextBlockComponent(parent) {
|
|
522
|
+
for (const child of parent.children) {
|
|
523
|
+
yield { parent, child };
|
|
524
|
+
if (child.type === "list" || child.type === "paragraph") {
|
|
525
|
+
yield* traverseTextBlockComponent(child);
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Returns the formatted marker text for a list item based on the marker type and item number.
|
|
531
|
+
* Supports ordered and unordered list markers, including alphabetic, Roman numeral, and numeric formats.
|
|
532
|
+
* @param marker The type of list marker to use.
|
|
533
|
+
* @param num The item number in the list.
|
|
534
|
+
* @returns The formatted marker string for the list item.
|
|
535
|
+
* @beta
|
|
536
|
+
*/
|
|
537
|
+
export function getMarkerText(marker, num) {
|
|
538
|
+
let markerString = "";
|
|
539
|
+
switch (marker.enumerator) {
|
|
540
|
+
case undefined:
|
|
541
|
+
case ListMarkerEnumerator.Number:
|
|
542
|
+
markerString = `${num}`;
|
|
543
|
+
break;
|
|
544
|
+
case ListMarkerEnumerator.Letter:
|
|
545
|
+
markerString = integerToAlpha(num);
|
|
546
|
+
break;
|
|
547
|
+
case ListMarkerEnumerator.RomanNumeral:
|
|
548
|
+
markerString = integerToRoman(num);
|
|
549
|
+
break;
|
|
550
|
+
default:
|
|
551
|
+
markerString = marker.enumerator;
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
if (marker.case) {
|
|
555
|
+
markerString = marker.case === "upper" ? markerString.toUpperCase() : markerString.toLowerCase();
|
|
556
|
+
}
|
|
557
|
+
const terminator = marker.terminator === "period" ? "." : marker.terminator === "parenthesis" ? ")" : "";
|
|
558
|
+
return `${markerString}${terminator}`;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Converts an integer to its Roman numeral representation.
|
|
562
|
+
* Supports numbers from 1 and above.
|
|
563
|
+
* @param num The integer to convert.
|
|
564
|
+
* @returns The Roman numeral string.
|
|
565
|
+
*/
|
|
566
|
+
function integerToRoman(num) {
|
|
567
|
+
const values = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
|
|
568
|
+
const symbols = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
|
|
569
|
+
let roman = '';
|
|
570
|
+
for (let i = 0; i < values.length; i++) {
|
|
571
|
+
while (num >= values[i]) {
|
|
572
|
+
roman += symbols[i];
|
|
573
|
+
num -= values[i];
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
return roman;
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Converts an integer to its alphabetic representation (A-Z, AA-ZZ, etc.).
|
|
580
|
+
* Used for ordered list markers with alphabetic styles.
|
|
581
|
+
* @param num The integer to convert (1-based).
|
|
582
|
+
* @returns The alphabetic string for the given number.
|
|
583
|
+
*/
|
|
584
|
+
function integerToAlpha(num) {
|
|
585
|
+
const letterOffset = (num - 1) % 26;
|
|
586
|
+
const letter = String.fromCharCode(65 + letterOffset);
|
|
587
|
+
const depth = Math.ceil(num / 26);
|
|
588
|
+
return letter.repeat(depth);
|
|
589
|
+
}
|
|
501
590
|
//# sourceMappingURL=TextBlock.js.map
|