@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
|
@@ -7,27 +7,39 @@
|
|
|
7
7
|
* @module Annotation
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.TextBlock = exports.Paragraph = exports.FieldRun = exports.TabRun = exports.LineBreakRun = exports.FractionRun = exports.TextRun = exports.Run = exports.TextBlockComponent = void 0;
|
|
10
|
+
exports.TextBlock = exports.List = exports.Paragraph = exports.FieldRun = exports.TabRun = exports.LineBreakRun = exports.FractionRun = exports.TextRun = exports.Run = exports.TextBlockComponent = void 0;
|
|
11
|
+
exports.traverseTextBlockComponent = traverseTextBlockComponent;
|
|
12
|
+
exports.getMarkerText = getMarkerText;
|
|
11
13
|
const TextStyle_1 = require("./TextStyle");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
function clearStyleOverrides(component, options) {
|
|
15
|
+
component.styleOverrides = {};
|
|
16
|
+
if (!options?.preserveChildrenOverrides) {
|
|
17
|
+
for (const child of component.children) {
|
|
18
|
+
child.clearStyleOverrides(options);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s and [[StructuralTextBlockComponent]]s.
|
|
24
|
+
* The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents.
|
|
25
|
+
* Each component can specify an optional [[styleOverrides]] to customize that formatting.
|
|
14
26
|
* @beta
|
|
15
27
|
*/
|
|
16
28
|
class TextBlockComponent {
|
|
17
29
|
_styleOverrides;
|
|
18
30
|
/** @internal */
|
|
19
31
|
constructor(props) {
|
|
20
|
-
this._styleOverrides =
|
|
32
|
+
this._styleOverrides = structuredClone(props?.styleOverrides ?? {});
|
|
21
33
|
}
|
|
22
|
-
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend)
|
|
23
|
-
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.
|
|
34
|
+
/** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).
|
|
35
|
+
* For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.font.name` to "Comic Sans".
|
|
24
36
|
* @see [[clearStyleOverrides]] to reset this to an empty object.
|
|
25
37
|
*/
|
|
26
38
|
get styleOverrides() {
|
|
27
39
|
return this._styleOverrides;
|
|
28
40
|
}
|
|
29
41
|
set styleOverrides(overrides) {
|
|
30
|
-
this._styleOverrides =
|
|
42
|
+
this._styleOverrides = structuredClone(overrides);
|
|
31
43
|
}
|
|
32
44
|
/** Reset any [[styleOverrides]] applied to this component. */
|
|
33
45
|
clearStyleOverrides(_options) {
|
|
@@ -48,23 +60,14 @@ class TextBlockComponent {
|
|
|
48
60
|
/** Convert this component to its JSON representation. */
|
|
49
61
|
toJSON() {
|
|
50
62
|
return {
|
|
51
|
-
styleOverrides:
|
|
63
|
+
styleOverrides: structuredClone(this.styleOverrides),
|
|
52
64
|
};
|
|
53
65
|
}
|
|
54
66
|
/** Returns true if `this` is equivalent to `other`. */
|
|
55
67
|
equals(other) {
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
for (const name of myKeys) {
|
|
62
|
-
const key = name;
|
|
63
|
-
if (this.styleOverrides[key] !== other.styleOverrides[key]) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return true;
|
|
68
|
+
const mySettings = TextStyle_1.TextStyleSettings.fromJSON(this.styleOverrides);
|
|
69
|
+
const otherSettings = TextStyle_1.TextStyleSettings.fromJSON(other.styleOverrides);
|
|
70
|
+
return mySettings.equals(otherSettings);
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
exports.TextBlockComponent = TextBlockComponent;
|
|
@@ -76,15 +79,15 @@ exports.TextBlockComponent = TextBlockComponent;
|
|
|
76
79
|
var Run;
|
|
77
80
|
(function (Run) {
|
|
78
81
|
/** Create a run from its JSON representation.
|
|
79
|
-
* @see [[TextRun.create]], [[FractionRun.create]], and [[LineBreakRun.create]] to create a run directly.
|
|
82
|
+
* @see [[TextRun.create]], [[FractionRun.create]], [[FieldRun.create]], [[TabRun.create]], and [[LineBreakRun.create]] to create a run directly.
|
|
80
83
|
*/
|
|
81
84
|
function fromJSON(props) {
|
|
82
85
|
switch (props.type) {
|
|
83
|
-
case "
|
|
86
|
+
case "field": return FieldRun.create(props);
|
|
84
87
|
case "fraction": return FractionRun.create(props);
|
|
85
|
-
case "tab": return TabRun.create(props);
|
|
86
88
|
case "linebreak": return LineBreakRun.create(props);
|
|
87
|
-
case "
|
|
89
|
+
case "tab": return TabRun.create(props);
|
|
90
|
+
case "text": return TextRun.create(props);
|
|
88
91
|
}
|
|
89
92
|
}
|
|
90
93
|
Run.fromJSON = fromJSON;
|
|
@@ -116,7 +119,10 @@ class TextRun extends TextBlockComponent {
|
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
static create(props) {
|
|
119
|
-
return new TextRun(props);
|
|
122
|
+
return new TextRun({ ...props, type: "text" });
|
|
123
|
+
}
|
|
124
|
+
get isEmpty() {
|
|
125
|
+
return this.stringify().length === 0;
|
|
120
126
|
}
|
|
121
127
|
/** Simply returns [[content]]. */
|
|
122
128
|
stringify() {
|
|
@@ -155,7 +161,10 @@ class FractionRun extends TextBlockComponent {
|
|
|
155
161
|
return new FractionRun(this.toJSON());
|
|
156
162
|
}
|
|
157
163
|
static create(props) {
|
|
158
|
-
return new FractionRun(props);
|
|
164
|
+
return new FractionRun({ ...props, type: "fraction" });
|
|
165
|
+
}
|
|
166
|
+
get isEmpty() {
|
|
167
|
+
return this.stringify().length === 0;
|
|
159
168
|
}
|
|
160
169
|
/** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */
|
|
161
170
|
stringify(options) {
|
|
@@ -183,11 +192,14 @@ class LineBreakRun extends TextBlockComponent {
|
|
|
183
192
|
};
|
|
184
193
|
}
|
|
185
194
|
static create(props) {
|
|
186
|
-
return new LineBreakRun(props);
|
|
195
|
+
return new LineBreakRun({ ...props, type: "linebreak" });
|
|
187
196
|
}
|
|
188
197
|
clone() {
|
|
189
198
|
return new LineBreakRun(this.toJSON());
|
|
190
199
|
}
|
|
200
|
+
get isEmpty() {
|
|
201
|
+
return this.stringify().length === 0;
|
|
202
|
+
}
|
|
191
203
|
/** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */
|
|
192
204
|
stringify(options) {
|
|
193
205
|
return options?.lineBreak ?? " ";
|
|
@@ -216,6 +228,9 @@ class TabRun extends TextBlockComponent {
|
|
|
216
228
|
static create(props) {
|
|
217
229
|
return new TabRun(props);
|
|
218
230
|
}
|
|
231
|
+
get isEmpty() {
|
|
232
|
+
return this.stringify().length === 0;
|
|
233
|
+
}
|
|
219
234
|
/**
|
|
220
235
|
* Converts a [[TabRun]] to its string representation.
|
|
221
236
|
* If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.
|
|
@@ -235,7 +250,8 @@ exports.TabRun = TabRun;
|
|
|
235
250
|
/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).
|
|
236
251
|
* When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,
|
|
237
252
|
* a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that
|
|
238
|
-
* whenever the source element specified by [[propertyHost]] is modified
|
|
253
|
+
* whenever the source element specified by [[propertyHost]] is modified or the `ITextAnnotation` element is inserted or updated in the iModel,
|
|
254
|
+
* the field(s) in the `ITextAnnotation` element are automatically
|
|
239
255
|
* recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or
|
|
240
256
|
* property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].
|
|
241
257
|
* A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.
|
|
@@ -250,8 +266,10 @@ class FieldRun extends TextBlockComponent {
|
|
|
250
266
|
propertyHost;
|
|
251
267
|
/** Describes how to obtain the property value from [[propertyHost]]. */
|
|
252
268
|
propertyPath;
|
|
253
|
-
/** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].
|
|
254
|
-
|
|
269
|
+
/** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].
|
|
270
|
+
* The specific options used depend upon the [[FieldPropertyType]].
|
|
271
|
+
*/
|
|
272
|
+
formatOptions;
|
|
255
273
|
_cachedContent;
|
|
256
274
|
/** The field's most recently evaluated display string. */
|
|
257
275
|
get cachedContent() {
|
|
@@ -266,7 +284,7 @@ class FieldRun extends TextBlockComponent {
|
|
|
266
284
|
this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;
|
|
267
285
|
this.propertyHost = props.propertyHost;
|
|
268
286
|
this.propertyPath = props.propertyPath;
|
|
269
|
-
this.
|
|
287
|
+
this.formatOptions = props.formatOptions;
|
|
270
288
|
}
|
|
271
289
|
/** Create a FieldRun from its JSON representation. */
|
|
272
290
|
static create(props) {
|
|
@@ -274,7 +292,8 @@ class FieldRun extends TextBlockComponent {
|
|
|
274
292
|
...props,
|
|
275
293
|
propertyHost: { ...props.propertyHost },
|
|
276
294
|
propertyPath: structuredClone(props.propertyPath),
|
|
277
|
-
|
|
295
|
+
formatOptions: structuredClone(props.formatOptions),
|
|
296
|
+
type: "field",
|
|
278
297
|
});
|
|
279
298
|
}
|
|
280
299
|
/** Convert the FieldRun to its JSON representation. */
|
|
@@ -288,8 +307,8 @@ class FieldRun extends TextBlockComponent {
|
|
|
288
307
|
if (this.cachedContent !== FieldRun.invalidContentIndicator) {
|
|
289
308
|
json.cachedContent = this.cachedContent;
|
|
290
309
|
}
|
|
291
|
-
if (this.
|
|
292
|
-
json.
|
|
310
|
+
if (this.formatOptions) {
|
|
311
|
+
json.formatOptions = structuredClone(this.formatOptions);
|
|
293
312
|
}
|
|
294
313
|
return json;
|
|
295
314
|
}
|
|
@@ -297,6 +316,9 @@ class FieldRun extends TextBlockComponent {
|
|
|
297
316
|
clone() {
|
|
298
317
|
return new FieldRun(this.toJSON());
|
|
299
318
|
}
|
|
319
|
+
get isEmpty() {
|
|
320
|
+
return this.stringify().length === 0;
|
|
321
|
+
}
|
|
300
322
|
/** Convert this FieldRun to a simple string representation. */
|
|
301
323
|
stringify() {
|
|
302
324
|
return this.cachedContent;
|
|
@@ -316,197 +338,267 @@ class FieldRun extends TextBlockComponent {
|
|
|
316
338
|
}
|
|
317
339
|
const thisAccessors = this.propertyPath.accessors ?? [];
|
|
318
340
|
const otherAccessors = other.propertyPath.accessors ?? [];
|
|
319
|
-
|
|
320
|
-
const otherJsonAccessors = other.propertyPath.jsonAccessors ?? [];
|
|
321
|
-
if (thisAccessors.length !== otherAccessors.length || thisJsonAccessors.length !== otherJsonAccessors.length) {
|
|
341
|
+
if (thisAccessors.length !== otherAccessors.length) {
|
|
322
342
|
return false;
|
|
323
343
|
}
|
|
324
344
|
if (!thisAccessors.every((value, index) => value === otherAccessors[index])) {
|
|
325
345
|
return false;
|
|
326
346
|
}
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
// ###TODO better comparison of formatter objects.
|
|
332
|
-
if (JSON.stringify(this.formatter) !== JSON.stringify(other.formatter)) {
|
|
347
|
+
if (this.formatOptions && other.formatOptions) {
|
|
348
|
+
// We anticipate new formatting options being added in the future.
|
|
349
|
+
// So to account for properties we don't know about, just compare the string representations.
|
|
350
|
+
if (JSON.stringify(this.formatOptions) !== JSON.stringify(other.formatOptions)) {
|
|
333
351
|
return false;
|
|
334
352
|
}
|
|
335
353
|
}
|
|
336
|
-
else if (this.
|
|
354
|
+
else if (this.formatOptions || other.formatOptions) {
|
|
337
355
|
return false;
|
|
338
356
|
}
|
|
339
357
|
return true;
|
|
340
358
|
}
|
|
341
359
|
}
|
|
342
360
|
exports.FieldRun = FieldRun;
|
|
343
|
-
/** A collection of [[Run]]s
|
|
361
|
+
/** A collection of [[Run]]s and [[List]]s. Paragraphs can be appended to [[List]]s and [[TextBlock]]s.
|
|
362
|
+
* Each paragraph is laid out on a separate line. If included in a [[List]], the paragraph will be treated as a list item.
|
|
344
363
|
* @beta
|
|
345
364
|
*/
|
|
346
365
|
class Paragraph extends TextBlockComponent {
|
|
347
|
-
|
|
348
|
-
|
|
366
|
+
type = "paragraph";
|
|
367
|
+
children;
|
|
349
368
|
constructor(props) {
|
|
350
369
|
super(props);
|
|
351
|
-
this.
|
|
370
|
+
this.children = props?.children?.map((child) => child.type === "list" ? List.create(child) : Run.fromJSON(child)) ?? [];
|
|
371
|
+
}
|
|
372
|
+
/** Create a paragraph from its JSON representation. */
|
|
373
|
+
static create(props) {
|
|
374
|
+
return new Paragraph(props);
|
|
375
|
+
}
|
|
376
|
+
clearStyleOverrides(options) {
|
|
377
|
+
clearStyleOverrides(this, options);
|
|
378
|
+
}
|
|
379
|
+
get isEmpty() {
|
|
380
|
+
return this.children.length === 0;
|
|
381
|
+
}
|
|
382
|
+
clone() {
|
|
383
|
+
return new Paragraph(this.toJSON());
|
|
352
384
|
}
|
|
353
385
|
toJSON() {
|
|
354
386
|
return {
|
|
355
387
|
...super.toJSON(),
|
|
356
|
-
|
|
388
|
+
children: this.children.map((child) => child.toJSON()),
|
|
357
389
|
};
|
|
358
390
|
}
|
|
359
|
-
/**
|
|
391
|
+
/** Compute a string representation of this paragraph by concatenating the string representations of all of its children. */
|
|
392
|
+
stringify(options, context) {
|
|
393
|
+
return this.children.map((x, index) => (index > 0 && x.type === "list") ? `${options?.paragraphBreak ?? " "}${x.stringify(options, context)}` : x.stringify(options, context)).join("") ?? "";
|
|
394
|
+
}
|
|
395
|
+
equals(other) {
|
|
396
|
+
return (other instanceof Paragraph) && super.equals(other);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
exports.Paragraph = Paragraph;
|
|
400
|
+
/** A collection of list items ([[Paragraph]]s). Lists can be appended to [[Paragraph]]s.
|
|
401
|
+
* Lists will be laid out on a new line. Each item in a list is laid out on a separate line.
|
|
402
|
+
* @beta
|
|
403
|
+
*/
|
|
404
|
+
class List extends TextBlockComponent {
|
|
405
|
+
type = "list";
|
|
406
|
+
children;
|
|
407
|
+
constructor(props) {
|
|
408
|
+
super(props);
|
|
409
|
+
this.children = props?.children?.map((child) => Paragraph.create(child)) ?? [];
|
|
410
|
+
}
|
|
411
|
+
/** Create a list from its JSON representation. */
|
|
360
412
|
static create(props) {
|
|
361
|
-
return new
|
|
413
|
+
return new List({ ...props, type: "list" });
|
|
414
|
+
}
|
|
415
|
+
clearStyleOverrides(options) {
|
|
416
|
+
clearStyleOverrides(this, options);
|
|
417
|
+
}
|
|
418
|
+
get isEmpty() {
|
|
419
|
+
return this.children.length === 0;
|
|
362
420
|
}
|
|
363
421
|
clone() {
|
|
364
|
-
return new
|
|
422
|
+
return new List(this.toJSON());
|
|
365
423
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (options?.preserveChildrenOverrides)
|
|
373
|
-
return;
|
|
374
|
-
for (const run of this.runs) {
|
|
375
|
-
run.clearStyleOverrides();
|
|
376
|
-
}
|
|
424
|
+
toJSON() {
|
|
425
|
+
return {
|
|
426
|
+
...super.toJSON(),
|
|
427
|
+
type: "list",
|
|
428
|
+
children: this.children.map((run) => run.toJSON()),
|
|
429
|
+
};
|
|
377
430
|
}
|
|
378
|
-
/** Compute a string representation of this
|
|
379
|
-
stringify(options) {
|
|
380
|
-
|
|
431
|
+
/** Compute a string representation of this list by concatenating the string representations of all of its [[children]]. */
|
|
432
|
+
stringify(options, context) {
|
|
433
|
+
const children = this.children.map((x, index) => {
|
|
434
|
+
const depth = context?.depth ?? 0;
|
|
435
|
+
const marker = getMarkerText(this.styleOverrides.listMarker ?? TextStyle_1.TextStyleSettings.defaultProps.listMarker, index + 1);
|
|
436
|
+
const tab = (options?.tabsAsSpaces ? " ".repeat(options.tabsAsSpaces) : "\t").repeat(depth);
|
|
437
|
+
return `${tab}${marker}${options?.listMarkerBreak ?? " "}${x.stringify(options, { depth: depth + 1 })}`;
|
|
438
|
+
});
|
|
439
|
+
return children.join(options?.paragraphBreak ?? " ") ?? "";
|
|
381
440
|
}
|
|
382
441
|
equals(other) {
|
|
383
|
-
|
|
384
|
-
return false;
|
|
385
|
-
}
|
|
386
|
-
if (this.runs.length !== other.runs.length || !super.equals(other)) {
|
|
387
|
-
return false;
|
|
388
|
-
}
|
|
389
|
-
return this.runs.every((run, index) => run.equals(other.runs[index]));
|
|
442
|
+
return (other instanceof List) && super.equals(other);
|
|
390
443
|
}
|
|
391
444
|
}
|
|
392
|
-
exports.
|
|
393
|
-
|
|
394
|
-
/** 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.
|
|
395
|
-
* You can change the content of the document by directly modifying the contents of its [[paragraphs]], or via [[appendParagraph]] and [[appendRun]].
|
|
445
|
+
exports.List = List;
|
|
446
|
+
/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.
|
|
396
447
|
* No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
|
|
397
448
|
* @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
|
|
398
449
|
* @beta
|
|
399
450
|
*/
|
|
400
451
|
class TextBlock extends TextBlockComponent {
|
|
401
|
-
|
|
402
|
-
* @note Assigning to this property retains all style overrides on the TextBlock and its child components.
|
|
403
|
-
* Call [[clearStyleOverrides]] to clear the TextBlock's and optionally all children's style overrides.
|
|
404
|
-
*/
|
|
405
|
-
styleId;
|
|
452
|
+
children;
|
|
406
453
|
/** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.
|
|
407
454
|
* A value less than or equal to zero indicates no wrapping is to be applied.
|
|
408
455
|
* Default: 0
|
|
409
456
|
*/
|
|
410
457
|
width;
|
|
411
|
-
/** The alignment of the document's content. */
|
|
412
|
-
justification;
|
|
413
|
-
/** The margins of the document. */
|
|
414
|
-
margins;
|
|
415
|
-
/** The ordered list of paragraphs within the document. */
|
|
416
|
-
paragraphs;
|
|
417
458
|
constructor(props) {
|
|
418
459
|
super(props);
|
|
419
|
-
this.styleId = props.styleId;
|
|
420
460
|
this.width = props.width ?? 0;
|
|
421
|
-
this.
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
right: props.margins?.right ?? 0,
|
|
426
|
-
top: props.margins?.top ?? 0,
|
|
427
|
-
bottom: props.margins?.bottom ?? 0,
|
|
428
|
-
};
|
|
429
|
-
this.paragraphs = props.paragraphs?.map((x) => Paragraph.create(x)) ?? [];
|
|
461
|
+
this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];
|
|
462
|
+
}
|
|
463
|
+
clearStyleOverrides(options) {
|
|
464
|
+
clearStyleOverrides(this, options);
|
|
430
465
|
}
|
|
431
466
|
toJSON() {
|
|
432
467
|
return {
|
|
433
468
|
...super.toJSON(),
|
|
434
|
-
styleId: this.styleId,
|
|
435
469
|
width: this.width,
|
|
436
|
-
|
|
437
|
-
margins: this.margins,
|
|
438
|
-
paragraphs: this.paragraphs.map((x) => x.toJSON()),
|
|
470
|
+
children: this.children.map((x) => x.toJSON()),
|
|
439
471
|
};
|
|
440
472
|
}
|
|
441
473
|
/** Create a text block from its JSON representation. */
|
|
442
474
|
static create(props) {
|
|
443
|
-
return new TextBlock(props);
|
|
444
|
-
}
|
|
445
|
-
/** Create an empty text block containing no [[paragraphs]] and an empty [[styleId]]. */
|
|
446
|
-
static createEmpty() {
|
|
447
|
-
return TextBlock.create({ styleId: "" });
|
|
475
|
+
return new TextBlock(props ?? {});
|
|
448
476
|
}
|
|
449
477
|
/** Returns true if every paragraph in this text block is empty. */
|
|
450
478
|
get isEmpty() {
|
|
451
|
-
return this.
|
|
479
|
+
return !this.children || this.children.every((child) => child.isEmpty);
|
|
452
480
|
}
|
|
453
481
|
clone() {
|
|
454
482
|
return new TextBlock(this.toJSON());
|
|
455
483
|
}
|
|
456
|
-
/**
|
|
457
|
-
* Clears any [[styleOverrides]] applied to this TextBlock.
|
|
458
|
-
* Will also clear [[styleOverrides]] from all child components unless [[ClearTextStyleOptions.preserveChildrenOverrides]] is `true`.
|
|
459
|
-
*/
|
|
460
|
-
clearStyleOverrides(options) {
|
|
461
|
-
super.clearStyleOverrides();
|
|
462
|
-
if (options?.preserveChildrenOverrides)
|
|
463
|
-
return;
|
|
464
|
-
for (const paragraph of this.paragraphs) {
|
|
465
|
-
paragraph.clearStyleOverrides();
|
|
466
|
-
}
|
|
467
|
-
}
|
|
468
|
-
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[paragraphs]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
484
|
+
/** Compute a string representation of the document's contents by concatenating the string representations of each of its [[children]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */
|
|
469
485
|
stringify(options) {
|
|
470
|
-
return this.
|
|
486
|
+
return this.children.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? " ") || "";
|
|
471
487
|
}
|
|
472
488
|
/** Add and return a new paragraph.
|
|
473
489
|
* By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.
|
|
474
|
-
* @param seedFromLast If true and [[
|
|
490
|
+
* @param seedFromLast If true and [[children]] is not empty, the new paragraph will inherit the style overrides of the last child in this block.
|
|
491
|
+
* @note Be sure you pass in [[ParagraphProps]] and not [[Paragraph]] or style overrides will be ignored.
|
|
475
492
|
*/
|
|
476
|
-
appendParagraph(seedFromLast = false) {
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
}
|
|
482
|
-
const paragraph = Paragraph.create({
|
|
483
|
-
styleOverrides
|
|
484
|
-
});
|
|
485
|
-
this.paragraphs.push(paragraph);
|
|
493
|
+
appendParagraph(props, seedFromLast = false) {
|
|
494
|
+
const seed = seedFromLast ? this.children[this.children.length - 1] : undefined;
|
|
495
|
+
const styleOverrides = { ...seed?.styleOverrides, ...props?.styleOverrides };
|
|
496
|
+
const paragraph = Paragraph.create({ ...props, styleOverrides });
|
|
497
|
+
this.children.push(paragraph);
|
|
486
498
|
return paragraph;
|
|
487
499
|
}
|
|
488
500
|
/** Append a run to the last [[Paragraph]] in this block.
|
|
489
|
-
* If the block contains no [[
|
|
501
|
+
* If the block contains no [[children]], a new [[Paragraph]] will first be created using [[appendParagraph]].
|
|
490
502
|
*/
|
|
491
503
|
appendRun(run) {
|
|
492
|
-
const paragraph = this.
|
|
493
|
-
paragraph.
|
|
504
|
+
const paragraph = this.children[this.children.length - 1] ?? this.appendParagraph();
|
|
505
|
+
paragraph.children.push(run);
|
|
494
506
|
}
|
|
495
507
|
equals(other) {
|
|
496
508
|
if (!(other instanceof TextBlock)) {
|
|
497
509
|
return false;
|
|
498
510
|
}
|
|
499
|
-
if (
|
|
511
|
+
if (!super.equals(other)) {
|
|
500
512
|
return false;
|
|
501
513
|
}
|
|
502
|
-
if (this.width !== other.width
|
|
514
|
+
if (this.width !== other.width) {
|
|
503
515
|
return false;
|
|
504
516
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
517
|
+
if (this.children && other.children) {
|
|
518
|
+
if (this.children.length !== other.children.length) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
521
|
+
return this.children.every((child, index) => other.children && child.equals(other.children[index]));
|
|
522
|
+
}
|
|
523
|
+
return true;
|
|
509
524
|
}
|
|
510
525
|
}
|
|
511
526
|
exports.TextBlock = TextBlock;
|
|
527
|
+
/**
|
|
528
|
+
* Recursively traverses a [[StructuralTextBlockComponent]] tree, yielding each child component along with its parent container.
|
|
529
|
+
* This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.
|
|
530
|
+
*
|
|
531
|
+
* @param parent The root container whose children should be traversed.
|
|
532
|
+
* @returns An IterableIterator yielding objects with the child component and its parent container.
|
|
533
|
+
* @beta
|
|
534
|
+
*/
|
|
535
|
+
function* traverseTextBlockComponent(parent) {
|
|
536
|
+
for (const child of parent.children) {
|
|
537
|
+
yield { parent, child };
|
|
538
|
+
if (child.type === "list" || child.type === "paragraph") {
|
|
539
|
+
yield* traverseTextBlockComponent(child);
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Returns the formatted marker text for a list item based on the marker type and item number.
|
|
545
|
+
* Supports ordered and unordered list markers, including alphabetic, Roman numeral, and numeric formats.
|
|
546
|
+
* @param marker The type of list marker to use.
|
|
547
|
+
* @param num The item number in the list.
|
|
548
|
+
* @returns The formatted marker string for the list item.
|
|
549
|
+
* @beta
|
|
550
|
+
*/
|
|
551
|
+
function getMarkerText(marker, num) {
|
|
552
|
+
let markerString = "";
|
|
553
|
+
switch (marker.enumerator) {
|
|
554
|
+
case undefined:
|
|
555
|
+
case TextStyle_1.ListMarkerEnumerator.Number:
|
|
556
|
+
markerString = `${num}`;
|
|
557
|
+
break;
|
|
558
|
+
case TextStyle_1.ListMarkerEnumerator.Letter:
|
|
559
|
+
markerString = integerToAlpha(num);
|
|
560
|
+
break;
|
|
561
|
+
case TextStyle_1.ListMarkerEnumerator.RomanNumeral:
|
|
562
|
+
markerString = integerToRoman(num);
|
|
563
|
+
break;
|
|
564
|
+
default:
|
|
565
|
+
markerString = marker.enumerator;
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
if (marker.case) {
|
|
569
|
+
markerString = marker.case === "upper" ? markerString.toUpperCase() : markerString.toLowerCase();
|
|
570
|
+
}
|
|
571
|
+
const terminator = marker.terminator === "period" ? "." : marker.terminator === "parenthesis" ? ")" : "";
|
|
572
|
+
return `${markerString}${terminator}`;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Converts an integer to its Roman numeral representation.
|
|
576
|
+
* Supports numbers from 1 and above.
|
|
577
|
+
* @param num The integer to convert.
|
|
578
|
+
* @returns The Roman numeral string.
|
|
579
|
+
*/
|
|
580
|
+
function integerToRoman(num) {
|
|
581
|
+
const values = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];
|
|
582
|
+
const symbols = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];
|
|
583
|
+
let roman = '';
|
|
584
|
+
for (let i = 0; i < values.length; i++) {
|
|
585
|
+
while (num >= values[i]) {
|
|
586
|
+
roman += symbols[i];
|
|
587
|
+
num -= values[i];
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
return roman;
|
|
591
|
+
}
|
|
592
|
+
/**
|
|
593
|
+
* Converts an integer to its alphabetic representation (A-Z, AA-ZZ, etc.).
|
|
594
|
+
* Used for ordered list markers with alphabetic styles.
|
|
595
|
+
* @param num The integer to convert (1-based).
|
|
596
|
+
* @returns The alphabetic string for the given number.
|
|
597
|
+
*/
|
|
598
|
+
function integerToAlpha(num) {
|
|
599
|
+
const letterOffset = (num - 1) % 26;
|
|
600
|
+
const letter = String.fromCharCode(65 + letterOffset);
|
|
601
|
+
const depth = Math.ceil(num / 26);
|
|
602
|
+
return letter.repeat(depth);
|
|
603
|
+
}
|
|
512
604
|
//# sourceMappingURL=TextBlock.js.map
|