@itwin/core-common 4.6.0-dev.8 → 4.6.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 +23 -1
- package/lib/cjs/AmbientOcclusion.js +1 -1
- package/lib/cjs/AmbientOcclusion.js.map +1 -1
- package/lib/cjs/AnalysisStyle.js +1 -1
- package/lib/cjs/AnalysisStyle.js.map +1 -1
- package/lib/cjs/Atmosphere.js +12 -12
- package/lib/cjs/Atmosphere.js.map +1 -1
- package/lib/cjs/BackgroundMapProvider.js +1 -1
- package/lib/cjs/BackgroundMapProvider.js.map +1 -1
- package/lib/cjs/BackgroundMapSettings.js +1 -1
- package/lib/cjs/BackgroundMapSettings.js.map +1 -1
- package/lib/cjs/Base64EncodedString.js +1 -1
- package/lib/cjs/Base64EncodedString.js.map +1 -1
- package/lib/cjs/BlobReader.js.map +1 -1
- package/lib/cjs/BriefcaseTypes.js +5 -5
- package/lib/cjs/BriefcaseTypes.js.map +1 -1
- package/lib/cjs/Camera.js.map +1 -1
- package/lib/cjs/ChangedElements.js +1 -1
- package/lib/cjs/ChangedElements.js.map +1 -1
- package/lib/cjs/ChangesetProps.js +1 -1
- package/lib/cjs/ChangesetProps.js.map +1 -1
- package/lib/cjs/ClipStyle.js +3 -3
- package/lib/cjs/ClipStyle.js.map +1 -1
- package/lib/cjs/Code.d.ts +1 -0
- package/lib/cjs/Code.d.ts.map +1 -1
- package/lib/cjs/Code.js +3 -2
- package/lib/cjs/Code.js.map +1 -1
- package/lib/cjs/ColorDef.js +1 -1
- package/lib/cjs/ColorDef.js.map +1 -1
- package/lib/cjs/CommonLoggerCategory.js +1 -1
- package/lib/cjs/CommonLoggerCategory.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +11 -11
- package/lib/cjs/ConcurrentQuery.d.ts.map +1 -1
- package/lib/cjs/ConcurrentQuery.js +6 -6
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/ContextRealityModel.js +5 -5
- package/lib/cjs/ContextRealityModel.js.map +1 -1
- package/lib/cjs/DisplayStyleSettings.js +1 -1
- package/lib/cjs/DisplayStyleSettings.js.map +1 -1
- package/lib/cjs/ECSqlReader.js +1 -1
- package/lib/cjs/ECSqlReader.js.map +1 -1
- package/lib/cjs/ECSqlTypes.js +4 -4
- package/lib/cjs/ECSqlTypes.js.map +1 -1
- package/lib/cjs/ElementMesh.js.map +1 -1
- package/lib/cjs/ElementProps.d.ts +23 -0
- package/lib/cjs/ElementProps.d.ts.map +1 -1
- package/lib/cjs/ElementProps.js +4 -4
- package/lib/cjs/ElementProps.js.map +1 -1
- package/lib/cjs/EmphasizeElementsProps.js +1 -1
- package/lib/cjs/EmphasizeElementsProps.js.map +1 -1
- package/lib/cjs/EntityProps.d.ts +5 -2
- package/lib/cjs/EntityProps.d.ts.map +1 -1
- package/lib/cjs/EntityProps.js +2 -1
- package/lib/cjs/EntityProps.js.map +1 -1
- package/lib/cjs/EntityReference.js +2 -2
- package/lib/cjs/EntityReference.js.map +1 -1
- package/lib/cjs/Environment.js +1 -1
- package/lib/cjs/Environment.js.map +1 -1
- package/lib/cjs/FeatureIndex.js +1 -1
- package/lib/cjs/FeatureIndex.js.map +1 -1
- package/lib/cjs/FeatureSymbology.d.ts +1 -1
- package/lib/cjs/FeatureSymbology.js +3 -3
- package/lib/cjs/FeatureSymbology.js.map +1 -1
- package/lib/cjs/FeatureTable.js +3 -3
- package/lib/cjs/FeatureTable.js.map +1 -1
- package/lib/cjs/Fonts.js +1 -1
- package/lib/cjs/Fonts.js.map +1 -1
- package/lib/cjs/Frustum.d.ts.map +1 -1
- package/lib/cjs/Frustum.js +3 -1
- package/lib/cjs/Frustum.js.map +1 -1
- package/lib/cjs/GenericInstanceFilter.js +2 -2
- package/lib/cjs/GenericInstanceFilter.js.map +1 -1
- package/lib/cjs/GeoCoordinateServices.js +1 -1
- package/lib/cjs/GeoCoordinateServices.js.map +1 -1
- package/lib/cjs/GeometryParams.js +3 -3
- package/lib/cjs/GeometryParams.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +1 -1
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/Gradient.js +5 -5
- package/lib/cjs/Gradient.js.map +1 -1
- package/lib/cjs/GraphicParams.js +1 -1
- package/lib/cjs/GraphicParams.js.map +1 -1
- package/lib/cjs/GroundPlane.js +1 -1
- package/lib/cjs/GroundPlane.js.map +1 -1
- package/lib/cjs/HSVColor.js +1 -1
- package/lib/cjs/HSVColor.js.map +1 -1
- package/lib/cjs/HiddenLine.js +1 -1
- package/lib/cjs/HiddenLine.js.map +1 -1
- package/lib/cjs/Hilite.js +1 -1
- package/lib/cjs/Hilite.js.map +1 -1
- package/lib/cjs/IModel.js +1 -1
- package/lib/cjs/IModel.js.map +1 -1
- package/lib/cjs/IModelVersion.js.map +1 -1
- package/lib/cjs/Image.js +2 -2
- package/lib/cjs/Image.js.map +1 -1
- package/lib/cjs/IpcAppProps.d.ts +24 -2
- package/lib/cjs/IpcAppProps.d.ts.map +1 -1
- package/lib/cjs/IpcAppProps.js.map +1 -1
- package/lib/cjs/LightSettings.js +1 -1
- package/lib/cjs/LightSettings.js.map +1 -1
- package/lib/cjs/LinePixels.js +1 -1
- package/lib/cjs/LinePixels.js.map +1 -1
- package/lib/cjs/Localization.js.map +1 -1
- package/lib/cjs/MapImagerySettings.js +1 -1
- package/lib/cjs/MapImagerySettings.js.map +1 -1
- package/lib/cjs/MapLayerSettings.js.map +1 -1
- package/lib/cjs/MassProperties.js +1 -1
- package/lib/cjs/MassProperties.js.map +1 -1
- package/lib/cjs/MaterialProps.js +2 -2
- package/lib/cjs/MaterialProps.js.map +1 -1
- package/lib/cjs/ModelGeometryChanges.js +2 -2
- package/lib/cjs/ModelGeometryChanges.js.map +1 -1
- package/lib/cjs/NativeAppProps.js +2 -2
- package/lib/cjs/NativeAppProps.js.map +1 -1
- package/lib/cjs/OctEncodedNormal.js.map +1 -1
- package/lib/cjs/PlanarClipMask.js +3 -3
- package/lib/cjs/PlanarClipMask.js.map +1 -1
- package/lib/cjs/QPoint.d.ts +4 -3
- package/lib/cjs/QPoint.d.ts.map +1 -1
- package/lib/cjs/QPoint.js +5 -4
- package/lib/cjs/QPoint.js.map +1 -1
- package/lib/cjs/RealityDataAccessProps.d.ts +4 -4
- package/lib/cjs/RealityDataAccessProps.d.ts.map +1 -1
- package/lib/cjs/RealityDataAccessProps.js +1 -1
- package/lib/cjs/RealityDataAccessProps.js.map +1 -1
- package/lib/cjs/RealityModelDisplaySettings.js +2 -2
- package/lib/cjs/RealityModelDisplaySettings.js.map +1 -1
- package/lib/cjs/Render.d.ts +2 -2
- package/lib/cjs/Render.d.ts.map +1 -1
- package/lib/cjs/Render.js +1 -1
- package/lib/cjs/Render.js.map +1 -1
- package/lib/cjs/RenderMaterial.js +1 -1
- package/lib/cjs/RenderMaterial.js.map +1 -1
- package/lib/cjs/RenderSchedule.js +1 -1
- package/lib/cjs/RenderSchedule.js.map +1 -1
- package/lib/cjs/RenderTexture.js +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/SkyBox.js +3 -3
- package/lib/cjs/SkyBox.js.map +1 -1
- package/lib/cjs/SolarCalculate.js.map +1 -1
- package/lib/cjs/SolarShadows.js +1 -1
- package/lib/cjs/SolarShadows.js.map +1 -1
- package/lib/cjs/SpatialClassification.js +2 -2
- package/lib/cjs/SpatialClassification.js.map +1 -1
- package/lib/cjs/SubCategoryAppearance.js +1 -1
- package/lib/cjs/SubCategoryAppearance.js.map +1 -1
- package/lib/cjs/SubCategoryOverride.js +1 -1
- package/lib/cjs/SubCategoryOverride.js.map +1 -1
- package/lib/cjs/TerrainSettings.js +2 -2
- package/lib/cjs/TerrainSettings.js.map +1 -1
- package/lib/cjs/TextureMapping.js +1 -1
- package/lib/cjs/TextureMapping.js.map +1 -1
- package/lib/cjs/TextureProps.js +1 -1
- package/lib/cjs/TextureProps.js.map +1 -1
- package/lib/cjs/ThematicDisplay.js +5 -5
- package/lib/cjs/ThematicDisplay.js.map +1 -1
- package/lib/cjs/TileProps.js +1 -1
- package/lib/cjs/TileProps.js.map +1 -1
- package/lib/cjs/Tween.js.map +1 -1
- package/lib/cjs/TxnAction.js +1 -1
- package/lib/cjs/TxnAction.js.map +1 -1
- package/lib/cjs/ViewDetails.js +2 -2
- package/lib/cjs/ViewDetails.js.map +1 -1
- package/lib/cjs/ViewFlags.js +2 -2
- package/lib/cjs/ViewFlags.js.map +1 -1
- package/lib/cjs/ViewProps.js +1 -1
- package/lib/cjs/ViewProps.js.map +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js +1 -1
- package/lib/cjs/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/cjs/annotation/TextAnnotation.d.ts +93 -0
- package/lib/cjs/annotation/TextAnnotation.d.ts.map +1 -0
- package/lib/cjs/annotation/TextAnnotation.js +95 -0
- package/lib/cjs/annotation/TextAnnotation.js.map +1 -0
- package/lib/cjs/annotation/TextBlock.d.ts +276 -0
- package/lib/cjs/annotation/TextBlock.d.ts.map +1 -0
- package/lib/cjs/annotation/TextBlock.js +324 -0
- package/lib/cjs/annotation/TextBlock.js.map +1 -0
- package/lib/cjs/annotation/TextBlockGeometryProps.d.ts +40 -0
- package/lib/cjs/annotation/TextBlockGeometryProps.d.ts.map +1 -0
- package/lib/cjs/annotation/TextBlockGeometryProps.js +10 -0
- package/lib/cjs/annotation/TextBlockGeometryProps.js.map +1 -0
- package/lib/cjs/annotation/TextStyle.d.ts +173 -0
- package/lib/cjs/annotation/TextStyle.d.ts.map +1 -0
- package/lib/cjs/annotation/TextStyle.js +106 -0
- package/lib/cjs/annotation/TextStyle.js.map +1 -0
- package/lib/cjs/core-common.d.ts +8 -0
- package/lib/cjs/core-common.d.ts.map +1 -1
- package/lib/cjs/core-common.js +8 -0
- package/lib/cjs/core-common.js.map +1 -1
- package/lib/cjs/geometry/AdditionalTransform.js.map +1 -1
- package/lib/cjs/geometry/AreaPattern.js +1 -1
- package/lib/cjs/geometry/AreaPattern.js.map +1 -1
- package/lib/cjs/geometry/Cartographic.js +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.d.ts +5 -0
- package/lib/cjs/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/cjs/geometry/ElementGeometry.js +28 -3
- package/lib/cjs/geometry/ElementGeometry.js.map +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js +1 -1
- package/lib/cjs/geometry/ElementGeometryFB.js.map +1 -1
- package/lib/cjs/geometry/FrustumPlanes.js +5 -5
- 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.d.ts +5 -0
- package/lib/cjs/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/cjs/geometry/GeometryStream.js +35 -9
- package/lib/cjs/geometry/GeometryStream.js.map +1 -1
- package/lib/cjs/geometry/LineStyle.js +1 -1
- package/lib/cjs/geometry/LineStyle.js.map +1 -1
- package/lib/cjs/geometry/Projection.js.map +1 -1
- package/lib/cjs/geometry/TextString.d.ts.map +1 -1
- package/lib/cjs/geometry/TextString.js +16 -13
- package/lib/cjs/geometry/TextString.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocket.js +3 -3
- package/lib/cjs/ipc/IpcWebSocket.js.map +1 -1
- package/lib/cjs/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/cjs/rpc/DevToolsRpcInterface.js +2 -2
- package/lib/cjs/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js +1 -1
- package/lib/cjs/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js +1 -1
- package/lib/cjs/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js +1 -1
- package/lib/cjs/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/WipRpcInterface.js +1 -1
- package/lib/cjs/rpc/WipRpcInterface.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConfiguration.js +6 -6
- package/lib/cjs/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/cjs/rpc/core/RpcConstants.js +7 -7
- package/lib/cjs/rpc/core/RpcConstants.js.map +1 -1
- package/lib/cjs/rpc/core/RpcControl.js +1 -1
- package/lib/cjs/rpc/core/RpcControl.js.map +1 -1
- package/lib/cjs/rpc/core/RpcInvocation.js +3 -3
- package/lib/cjs/rpc/core/RpcInvocation.js.map +1 -1
- package/lib/cjs/rpc/core/RpcMarshaling.js +2 -2
- package/lib/cjs/rpc/core/RpcMarshaling.js.map +1 -1
- package/lib/cjs/rpc/core/RpcOperation.js +2 -3
- 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 +3 -3
- package/lib/cjs/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/cjs/rpc/core/RpcPush.js +2 -2
- 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 +1 -1
- package/lib/cjs/rpc/core/RpcRequest.js.map +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js +1 -1
- package/lib/cjs/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/cjs/rpc/web/BentleyCloudRpcManager.js +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/RpcMultipart.js +1 -1
- package/lib/cjs/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/cjs/rpc/web/WebAppRpcLogging.js +8 -8
- 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 +3 -3
- 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/GltfTileIO.js +2 -2
- package/lib/cjs/tile/GltfTileIO.js.map +1 -1
- package/lib/cjs/tile/I3dmTileIO.js.map +1 -1
- package/lib/cjs/tile/IModelTileIO.js +3 -3
- package/lib/cjs/tile/IModelTileIO.js.map +1 -1
- package/lib/cjs/tile/TileIO.d.ts +6 -6
- package/lib/cjs/tile/TileIO.d.ts.map +1 -1
- package/lib/cjs/tile/TileIO.js +2 -2
- package/lib/cjs/tile/TileIO.js.map +1 -1
- package/lib/cjs/tile/TileMetadata.d.ts +3 -3
- package/lib/cjs/tile/TileMetadata.d.ts.map +1 -1
- package/lib/cjs/tile/TileMetadata.js +3 -3
- package/lib/cjs/tile/TileMetadata.js.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.d.ts.map +1 -1
- package/lib/cjs/tile/Tileset3dSchema.js.map +1 -1
- package/lib/esm/AnalysisStyle.js +1 -2
- package/lib/esm/AnalysisStyle.js.map +1 -1
- package/lib/esm/Atmosphere.js +11 -11
- package/lib/esm/Atmosphere.js.map +1 -1
- package/lib/esm/BackgroundMapProvider.js.map +1 -1
- package/lib/esm/BackgroundMapSettings.js.map +1 -1
- package/lib/esm/BlobReader.js.map +1 -1
- package/lib/esm/Camera.js.map +1 -1
- package/lib/esm/ClipStyle.js +3 -6
- package/lib/esm/ClipStyle.js.map +1 -1
- package/lib/esm/Code.d.ts +1 -0
- package/lib/esm/Code.d.ts.map +1 -1
- package/lib/esm/Code.js +1 -0
- package/lib/esm/Code.js.map +1 -1
- package/lib/esm/ColorDef.js +1 -2
- package/lib/esm/ColorDef.js.map +1 -1
- package/lib/esm/ConcurrentQuery.d.ts +11 -11
- package/lib/esm/ConcurrentQuery.d.ts.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/ContextRealityModel.js.map +1 -1
- package/lib/esm/DisplayStyleSettings.js.map +1 -1
- package/lib/esm/ECSqlReader.js +1 -2
- 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 +23 -0
- package/lib/esm/ElementProps.d.ts.map +1 -1
- package/lib/esm/ElementProps.js +1 -2
- package/lib/esm/ElementProps.js.map +1 -1
- package/lib/esm/EntityProps.d.ts +5 -2
- package/lib/esm/EntityProps.d.ts.map +1 -1
- package/lib/esm/EntityProps.js +1 -0
- package/lib/esm/EntityProps.js.map +1 -1
- package/lib/esm/Environment.js +1 -2
- package/lib/esm/Environment.js.map +1 -1
- package/lib/esm/FeatureSymbology.d.ts +1 -1
- package/lib/esm/FeatureSymbology.js +2 -4
- package/lib/esm/FeatureSymbology.js.map +1 -1
- package/lib/esm/FeatureTable.js.map +1 -1
- package/lib/esm/Frustum.d.ts.map +1 -1
- package/lib/esm/Frustum.js +2 -0
- package/lib/esm/Frustum.js.map +1 -1
- package/lib/esm/GeoCoordinateServices.js.map +1 -1
- package/lib/esm/GeometryParams.js.map +1 -1
- package/lib/esm/Gradient.js +4 -4
- package/lib/esm/Gradient.js.map +1 -1
- package/lib/esm/GroundPlane.js +1 -2
- package/lib/esm/GroundPlane.js.map +1 -1
- package/lib/esm/HSVColor.js.map +1 -1
- package/lib/esm/HiddenLine.js.map +1 -1
- package/lib/esm/IModel.js +1 -2
- package/lib/esm/IModel.js.map +1 -1
- package/lib/esm/IModelVersion.js.map +1 -1
- package/lib/esm/Image.js.map +1 -1
- package/lib/esm/IpcAppProps.d.ts +24 -2
- package/lib/esm/IpcAppProps.d.ts.map +1 -1
- package/lib/esm/IpcAppProps.js.map +1 -1
- package/lib/esm/LightSettings.js +1 -2
- package/lib/esm/LightSettings.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/ModelGeometryChanges.js.map +1 -1
- package/lib/esm/OctEncodedNormal.js.map +1 -1
- package/lib/esm/PlanarClipMask.js +1 -2
- package/lib/esm/PlanarClipMask.js.map +1 -1
- package/lib/esm/QPoint.d.ts +4 -3
- package/lib/esm/QPoint.d.ts.map +1 -1
- package/lib/esm/QPoint.js +2 -1
- package/lib/esm/QPoint.js.map +1 -1
- package/lib/esm/RealityDataAccessProps.d.ts +4 -4
- package/lib/esm/RealityDataAccessProps.d.ts.map +1 -1
- package/lib/esm/RealityModelDisplaySettings.js +2 -4
- package/lib/esm/RealityModelDisplaySettings.js.map +1 -1
- package/lib/esm/Render.d.ts +2 -2
- package/lib/esm/Render.d.ts.map +1 -1
- package/lib/esm/Render.js.map +1 -1
- package/lib/esm/RenderSchedule.js.map +1 -1
- package/lib/esm/RgbColor.js.map +1 -1
- package/lib/esm/RpcInterface.js.map +1 -1
- package/lib/esm/SkyBox.js +2 -4
- package/lib/esm/SkyBox.js.map +1 -1
- package/lib/esm/SolarCalculate.js.map +1 -1
- package/lib/esm/SolarShadows.js +1 -2
- package/lib/esm/SolarShadows.js.map +1 -1
- package/lib/esm/SpatialClassification.js.map +1 -1
- package/lib/esm/SubCategoryAppearance.js +1 -2
- package/lib/esm/SubCategoryAppearance.js.map +1 -1
- package/lib/esm/SubCategoryOverride.js +1 -2
- 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/ThematicDisplay.js +1 -2
- package/lib/esm/ThematicDisplay.js.map +1 -1
- package/lib/esm/Tween.js.map +1 -1
- package/lib/esm/ViewDetails.js +1 -2
- package/lib/esm/ViewDetails.js.map +1 -1
- package/lib/esm/ViewFlags.js +1 -2
- package/lib/esm/ViewFlags.js.map +1 -1
- package/lib/esm/WhiteOnWhiteReversalSettings.js +1 -2
- package/lib/esm/WhiteOnWhiteReversalSettings.js.map +1 -1
- package/lib/esm/annotation/TextAnnotation.d.ts +93 -0
- package/lib/esm/annotation/TextAnnotation.d.ts.map +1 -0
- package/lib/esm/annotation/TextAnnotation.js +91 -0
- package/lib/esm/annotation/TextAnnotation.js.map +1 -0
- package/lib/esm/annotation/TextBlock.d.ts +276 -0
- package/lib/esm/annotation/TextBlock.d.ts.map +1 -0
- package/lib/esm/annotation/TextBlock.js +315 -0
- package/lib/esm/annotation/TextBlock.js.map +1 -0
- package/lib/esm/annotation/TextBlockGeometryProps.d.ts +40 -0
- package/lib/esm/annotation/TextBlockGeometryProps.d.ts.map +1 -0
- package/lib/esm/annotation/TextBlockGeometryProps.js +9 -0
- package/lib/esm/annotation/TextBlockGeometryProps.js.map +1 -0
- package/lib/esm/annotation/TextStyle.d.ts +173 -0
- package/lib/esm/annotation/TextStyle.d.ts.map +1 -0
- package/lib/esm/annotation/TextStyle.js +101 -0
- package/lib/esm/annotation/TextStyle.js.map +1 -0
- package/lib/esm/core-common.d.ts +8 -0
- package/lib/esm/core-common.d.ts.map +1 -1
- package/lib/esm/core-common.js +8 -0
- package/lib/esm/core-common.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/Cartographic.js +1 -2
- package/lib/esm/geometry/Cartographic.js.map +1 -1
- package/lib/esm/geometry/CoordinateReferenceSystem.js.map +1 -1
- package/lib/esm/geometry/ElementGeometry.d.ts +5 -0
- package/lib/esm/geometry/ElementGeometry.d.ts.map +1 -1
- package/lib/esm/geometry/ElementGeometry.js +26 -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 +4 -4
- 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.d.ts +5 -0
- package/lib/esm/geometry/GeometryStream.d.ts.map +1 -1
- package/lib/esm/geometry/GeometryStream.js +34 -8
- package/lib/esm/geometry/GeometryStream.js.map +1 -1
- package/lib/esm/geometry/LineStyle.js.map +1 -1
- package/lib/esm/geometry/Projection.js.map +1 -1
- package/lib/esm/geometry/TextString.d.ts.map +1 -1
- package/lib/esm/geometry/TextString.js +16 -13
- package/lib/esm/geometry/TextString.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocket.js +1 -2
- package/lib/esm/ipc/IpcWebSocket.js.map +1 -1
- package/lib/esm/ipc/IpcWebSocketTransport.js.map +1 -1
- package/lib/esm/rpc/DevToolsRpcInterface.js +1 -2
- package/lib/esm/rpc/DevToolsRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelReadRpcInterface.js +1 -2
- package/lib/esm/rpc/IModelReadRpcInterface.js.map +1 -1
- package/lib/esm/rpc/IModelTileRpcInterface.js +1 -2
- package/lib/esm/rpc/IModelTileRpcInterface.js.map +1 -1
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js +1 -2
- package/lib/esm/rpc/SnapshotIModelRpcInterface.js.map +1 -1
- package/lib/esm/rpc/WipRpcInterface.js +1 -2
- package/lib/esm/rpc/WipRpcInterface.js.map +1 -1
- package/lib/esm/rpc/core/RpcConfiguration.js +5 -6
- package/lib/esm/rpc/core/RpcConfiguration.js.map +1 -1
- package/lib/esm/rpc/core/RpcControl.js +1 -2
- package/lib/esm/rpc/core/RpcControl.js.map +1 -1
- package/lib/esm/rpc/core/RpcInvocation.js +3 -4
- 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 +1 -2
- 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 +1 -2
- package/lib/esm/rpc/core/RpcProtocol.js.map +1 -1
- package/lib/esm/rpc/core/RpcPush.js +2 -4
- 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 +1 -2
- package/lib/esm/rpc/core/RpcRequest.js.map +1 -1
- package/lib/esm/rpc/core/RpcRoutingToken.js +1 -2
- package/lib/esm/rpc/core/RpcRoutingToken.js.map +1 -1
- package/lib/esm/rpc/web/BentleyCloudRpcManager.js +1 -2
- 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/RpcMultipart.js +1 -2
- package/lib/esm/rpc/web/RpcMultipart.js.map +1 -1
- package/lib/esm/rpc/web/WebAppRpcLogging.js +8 -8
- 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 +3 -4
- 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/GltfTileIO.js.map +1 -1
- package/lib/esm/tile/I3dmTileIO.js.map +1 -1
- package/lib/esm/tile/IModelTileIO.js +1 -2
- package/lib/esm/tile/IModelTileIO.js.map +1 -1
- package/lib/esm/tile/TileIO.d.ts +6 -6
- package/lib/esm/tile/TileIO.d.ts.map +1 -1
- package/lib/esm/tile/TileIO.js.map +1 -1
- package/lib/esm/tile/TileMetadata.d.ts +3 -3
- package/lib/esm/tile/TileMetadata.d.ts.map +1 -1
- package/lib/esm/tile/TileMetadata.js.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.d.ts.map +1 -1
- package/lib/esm/tile/Tileset3dSchema.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Annotation
|
|
3
|
+
*/
|
|
4
|
+
import { TextStyleSettingsProps } from "./TextStyle";
|
|
5
|
+
/** Options supplied to [[TextBlockComponent.applyStyle]] to control how the style is applied to the component and its child components.
|
|
6
|
+
* @beta
|
|
7
|
+
*/
|
|
8
|
+
export interface ApplyTextStyleOptions {
|
|
9
|
+
/** Controls whether any deviations from the style's settings stored in [[TextBlockComponent.styleOverrides]] are retained.
|
|
10
|
+
* By default, all overrides are cleared.
|
|
11
|
+
*/
|
|
12
|
+
preserveOverrides?: boolean;
|
|
13
|
+
/** Controls whether the style should be recursively applied to the [[Paragraph]]s belonging to a [[TextBlock]] and the [[Run]]s belonging to a [[Paragraph]].
|
|
14
|
+
* By default, the style change propagates to child components.
|
|
15
|
+
*/
|
|
16
|
+
preventPropagation?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** The JSON representation of a [[TextBlockComponent]].
|
|
19
|
+
* @beta
|
|
20
|
+
*/
|
|
21
|
+
export interface TextBlockComponentProps {
|
|
22
|
+
/** The name of a [[TextStyle]] stored in a [Workspace]($backend) from which the base [[TextStyleSettings]] applied to the component originates. */
|
|
23
|
+
styleName: string;
|
|
24
|
+
/** Deviations from the base [[TextStyleSettings]] defined by the [[TextStyle]] applied to this component.
|
|
25
|
+
* This permits you to, e.g., create a [[TextRun]] using "Arial" font and override it to use "Comic Sans" instead.
|
|
26
|
+
*/
|
|
27
|
+
styleOverrides?: TextStyleSettingsProps;
|
|
28
|
+
}
|
|
29
|
+
/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.
|
|
30
|
+
* @beta
|
|
31
|
+
*/
|
|
32
|
+
export interface TextBlockStringifyOptions {
|
|
33
|
+
/** A string to insert in between each [[Paragraph]].
|
|
34
|
+
* Default: " " - a single space.
|
|
35
|
+
*/
|
|
36
|
+
paragraphBreak?: string;
|
|
37
|
+
/** A string to insert for each [[LineBreakRun]].
|
|
38
|
+
* Default: " " - a single space.
|
|
39
|
+
*/
|
|
40
|
+
lineBreak?: string;
|
|
41
|
+
/** A string to insert between the numerator and denominator of each [[FractionRun]].
|
|
42
|
+
* Default: "/"
|
|
43
|
+
*/
|
|
44
|
+
fractionSeparator?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.
|
|
47
|
+
* Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.
|
|
48
|
+
* @beta
|
|
49
|
+
*/
|
|
50
|
+
export declare abstract class TextBlockComponent {
|
|
51
|
+
private _styleName;
|
|
52
|
+
private _styleOverrides;
|
|
53
|
+
/** @internal */
|
|
54
|
+
protected constructor(props: TextBlockComponentProps);
|
|
55
|
+
/** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.
|
|
56
|
+
* @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of
|
|
57
|
+
* the components sub-components and clears any [[styleOverrides]].
|
|
58
|
+
*/
|
|
59
|
+
get styleName(): string;
|
|
60
|
+
set styleName(styleName: string);
|
|
61
|
+
/** Deviations in individual properties of the [[TextStyle]] specified by [[styleName]].
|
|
62
|
+
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.fontName` to "Comic Sans".
|
|
63
|
+
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
64
|
+
*/
|
|
65
|
+
get styleOverrides(): TextStyleSettingsProps;
|
|
66
|
+
set styleOverrides(overrides: TextStyleSettingsProps);
|
|
67
|
+
/** Reset any [[styleOverrides]] applied to this component's [[TextStyle]]. */
|
|
68
|
+
clearStyleOverrides(): void;
|
|
69
|
+
/** Apply the [[TextStyle]] specified by `styleName` to this component, optionally preserving [[styleOverrides]] and/or preventing propagation to sub-components. */
|
|
70
|
+
applyStyle(styleName: string, options?: ApplyTextStyleOptions): void;
|
|
71
|
+
/** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */
|
|
72
|
+
get overridesStyle(): boolean;
|
|
73
|
+
/** Create a deep copy of this component. */
|
|
74
|
+
abstract clone(): TextBlockComponent;
|
|
75
|
+
/** Compute a string representation of the contents of this component and all of its sub-components. */
|
|
76
|
+
abstract stringify(options?: TextBlockStringifyOptions): string;
|
|
77
|
+
/** Convert this component to its JSON representation. */
|
|
78
|
+
toJSON(): TextBlockComponentProps;
|
|
79
|
+
/** Returns true if `this` is equivalent to `other`. */
|
|
80
|
+
equals(other: TextBlockComponent): boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @beta
|
|
84
|
+
*/
|
|
85
|
+
export type Run = TextRun | FractionRun | LineBreakRun;
|
|
86
|
+
/** The JSON representation of a [[Run]].
|
|
87
|
+
* Use the `type` field to discriminate between the different kinds of runs.
|
|
88
|
+
* @beta
|
|
89
|
+
*/
|
|
90
|
+
export type RunProps = TextRunProps | FractionRunProps | LineBreakRunProps;
|
|
91
|
+
/** 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
|
|
92
|
+
* multiple lines, but it will never contain different styling.
|
|
93
|
+
* Use the `type` field to discriminate between the different kinds of runs.
|
|
94
|
+
* @beta
|
|
95
|
+
*/
|
|
96
|
+
export declare namespace Run {
|
|
97
|
+
/** Create a run from its JSON representation.
|
|
98
|
+
* @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.
|
|
99
|
+
*/
|
|
100
|
+
function fromJSON(props: RunProps): Run;
|
|
101
|
+
}
|
|
102
|
+
/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.
|
|
103
|
+
* [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]
|
|
104
|
+
* affect how the content is rendered.
|
|
105
|
+
* @beta
|
|
106
|
+
*/
|
|
107
|
+
export type BaselineShift = "subscript" | "superscript" | "none";
|
|
108
|
+
/** JSON representation of a [[TextRun]].
|
|
109
|
+
* @beta
|
|
110
|
+
*/
|
|
111
|
+
export interface TextRunProps extends TextBlockComponentProps {
|
|
112
|
+
/** Discriminator field for the [[RunProps]] union. */
|
|
113
|
+
readonly type: "text";
|
|
114
|
+
/** The characters displayed by the run.
|
|
115
|
+
* Default: an empty string.
|
|
116
|
+
*/
|
|
117
|
+
content?: string;
|
|
118
|
+
/** Whether to display [[content]] as a subscript, superscript, or normally.
|
|
119
|
+
* Default: "none"
|
|
120
|
+
*/
|
|
121
|
+
baselineShift?: BaselineShift;
|
|
122
|
+
}
|
|
123
|
+
/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.
|
|
124
|
+
* @beta
|
|
125
|
+
*/
|
|
126
|
+
export declare class TextRun extends TextBlockComponent {
|
|
127
|
+
/** Discriminator field for the [[Run]] union. */
|
|
128
|
+
readonly type = "text";
|
|
129
|
+
/** The sequence of characters to be displayed by the run. */
|
|
130
|
+
content: string;
|
|
131
|
+
/** Whether to display [[content]] as a subscript, superscript, or normally. */
|
|
132
|
+
baselineShift: BaselineShift;
|
|
133
|
+
private constructor();
|
|
134
|
+
clone(): TextRun;
|
|
135
|
+
toJSON(): TextRunProps;
|
|
136
|
+
static create(props: Omit<TextRunProps, "type">): TextRun;
|
|
137
|
+
/** Simply returns [[content]]. */
|
|
138
|
+
stringify(): string;
|
|
139
|
+
equals(other: TextBlockComponent): boolean;
|
|
140
|
+
}
|
|
141
|
+
/** JSON representation of a [[FractionRun]].
|
|
142
|
+
* @beta
|
|
143
|
+
*/
|
|
144
|
+
export interface FractionRunProps extends TextBlockComponentProps {
|
|
145
|
+
/** Discriminator field for the [[RunProps]] union. */
|
|
146
|
+
readonly type: "fraction";
|
|
147
|
+
/** The text displayed before or above the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */
|
|
148
|
+
numerator?: string;
|
|
149
|
+
/** The text displayed after or below the fraction separator, depending on [[TextStyle.stackedFractionType]]. Default: an empty string. */
|
|
150
|
+
denominator?: string;
|
|
151
|
+
}
|
|
152
|
+
/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.
|
|
153
|
+
* @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.
|
|
154
|
+
* @beta
|
|
155
|
+
*/
|
|
156
|
+
export declare class FractionRun extends TextBlockComponent {
|
|
157
|
+
/** Discriminator field for the [[Run]] union. */
|
|
158
|
+
readonly type = "fraction";
|
|
159
|
+
/** The fraction's numerator. */
|
|
160
|
+
numerator: string;
|
|
161
|
+
/** The fraction's denominator. */
|
|
162
|
+
denominator: string;
|
|
163
|
+
private constructor();
|
|
164
|
+
toJSON(): FractionRunProps;
|
|
165
|
+
clone(): FractionRun;
|
|
166
|
+
static create(props: Omit<FractionRunProps, "type">): FractionRun;
|
|
167
|
+
/** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */
|
|
168
|
+
stringify(options?: TextBlockStringifyOptions): string;
|
|
169
|
+
equals(other: TextBlockComponent): boolean;
|
|
170
|
+
}
|
|
171
|
+
/** JSON representation of a [[LineBreakRun]].
|
|
172
|
+
* @beta
|
|
173
|
+
*/
|
|
174
|
+
export interface LineBreakRunProps extends TextBlockComponentProps {
|
|
175
|
+
/** Discriminator field for the [[RunProps]] union. */
|
|
176
|
+
readonly type: "linebreak";
|
|
177
|
+
}
|
|
178
|
+
/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.
|
|
179
|
+
* @beta
|
|
180
|
+
*/
|
|
181
|
+
export declare class LineBreakRun extends TextBlockComponent {
|
|
182
|
+
/** Discriminator field for the [[Run]] union. */
|
|
183
|
+
readonly type = "linebreak";
|
|
184
|
+
private constructor();
|
|
185
|
+
toJSON(): LineBreakRunProps;
|
|
186
|
+
static create(props: TextBlockComponentProps): LineBreakRun;
|
|
187
|
+
clone(): LineBreakRun;
|
|
188
|
+
/** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */
|
|
189
|
+
stringify(options?: TextBlockStringifyOptions): string;
|
|
190
|
+
equals(other: TextBlockComponent): boolean;
|
|
191
|
+
}
|
|
192
|
+
/** JSON representation of a [[Paragraph]].
|
|
193
|
+
* @beta
|
|
194
|
+
*/
|
|
195
|
+
export interface ParagraphProps extends TextBlockComponentProps {
|
|
196
|
+
/** The collection of [[Run]]s within the paragraph.
|
|
197
|
+
* Default: an empty array.
|
|
198
|
+
*/
|
|
199
|
+
runs?: RunProps[];
|
|
200
|
+
}
|
|
201
|
+
/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.
|
|
202
|
+
* @beta
|
|
203
|
+
*/
|
|
204
|
+
export declare class Paragraph extends TextBlockComponent {
|
|
205
|
+
/** The runs within the paragraph. You can modify the contents of this array to change the content of the paragraph. */
|
|
206
|
+
readonly runs: Run[];
|
|
207
|
+
private constructor();
|
|
208
|
+
toJSON(): ParagraphProps;
|
|
209
|
+
/** Create a paragraph from its JSON representation. */
|
|
210
|
+
static create(props: ParagraphProps): Paragraph;
|
|
211
|
+
clone(): Paragraph;
|
|
212
|
+
/** Apply the specified style to this [[Paragraph]], and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[runs]]. */
|
|
213
|
+
applyStyle(styleName: string, options?: ApplyTextStyleOptions): void;
|
|
214
|
+
/** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */
|
|
215
|
+
stringify(options?: TextBlockStringifyOptions): string;
|
|
216
|
+
equals(other: TextBlockComponent): boolean;
|
|
217
|
+
}
|
|
218
|
+
/** Describes the relative alignment of the content of a [[TextBlock]].
|
|
219
|
+
* @beta
|
|
220
|
+
*/
|
|
221
|
+
export type TextBlockJustification = "left" | "center" | "right";
|
|
222
|
+
/** JSON representation of a [[TextBlock]].
|
|
223
|
+
* @beta
|
|
224
|
+
*/
|
|
225
|
+
export interface TextBlockProps extends TextBlockComponentProps {
|
|
226
|
+
/** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line.
|
|
227
|
+
* A value less than or equal to zero indicates no wrapping is to be applied.
|
|
228
|
+
* Default: 0
|
|
229
|
+
*/
|
|
230
|
+
width?: number;
|
|
231
|
+
/** The alignment of the document content. Default: "left". */
|
|
232
|
+
justification?: TextBlockJustification;
|
|
233
|
+
/** The paragraphs within the text block. Default: an empty array. */
|
|
234
|
+
paragraphs?: ParagraphProps[];
|
|
235
|
+
}
|
|
236
|
+
/** 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.
|
|
237
|
+
* You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].
|
|
238
|
+
* No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
|
|
239
|
+
* @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
|
|
240
|
+
* @beta
|
|
241
|
+
*/
|
|
242
|
+
export declare class TextBlock extends TextBlockComponent {
|
|
243
|
+
/** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line.
|
|
244
|
+
* A value less than or equal to zero indicates no wrapping is to be applied.
|
|
245
|
+
* Default: 0
|
|
246
|
+
*/
|
|
247
|
+
width: number;
|
|
248
|
+
/** The alignment of the document's content. */
|
|
249
|
+
justification: TextBlockJustification;
|
|
250
|
+
/** The ordered list of paragraphs within the document. */
|
|
251
|
+
readonly paragraphs: Paragraph[];
|
|
252
|
+
private constructor();
|
|
253
|
+
toJSON(): TextBlockProps;
|
|
254
|
+
/** Create a text block from its JSON representation. */
|
|
255
|
+
static create(props: TextBlockProps): TextBlock;
|
|
256
|
+
/** Create an empty text block containing no [[paragraphs]] and an empty [[styleName]]. */
|
|
257
|
+
static createEmpty(): TextBlock;
|
|
258
|
+
/** Returns true if every paragraph in this text block is empty. */
|
|
259
|
+
get isEmpty(): boolean;
|
|
260
|
+
clone(): TextBlock;
|
|
261
|
+
/** Apply the specified style to this block and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[paragraphs]]. */
|
|
262
|
+
applyStyle(styleName: string, options?: ApplyTextStyleOptions): void;
|
|
263
|
+
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
264
|
+
stringify(options?: TextBlockStringifyOptions): string;
|
|
265
|
+
/** Add and return a new paragraph.
|
|
266
|
+
* If [[paragraphs]] is not empty, the style and overrides of the last [[Paragraph]] in the block will be applied to the new paragraph; otherwise,
|
|
267
|
+
* the paragraph will inherit this block's style with no overrides.
|
|
268
|
+
*/
|
|
269
|
+
appendParagraph(): Paragraph;
|
|
270
|
+
/** Append a run to the last [[Paragraph]] in this block.
|
|
271
|
+
* If the block contains no [[paragraphs]], a new one will first be created using [[appendParagraph]].
|
|
272
|
+
*/
|
|
273
|
+
appendRun(run: Run): void;
|
|
274
|
+
equals(other: TextBlockComponent): boolean;
|
|
275
|
+
}
|
|
276
|
+
//# sourceMappingURL=TextBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextBlock.d.ts","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC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+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
/** @packageDocumentation
|
|
7
|
+
* @module Annotation
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.TextBlock = exports.Paragraph = exports.LineBreakRun = exports.FractionRun = exports.TextRun = exports.Run = exports.TextBlockComponent = void 0;
|
|
11
|
+
/** Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s, [[Paragraph]]s, and [[TextBlock]] itself.
|
|
12
|
+
* Each component can specify a [[TextStyle]] that formats its contents and optional [[styleOverrides]] to customize that formatting.
|
|
13
|
+
* @beta
|
|
14
|
+
*/
|
|
15
|
+
class TextBlockComponent {
|
|
16
|
+
/** @internal */
|
|
17
|
+
constructor(props) {
|
|
18
|
+
this._styleName = props.styleName;
|
|
19
|
+
this._styleOverrides = { ...props.styleOverrides };
|
|
20
|
+
}
|
|
21
|
+
/** The name of the [[TextStyle]] that provides the base formatting for the contents of this component.
|
|
22
|
+
* @note Assigning to this property is equivalent to calling [[applyStyle]] with default [[ApplyTextStyleOptions]], which propagates the style change to all of
|
|
23
|
+
* the components sub-components and clears any [[styleOverrides]].
|
|
24
|
+
*/
|
|
25
|
+
get styleName() {
|
|
26
|
+
return this._styleName;
|
|
27
|
+
}
|
|
28
|
+
set styleName(styleName) {
|
|
29
|
+
this.applyStyle(styleName);
|
|
30
|
+
}
|
|
31
|
+
/** Deviations in individual properties of the [[TextStyle]] specified by [[styleName]].
|
|
32
|
+
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.fontName` to "Comic Sans".
|
|
33
|
+
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
34
|
+
*/
|
|
35
|
+
get styleOverrides() {
|
|
36
|
+
return this._styleOverrides;
|
|
37
|
+
}
|
|
38
|
+
set styleOverrides(overrides) {
|
|
39
|
+
this._styleOverrides = { ...overrides };
|
|
40
|
+
}
|
|
41
|
+
/** Reset any [[styleOverrides]] applied to this component's [[TextStyle]]. */
|
|
42
|
+
clearStyleOverrides() {
|
|
43
|
+
this.styleOverrides = {};
|
|
44
|
+
}
|
|
45
|
+
/** Apply the [[TextStyle]] specified by `styleName` to this component, optionally preserving [[styleOverrides]] and/or preventing propagation to sub-components. */
|
|
46
|
+
applyStyle(styleName, options) {
|
|
47
|
+
this._styleName = styleName;
|
|
48
|
+
if (!(options?.preserveOverrides)) {
|
|
49
|
+
this.clearStyleOverrides();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
/** Returns true if [[styleOverrides]] specifies any deviations from this component's base [[TextStyle]]. */
|
|
53
|
+
get overridesStyle() {
|
|
54
|
+
return Object.keys(this.styleOverrides).length > 0;
|
|
55
|
+
}
|
|
56
|
+
/** Convert this component to its JSON representation. */
|
|
57
|
+
toJSON() {
|
|
58
|
+
return {
|
|
59
|
+
styleName: this.styleName,
|
|
60
|
+
styleOverrides: { ...this.styleOverrides },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** Returns true if `this` is equivalent to `other`. */
|
|
64
|
+
equals(other) {
|
|
65
|
+
const myKeys = Object.keys(this.styleOverrides);
|
|
66
|
+
const yrKeys = Object.keys(other._styleOverrides);
|
|
67
|
+
if (this.styleName !== other.styleName || myKeys.length !== yrKeys.length) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
for (const name of myKeys) {
|
|
71
|
+
const key = name;
|
|
72
|
+
if (this.styleOverrides[key] !== other.styleOverrides[key]) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.TextBlockComponent = TextBlockComponent;
|
|
80
|
+
/** 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
|
|
81
|
+
* multiple lines, but it will never contain different styling.
|
|
82
|
+
* Use the `type` field to discriminate between the different kinds of runs.
|
|
83
|
+
* @beta
|
|
84
|
+
*/
|
|
85
|
+
var Run;
|
|
86
|
+
(function (Run) {
|
|
87
|
+
/** Create a run from its JSON representation.
|
|
88
|
+
* @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.
|
|
89
|
+
*/
|
|
90
|
+
function fromJSON(props) {
|
|
91
|
+
switch (props.type) {
|
|
92
|
+
case "text": return TextRun.create(props);
|
|
93
|
+
case "fraction": return FractionRun.create(props);
|
|
94
|
+
case "linebreak": return LineBreakRun.create(props);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
Run.fromJSON = fromJSON;
|
|
98
|
+
})(Run || (exports.Run = Run = {}));
|
|
99
|
+
/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.
|
|
100
|
+
* @beta
|
|
101
|
+
*/
|
|
102
|
+
class TextRun extends TextBlockComponent {
|
|
103
|
+
constructor(props) {
|
|
104
|
+
super(props);
|
|
105
|
+
/** Discriminator field for the [[Run]] union. */
|
|
106
|
+
this.type = "text";
|
|
107
|
+
this.content = props.content ?? "";
|
|
108
|
+
this.baselineShift = props.baselineShift ?? "none";
|
|
109
|
+
}
|
|
110
|
+
clone() {
|
|
111
|
+
return new TextRun(this.toJSON());
|
|
112
|
+
}
|
|
113
|
+
toJSON() {
|
|
114
|
+
return {
|
|
115
|
+
...super.toJSON(),
|
|
116
|
+
type: "text",
|
|
117
|
+
content: this.content,
|
|
118
|
+
baselineShift: this.baselineShift,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
static create(props) {
|
|
122
|
+
return new TextRun(props);
|
|
123
|
+
}
|
|
124
|
+
/** Simply returns [[content]]. */
|
|
125
|
+
stringify() {
|
|
126
|
+
return this.content;
|
|
127
|
+
}
|
|
128
|
+
equals(other) {
|
|
129
|
+
return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
exports.TextRun = TextRun;
|
|
133
|
+
/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.
|
|
134
|
+
* @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.
|
|
135
|
+
* @beta
|
|
136
|
+
*/
|
|
137
|
+
class FractionRun extends TextBlockComponent {
|
|
138
|
+
constructor(props) {
|
|
139
|
+
super(props);
|
|
140
|
+
/** Discriminator field for the [[Run]] union. */
|
|
141
|
+
this.type = "fraction";
|
|
142
|
+
this.numerator = props.numerator ?? "";
|
|
143
|
+
this.denominator = props.denominator ?? "";
|
|
144
|
+
}
|
|
145
|
+
toJSON() {
|
|
146
|
+
return {
|
|
147
|
+
...super.toJSON(),
|
|
148
|
+
type: "fraction",
|
|
149
|
+
numerator: this.numerator,
|
|
150
|
+
denominator: this.denominator,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
clone() {
|
|
154
|
+
return new FractionRun(this.toJSON());
|
|
155
|
+
}
|
|
156
|
+
static create(props) {
|
|
157
|
+
return new FractionRun(props);
|
|
158
|
+
}
|
|
159
|
+
/** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */
|
|
160
|
+
stringify(options) {
|
|
161
|
+
const sep = options?.fractionSeparator ?? "/";
|
|
162
|
+
return `${this.numerator}${sep}${this.denominator}`;
|
|
163
|
+
}
|
|
164
|
+
equals(other) {
|
|
165
|
+
return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
exports.FractionRun = FractionRun;
|
|
169
|
+
/** A [[Run]] that represents the end of a line of text within a [[Paragraph]]. It contains no content of its own - it simply causes subsequent content to display on a new line.
|
|
170
|
+
* @beta
|
|
171
|
+
*/
|
|
172
|
+
class LineBreakRun extends TextBlockComponent {
|
|
173
|
+
constructor(props) {
|
|
174
|
+
super(props);
|
|
175
|
+
/** Discriminator field for the [[Run]] union. */
|
|
176
|
+
this.type = "linebreak";
|
|
177
|
+
}
|
|
178
|
+
toJSON() {
|
|
179
|
+
return {
|
|
180
|
+
...super.toJSON(),
|
|
181
|
+
type: "linebreak",
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
static create(props) {
|
|
185
|
+
return new LineBreakRun(props);
|
|
186
|
+
}
|
|
187
|
+
clone() {
|
|
188
|
+
return new LineBreakRun(this.toJSON());
|
|
189
|
+
}
|
|
190
|
+
/** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */
|
|
191
|
+
stringify(options) {
|
|
192
|
+
return options?.lineBreak ?? " ";
|
|
193
|
+
}
|
|
194
|
+
equals(other) {
|
|
195
|
+
return other instanceof LineBreakRun && super.equals(other);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.LineBreakRun = LineBreakRun;
|
|
199
|
+
/** A collection of [[Run]]s within a [[TextBlock]]. Each paragraph within a text block is laid out on a separate line.
|
|
200
|
+
* @beta
|
|
201
|
+
*/
|
|
202
|
+
class Paragraph extends TextBlockComponent {
|
|
203
|
+
constructor(props) {
|
|
204
|
+
super(props);
|
|
205
|
+
this.runs = props.runs?.map((run) => Run.fromJSON(run)) ?? [];
|
|
206
|
+
}
|
|
207
|
+
toJSON() {
|
|
208
|
+
return {
|
|
209
|
+
...super.toJSON(),
|
|
210
|
+
runs: this.runs.map((run) => run.toJSON()),
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/** Create a paragraph from its JSON representation. */
|
|
214
|
+
static create(props) {
|
|
215
|
+
return new Paragraph(props);
|
|
216
|
+
}
|
|
217
|
+
clone() {
|
|
218
|
+
return new Paragraph(this.toJSON());
|
|
219
|
+
}
|
|
220
|
+
/** Apply the specified style to this [[Paragraph]], and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[runs]]. */
|
|
221
|
+
applyStyle(styleName, options) {
|
|
222
|
+
super.applyStyle(styleName, options);
|
|
223
|
+
if (!(options?.preventPropagation)) {
|
|
224
|
+
for (const run of this.runs) {
|
|
225
|
+
run.applyStyle(styleName, options);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
/** Compute a string representation of this paragraph by concatenating the string representations of all of its [[runs]]. */
|
|
230
|
+
stringify(options) {
|
|
231
|
+
return this.runs.map((x) => x.stringify(options)).join("");
|
|
232
|
+
}
|
|
233
|
+
equals(other) {
|
|
234
|
+
if (!(other instanceof Paragraph)) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
if (this.runs.length !== other.runs.length || !super.equals(other)) {
|
|
238
|
+
return false;
|
|
239
|
+
}
|
|
240
|
+
return this.runs.every((run, index) => run.equals(other.runs[index]));
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
exports.Paragraph = Paragraph;
|
|
244
|
+
/** 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.
|
|
245
|
+
* You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].
|
|
246
|
+
* No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
|
|
247
|
+
* @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
|
|
248
|
+
* @beta
|
|
249
|
+
*/
|
|
250
|
+
class TextBlock extends TextBlockComponent {
|
|
251
|
+
constructor(props) {
|
|
252
|
+
super(props);
|
|
253
|
+
this.width = props.width ?? 0;
|
|
254
|
+
this.justification = props.justification ?? "left";
|
|
255
|
+
this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];
|
|
256
|
+
}
|
|
257
|
+
toJSON() {
|
|
258
|
+
return {
|
|
259
|
+
...super.toJSON(),
|
|
260
|
+
width: this.width,
|
|
261
|
+
justification: this.justification,
|
|
262
|
+
paragraphs: this.paragraphs.map((x) => x.toJSON()),
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
/** Create a text block from its JSON representation. */
|
|
266
|
+
static create(props) {
|
|
267
|
+
return new TextBlock(props);
|
|
268
|
+
}
|
|
269
|
+
/** Create an empty text block containing no [[paragraphs]] and an empty [[styleName]]. */
|
|
270
|
+
static createEmpty() {
|
|
271
|
+
return TextBlock.create({ styleName: "" });
|
|
272
|
+
}
|
|
273
|
+
/** Returns true if every paragraph in this text block is empty. */
|
|
274
|
+
get isEmpty() {
|
|
275
|
+
return this.paragraphs.every((p) => p.runs.length === 0);
|
|
276
|
+
}
|
|
277
|
+
clone() {
|
|
278
|
+
return new TextBlock(this.toJSON());
|
|
279
|
+
}
|
|
280
|
+
/** Apply the specified style to this block and - unless [[ApplyTextStyleOptions.preventPropagation]] is `true` - to all of its [[paragraphs]]. */
|
|
281
|
+
applyStyle(styleName, options) {
|
|
282
|
+
super.applyStyle(styleName, options);
|
|
283
|
+
if (!(options?.preventPropagation)) {
|
|
284
|
+
for (const paragraph of this.paragraphs) {
|
|
285
|
+
paragraph.applyStyle(styleName, options);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
290
|
+
stringify(options) {
|
|
291
|
+
return this.paragraphs.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? " ");
|
|
292
|
+
}
|
|
293
|
+
/** Add and return a new paragraph.
|
|
294
|
+
* If [[paragraphs]] is not empty, the style and overrides of the last [[Paragraph]] in the block will be applied to the new paragraph; otherwise,
|
|
295
|
+
* the paragraph will inherit this block's style with no overrides.
|
|
296
|
+
*/
|
|
297
|
+
appendParagraph() {
|
|
298
|
+
const seed = this.paragraphs[0];
|
|
299
|
+
const paragraph = Paragraph.create({
|
|
300
|
+
styleName: seed?.styleName ?? this.styleName,
|
|
301
|
+
styleOverrides: seed?.styleOverrides ?? undefined,
|
|
302
|
+
});
|
|
303
|
+
this.paragraphs.push(paragraph);
|
|
304
|
+
return paragraph;
|
|
305
|
+
}
|
|
306
|
+
/** Append a run to the last [[Paragraph]] in this block.
|
|
307
|
+
* If the block contains no [[paragraphs]], a new one will first be created using [[appendParagraph]].
|
|
308
|
+
*/
|
|
309
|
+
appendRun(run) {
|
|
310
|
+
const paragraph = this.paragraphs[this.paragraphs.length - 1] ?? this.appendParagraph();
|
|
311
|
+
paragraph.runs.push(run);
|
|
312
|
+
}
|
|
313
|
+
equals(other) {
|
|
314
|
+
if (!(other instanceof TextBlock)) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
if (this.width !== other.width || this.justification !== other.justification || this.paragraphs.length !== other.paragraphs.length) {
|
|
318
|
+
return false;
|
|
319
|
+
}
|
|
320
|
+
return this.paragraphs.every((paragraph, index) => paragraph.equals(other.paragraphs[index]));
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
exports.TextBlock = TextBlock;
|
|
324
|
+
//# sourceMappingURL=TextBlock.js.map
|