@itwin/core-common 5.3.0-dev.1 → 5.3.0-dev.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"TextStyle.js","sourceRoot":"","sources":["../../../src/annotation/TextStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,0CAAsD;AAEtD;;;GAGG;AACH,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC9B,uBAAuB;IACvB,oCAAY,CAAA;IACZ,0CAAkB,CAAA;IAClB,oCAAY,CAAA;IACZ,yCAAY,CAAA;IACZ,yCAAY,CAAA;IACZ,yCAAY,CAAA;IACZ,cAAc;IACd,uCAAU,CAAA;AACZ,CAAC,EAVW,oBAAoB,oCAApB,oBAAoB,QAU/B;AAcD;;EAEE;AACW,QAAA,yBAAyB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,CAAU,CAAC;AA2CtM,CAAC;AA0IF,SAAS,UAAU,CAAI,GAAM;IAC3B,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjE,OAAO;IACT,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,GAAW,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACvC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED;;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,IAAI,CAAC,EAAE,CAAC;YACnC,aAAa,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;;AA1OH,8CA2OC;AAED,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAC3C,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { DeepReadonlyObject, DeepRequiredObject } from \"@itwin/core-bentley\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\n\n/** Predefined markers for list items in text annotations.\n * These values control the appearance of list item markers (e.g., bullet, circle, square, dash, number) that denote the start of a list item in a list.\n * @beta\n */\nexport enum ListMarkerEnumerator {\n /** English Alphabet */\n Letter = \"A\",\n RomanNumeral = \"I\",\n Number = \"1\",\n Bullet = \"•\",\n Circle = \"○\",\n Square = \"■\",\n /** EM Dash */\n Dash = \"–\",\n}\n\n/** A settings to specify how to mark or denote the start of a list item in a [[List]].\n * @beta\n */\nexport interface ListMarker {\n /** This can be either one of the predefined markers in [[ListMarkerEnumerator]], or any arbitrary string. */\n enumerator: ListMarkerEnumerator | string,\n /** The punctuation to follow the enumerator. */\n terminator?: \"parenthesis\" | \"period\",\n /** Whether to use upper or lower case for alphabetic or roman numeral enumerators. Ignored if [[enumerator]] is not alphabetic or roman numeral. */\n case?: \"upper\" | \"lower\",\n}\n\n/** Set of predefined shapes that can be computed and drawn around the margins of a [[TextBlock]]\n * @beta\n*/\nexport const textAnnotationFrameShapes = [\"none\", \"line\", \"rectangle\", \"circle\", \"equilateralTriangle\", \"diamond\", \"square\", \"pentagon\", \"hexagon\", \"octagon\", \"capsule\", \"roundedRectangle\"] as const;\n\n/** Describes a predefined shape that can be computed and drawn around the margins of a [[TextBlock]]\n * @beta\n*/\nexport type TextAnnotationFrameShape = typeof textAnnotationFrameShapes[number];\n\n/**\n * Describes what color to use when filling the frame around a [[TextBlock]].\n * If `background` is specified, [[GeometryParams.BackgroundFill]] will be set to `BackgroundFill.Outline`.\n * If `none` is specified, no fill will be applied.\n * @beta\n */\nexport type TextAnnotationFillColor = TextStyleColor | \"background\" | \"none\";\n\n/** Specifies how to separate the numerator and denominator of a [[FractionRun]], by either a horizontal or diagonal bar.\n * @see [[TextStyleSettingsProps.stackedFractionType]] and [[TextStyleSettings.stackedFractionType]].\n * @beta\n */\nexport type StackedFractionType = \"horizontal\" | \"diagonal\";\n\n/** Describes the color in which to draw the text in a [[TextRun]].\n * \"subcategory\" indicates that the text should be drawn using the color of the [SubCategory]($backend) specified by the [GeometryStream]($docs/learning/common/GeometryStream.md) hosting the\n * text.\n * @beta\n */\nexport type TextStyleColor = ColorDefProps | \"subcategory\";\n\n/**\n * Describes how to draw the frame around a [[TextAnnotation]].\n * The frame can be a simple line, a filled shape, or both.\n * If only a subset of properties are specified, the others will be set to their default value.\n * @beta\n */\nexport interface TextFrameStyleProps {\n /** Shape of the frame. Default: \"none\" */\n shape?: TextAnnotationFrameShape;\n /** The color to fill the shape of the text frame. This fill is applied using [[FillDisplay.Blanking]]. Default: \"none\" */\n fill?: TextAnnotationFillColor;\n /** The color of the text frame's outline. Default: black */\n border?: TextStyleColor;\n /** This will be used to set the [[GeometryParams.weight]] property of the frame (in pixels). Default: 1px */\n borderWeight?: number;\n};\n\n/** Properties describing the appearance of [[TextAnnotationLeader]] in a [[TextAnnotation]].\n * Used when producing geometry for [[TextAnnotation]].\n * @beta\n */\nexport interface TextLeaderStyleProps {\n /** The color of the leader.\n * If `inherit` is specified, the [[TextAnnotationLeader]] will use the color specified in the parent [[TextStyleSettings]]`.\n * Default: \"inherit\".\n */\n color?: TextStyleColor | \"inherit\";\n /** Whether to use an elbow in the leader.\n * Default: false\n */\n wantElbow?: boolean;\n /** Multiplier used to compute length of the elbow in the leader.\n * The elbowLength is computed in meters as elbowLength * [[lineHeight]].\n * Default: 1.0\n */\n elbowLength?: number;\n /** Multiplier to compute height of the leader terminator.\n * The terminator height is computed in meters as terminatorHeight * [[lineHeight]].\n * Default: 1.0\n */\n terminatorHeightFactor?: number;\n /** Multiplier to compute width of the leader terminator.\n * The terminator width is computed in meters as terminatorWidth * [[lineHeight]].\n * Default: 1.0\n */\n terminatorWidthFactor?: number;\n}\n\n/** Serves both as the JSON representation of a [[TextStyleSettings]], and a way for a [[TextBlockComponent]] to selectively override aspects of a [AnnotationTextStyle]($backend)'s properties.\n * @beta\n */\nexport interface TextStyleSettingsProps {\n /** The color of the text.\n * Default: \"subcategory\".\n */\n color?: TextStyleColor;\n /** The name of a font stored in an iModel, used to draw the contents of a [[TextRun]].\n * Default: \"\" (an invalid font name).\n */\n fontName?: string;\n /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.\n * For example, the height and offset from baseline of a subscript [[TextRun]] are computed as lineHeight * [[subScriptScale]] and\n * lineHeight * [[subScriptOffsetFactor]], respectively.\n * Default: 1.0. */\n lineHeight?: number;\n /** Multiplier used to compute the vertical distance between two lines of text.\n * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].\n * Default: 0.5.\n */\n lineSpacingFactor?: number;\n /** Multiplier used to compute the vertical distance between two paragraphs of text.\n * The distance is computed in meters as paragraphSpacingFactor * [[lineHeight]].\n * Default: 0.5.\n */\n paragraphSpacingFactor?: number;\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**.\n * Default: false.\n */\n isBold?: boolean;\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*.\n * Default: false.\n */\n isItalic?: boolean;\n /** Specifies whether the content of a [[TextRun]] should be underlined.\n * Default: false.\n */\n isUnderlined?: boolean;\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\n * The height is computed in meters as stackedFractionScale * [[lineHeight]].\n * Default: 0.7.\n */\n stackedFractionScale?: number;\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]].\n * Default: \"horizontal\".\n */\n stackedFractionType?: StackedFractionType;\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\n * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].\n * Default: -0.15.\n */\n subScriptOffsetFactor?: number;\n /** Multiplier used to compute the height of a subscript [[TextRun]].\n * The height is computed as subScriptScale * [[lineHeight]].\n * Default: 2/3\n */\n subScriptScale?: number;\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\n * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].\n * Default: -0.5.\n */\n superScriptOffsetFactor?: number;\n /** Multiplier used to compute the height of a superscript [[TextRun]].\n * The height is computed as superScriptScale * [[lineHeight]].\n * Default: 2/3\n */\n superScriptScale?: number;\n /** A scale applied to the width of each glyph.\n * Default: 1.0\n */\n widthFactor?: number;\n\n /** Properties describing appearance of leaders in a [[TextAnnotation]]\n * Used when producing geometry for [[TextAnnotation]]\n * Default: {color:\"subcategory\", wantElbow:\"false\",elbowLength:1, terminatorWidthFactor:1, terminatorHeightFactor:1}.\n */\n leader?: TextLeaderStyleProps;\n /** The size (in meters) used to calculate the tab stops in a run.\n * These are equally spaced from the left edge of the TextBlock.\n * [[tabInterval]] is also used in lists to compute the offset of each child or [[Paragraph]].\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n * Default: 4 meters.\n */\n tabInterval?: number;\n /**\n * A description of the frame around the text annotation.\n * Used when producing geometry for [[TextAnnotation]]s.\n * Default: {shape: \"none\", fill: \"none\", border: black, borderWeight: 1} for no frame.\n */\n frame?: TextFrameStyleProps;\n /** The offset (in meters) from the left edge of the text block to the start of the line of text.\n * In lists, the indentation is added to offset of list items.\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n * Default: 0 meters.\n */\n indentation?: number;\n /** The marker used to indicate the start of a list item.\n * Default: \"1.\".\n */\n listMarker?: ListMarker;\n}\n\nfunction deepFreeze<T>(obj: T) {\n if (obj === null || typeof obj !== \"object\" || Object.isFrozen(obj))\n return;\n Object.getOwnPropertyNames(obj).forEach((prop) => {\n const value = (obj as any)[prop];\n if (value && typeof value === \"object\") {\n deepFreeze(value);\n }\n });\n Object.freeze(obj);\n}\n\n/** A description of the formatting to be applied to a [[TextBlockComponent]].\n * Named instances of these settings can be stored as [AnnotationTextStyle]($backend)s in an iModel.\n * @note This is an immutable type. Use [[clone]] to create a modified copy.\n * @see [[TextStyleSettingsProps]] for documentation of each of the settings.\n * @beta\n */\nexport class TextStyleSettings {\n /** The color of the text. */\n public readonly color: TextStyleColor;\n /** The name of a font stored in an iModel, used to draw the contents of a [[TextRun]].\n */\n public readonly fontName: string;\n /** The height each line of text, in meters. Many other settings use the line height as the basis for computing their own values.\n * For example, the height and offset from baseline of a subscript [[TextRun]] are computed as lineHeight * [[subScriptScale]] and\n * lineHeight * [[subScriptOffsetFactor]], respectively.\n */\n public readonly lineHeight: number;\n /** Multiplier used to compute the vertical distance between two lines of text.\n * The distance is computed in meters as lineSpacingFactor * [[lineHeight]].\n */\n public readonly lineSpacingFactor: number;\n /** Multiplier used to compute the vertical distance between two paragraphs of text.\n * The distance is computed in meters as paragraphSpacingFactor * [[lineHeight]].\n */\n public readonly paragraphSpacingFactor: number;\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**. */\n public readonly isBold: boolean;\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*. */\n public readonly isItalic: boolean;\n /** Specifies whether the content of a [[TextRun]] should be underlined. */\n public readonly isUnderlined: boolean;\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\n * The height is computed in meters as stackedFractionScale * [[lineHeight]].\n */\n public readonly stackedFractionScale: number;\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]]. */\n public readonly stackedFractionType: StackedFractionType;\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\n * The offset is computed in meters as subScriptOffsetFactor * [[lineHeight]].\n */\n public readonly subScriptOffsetFactor: number;\n /** Multiplier used to compute the height of a subscript [[TextRun]].\n * The height is computed as subScriptScale * [[lineHeight]].\n */\n public readonly subScriptScale: number;\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\n * The offset is computed in meters as superScriptOffsetFactor * [[lineHeight]].\n */\n public readonly superScriptOffsetFactor: number;\n /** Multiplier used to compute the height of a superscript [[TextRun]].\n * The height is computed as superScriptScale * [[lineHeight]].\n */\n public readonly superScriptScale: number;\n /** Multiplier used to compute the width of each glyph, relative to [[lineHeight]]. */\n public readonly widthFactor: number;\n /** Properties describing appearance of leaders in a [[TextAnnotation]].\n * Used when producing geometry for [[TextAnnotation]].\n */\n public readonly leader: Readonly<Required<TextLeaderStyleProps>>;\n /** The size (in meters) used to calculate the tab stops in a run.\n * These are equally spaced from the left edge of the TextBlock.\n * [[tabInterval]] is also used in lists to compute the offset of each child or [[Paragraph]].\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n */\n public readonly tabInterval: number;\n /** The offset (in meters) from the left edge of the text block to the start of the line of text.\n * In lists, the indentation is added to offset of list items.\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n */\n public readonly indentation: number;\n /** The marker used to indicate the start of a list item.\n * Default: [[ListMarkerEnumerator.Number]].\n */\n public readonly listMarker: ListMarker;\n /** The frame settings of the [[TextAnnotation]]. */\n public readonly frame: Readonly<Required<TextFrameStyleProps>>;\n\n /** A fully-populated JSON representation of the default settings. A real `fontName` must be provided before use. */\n public static defaultProps: DeepReadonlyObject<DeepRequiredObject<TextStyleSettingsProps>> = {\n color: \"subcategory\",\n fontName: \"\",\n lineHeight: 1,\n lineSpacingFactor: 0.5,\n paragraphSpacingFactor: 0.5,\n isBold: false,\n isItalic: false,\n isUnderlined: false,\n stackedFractionScale: 0.7,\n stackedFractionType: \"horizontal\",\n subScriptOffsetFactor: -0.15,\n subScriptScale: 2 / 3,\n superScriptOffsetFactor: 0.5,\n superScriptScale: 2 / 3,\n widthFactor: 1,\n leader: {\n color: \"inherit\",\n wantElbow: false,\n elbowLength: 1.0,\n terminatorHeightFactor: 1.0,\n terminatorWidthFactor: 1.0,\n },\n tabInterval: 4,\n indentation: 0,\n listMarker: { enumerator: \"1\", terminator: \"period\", case: \"lower\" },\n frame: {\n shape: \"none\",\n fill: \"none\",\n border: ColorDef.black.toJSON(),\n borderWeight: 1,\n },\n };\n\n /** Settings initialized to all default values. */\n public static defaults: TextStyleSettings = new TextStyleSettings({});\n\n private constructor(props: TextStyleSettingsProps, defaults?: Required<TextStyleSettingsProps>) {\n if (!defaults) {\n defaults = TextStyleSettings.defaultProps;\n }\n\n this.color = props.color ?? defaults.color;\n this.fontName = props.fontName ?? defaults.fontName;\n this.lineHeight = props.lineHeight ?? defaults.lineHeight;\n this.lineSpacingFactor = props.lineSpacingFactor ?? defaults.lineSpacingFactor;\n this.paragraphSpacingFactor = props.paragraphSpacingFactor ?? defaults.paragraphSpacingFactor;\n this.isBold = props.isBold ?? defaults.isBold;\n this.isItalic = props.isItalic ?? defaults.isItalic;\n this.isUnderlined = props.isUnderlined ?? defaults.isUnderlined;\n this.stackedFractionScale = props.stackedFractionScale ?? defaults.stackedFractionScale;\n this.stackedFractionType = props.stackedFractionType ?? defaults.stackedFractionType;\n this.subScriptOffsetFactor = props.subScriptOffsetFactor ?? defaults.subScriptOffsetFactor;\n this.subScriptScale = props.subScriptScale ?? defaults.subScriptScale;\n this.superScriptOffsetFactor = props.superScriptOffsetFactor ?? defaults.superScriptOffsetFactor;\n this.superScriptScale = props.superScriptScale ?? defaults.superScriptScale;\n this.widthFactor = props.widthFactor ?? defaults.widthFactor;\n const leader = {\n color: props.leader?.color ?? defaults.leader.color,\n wantElbow: props.leader?.wantElbow ?? defaults.leader.wantElbow,\n elbowLength: props.leader?.elbowLength ?? defaults.leader.elbowLength,\n terminatorHeightFactor: props.leader?.terminatorHeightFactor ?? defaults.leader.terminatorHeightFactor,\n terminatorWidthFactor: props.leader?.terminatorWidthFactor ?? defaults.leader.terminatorWidthFactor,\n }\n this.leader = Object.freeze(leader) as Readonly<Required<TextLeaderStyleProps>>;\n this.tabInterval = props.tabInterval ?? defaults.tabInterval;\n this.indentation = props.indentation ?? defaults.indentation;\n this.listMarker = props.listMarker ?? defaults.listMarker;\n\n const frame = {\n shape: props.frame?.shape ?? defaults.frame.shape,\n fill: props.frame?.fill ?? defaults.frame.fill,\n border: props.frame?.border ?? defaults.frame.border,\n borderWeight: props.frame?.borderWeight ?? defaults.frame.borderWeight,\n };\n // Cast to indicate to TypeScript that the frame properties are all defined\n this.frame = Object.freeze(frame) as Readonly<Required<TextFrameStyleProps>>;\n }\n\n /** Create a copy of these settings, modified according to the properties defined by `alteredProps`. */\n public clone(alteredProps?: TextStyleSettingsProps): TextStyleSettings {\n return alteredProps ? new TextStyleSettings(alteredProps, this) : this;\n }\n\n /** Creates a deep copy of the `TextStyleSettingsProps`. */\n public static cloneProps(props: TextStyleSettingsProps): TextStyleSettingsProps {\n const copy = { ...props };\n if (props.leader) {\n copy.leader = { ...props.leader };\n }\n if (props.frame) {\n copy.frame = { ...props.frame };\n }\n return copy;\n }\n\n /** Create settings from their JSON representation. */\n public static fromJSON(props?: TextStyleSettingsProps): TextStyleSettings {\n return props ? new TextStyleSettings(props) : TextStyleSettings.defaults;\n }\n\n public toJSON(): TextStyleSettingsProps {\n return { ...this };\n }\n\n /** Compare two [[TextLeaderStyleProps]] for equality.\n * @param other The other leader style properties to compare against.\n * @returns true if the two leader styles are equal, false otherwise.\n */\n public leaderEquals(other: TextLeaderStyleProps): boolean {\n return this.leader.color === other.color && this.leader.wantElbow === other.wantElbow\n && this.leader.elbowLength === other.elbowLength && this.leader.terminatorHeightFactor === other.terminatorHeightFactor\n && this.leader.terminatorWidthFactor === other.terminatorWidthFactor;\n }\n\n public frameEquals(other: TextFrameStyleProps): boolean {\n return this.frame?.shape === other.shape\n && this.frame?.fill === other.fill\n && this.frame?.border === other.border\n && this.frame?.borderWeight === other.borderWeight;\n }\n\n public equals(other: TextStyleSettings): boolean {\n return this.color === other.color && this.fontName === other.fontName\n && this.lineHeight === other.lineHeight && this.lineSpacingFactor === other.lineSpacingFactor && this.paragraphSpacingFactor === other.paragraphSpacingFactor && this.widthFactor === other.widthFactor\n && this.isBold === other.isBold && this.isItalic === other.isItalic && this.isUnderlined === other.isUnderlined\n && this.stackedFractionType === other.stackedFractionType && this.stackedFractionScale === other.stackedFractionScale\n && this.subScriptOffsetFactor === other.subScriptOffsetFactor && this.subScriptScale === other.subScriptScale\n && this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale\n && this.tabInterval === other.tabInterval && this.indentation === other.indentation\n && this.listMarker.case === other.listMarker.case && this.listMarker.enumerator === other.listMarker.enumerator && this.listMarker.terminator === other.listMarker.terminator\n && this.leaderEquals(other.leader)\n && this.frameEquals(other.frame)\n }\n\n /**\n * Returns a list of validation errors for this instance.\n *\n * A TextStyleSettings object may contain values that are invalid in all contexts.\n * If this method returns any error strings, using the settings will likely result in rendering failures or runtime exceptions.\n *\n * This method only checks for universally invalid values. Additional domain-specific validation may be required depending on the context in which these settings are used.\n *\n * @returns An array of error strings describing the invalid values, or an empty array if the settings are valid.\n */\n public getValidationErrors(): string[] {\n const errorMessages: string[] = [];\n if (this.fontName.trim() === \"\") {\n errorMessages.push(\"fontName must be provided\");\n }\n\n if (this.lineHeight <= 0) {\n errorMessages.push(\"lineHeight must be greater than 0\");\n }\n\n if (this.stackedFractionScale <= 0) {\n errorMessages.push(\"stackedFractionScale must be greater than 0\");\n }\n\n return errorMessages;\n }\n}\n\ndeepFreeze(TextStyleSettings.defaultProps);\ndeepFreeze(TextStyleSettings.defaults);"]}
1
+ {"version":3,"file":"TextStyle.js","sourceRoot":"","sources":["../../../src/annotation/TextStyle.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,0CAAsD;AACtD,oCAAwD;AAExD;;;GAGG;AACH,IAAY,oBAUX;AAVD,WAAY,oBAAoB;IAC9B,uBAAuB;IACvB,oCAAY,CAAA;IACZ,0CAAkB,CAAA;IAClB,oCAAY,CAAA;IACZ,yCAAY,CAAA;IACZ,yCAAY,CAAA;IACZ,yCAAY,CAAA;IACZ,cAAc;IACd,uCAAU,CAAA;AACZ,CAAC,EAVW,oBAAoB,oCAApB,oBAAoB,QAU/B;AAcD;;EAEE;AACW,QAAA,yBAAyB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,CAAU,CAAC;AA4BtM,CAAC;AAmCD,CAAC;AAgJF,SAAS,UAAU,CAAI,GAAM;IAC3B,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC;QACjE,OAAO;IACT,MAAM,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/C,MAAM,KAAK,GAAI,GAAW,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACvC,UAAU,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAED;;;;;GAKG;AACH,MAAa,iBAAiB;IAC5B,6BAA6B;IACb,KAAK,CAAiB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,gBAAgB,KAAK,KAAK,CAAC,gBAAgB;eAClH,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,WAAW;eAChF,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,KAAK,CAAC,UAAU,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,CAAC,UAAU,KAAK,KAAK,CAAC,UAAU,CAAC,UAAU;eAC1K,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa;eAC1C,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC;eAC/B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,CAAC;eAC7B,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;;;;OASG;IACI,mBAAmB;QACxB,MAAM,aAAa,GAAa,EAAE,CAAC;QACnC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACjC,aAAa,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC;QACnD,CAAC;QAED,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,EAAE,CAAC;YACzB,aAAa,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;QAC1D,CAAC;QAED,IAAI,IAAI,CAAC,oBAAoB,IAAI,CAAC,EAAE,CAAC;YACnC,aAAa,CAAC,IAAI,CAAC,6CAA6C,CAAC,CAAC;QACpE,CAAC;QAED,OAAO,aAAa,CAAC;IACvB,CAAC;;AA5PH,8CA6PC;AAED,UAAU,CAAC,iBAAiB,CAAC,YAAY,CAAC,CAAC;AAC3C,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { DeepReadonlyObject, DeepRequiredObject } from \"@itwin/core-bentley\";\nimport { ColorDef, ColorDefProps } from \"../ColorDef\";\nimport { FontFamilySelector, FontType } from \"../Fonts\";\n\n/** Predefined markers for list items in text annotations.\n * These values control the appearance of list item markers (e.g., bullet, circle, square, dash, number) that denote the start of a list item in a list.\n * @beta\n */\nexport enum ListMarkerEnumerator {\n /** English Alphabet */\n Letter = \"A\",\n RomanNumeral = \"I\",\n Number = \"1\",\n Bullet = \"•\",\n Circle = \"○\",\n Square = \"■\",\n /** EM Dash */\n Dash = \"–\",\n}\n\n/** A settings to specify how to mark or denote the start of a list item in a [[List]].\n * @beta\n */\nexport interface ListMarker {\n /** This can be either one of the predefined markers in [[ListMarkerEnumerator]], or any arbitrary string. */\n enumerator: ListMarkerEnumerator | string,\n /** The punctuation to follow the enumerator. */\n terminator?: \"parenthesis\" | \"period\",\n /** Whether to use upper or lower case for alphabetic or roman numeral enumerators. Ignored if [[enumerator]] is not alphabetic or roman numeral. */\n case?: \"upper\" | \"lower\",\n}\n\n/** Set of predefined shapes that can be computed and drawn around the margins of a [[TextBlock]]\n * @beta\n*/\nexport const textAnnotationFrameShapes = [\"none\", \"line\", \"rectangle\", \"circle\", \"equilateralTriangle\", \"diamond\", \"square\", \"pentagon\", \"hexagon\", \"octagon\", \"capsule\", \"roundedRectangle\"] as const;\n\n/** Describes a predefined shape that can be computed and drawn around the margins of a [[TextBlock]]\n * @beta\n*/\nexport type TextAnnotationFrameShape = typeof textAnnotationFrameShapes[number];\n\n/**\n * Describes what color to use when filling the frame around a [[TextBlock]].\n * If `background` is specified, [[GeometryParams.BackgroundFill]] will be set to `BackgroundFill.Outline`.\n * If `none` is specified, no fill will be applied.\n * @beta\n */\nexport type TextAnnotationFillColor = TextStyleColor | \"background\" | \"none\";\n\n/** Describes the margins around the content inside a [[TextBlock]], measured in meters.\n * All margins default to zero if `undefined`.\n * @beta\n */\nexport interface TextBlockMargins {\n /** The left margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n left?: number;\n /** The right margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n right?: number;\n /** The top margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n top?: number;\n /** The bottom margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n bottom?: number;\n};\n\n/** Describes the relative alignment of text.\n * @beta\n*/\nexport type TextJustification = \"left\" | \"center\" | \"right\";\n\n/** Specifies how to separate the numerator and denominator of a [[FractionRun]], by either a horizontal or diagonal bar.\n * @see [[TextStyleSettingsProps.stackedFractionType]] and [[TextStyleSettings.stackedFractionType]].\n * @beta\n */\nexport type StackedFractionType = \"horizontal\" | \"diagonal\";\n\n/** Describes the color in which to draw the text in a [[TextRun]].\n * \"subcategory\" indicates that the text should be drawn using the color of the [SubCategory]($backend) specified by the [GeometryStream]($docs/learning/common/GeometryStream.md) hosting the\n * text.\n * @beta\n */\nexport type TextStyleColor = ColorDefProps | \"subcategory\";\n\n/**\n * Describes how to draw the frame around a [[TextAnnotation]].\n * The frame can be a simple line, a filled shape, or both.\n * If only a subset of properties are specified, the others will be set to their default value.\n * @beta\n */\nexport interface TextFrameStyleProps {\n /** Shape of the frame. Default: \"none\" */\n shape?: TextAnnotationFrameShape;\n /** The color to fill the shape of the text frame. This fill is applied using [[FillDisplay.Blanking]]. Default: \"none\" */\n fillColor?: TextAnnotationFillColor;\n /** The color of the text frame's outline. Default: black */\n borderColor?: TextStyleColor;\n /** This will be used to set the [[GeometryParams.weight]] property of the frame (in pixels). Default: 1px */\n borderWeight?: number;\n};\n\n/** Properties describing the appearance of [[TextAnnotationLeader]] in a [[TextAnnotation]].\n * Used when producing geometry for [[TextAnnotation]].\n * @beta\n */\nexport interface TextLeaderStyleProps {\n /** The color of the leader.\n * If `inherit` is specified, the [[TextAnnotationLeader]] will use the color specified in the parent [[TextStyleSettings]]`.\n * Default: \"inherit\".\n */\n color?: TextStyleColor | \"inherit\";\n /** Whether to use an elbow in the leader.\n * Default: false\n */\n wantElbow?: boolean;\n /** Multiplier used to compute length of the elbow in the leader.\n * The elbowLength is computed in meters as elbowLength * [[textHeight]].\n * Default: 1.0\n */\n elbowLength?: number;\n /** Multiplier to compute height of the leader terminator.\n * The terminator height is computed in meters as terminatorHeight * [[textHeight]].\n * Default: 1.0\n */\n terminatorHeightFactor?: number;\n /** Multiplier to compute width of the leader terminator.\n * The terminator width is computed in meters as terminatorWidth * [[textHeight]].\n * Default: 1.0\n */\n terminatorWidthFactor?: number;\n}\n\n/** Serves both as the JSON representation of a [[TextStyleSettings]], and a way for a [[TextBlockComponent]] to selectively override aspects of a [AnnotationTextStyle]($backend)'s properties.\n * @beta\n */\nexport interface TextStyleSettingsProps {\n /** The color of the text.\n * Default: \"subcategory\".\n */\n color?: TextStyleColor;\n /** The font stored in an iModel, used to draw the contents of a [[TextRun]].\n * Default: { name: \"\" } (an invalid font name).\n */\n font?: FontFamilySelector;\n /** The height of the text, in meters. Many other settings use the text height as the basis for computing their own values.\n * For example, the height and offset from baseline of a subscript [[TextRun]] are computed as textHeight * [[subScriptScale]] and\n * textHeight * [[subScriptOffsetFactor]], respectively.\n * Default: 1.0. */\n textHeight?: number;\n /** Multiplier used to compute the vertical distance between two lines of text.\n * The distance is computed in meters as lineSpacingFactor * [[textHeight]].\n * Default: 0.5.\n */\n lineSpacingFactor?: number;\n /** Multiplier used to compute the vertical distance between two paragraphs of text.\n * The distance is computed in meters as paragraphSpacingFactor * [[textHeight]].\n * Default: 0.5.\n */\n paragraphSpacingFactor?: number;\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**.\n * Default: false.\n */\n isBold?: boolean;\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*.\n * Default: false.\n */\n isItalic?: boolean;\n /** Specifies whether the content of a [[TextRun]] should be underlined.\n * Default: false.\n */\n isUnderlined?: boolean;\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\n * The height is computed in meters as stackedFractionScale * [[textHeight]].\n * Default: 0.7.\n */\n stackedFractionScale?: number;\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]].\n * Default: \"horizontal\".\n */\n stackedFractionType?: StackedFractionType;\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\n * The offset is computed in meters as subScriptOffsetFactor * [[textHeight]].\n * Default: -0.15.\n */\n subScriptOffsetFactor?: number;\n /** Multiplier used to compute the height of a subscript [[TextRun]].\n * The height is computed as subScriptScale * [[textHeight]].\n * Default: 2/3\n */\n subScriptScale?: number;\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\n * The offset is computed in meters as superScriptOffsetFactor * [[textHeight]].\n * Default: -0.5.\n */\n superScriptOffsetFactor?: number;\n /** Multiplier used to compute the height of a superscript [[TextRun]].\n * The height is computed as superScriptScale * [[textHeight]].\n * Default: 2/3\n */\n superScriptScale?: number;\n /** A scale applied to the width of each glyph.\n * Default: 1.0\n */\n widthFactor?: number;\n\n /** Properties describing appearance of leaders in a [[TextAnnotation]]\n * Used when producing geometry for [[TextAnnotation]]\n * Default: {color:\"subcategory\", wantElbow:\"false\",elbowLength:1, terminatorWidthFactor:1, terminatorHeightFactor:1}.\n */\n leader?: TextLeaderStyleProps;\n /** The size (in meters) used to calculate the tab stops in a run.\n * These are equally spaced from the left edge of the TextBlock.\n * [[tabInterval]] is also used in lists to compute the offset of each child or [[Paragraph]].\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n * Default: 4 meters.\n */\n tabInterval?: number;\n /**\n * A description of the frame around the text annotation.\n * Used when producing geometry for [[TextAnnotation]]s.\n * Default: {shape: \"none\", fill: \"none\", border: black, borderWeight: 1} for no frame.\n */\n frame?: TextFrameStyleProps;\n /** The margins to surround the document content.\n * Default: 0 margins on all sides */\n margins?: TextBlockMargins;\n /** The offset (in meters) from the left edge of the text block to the start of the line of text.\n * In lists, the indentation is added to offset of list items.\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n * Default: 0 meters.\n */\n indentation?: number;\n /** The marker used to indicate the start of a list item.\n * Default: \"1.\".\n */\n listMarker?: ListMarker;\n /** The alignment of the text content.\n * Default: \"left\". */\n justification?: TextJustification;\n}\n\nfunction deepFreeze<T>(obj: T) {\n if (obj === null || typeof obj !== \"object\" || Object.isFrozen(obj))\n return;\n Object.getOwnPropertyNames(obj).forEach((prop) => {\n const value = (obj as any)[prop];\n if (value && typeof value === \"object\") {\n deepFreeze(value);\n }\n });\n Object.freeze(obj);\n}\n\n/** A description of the formatting to be applied to a [[TextBlockComponent]].\n * Named instances of these settings can be stored as [AnnotationTextStyle]($backend)s in an iModel.\n * @note This is an immutable type. Use [[clone]] to create a modified copy.\n * @see [[TextStyleSettingsProps]] for documentation of each of the settings.\n * @beta\n */\nexport class TextStyleSettings {\n /** The color of the text. */\n public readonly color: TextStyleColor;\n /** The font stored in an iModel, used to draw the contents of a [[TextRun]].\n */\n public readonly font: Readonly<Required<FontFamilySelector>>;\n /** The height of the text, in meters. Many other settings use the text height as the basis for computing their own values.\n * For example, the height and offset from baseline of a subscript [[TextRun]] are computed as textHeight * [[subScriptScale]] and\n * textHeight * [[subScriptOffsetFactor]], respectively.\n */\n public readonly textHeight: number;\n /** Multiplier used to compute the vertical distance between two lines of text.\n * The distance is computed in meters as lineSpacingFactor * [[textHeight]] of the [[TextBlock]].\n */\n public readonly lineSpacingFactor: number;\n /** Multiplier used to compute the vertical distance between two paragraphs of text.\n * The distance is computed in meters as paragraphSpacingFactor * the [[TextBlock]]'s [[textHeight]].\n */\n public readonly paragraphSpacingFactor: number;\n /** Specifies whether the content of a [[TextRun]] should be rendered **bold**. */\n public readonly isBold: boolean;\n /** Specifies whether the content of a [[TextRun]] should be rendered in *italics*. */\n public readonly isItalic: boolean;\n /** Specifies whether the content of a [[TextRun]] should be underlined. */\n public readonly isUnderlined: boolean;\n /** Multiplier used to compute the height of both the numerator and denominator of a [[FractionRun]].\n * The height is computed in meters as stackedFractionScale * [[textHeight]].\n */\n public readonly stackedFractionScale: number;\n /** Specifies how to separate the numerator and denominator of a [[FractionRun]]. */\n public readonly stackedFractionType: StackedFractionType;\n /** Multiplier used to compute the vertical offset from the baseline for a subscript [[TextRun]].\n * The offset is computed in meters as subScriptOffsetFactor * [[textHeight]].\n */\n public readonly subScriptOffsetFactor: number;\n /** Multiplier used to compute the height of a subscript [[TextRun]].\n * The height is computed as subScriptScale * [[textHeight]].\n */\n public readonly subScriptScale: number;\n /** Multiplier used to compute the vertical offset from the baseline for a super [[TextRun]].\n * The offset is computed in meters as superScriptOffsetFactor * [[textHeight]].\n */\n public readonly superScriptOffsetFactor: number;\n /** Multiplier used to compute the height of a superscript [[TextRun]].\n * The height is computed as superScriptScale * [[textHeight]].\n */\n public readonly superScriptScale: number;\n /** Multiplier used to compute the width of each glyph, relative to [[textHeight]]. */\n public readonly widthFactor: number;\n /** Properties describing appearance of leaders in a [[TextAnnotation]].\n * Used when producing geometry for [[TextAnnotation]].\n */\n public readonly leader: Readonly<Required<TextLeaderStyleProps>>;\n /** The size (in meters) used to calculate the tab stops in a run.\n * These are equally spaced from the left edge of the TextBlock.\n * [[tabInterval]] is also used in lists to compute the offset of each child or [[Paragraph]].\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n */\n public readonly tabInterval: number;\n /** The offset (in meters) from the left edge of the text block to the start of the line of text.\n * In lists, the indentation is added to offset of list items.\n * The [[listMarker]] is right justified on [[indentation]] + [[tabInterval]]*(depth - 1/2).\n * [[Paragraph]]s will start at [[indentation]] + [[tabInterval]]*depth.\n */\n public readonly indentation: number;\n /** The marker used to indicate the start of a list item.\n * Default: [[ListMarkerEnumerator.Number]].\n */\n public readonly listMarker: ListMarker;\n /** The frame settings of the [[TextAnnotation]]. */\n public readonly frame: Readonly<Required<TextFrameStyleProps>>;\n /** The margins to surround the document content. */\n public readonly margins: Readonly<Required<TextBlockMargins>>;\n /** The alignment of the text content. */\n public readonly justification: TextJustification;\n\n /** A fully-populated JSON representation of the default settings. A real `font` must be provided before use. */\n public static defaultProps: DeepReadonlyObject<DeepRequiredObject<TextStyleSettingsProps>> = {\n color: \"subcategory\",\n font: { name: \"\", type: FontType.TrueType },\n textHeight: 1,\n lineSpacingFactor: 0.5,\n paragraphSpacingFactor: 0.5,\n isBold: false,\n isItalic: false,\n isUnderlined: false,\n stackedFractionScale: 0.7,\n stackedFractionType: \"horizontal\",\n subScriptOffsetFactor: -0.15,\n subScriptScale: 2 / 3,\n superScriptOffsetFactor: 0.5,\n superScriptScale: 2 / 3,\n widthFactor: 1,\n leader: {\n color: \"inherit\",\n wantElbow: false,\n elbowLength: 1.0,\n terminatorHeightFactor: 1.0,\n terminatorWidthFactor: 1.0,\n },\n tabInterval: 4,\n indentation: 0,\n listMarker: { enumerator: \"1\", terminator: \"period\", case: \"lower\" },\n frame: {\n shape: \"none\",\n fillColor: \"none\",\n borderColor: ColorDef.black.toJSON(),\n borderWeight: 1,\n },\n margins: {\n left: 0,\n right: 0,\n top: 0,\n bottom: 0\n },\n justification: \"left\",\n };\n\n /** Settings initialized to all default values. */\n public static defaults: TextStyleSettings = new TextStyleSettings({});\n\n private constructor(props: TextStyleSettingsProps, defaults?: Required<TextStyleSettingsProps>) {\n if (!defaults) {\n defaults = TextStyleSettings.defaultProps;\n }\n\n this.color = props.color ?? defaults.color;\n const font = {\n name: props.font?.name ?? defaults.font.name,\n type: props.font?.type ?? defaults.font.type,\n }\n this.font = Object.freeze(font) as Readonly<Required<FontFamilySelector>>;\n this.textHeight = props.textHeight ?? defaults.textHeight;\n this.lineSpacingFactor = props.lineSpacingFactor ?? defaults.lineSpacingFactor;\n this.paragraphSpacingFactor = props.paragraphSpacingFactor ?? defaults.paragraphSpacingFactor;\n this.isBold = props.isBold ?? defaults.isBold;\n this.isItalic = props.isItalic ?? defaults.isItalic;\n this.isUnderlined = props.isUnderlined ?? defaults.isUnderlined;\n this.stackedFractionScale = props.stackedFractionScale ?? defaults.stackedFractionScale;\n this.stackedFractionType = props.stackedFractionType ?? defaults.stackedFractionType;\n this.subScriptOffsetFactor = props.subScriptOffsetFactor ?? defaults.subScriptOffsetFactor;\n this.subScriptScale = props.subScriptScale ?? defaults.subScriptScale;\n this.superScriptOffsetFactor = props.superScriptOffsetFactor ?? defaults.superScriptOffsetFactor;\n this.superScriptScale = props.superScriptScale ?? defaults.superScriptScale;\n this.widthFactor = props.widthFactor ?? defaults.widthFactor;\n const leader = {\n color: props.leader?.color ?? defaults.leader.color,\n wantElbow: props.leader?.wantElbow ?? defaults.leader.wantElbow,\n elbowLength: props.leader?.elbowLength ?? defaults.leader.elbowLength,\n terminatorHeightFactor: props.leader?.terminatorHeightFactor ?? defaults.leader.terminatorHeightFactor,\n terminatorWidthFactor: props.leader?.terminatorWidthFactor ?? defaults.leader.terminatorWidthFactor,\n }\n this.leader = Object.freeze(leader) as Readonly<Required<TextLeaderStyleProps>>;\n this.tabInterval = props.tabInterval ?? defaults.tabInterval;\n this.indentation = props.indentation ?? defaults.indentation;\n this.listMarker = props.listMarker ?? defaults.listMarker;\n const frame = {\n shape: props.frame?.shape ?? defaults.frame.shape,\n fillColor: props.frame?.fillColor ?? defaults.frame.fillColor,\n borderColor: props.frame?.borderColor ?? defaults.frame.borderColor,\n borderWeight: props.frame?.borderWeight ?? defaults.frame.borderWeight,\n };\n // Cast to indicate to TypeScript that the frame properties are all defined\n this.frame = Object.freeze(frame) as Readonly<Required<TextFrameStyleProps>>;\n this.margins = Object.freeze({\n left: props.margins?.left ?? defaults.margins.left,\n right: props.margins?.right ?? defaults.margins.right,\n top: props.margins?.top ?? defaults.margins.top,\n bottom: props.margins?.bottom ?? defaults.margins.bottom,\n }) as Readonly<Required<TextBlockMargins>>;\n this.justification = props.justification ?? defaults.justification;\n }\n\n /** Create a copy of these settings, modified according to the properties defined by `alteredProps`. */\n public clone(alteredProps?: TextStyleSettingsProps): TextStyleSettings {\n return alteredProps ? new TextStyleSettings(alteredProps, this) : this;\n }\n\n /** Create settings from their JSON representation. */\n public static fromJSON(props?: TextStyleSettingsProps): TextStyleSettings {\n return props ? new TextStyleSettings(props) : TextStyleSettings.defaults;\n }\n\n public toJSON(): TextStyleSettingsProps {\n return structuredClone(this);\n }\n\n /** Compare two [[TextLeaderStyleProps]] for equality.\n * @param other The other leader style properties to compare against.\n * @returns true if the two leader styles are equal, false otherwise.\n */\n public leaderEquals(other: TextLeaderStyleProps): boolean {\n return this.leader.color === other.color && this.leader.wantElbow === other.wantElbow\n && this.leader.elbowLength === other.elbowLength && this.leader.terminatorHeightFactor === other.terminatorHeightFactor\n && this.leader.terminatorWidthFactor === other.terminatorWidthFactor;\n }\n\n public frameEquals(other: TextFrameStyleProps): boolean {\n return this.frame?.shape === other.shape\n && this.frame?.fillColor === other.fillColor\n && this.frame?.borderColor === other.borderColor\n && this.frame?.borderWeight === other.borderWeight;\n }\n\n public marginsEqual(other: TextBlockMargins): boolean {\n return Object.entries(this.margins).every(([key, value]) =>\n value === (other as any)[key]\n );\n }\n\n public equals(other: TextStyleSettings): boolean {\n return this.color === other.color && this.font.name === other.font.name && this.font.type === other.font.type\n && this.textHeight === other.textHeight && this.widthFactor === other.widthFactor\n && this.lineSpacingFactor === other.lineSpacingFactor && this.paragraphSpacingFactor === other.paragraphSpacingFactor\n && this.isBold === other.isBold && this.isItalic === other.isItalic && this.isUnderlined === other.isUnderlined\n && this.stackedFractionType === other.stackedFractionType && this.stackedFractionScale === other.stackedFractionScale\n && this.subScriptOffsetFactor === other.subScriptOffsetFactor && this.subScriptScale === other.subScriptScale\n && this.superScriptOffsetFactor === other.superScriptOffsetFactor && this.superScriptScale === other.superScriptScale\n && this.tabInterval === other.tabInterval && this.indentation === other.indentation\n && this.listMarker.case === other.listMarker.case && this.listMarker.enumerator === other.listMarker.enumerator && this.listMarker.terminator === other.listMarker.terminator\n && this.justification === other.justification\n && this.leaderEquals(other.leader)\n && this.frameEquals(other.frame)\n && this.marginsEqual(other.margins);\n }\n\n /**\n * Returns a list of validation errors for this instance.\n *\n * A TextStyleSettings object may contain values that are invalid in all contexts.\n * If this method returns any error strings, using the settings will likely result in rendering failures or runtime exceptions.\n *\n * This method only checks for universally invalid values. Additional domain-specific validation may be required depending on the context in which these settings are used.\n *\n * @returns An array of error strings describing the invalid values, or an empty array if the settings are valid.\n */\n public getValidationErrors(): string[] {\n const errorMessages: string[] = [];\n if (this.font.name.trim() === \"\") {\n errorMessages.push(\"font name must be provided\");\n }\n\n if (this.textHeight <= 0) {\n errorMessages.push(\"textHeight must be greater than 0\");\n }\n\n if (this.stackedFractionScale <= 0) {\n errorMessages.push(\"stackedFractionScale must be greater than 0\");\n }\n\n return errorMessages;\n }\n}\n\ndeepFreeze(TextStyleSettings.defaultProps);\ndeepFreeze(TextStyleSettings.defaults);"]}
@@ -65,7 +65,7 @@ export declare abstract class TextBlockComponent {
65
65
  /** @internal */
66
66
  protected constructor(props?: TextBlockComponentProps);
67
67
  /** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).
68
- * For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.fontName` to "Comic Sans".
68
+ * For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.font.name` to "Comic Sans".
69
69
  * @see [[clearStyleOverrides]] to reset this to an empty object.
70
70
  */
71
71
  get styleOverrides(): TextStyleSettingsProps;
@@ -339,23 +339,6 @@ export declare class List extends TextBlockComponent {
339
339
  stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string;
340
340
  equals(other: TextBlockComponent): boolean;
341
341
  }
342
- /** Describes the relative alignment of the content of a [[TextBlock]].
343
- * @beta
344
- */
345
- export type TextBlockJustification = "left" | "center" | "right";
346
- /** Describes the margins around the content inside a [[TextBlock]]. It's measured in meters.
347
- * @beta
348
- */
349
- export interface TextBlockMargins {
350
- /** The left margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
351
- left: number;
352
- /** The right margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
353
- right: number;
354
- /** The top margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
355
- top: number;
356
- /** The bottom margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */
357
- bottom: number;
358
- }
359
342
  /** JSON representation of a [[TextBlock]].
360
343
  * @beta
361
344
  */
@@ -365,10 +348,6 @@ export interface TextBlockProps extends TextBlockComponentProps {
365
348
  * Default: 0
366
349
  */
367
350
  width?: number;
368
- /** The alignment of the document content. Default: "left". */
369
- justification?: TextBlockJustification;
370
- /** The margins to surround the document content. Default: 0 margins on all sides */
371
- margins?: Partial<TextBlockMargins>;
372
351
  children?: ParagraphProps[];
373
352
  }
374
353
  /** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.
@@ -383,10 +362,6 @@ export declare class TextBlock extends TextBlockComponent {
383
362
  * Default: 0
384
363
  */
385
364
  width: number;
386
- /** The alignment of the document's content. */
387
- justification: TextBlockJustification;
388
- /** The margins of the document. */
389
- margins: TextBlockMargins;
390
365
  private constructor();
391
366
  clearStyleOverrides(options?: ClearTextStyleOptions): void;
392
367
  toJSON(): TextBlockProps;
@@ -1 +1 @@
1
- {"version":3,"file":"TextBlock.d.ts","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAA2C,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEvF;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CA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AAG,GAAG,IAAI;IAKhB,MAAM,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO;CAuB3D;AAED;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC;AAExE;;;;;;;GAOG;AACH,wBAAiB,0BAA0B,CAAC,MAAM,EAAE,4BAA4B,GAAG,gBAAgB,CAAC;IAAE,MAAM,EAAE,4BAA4B,CAAC;IAAC,KAAK,EAAE,IAAI,GAAG,SAAS,GAAG,GAAG,CAAA;CAAE,CAAC,CAO3K;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CA0BrE"}
@@ -24,17 +24,17 @@ export class TextBlockComponent {
24
24
  _styleOverrides;
25
25
  /** @internal */
26
26
  constructor(props) {
27
- this._styleOverrides = TextStyleSettings.cloneProps(props?.styleOverrides ?? {});
27
+ this._styleOverrides = structuredClone(props?.styleOverrides ?? {});
28
28
  }
29
29
  /** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).
30
- * For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.fontName` to "Comic Sans".
30
+ * For example, if the style uses the "Arial" font, you can override that by settings `styleOverrides.font.name` to "Comic Sans".
31
31
  * @see [[clearStyleOverrides]] to reset this to an empty object.
32
32
  */
33
33
  get styleOverrides() {
34
34
  return this._styleOverrides;
35
35
  }
36
36
  set styleOverrides(overrides) {
37
- this._styleOverrides = TextStyleSettings.cloneProps(overrides);
37
+ this._styleOverrides = structuredClone(overrides);
38
38
  }
39
39
  /** Reset any [[styleOverrides]] applied to this component. */
40
40
  clearStyleOverrides(_options) {
@@ -55,23 +55,14 @@ export class TextBlockComponent {
55
55
  /** Convert this component to its JSON representation. */
56
56
  toJSON() {
57
57
  return {
58
- styleOverrides: TextStyleSettings.cloneProps(this.styleOverrides),
58
+ styleOverrides: structuredClone(this.styleOverrides),
59
59
  };
60
60
  }
61
61
  /** Returns true if `this` is equivalent to `other`. */
62
62
  equals(other) {
63
- const myKeys = Object.keys(this.styleOverrides);
64
- const yrKeys = Object.keys(other._styleOverrides);
65
- if (myKeys.length !== yrKeys.length) {
66
- return false;
67
- }
68
- for (const name of myKeys) {
69
- const key = name;
70
- if (this.styleOverrides[key] !== other.styleOverrides[key]) {
71
- return false;
72
- }
73
- }
74
- return true;
63
+ const mySettings = TextStyleSettings.fromJSON(this.styleOverrides);
64
+ const otherSettings = TextStyleSettings.fromJSON(other.styleOverrides);
65
+ return mySettings.equals(otherSettings);
75
66
  }
76
67
  }
77
68
  /** A sequence of characters within a [[Paragraph]] that share a single style. Runs are the leaf nodes of a [[TextBlock]] document. When laid out for display, a single run may span
@@ -439,7 +430,6 @@ export class List extends TextBlockComponent {
439
430
  return (other instanceof List) && super.equals(other);
440
431
  }
441
432
  }
442
- ;
443
433
  /** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.
444
434
  * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.
445
435
  * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.
@@ -452,21 +442,9 @@ export class TextBlock extends TextBlockComponent {
452
442
  * Default: 0
453
443
  */
454
444
  width;
455
- /** The alignment of the document's content. */
456
- justification;
457
- /** The margins of the document. */
458
- margins;
459
445
  constructor(props) {
460
446
  super(props);
461
447
  this.width = props.width ?? 0;
462
- this.justification = props.justification ?? "left";
463
- // Assign default margins if not provided
464
- this.margins = {
465
- left: props.margins?.left ?? 0,
466
- right: props.margins?.right ?? 0,
467
- top: props.margins?.top ?? 0,
468
- bottom: props.margins?.bottom ?? 0,
469
- };
470
448
  this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];
471
449
  }
472
450
  clearStyleOverrides(options) {
@@ -476,8 +454,6 @@ export class TextBlock extends TextBlockComponent {
476
454
  return {
477
455
  ...super.toJSON(),
478
456
  width: this.width,
479
- justification: this.justification,
480
- margins: this.margins,
481
457
  children: this.children.map((x) => x.toJSON()),
482
458
  };
483
459
  }
@@ -522,12 +498,9 @@ export class TextBlock extends TextBlockComponent {
522
498
  if (!super.equals(other)) {
523
499
  return false;
524
500
  }
525
- if (this.width !== other.width || this.justification !== other.justification) {
501
+ if (this.width !== other.width) {
526
502
  return false;
527
503
  }
528
- const marginsAreEqual = Object.entries(this.margins).every(([key, value]) => value === other.margins[key]);
529
- if (!marginsAreEqual)
530
- return false;
531
504
  if (this.children && other.children) {
532
505
  if (this.children.length !== other.children.length) {
533
506
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,oBAAoB,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AA0D1G,SAAS,mBAAmB,CAAC,SAAuC,EAAE,OAA+B;IACnG,SAAS,CAAC,cAAc,GAAG,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,yBAAyB,EAAE,CAAC;QACxC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACvC,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAgB,kBAAkB;IAC9B,eAAe,CAAyB;IAEhD,gBAAgB;IAChB,YAAsB,KAA+B;QACnD,IAAI,CAAC,eAAe,GAAG,iBAAiB,CAAC,UAAU,CAAC,KAAK,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;IACnF,CAAC;IAED;;;OAGG;IACH,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED,IAAW,cAAc,CAAC,SAAiC;QACzD,IAAI,CAAC,eAAe,GAAG,iBAAiB,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACjE,CAAC;IAED,8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;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { ListMarker, ListMarkerEnumerator, TextStyleSettings, TextStyleSettingsProps } from \"./TextStyle\";\nimport { FieldFormatOptions, FieldPropertyHost, FieldPropertyPath } from \"./TextField\";\n\n/** Options supplied to [[TextBlockComponent.clearStyleOverrides]] to control how the style overrides are cleared on the component and its child components.\n * @beta\n */\nexport interface ClearTextStyleOptions {\n /** Controls whether the styleOverrides of any child components are retained.\n * By default, all overrides are cleared.\n */\n preserveChildrenOverrides?: boolean;\n}\n\n/** The JSON representation of a [[TextBlockComponent]].\n * @beta\n */\nexport interface TextBlockComponentProps {\n /** Deviations from the base [[TextStyleSettings]] defined by the [AnnotationTextStyle]($backend) applied to this component.\n * This permits you to, e.g., create a [[TextBlock]] using \"Arial\" font and override one of its [[TextRun]]s to use \"Comic Sans\" instead.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\n * @beta\n */\nexport interface TextBlockStringifyOptions {\n /** A string to insert in between each [[Paragraph]].\n * Default: \" \" - a single space.\n */\n paragraphBreak?: string;\n /** A string to insert for each [[LineBreakRun]].\n * Default: \" \" - a single space.\n */\n lineBreak?: string;\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\n * Default: \"/\"\n */\n fractionSeparator?: string;\n /** The number of spaces to use for tabs. If not provided, tabs will be represented by a tab character: \"\\t\".\n * Default: \"undefined\" - use \"\\t\".\n */\n tabsAsSpaces?: number;\n /** A string to insert in between the list marker and the list item.\n * Default: \" \" - a single space.\n */\n listMarkerBreak?: string;\n}\n\n/**\n * Context information that may be useful when converting a [[TextBlock]] to a string.\n * @beta\n */\nexport interface TextBlockStringifyContext {\n /** The current depth of the text block in the document structure. */\n depth: number;\n}\n\nfunction clearStyleOverrides(component: StructuralTextBlockComponent, options?: ClearTextStyleOptions): void {\n component.styleOverrides = {};\n if (!options?.preserveChildrenOverrides) {\n for (const child of component.children) {\n child.clearStyleOverrides(options);\n }\n }\n}\n\n/**\n * Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s and [[StructuralTextBlockComponent]]s.\n * The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents.\n * Each component can specify an optional [[styleOverrides]] to customize that formatting.\n * @beta\n */\nexport abstract class TextBlockComponent {\n private _styleOverrides: TextStyleSettingsProps;\n\n /** @internal */\n protected constructor(props?: TextBlockComponentProps) {\n this._styleOverrides = TextStyleSettings.cloneProps(props?.styleOverrides ?? {});\n }\n\n /** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.fontName` to \"Comic Sans\".\n * @see [[clearStyleOverrides]] to reset this to an empty object.\n */\n public get styleOverrides(): TextStyleSettingsProps {\n return this._styleOverrides;\n }\n\n public set styleOverrides(overrides: TextStyleSettingsProps) {\n this._styleOverrides = TextStyleSettings.cloneProps(overrides);\n }\n\n /** Reset any [[styleOverrides]] applied to this component. */\n public clearStyleOverrides(_options?: ClearTextStyleOptions): void {\n this.styleOverrides = {};\n }\n\n /** Returns true if [[styleOverrides]] specifies any deviations from the [[TextBlock]]'s [AnnotationTextStyle]($backend). */\n public get overridesStyle(): boolean {\n return Object.keys(this.styleOverrides).length > 0;\n }\n\n /** Create a deep copy of this component. */\n public abstract clone(): TextBlockComponent;\n\n /** Compute a string representation of the contents of this component and all of its sub-components. */\n public abstract stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string;\n\n /** Returns true if this component has no content or children. */\n public abstract get isEmpty(): boolean;\n\n /**\n * Returns true if the string representation of this component consists only of whitespace characters.\n * Useful for checking if the component is visually empty (producing no graphics) or contains only spaces, tabs, or line breaks.\n */\n public get isWhitespace(): boolean {\n return /^\\s*$/g.test(this.stringify());\n };\n\n /** Convert this component to its JSON representation. */\n public toJSON(): TextBlockComponentProps {\n return {\n styleOverrides: TextStyleSettings.cloneProps(this.styleOverrides),\n };\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: TextBlockComponent): boolean {\n const myKeys = Object.keys(this.styleOverrides);\n const yrKeys = Object.keys(other._styleOverrides);\n if (myKeys.length !== yrKeys.length) {\n return false;\n }\n\n for (const name of myKeys) {\n const key = name as keyof TextStyleSettingsProps;\n if (this.styleOverrides[key] !== other.styleOverrides[key]) {\n return false;\n }\n }\n\n return true;\n }\n}\n\n/** [[TextBlockComponent]]s contained within a [[Paragraph]].\n * @beta\n */\nexport type Run = TextRun | FractionRun | TabRun | LineBreakRun | FieldRun;\n\n/** The JSON representation of a [[Run]].\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport type RunProps = TextRunProps | FractionRunProps | TabRunProps | LineBreakRunProps | FieldRunProps;\n\n/** 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\n * multiple lines, but it will never contain different styling.\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Create a run from its JSON representation.\n * @see [[TextRun.create]], [[FractionRun.create]], [[FieldRun.create]], [[TabRun.create]], and [[LineBreakRun.create]] to create a run directly.\n */\n export function fromJSON(props: RunProps): Run {\n switch (props.type) {\n case \"field\": return FieldRun.create(props);\n case \"fraction\": return FractionRun.create(props);\n case \"linebreak\": return LineBreakRun.create(props);\n case \"tab\": return TabRun.create(props);\n case \"text\": return TextRun.create(props);\n }\n }\n}\n\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\n * affect how the content is rendered.\n * @beta\n */\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\n\n/** JSON representation of a [[TextRun]].\n * @beta\n */\nexport interface TextRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"text\";\n /** The characters displayed by the run.\n * Default: an empty string.\n */\n content?: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally.\n * Default: \"none\"\n */\n baselineShift?: BaselineShift;\n}\n\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\n * @beta\n */\nexport class TextRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"text\";\n /** The sequence of characters to be displayed by the run. */\n public content: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\n public baselineShift: BaselineShift;\n\n private constructor(props: TextRunProps) {\n super(props);\n this.content = props?.content ?? \"\";\n this.baselineShift = props?.baselineShift ?? \"none\";\n }\n\n public override clone(): TextRun {\n return new TextRun(this.toJSON());\n }\n\n public override toJSON(): TextRunProps {\n return {\n ...super.toJSON(),\n type: \"text\",\n content: this.content,\n baselineShift: this.baselineShift,\n };\n }\n\n public static create(props?: Omit<TextRunProps, \"type\">): TextRun {\n return new TextRun({ ...props, type: \"text\" });\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Simply returns [[content]]. */\n public override stringify(): string {\n return this.content;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\n }\n}\n\n/** JSON representation of a [[FractionRun]].\n * @beta\n */\nexport interface FractionRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"fraction\";\n /** The text displayed before or above the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\n numerator?: string;\n /** The text displayed after or below the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\n denominator?: string;\n}\n\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\n * @beta\n */\nexport class FractionRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"fraction\";\n /** The fraction's numerator. */\n public numerator: string;\n /** The fraction's denominator. */\n public denominator: string;\n\n private constructor(props: FractionRunProps) {\n super(props);\n this.numerator = props?.numerator ?? \"\";\n this.denominator = props?.denominator ?? \"\";\n }\n\n public override toJSON(): FractionRunProps {\n return {\n ...super.toJSON(),\n type: \"fraction\",\n numerator: this.numerator,\n denominator: this.denominator,\n };\n }\n\n public override clone(): FractionRun {\n return new FractionRun(this.toJSON());\n }\n\n public static create(props?: Omit<FractionRunProps, \"type\">): FractionRun {\n return new FractionRun({ ...props, type: \"fraction\" });\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n const sep = options?.fractionSeparator ?? \"/\";\n return `${this.numerator}${sep}${this.denominator}`;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\n }\n}\n\n/** JSON representation of a [[LineBreakRun]].\n * @beta\n */\nexport interface LineBreakRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"linebreak\";\n}\n\n/** 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.\n * @beta\n */\nexport class LineBreakRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"linebreak\";\n\n private constructor(props: LineBreakRunProps) {\n super(props);\n }\n\n public override toJSON(): LineBreakRunProps {\n return {\n ...super.toJSON(),\n type: \"linebreak\",\n };\n }\n\n public static create(props?: Omit<LineBreakRunProps, \"type\">) {\n return new LineBreakRun({ ...props, type: \"linebreak\" });\n }\n\n public override clone(): LineBreakRun {\n return new LineBreakRun(this.toJSON());\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n return options?.lineBreak ?? \" \";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof LineBreakRun && super.equals(other);\n }\n}\n\n/** JSON representation of a [[TabRun]].\n * @beta\n */\nexport interface TabRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"tab\";\n}\n\n/** A [[TabRun]] is used to shift the next tab stop.\n * @note Only left-justified tabs are supported at this tab.\n * @beta\n */\nexport class TabRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"tab\";\n\n public override toJSON(): TabRunProps {\n return {\n ...super.toJSON(),\n type: \"tab\",\n };\n }\n\n public override clone(): TabRun {\n return new TabRun(this.toJSON());\n }\n\n public static create(props?: Omit<TabRunProps, \"type\">): TabRun {\n return new TabRun(props);\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /**\n * Converts a [[TabRun]] to its string representation.\n * If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.\n * Otherwise, returns a tab character (\"\\t\").\n */\n public override stringify(options?: TextBlockStringifyOptions): string {\n if (options?.tabsAsSpaces) {\n return \" \".repeat(options.tabsAsSpaces);\n }\n\n return \"\\t\";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof TabRun && super.equals(other);\n }\n}\n\n/** JSON representation of a [[FieldRun]].\n * @beta\n */\nexport interface FieldRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"field\";\n /** The element and BIS class containing the property described by [[propertyPath]]. */\n propertyHost: FieldPropertyHost;\n /** Describes how to obtain the property value from [[propertyHost]]. */\n propertyPath: FieldPropertyPath;\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\n * The specific options used depend upon the field's [[propertyType]].\n */\n formatOptions?: FieldFormatOptions;\n /** The field's most recently evaluated display string.\n * @note It is unnecessary to specify this when creating a field as part of an element like a [[TextAnnotation2d]], because\n * all of the element's fields will be re-evaluated when inserting or updating the element in the iModel.\n */\n cachedContent?: string;\n}\n\n/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).\n * When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,\n * a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that\n * whenever the source element specified by [[propertyHost]] is modified or the `ITextAnnotation` element is inserted or updated in the iModel,\n * the field(s) in the `ITextAnnotation` element are automatically\n * recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or\n * property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].\n * A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.\n * @beta\n */\nexport class FieldRun extends TextBlockComponent {\n /** Display string used to signal an error in computing the field's value. */\n public static invalidContentIndicator = \"####\";\n\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"field\";\n /** The element and BIS class containing the property described by [[propertyPath]]. */\n public readonly propertyHost: Readonly<FieldPropertyHost>;\n /** Describes how to obtain the property value from [[propertyHost]]. */\n public readonly propertyPath: Readonly<FieldPropertyPath>;\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\n * The specific options used depend upon the [[FieldPropertyType]].\n */\n public readonly formatOptions?: FieldFormatOptions;\n private _cachedContent: string;\n\n /** The field's most recently evaluated display string. */\n public get cachedContent(): string {\n return this._cachedContent;\n }\n\n /** @internal Used by core-backend when re-evaluating field content. */\n public setCachedContent(content: string | undefined): void {\n this._cachedContent = content ?? FieldRun.invalidContentIndicator;\n }\n\n private constructor(props: FieldRunProps) {\n super(props);\n\n this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;\n this.propertyHost = props.propertyHost\n this.propertyPath = props.propertyPath;\n this.formatOptions = props.formatOptions;\n }\n\n /** Create a FieldRun from its JSON representation. */\n public static create(props: Omit<FieldRunProps, \"type\">): FieldRun {\n return new FieldRun({\n ...props,\n propertyHost: { ...props.propertyHost },\n propertyPath: structuredClone(props.propertyPath),\n formatOptions: structuredClone(props.formatOptions),\n type: \"field\",\n });\n }\n\n /** Convert the FieldRun to its JSON representation. */\n public override toJSON(): FieldRunProps {\n const json: FieldRunProps = {\n ...super.toJSON(),\n type: \"field\",\n propertyHost: { ...this.propertyHost },\n propertyPath: structuredClone(this.propertyPath),\n };\n\n if (this.cachedContent !== FieldRun.invalidContentIndicator) {\n json.cachedContent = this.cachedContent;\n }\n\n if (this.formatOptions) {\n json.formatOptions = structuredClone(this.formatOptions);\n }\n\n return json;\n }\n\n /** Create a deep copy of this FieldRun. */\n public override clone(): FieldRun {\n return new FieldRun(this.toJSON());\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Convert this FieldRun to a simple string representation. */\n public override stringify(): string {\n return this.cachedContent;\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof FieldRun) || !super.equals(other)) {\n return false;\n }\n\n if (\n this.propertyHost.elementId !== other.propertyHost.elementId ||\n this.propertyHost.className !== other.propertyHost.className ||\n this.propertyHost.schemaName !== other.propertyHost.schemaName\n ) {\n return false;\n }\n\n if (this.propertyPath.propertyName !== other.propertyPath.propertyName) {\n return false;\n }\n\n const thisAccessors = this.propertyPath.accessors ?? [];\n const otherAccessors = other.propertyPath.accessors ?? [];\n\n if (thisAccessors.length !== otherAccessors.length) {\n return false;\n }\n\n if (!thisAccessors.every((value, index) => value === otherAccessors[index])) {\n return false;\n }\n\n if (this.formatOptions && other.formatOptions) {\n // We anticipate new formatting options being added in the future.\n // So to account for properties we don't know about, just compare the string representations.\n if (JSON.stringify(this.formatOptions) !== JSON.stringify(other.formatOptions)) {\n return false;\n }\n } else if (this.formatOptions || other.formatOptions) {\n return false;\n }\n\n return true;\n }\n}\n\n/** JSON representation of a [[Paragraph]].\n * @beta\n */\nexport interface ParagraphProps extends TextBlockComponentProps {\n children?: Array<ListProps | RunProps>;\n}\n\n/** A collection of [[Run]]s and [[List]]s. Paragraphs can be appended to [[List]]s and [[TextBlock]]s.\n * Each paragraph is laid out on a separate line. If included in a [[List]], the paragraph will be treated as a list item.\n * @beta\n */\nexport class Paragraph extends TextBlockComponent {\n public readonly type = \"paragraph\";\n public readonly children: Array<List | Run>;\n\n private constructor(props?: ParagraphProps) {\n super(props);\n\n this.children = props?.children?.map((child) =>\n child.type === \"list\" ? List.create(child) : Run.fromJSON(child)\n ) ?? [];\n }\n\n /** Create a paragraph from its JSON representation. */\n public static create(props?: Omit<ParagraphProps, \"type\">): Paragraph {\n return new Paragraph(props);\n }\n\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\n clearStyleOverrides(this, options);\n }\n\n public override get isEmpty() {\n return this.children.length === 0;\n }\n\n public override clone(): Paragraph {\n return new Paragraph(this.toJSON());\n }\n\n public override toJSON(): ParagraphProps {\n return {\n ...super.toJSON(),\n children: this.children.map((child) => child.toJSON()),\n };\n }\n\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its children. */\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\n return this.children.map((x, index) => (index > 0 && x.type === \"list\") ? `${options?.paragraphBreak ?? \" \"}${x.stringify(options, context)}` : x.stringify(options, context)).join(\"\") ?? \"\";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return (other instanceof Paragraph) && super.equals(other);\n }\n}\n\n/** JSON representation of a [[List]].\n * @beta\n */\nexport interface ListProps extends TextBlockComponentProps {\n readonly type: \"list\";\n children?: ParagraphProps[];\n}\n\n/** A collection of list items ([[Paragraph]]s). Lists can be appended to [[Paragraph]]s.\n * Lists will be laid out on a new line. Each item in a list is laid out on a separate line.\n * @beta\n */\nexport class List extends TextBlockComponent {\n public readonly type = \"list\";\n public readonly children: Paragraph[];\n\n protected constructor(props?: ListProps) {\n super(props);\n\n this.children = props?.children?.map((child) => Paragraph.create(child)) ?? [];\n }\n\n /** Create a list from its JSON representation. */\n public static create(props?: Omit<ListProps, \"type\">): List {\n return new List({ ...props, type: \"list\" });\n }\n\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\n clearStyleOverrides(this, options);\n }\n\n public override get isEmpty() {\n return this.children.length === 0;\n }\n\n public override clone(): List {\n return new List(this.toJSON());\n }\n\n public override toJSON(): ListProps {\n return {\n ...super.toJSON(),\n type: \"list\",\n children: this.children.map((run) => run.toJSON()),\n };\n }\n\n /** Compute a string representation of this list by concatenating the string representations of all of its [[children]]. */\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\n const children = this.children.map((x, index) => {\n const depth = context?.depth ?? 0;\n const marker = getMarkerText(this.styleOverrides.listMarker ?? TextStyleSettings.defaultProps.listMarker, index + 1);\n const tab = (options?.tabsAsSpaces ? \" \".repeat(options.tabsAsSpaces) : \"\\t\").repeat(depth);\n return `${tab}${marker}${options?.listMarkerBreak ?? \" \"}${x.stringify(options, { depth: depth + 1 })}`;\n });\n return children.join(options?.paragraphBreak ?? \" \") ?? \"\";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return (other instanceof List) && super.equals(other);\n }\n}\n\n\n/** Describes the relative alignment of the content of a [[TextBlock]].\n * @beta\n */\nexport type TextBlockJustification = \"left\" | \"center\" | \"right\";\n\n/** Describes the margins around the content inside a [[TextBlock]]. It's measured in meters.\n * @beta\n */\nexport interface TextBlockMargins {\n /** The left margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n left: number;\n /** The right margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n right: number;\n /** The top margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n top: number;\n /** The bottom margin measured in meters. Must be a positive number >= 0. Negative values are disregarded */\n bottom: number;\n};\n\n/** JSON representation of a [[TextBlock]].\n * @beta\n */\nexport interface TextBlockProps extends TextBlockComponentProps {\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n width?: number;\n /** The alignment of the document content. Default: \"left\". */\n justification?: TextBlockJustification;\n /** The margins to surround the document content. Default: 0 margins on all sides */\n margins?: Partial<TextBlockMargins>;\n children?: ParagraphProps[];\n}\n\n/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\n * @beta\n */\nexport class TextBlock extends TextBlockComponent {\n public readonly children: Paragraph[];\n\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n public width: number;\n /** The alignment of the document's content. */\n public justification: TextBlockJustification;\n /** The margins of the document. */\n public margins: TextBlockMargins;\n\n private constructor(props: TextBlockProps) {\n super(props);\n this.width = props.width ?? 0;\n this.justification = props.justification ?? \"left\";\n\n // Assign default margins if not provided\n this.margins = {\n left: props.margins?.left ?? 0,\n right: props.margins?.right ?? 0,\n top: props.margins?.top ?? 0,\n bottom: props.margins?.bottom ?? 0,\n };\n\n this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];\n }\n\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\n clearStyleOverrides(this, options);\n }\n\n public override toJSON(): TextBlockProps {\n return {\n ...super.toJSON(),\n width: this.width,\n justification: this.justification,\n margins: this.margins,\n children: this.children.map((x) => x.toJSON()),\n };\n }\n\n /** Create a text block from its JSON representation. */\n public static create(props?: Omit<TextBlockProps, \"type\">): TextBlock {\n return new TextBlock(props ?? {});\n }\n\n /** Returns true if every paragraph in this text block is empty. */\n public override get isEmpty(): boolean {\n return !this.children || this.children.every((child) => child.isEmpty);\n }\n\n public override clone(): TextBlock {\n return new TextBlock(this.toJSON());\n }\n\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[children]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\n public stringify(options?: TextBlockStringifyOptions): string {\n return this.children.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \") || \"\";\n }\n\n /** Add and return a new paragraph.\n * By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.\n * @param seedFromLast If true and [[children]] is not empty, the new paragraph will inherit the style overrides of the last child in this block.\n * @note Be sure you pass in [[ParagraphProps]] and not [[Paragraph]] or style overrides will be ignored.\n */\n public appendParagraph(props?: ParagraphProps, seedFromLast = false): Paragraph {\n const seed = seedFromLast ? this.children[this.children.length - 1] : undefined;\n const styleOverrides = { ...seed?.styleOverrides, ...props?.styleOverrides };\n const paragraph = Paragraph.create({ ...props, styleOverrides });\n this.children.push(paragraph);\n return paragraph;\n }\n\n /** Append a run to the last [[Paragraph]] in this block.\n * If the block contains no [[children]], a new [[Paragraph]] will first be created using [[appendParagraph]].\n */\n public appendRun(run: Run): void {\n const paragraph = this.children[this.children.length - 1] ?? this.appendParagraph();\n paragraph.children.push(run);\n }\n\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof TextBlock)) {\n return false;\n }\n\n if (!super.equals(other)) {\n return false;\n }\n\n if (this.width !== other.width || this.justification !== other.justification) {\n return false;\n }\n\n const marginsAreEqual = Object.entries(this.margins).every(([key, value]) =>\n value === (other.margins as any)[key]\n );\n\n if (!marginsAreEqual) return false;\n\n if (this.children && other.children) {\n if (this.children.length !== other.children.length) {\n return false;\n }\n\n return this.children.every((child, index) => other.children && child.equals(other.children[index]));\n }\n\n return true;\n }\n}\n\n/**\n * A union of all the [[TextBlockComponent]]s that can contain other components.\n * @beta\n */\nexport type StructuralTextBlockComponent = List | Paragraph | TextBlock;\n\n/**\n * Recursively traverses a [[StructuralTextBlockComponent]] tree, yielding each child component along with its parent container.\n * This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.\n *\n * @param parent The root container whose children should be traversed.\n * @returns An IterableIterator yielding objects with the child component and its parent container.\n * @beta\n */\nexport function* traverseTextBlockComponent(parent: StructuralTextBlockComponent): IterableIterator<{ parent: StructuralTextBlockComponent, child: List | Paragraph | Run }> {\n for (const child of parent.children) {\n yield { parent, child };\n if (child.type === \"list\" || child.type === \"paragraph\") {\n yield* traverseTextBlockComponent(child);\n }\n }\n}\n\n/**\n * Returns the formatted marker text for a list item based on the marker type and item number.\n * Supports ordered and unordered list markers, including alphabetic, Roman numeral, and numeric formats.\n * @param marker The type of list marker to use.\n * @param num The item number in the list.\n * @returns The formatted marker string for the list item.\n * @beta\n */\nexport function getMarkerText(marker: ListMarker, num: number): string {\n let markerString = \"\";\n\n switch (marker.enumerator) {\n case undefined:\n case ListMarkerEnumerator.Number:\n markerString = `${num}`;\n break;\n case ListMarkerEnumerator.Letter:\n markerString = integerToAlpha(num);\n break;\n case ListMarkerEnumerator.RomanNumeral:\n markerString = integerToRoman(num);\n break;\n default:\n markerString = marker.enumerator;\n break;\n }\n\n if (marker.case) {\n markerString = marker.case === \"upper\" ? markerString.toUpperCase() : markerString.toLowerCase();\n }\n\n const terminator = marker.terminator === \"period\" ? \".\" : marker.terminator === \"parenthesis\" ? \")\" : \"\";\n\n return `${markerString}${terminator}`;\n}\n\n/**\n * Converts an integer to its Roman numeral representation.\n * Supports numbers from 1 and above.\n * @param num The integer to convert.\n * @returns The Roman numeral string.\n */\nfunction integerToRoman(num: number): string {\n const values =\n [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n const symbols =\n ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n let roman = '';\n for (let i = 0; i < values.length; i++) {\n while (num >= values[i]) {\n roman += symbols[i];\n num -= values[i];\n }\n }\n\n return roman;\n}\n\n/**\n * Converts an integer to its alphabetic representation (A-Z, AA-ZZ, etc.).\n * Used for ordered list markers with alphabetic styles.\n * @param num The integer to convert (1-based).\n * @returns The alphabetic string for the given number.\n */\nfunction integerToAlpha(num: number): string {\n const letterOffset = (num - 1) % 26;\n const letter = String.fromCharCode(65 + letterOffset);\n const depth = Math.ceil(num / 26);\n return letter.repeat(depth);\n}\n"]}
1
+ {"version":3,"file":"TextBlock.js","sourceRoot":"","sources":["../../../src/annotation/TextBlock.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAc,oBAAoB,EAAE,iBAAiB,EAA0B,MAAM,aAAa,CAAC;AA0D1G,SAAS,mBAAmB,CAAC,SAAuC,EAAE,OAA+B;IACnG,SAAS,CAAC,cAAc,GAAG,EAAE,CAAC;IAC9B,IAAI,CAAC,OAAO,EAAE,yBAAyB,EAAE,CAAC;QACxC,KAAK,MAAM,KAAK,IAAI,SAAS,CAAC,QAAQ,EAAE,CAAC;YACvC,KAAK,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,OAAgB,kBAAkB;IAC9B,eAAe,CAAyB;IAEhD,gBAAgB;IAChB,YAAsB,KAA+B;QACnD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,KAAK,EAAE,cAAc,IAAI,EAAE,CAAC,CAAC;IAC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C,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACvC,OAAO,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;YACxB,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC;YACpB,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;QACnB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;GAKG;AACH,SAAS,cAAc,CAAC,GAAW;IACjC,MAAM,YAAY,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;IACpC,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,GAAG,YAAY,CAAC,CAAC;IACtD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Annotation\n */\n\nimport { ListMarker, ListMarkerEnumerator, TextStyleSettings, TextStyleSettingsProps } from \"./TextStyle\";\nimport { FieldFormatOptions, FieldPropertyHost, FieldPropertyPath } from \"./TextField\";\n\n/** Options supplied to [[TextBlockComponent.clearStyleOverrides]] to control how the style overrides are cleared on the component and its child components.\n * @beta\n */\nexport interface ClearTextStyleOptions {\n /** Controls whether the styleOverrides of any child components are retained.\n * By default, all overrides are cleared.\n */\n preserveChildrenOverrides?: boolean;\n}\n\n/** The JSON representation of a [[TextBlockComponent]].\n * @beta\n */\nexport interface TextBlockComponentProps {\n /** Deviations from the base [[TextStyleSettings]] defined by the [AnnotationTextStyle]($backend) applied to this component.\n * This permits you to, e.g., create a [[TextBlock]] using \"Arial\" font and override one of its [[TextRun]]s to use \"Comic Sans\" instead.\n */\n styleOverrides?: TextStyleSettingsProps;\n}\n\n/** Options supplied to [[TextBlockComponent.stringify]] to control how the content is formatted.\n * @beta\n */\nexport interface TextBlockStringifyOptions {\n /** A string to insert in between each [[Paragraph]].\n * Default: \" \" - a single space.\n */\n paragraphBreak?: string;\n /** A string to insert for each [[LineBreakRun]].\n * Default: \" \" - a single space.\n */\n lineBreak?: string;\n /** A string to insert between the numerator and denominator of each [[FractionRun]].\n * Default: \"/\"\n */\n fractionSeparator?: string;\n /** The number of spaces to use for tabs. If not provided, tabs will be represented by a tab character: \"\\t\".\n * Default: \"undefined\" - use \"\\t\".\n */\n tabsAsSpaces?: number;\n /** A string to insert in between the list marker and the list item.\n * Default: \" \" - a single space.\n */\n listMarkerBreak?: string;\n}\n\n/**\n * Context information that may be useful when converting a [[TextBlock]] to a string.\n * @beta\n */\nexport interface TextBlockStringifyContext {\n /** The current depth of the text block in the document structure. */\n depth: number;\n}\n\nfunction clearStyleOverrides(component: StructuralTextBlockComponent, options?: ClearTextStyleOptions): void {\n component.styleOverrides = {};\n if (!options?.preserveChildrenOverrides) {\n for (const child of component.children) {\n child.clearStyleOverrides(options);\n }\n }\n}\n\n/**\n * Abstract representation of any of the building blocks that make up a [[TextBlock]] document - namely [[Run]]s and [[StructuralTextBlockComponent]]s.\n * The [[TextBlock]] can specify an [AnnotationTextStyle]($backend) that formats its contents.\n * Each component can specify an optional [[styleOverrides]] to customize that formatting.\n * @beta\n */\nexport abstract class TextBlockComponent {\n private _styleOverrides: TextStyleSettingsProps;\n\n /** @internal */\n protected constructor(props?: TextBlockComponentProps) {\n this._styleOverrides = structuredClone(props?.styleOverrides ?? {});\n }\n\n /** Deviations in individual properties of the [[TextStyleSettings]] in the [AnnotationTextStyle]($backend).\n * For example, if the style uses the \"Arial\" font, you can override that by settings `styleOverrides.font.name` to \"Comic Sans\".\n * @see [[clearStyleOverrides]] to reset this to an empty object.\n */\n public get styleOverrides(): TextStyleSettingsProps {\n return this._styleOverrides;\n }\n\n public set styleOverrides(overrides: TextStyleSettingsProps) {\n this._styleOverrides = structuredClone(overrides);\n }\n\n /** Reset any [[styleOverrides]] applied to this component. */\n public clearStyleOverrides(_options?: ClearTextStyleOptions): void {\n this.styleOverrides = {};\n }\n\n /** Returns true if [[styleOverrides]] specifies any deviations from the [[TextBlock]]'s [AnnotationTextStyle]($backend). */\n public get overridesStyle(): boolean {\n return Object.keys(this.styleOverrides).length > 0;\n }\n\n /** Create a deep copy of this component. */\n public abstract clone(): TextBlockComponent;\n\n /** Compute a string representation of the contents of this component and all of its sub-components. */\n public abstract stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string;\n\n /** Returns true if this component has no content or children. */\n public abstract get isEmpty(): boolean;\n\n /**\n * Returns true if the string representation of this component consists only of whitespace characters.\n * Useful for checking if the component is visually empty (producing no graphics) or contains only spaces, tabs, or line breaks.\n */\n public get isWhitespace(): boolean {\n return /^\\s*$/g.test(this.stringify());\n };\n\n /** Convert this component to its JSON representation. */\n public toJSON(): TextBlockComponentProps {\n return {\n styleOverrides: structuredClone(this.styleOverrides),\n };\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public equals(other: TextBlockComponent): boolean {\n const mySettings = TextStyleSettings.fromJSON(this.styleOverrides);\n const otherSettings = TextStyleSettings.fromJSON(other.styleOverrides);\n return mySettings.equals(otherSettings);\n }\n}\n\n/** [[TextBlockComponent]]s contained within a [[Paragraph]].\n * @beta\n */\nexport type Run = TextRun | FractionRun | TabRun | LineBreakRun | FieldRun;\n\n/** The JSON representation of a [[Run]].\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport type RunProps = TextRunProps | FractionRunProps | TabRunProps | LineBreakRunProps | FieldRunProps;\n\n/** 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\n * multiple lines, but it will never contain different styling.\n * Use the `type` field to discriminate between the different kinds of runs.\n * @beta\n */\nexport namespace Run { // eslint-disable-line @typescript-eslint/no-redeclare\n /** Create a run from its JSON representation.\n * @see [[TextRun.create]], [[FractionRun.create]], [[FieldRun.create]], [[TabRun.create]], and [[LineBreakRun.create]] to create a run directly.\n */\n export function fromJSON(props: RunProps): Run {\n switch (props.type) {\n case \"field\": return FieldRun.create(props);\n case \"fraction\": return FractionRun.create(props);\n case \"linebreak\": return LineBreakRun.create(props);\n case \"tab\": return TabRun.create(props);\n case \"text\": return TextRun.create(props);\n }\n }\n}\n\n/** Describes whether the characters of a [[TextRun]] should be displayed normally, in subscript, or in superscript.\n * [[TextStyleSettings.superScriptScale]], [[TextStyleSettings.subScriptScale]], [[TextStyleSettings.superScriptOffsetFactor]], and [[TextStyleSettings.subScriptOffsetFactor]]\n * affect how the content is rendered.\n * @beta\n */\nexport type BaselineShift = \"subscript\" | \"superscript\" | \"none\";\n\n/** JSON representation of a [[TextRun]].\n * @beta\n */\nexport interface TextRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"text\";\n /** The characters displayed by the run.\n * Default: an empty string.\n */\n content?: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally.\n * Default: \"none\"\n */\n baselineShift?: BaselineShift;\n}\n\n/** The most common type of [[Run]], containing a sequence of characters to be displayed using a single style.\n * @beta\n */\nexport class TextRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"text\";\n /** The sequence of characters to be displayed by the run. */\n public content: string;\n /** Whether to display [[content]] as a subscript, superscript, or normally. */\n public baselineShift: BaselineShift;\n\n private constructor(props: TextRunProps) {\n super(props);\n this.content = props?.content ?? \"\";\n this.baselineShift = props?.baselineShift ?? \"none\";\n }\n\n public override clone(): TextRun {\n return new TextRun(this.toJSON());\n }\n\n public override toJSON(): TextRunProps {\n return {\n ...super.toJSON(),\n type: \"text\",\n content: this.content,\n baselineShift: this.baselineShift,\n };\n }\n\n public static create(props?: Omit<TextRunProps, \"type\">): TextRun {\n return new TextRun({ ...props, type: \"text\" });\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Simply returns [[content]]. */\n public override stringify(): string {\n return this.content;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof TextRun && this.content === other.content && this.baselineShift === other.baselineShift && super.equals(other);\n }\n}\n\n/** JSON representation of a [[FractionRun]].\n * @beta\n */\nexport interface FractionRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"fraction\";\n /** The text displayed before or above the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\n numerator?: string;\n /** The text displayed after or below the fraction separator, depending on [[TextStyleSettings.stackedFractionType]]. Default: an empty string. */\n denominator?: string;\n}\n\n/** A [[Run]] containing a numeric ratio to be displayed as a numerator and denominator separated by a horizontal or diagonal bar.\n * @note The [[numerator]] and [[denominator]] are stored as strings. They are not technically required to contain a numeric representation.\n * @beta\n */\nexport class FractionRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"fraction\";\n /** The fraction's numerator. */\n public numerator: string;\n /** The fraction's denominator. */\n public denominator: string;\n\n private constructor(props: FractionRunProps) {\n super(props);\n this.numerator = props?.numerator ?? \"\";\n this.denominator = props?.denominator ?? \"\";\n }\n\n public override toJSON(): FractionRunProps {\n return {\n ...super.toJSON(),\n type: \"fraction\",\n numerator: this.numerator,\n denominator: this.denominator,\n };\n }\n\n public override clone(): FractionRun {\n return new FractionRun(this.toJSON());\n }\n\n public static create(props?: Omit<FractionRunProps, \"type\">): FractionRun {\n return new FractionRun({ ...props, type: \"fraction\" });\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Formats the fraction as a string with the [[numerator]] and [[denominator]] separated by [[TextBlockStringifyOptions.fractionSeparator]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n const sep = options?.fractionSeparator ?? \"/\";\n return `${this.numerator}${sep}${this.denominator}`;\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof FractionRun && this.numerator === other.numerator && this.denominator === other.denominator && super.equals(other);\n }\n}\n\n/** JSON representation of a [[LineBreakRun]].\n * @beta\n */\nexport interface LineBreakRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"linebreak\";\n}\n\n/** 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.\n * @beta\n */\nexport class LineBreakRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"linebreak\";\n\n private constructor(props: LineBreakRunProps) {\n super(props);\n }\n\n public override toJSON(): LineBreakRunProps {\n return {\n ...super.toJSON(),\n type: \"linebreak\",\n };\n }\n\n public static create(props?: Omit<LineBreakRunProps, \"type\">) {\n return new LineBreakRun({ ...props, type: \"linebreak\" });\n }\n\n public override clone(): LineBreakRun {\n return new LineBreakRun(this.toJSON());\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Simply returns [[TextBlockStringifyOptions.lineBreak]]. */\n public override stringify(options?: TextBlockStringifyOptions): string {\n return options?.lineBreak ?? \" \";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof LineBreakRun && super.equals(other);\n }\n}\n\n/** JSON representation of a [[TabRun]].\n * @beta\n */\nexport interface TabRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"tab\";\n}\n\n/** A [[TabRun]] is used to shift the next tab stop.\n * @note Only left-justified tabs are supported at this tab.\n * @beta\n */\nexport class TabRun extends TextBlockComponent {\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"tab\";\n\n public override toJSON(): TabRunProps {\n return {\n ...super.toJSON(),\n type: \"tab\",\n };\n }\n\n public override clone(): TabRun {\n return new TabRun(this.toJSON());\n }\n\n public static create(props?: Omit<TabRunProps, \"type\">): TabRun {\n return new TabRun(props);\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /**\n * Converts a [[TabRun]] to its string representation.\n * If the `tabsAsSpaces` option is provided, returns a string of spaces of the specified length.\n * Otherwise, returns a tab character (\"\\t\").\n */\n public override stringify(options?: TextBlockStringifyOptions): string {\n if (options?.tabsAsSpaces) {\n return \" \".repeat(options.tabsAsSpaces);\n }\n\n return \"\\t\";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return other instanceof TabRun && super.equals(other);\n }\n}\n\n/** JSON representation of a [[FieldRun]].\n * @beta\n */\nexport interface FieldRunProps extends TextBlockComponentProps {\n /** Discriminator field for the [[RunProps]] union. */\n readonly type: \"field\";\n /** The element and BIS class containing the property described by [[propertyPath]]. */\n propertyHost: FieldPropertyHost;\n /** Describes how to obtain the property value from [[propertyHost]]. */\n propertyPath: FieldPropertyPath;\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\n * The specific options used depend upon the field's [[propertyType]].\n */\n formatOptions?: FieldFormatOptions;\n /** The field's most recently evaluated display string.\n * @note It is unnecessary to specify this when creating a field as part of an element like a [[TextAnnotation2d]], because\n * all of the element's fields will be re-evaluated when inserting or updating the element in the iModel.\n */\n cachedContent?: string;\n}\n\n/** A [[Run]] that displays the formatted value of a property of some [Element]($backend).\n * When a [[TextBlock]] containing a [[FieldRun]] is written into the iModel as an [ITextAnnotation]($backend) element,\n * a dependency is established between the two elements via the [ElementDrivesTextAnnotation]($backend) relationship such that\n * whenever the source element specified by [[propertyHost]] is modified or the `ITextAnnotation` element is inserted or updated in the iModel,\n * the field(s) in the `ITextAnnotation` element are automatically\n * recalculated, causing their [[cachedContent]] to update. If the field's display string cannot be evaluated (for example, because the specified element or\n * property does not exist), then its cached content is set to [[FieldRun.invalidContentIndicator]].\n * A [[FieldRun]] displays its [[cachedContent]] in the same way that [[TextRun]]s display their `content`, including word wrapping where appropriate.\n * @beta\n */\nexport class FieldRun extends TextBlockComponent {\n /** Display string used to signal an error in computing the field's value. */\n public static invalidContentIndicator = \"####\";\n\n /** Discriminator field for the [[Run]] union. */\n public readonly type = \"field\";\n /** The element and BIS class containing the property described by [[propertyPath]]. */\n public readonly propertyHost: Readonly<FieldPropertyHost>;\n /** Describes how to obtain the property value from [[propertyHost]]. */\n public readonly propertyPath: Readonly<FieldPropertyPath>;\n /** Specifies how to format the property value obtained from [[propertyPath]] into a string to be stored in [[cachedContent]].\n * The specific options used depend upon the [[FieldPropertyType]].\n */\n public readonly formatOptions?: FieldFormatOptions;\n private _cachedContent: string;\n\n /** The field's most recently evaluated display string. */\n public get cachedContent(): string {\n return this._cachedContent;\n }\n\n /** @internal Used by core-backend when re-evaluating field content. */\n public setCachedContent(content: string | undefined): void {\n this._cachedContent = content ?? FieldRun.invalidContentIndicator;\n }\n\n private constructor(props: FieldRunProps) {\n super(props);\n\n this._cachedContent = props.cachedContent ?? FieldRun.invalidContentIndicator;\n this.propertyHost = props.propertyHost\n this.propertyPath = props.propertyPath;\n this.formatOptions = props.formatOptions;\n }\n\n /** Create a FieldRun from its JSON representation. */\n public static create(props: Omit<FieldRunProps, \"type\">): FieldRun {\n return new FieldRun({\n ...props,\n propertyHost: { ...props.propertyHost },\n propertyPath: structuredClone(props.propertyPath),\n formatOptions: structuredClone(props.formatOptions),\n type: \"field\",\n });\n }\n\n /** Convert the FieldRun to its JSON representation. */\n public override toJSON(): FieldRunProps {\n const json: FieldRunProps = {\n ...super.toJSON(),\n type: \"field\",\n propertyHost: { ...this.propertyHost },\n propertyPath: structuredClone(this.propertyPath),\n };\n\n if (this.cachedContent !== FieldRun.invalidContentIndicator) {\n json.cachedContent = this.cachedContent;\n }\n\n if (this.formatOptions) {\n json.formatOptions = structuredClone(this.formatOptions);\n }\n\n return json;\n }\n\n /** Create a deep copy of this FieldRun. */\n public override clone(): FieldRun {\n return new FieldRun(this.toJSON());\n }\n\n public override get isEmpty(): boolean {\n return this.stringify().length === 0;\n }\n\n /** Convert this FieldRun to a simple string representation. */\n public override stringify(): string {\n return this.cachedContent;\n }\n\n /** Returns true if `this` is equivalent to `other`. */\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof FieldRun) || !super.equals(other)) {\n return false;\n }\n\n if (\n this.propertyHost.elementId !== other.propertyHost.elementId ||\n this.propertyHost.className !== other.propertyHost.className ||\n this.propertyHost.schemaName !== other.propertyHost.schemaName\n ) {\n return false;\n }\n\n if (this.propertyPath.propertyName !== other.propertyPath.propertyName) {\n return false;\n }\n\n const thisAccessors = this.propertyPath.accessors ?? [];\n const otherAccessors = other.propertyPath.accessors ?? [];\n\n if (thisAccessors.length !== otherAccessors.length) {\n return false;\n }\n\n if (!thisAccessors.every((value, index) => value === otherAccessors[index])) {\n return false;\n }\n\n if (this.formatOptions && other.formatOptions) {\n // We anticipate new formatting options being added in the future.\n // So to account for properties we don't know about, just compare the string representations.\n if (JSON.stringify(this.formatOptions) !== JSON.stringify(other.formatOptions)) {\n return false;\n }\n } else if (this.formatOptions || other.formatOptions) {\n return false;\n }\n\n return true;\n }\n}\n\n/** JSON representation of a [[Paragraph]].\n * @beta\n */\nexport interface ParagraphProps extends TextBlockComponentProps {\n children?: Array<ListProps | RunProps>;\n}\n\n/** A collection of [[Run]]s and [[List]]s. Paragraphs can be appended to [[List]]s and [[TextBlock]]s.\n * Each paragraph is laid out on a separate line. If included in a [[List]], the paragraph will be treated as a list item.\n * @beta\n */\nexport class Paragraph extends TextBlockComponent {\n public readonly type = \"paragraph\";\n public readonly children: Array<List | Run>;\n\n private constructor(props?: ParagraphProps) {\n super(props);\n\n this.children = props?.children?.map((child) =>\n child.type === \"list\" ? List.create(child) : Run.fromJSON(child)\n ) ?? [];\n }\n\n /** Create a paragraph from its JSON representation. */\n public static create(props?: Omit<ParagraphProps, \"type\">): Paragraph {\n return new Paragraph(props);\n }\n\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\n clearStyleOverrides(this, options);\n }\n\n public override get isEmpty() {\n return this.children.length === 0;\n }\n\n public override clone(): Paragraph {\n return new Paragraph(this.toJSON());\n }\n\n public override toJSON(): ParagraphProps {\n return {\n ...super.toJSON(),\n children: this.children.map((child) => child.toJSON()),\n };\n }\n\n /** Compute a string representation of this paragraph by concatenating the string representations of all of its children. */\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\n return this.children.map((x, index) => (index > 0 && x.type === \"list\") ? `${options?.paragraphBreak ?? \" \"}${x.stringify(options, context)}` : x.stringify(options, context)).join(\"\") ?? \"\";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return (other instanceof Paragraph) && super.equals(other);\n }\n}\n\n/** JSON representation of a [[List]].\n * @beta\n */\nexport interface ListProps extends TextBlockComponentProps {\n readonly type: \"list\";\n children?: ParagraphProps[];\n}\n\n/** A collection of list items ([[Paragraph]]s). Lists can be appended to [[Paragraph]]s.\n * Lists will be laid out on a new line. Each item in a list is laid out on a separate line.\n * @beta\n */\nexport class List extends TextBlockComponent {\n public readonly type = \"list\";\n public readonly children: Paragraph[];\n\n protected constructor(props?: ListProps) {\n super(props);\n\n this.children = props?.children?.map((child) => Paragraph.create(child)) ?? [];\n }\n\n /** Create a list from its JSON representation. */\n public static create(props?: Omit<ListProps, \"type\">): List {\n return new List({ ...props, type: \"list\" });\n }\n\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\n clearStyleOverrides(this, options);\n }\n\n public override get isEmpty() {\n return this.children.length === 0;\n }\n\n public override clone(): List {\n return new List(this.toJSON());\n }\n\n public override toJSON(): ListProps {\n return {\n ...super.toJSON(),\n type: \"list\",\n children: this.children.map((run) => run.toJSON()),\n };\n }\n\n /** Compute a string representation of this list by concatenating the string representations of all of its [[children]]. */\n public override stringify(options?: TextBlockStringifyOptions, context?: TextBlockStringifyContext): string {\n const children = this.children.map((x, index) => {\n const depth = context?.depth ?? 0;\n const marker = getMarkerText(this.styleOverrides.listMarker ?? TextStyleSettings.defaultProps.listMarker, index + 1);\n const tab = (options?.tabsAsSpaces ? \" \".repeat(options.tabsAsSpaces) : \"\\t\").repeat(depth);\n return `${tab}${marker}${options?.listMarkerBreak ?? \" \"}${x.stringify(options, { depth: depth + 1 })}`;\n });\n return children.join(options?.paragraphBreak ?? \" \") ?? \"\";\n }\n\n public override equals(other: TextBlockComponent): boolean {\n return (other instanceof List) && super.equals(other);\n }\n}\n\n/** JSON representation of a [[TextBlock]].\n * @beta\n */\nexport interface TextBlockProps extends TextBlockComponentProps {\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n width?: number;\n children?: ParagraphProps[];\n}\n\n/** Represents a formatted text document consisting of a series of [[Paragraph]]s, each laid out on a separate line and containing their own content.\n * No word-wrapping is applied to the document unless a [[width]] greater than zero is specified.\n * @see [[TextAnnotation]] to position a text block as an annotation in 2d or 3d space.\n * @beta\n */\nexport class TextBlock extends TextBlockComponent {\n public readonly children: Paragraph[];\n\n /** The width of the document in meters. Lines that would exceed this width are instead wrapped around to the next line if possible.\n * A value less than or equal to zero indicates no wrapping is to be applied.\n * Default: 0\n */\n public width: number;\n\n private constructor(props: TextBlockProps) {\n super(props);\n this.width = props.width ?? 0;\n\n this.children = props?.children?.map((para) => Paragraph.create(para)) ?? [];\n }\n\n public override clearStyleOverrides(options?: ClearTextStyleOptions): void {\n clearStyleOverrides(this, options);\n }\n\n public override toJSON(): TextBlockProps {\n return {\n ...super.toJSON(),\n width: this.width,\n children: this.children.map((x) => x.toJSON()),\n };\n }\n\n /** Create a text block from its JSON representation. */\n public static create(props?: Omit<TextBlockProps, \"type\">): TextBlock {\n return new TextBlock(props ?? {});\n }\n\n /** Returns true if every paragraph in this text block is empty. */\n public override get isEmpty(): boolean {\n return !this.children || this.children.every((child) => child.isEmpty);\n }\n\n public override clone(): TextBlock {\n return new TextBlock(this.toJSON());\n }\n\n /** Compute a string representation of the document's contents by concatenating the string representations of each of its [[children]], separated by [[TextBlockStringifyOptions.paragraphBreak]]. */\n public stringify(options?: TextBlockStringifyOptions): string {\n return this.children.map((x) => x.stringify(options)).join(options?.paragraphBreak ?? \" \") || \"\";\n }\n\n /** Add and return a new paragraph.\n * By default, the paragraph will be created with no [[styleOverrides]], so that it inherits the style of this block.\n * @param seedFromLast If true and [[children]] is not empty, the new paragraph will inherit the style overrides of the last child in this block.\n * @note Be sure you pass in [[ParagraphProps]] and not [[Paragraph]] or style overrides will be ignored.\n */\n public appendParagraph(props?: ParagraphProps, seedFromLast = false): Paragraph {\n const seed = seedFromLast ? this.children[this.children.length - 1] : undefined;\n const styleOverrides = { ...seed?.styleOverrides, ...props?.styleOverrides };\n const paragraph = Paragraph.create({ ...props, styleOverrides });\n this.children.push(paragraph);\n return paragraph;\n }\n\n /** Append a run to the last [[Paragraph]] in this block.\n * If the block contains no [[children]], a new [[Paragraph]] will first be created using [[appendParagraph]].\n */\n public appendRun(run: Run): void {\n const paragraph = this.children[this.children.length - 1] ?? this.appendParagraph();\n paragraph.children.push(run);\n }\n\n public override equals(other: TextBlockComponent): boolean {\n if (!(other instanceof TextBlock)) {\n return false;\n }\n\n if (!super.equals(other)) {\n return false;\n }\n\n if (this.width !== other.width) {\n return false;\n }\n\n if (this.children && other.children) {\n if (this.children.length !== other.children.length) {\n return false;\n }\n\n return this.children.every((child, index) => other.children && child.equals(other.children[index]));\n }\n\n return true;\n }\n}\n\n/**\n * A union of all the [[TextBlockComponent]]s that can contain other components.\n * @beta\n */\nexport type StructuralTextBlockComponent = List | Paragraph | TextBlock;\n\n/**\n * Recursively traverses a [[StructuralTextBlockComponent]] tree, yielding each child component along with its parent container.\n * This generator enables depth-first iteration over all components in a text block structure, including paragraphs, lists, and runs.\n *\n * @param parent The root container whose children should be traversed.\n * @returns An IterableIterator yielding objects with the child component and its parent container.\n * @beta\n */\nexport function* traverseTextBlockComponent(parent: StructuralTextBlockComponent): IterableIterator<{ parent: StructuralTextBlockComponent, child: List | Paragraph | Run }> {\n for (const child of parent.children) {\n yield { parent, child };\n if (child.type === \"list\" || child.type === \"paragraph\") {\n yield* traverseTextBlockComponent(child);\n }\n }\n}\n\n/**\n * Returns the formatted marker text for a list item based on the marker type and item number.\n * Supports ordered and unordered list markers, including alphabetic, Roman numeral, and numeric formats.\n * @param marker The type of list marker to use.\n * @param num The item number in the list.\n * @returns The formatted marker string for the list item.\n * @beta\n */\nexport function getMarkerText(marker: ListMarker, num: number): string {\n let markerString = \"\";\n\n switch (marker.enumerator) {\n case undefined:\n case ListMarkerEnumerator.Number:\n markerString = `${num}`;\n break;\n case ListMarkerEnumerator.Letter:\n markerString = integerToAlpha(num);\n break;\n case ListMarkerEnumerator.RomanNumeral:\n markerString = integerToRoman(num);\n break;\n default:\n markerString = marker.enumerator;\n break;\n }\n\n if (marker.case) {\n markerString = marker.case === \"upper\" ? markerString.toUpperCase() : markerString.toLowerCase();\n }\n\n const terminator = marker.terminator === \"period\" ? \".\" : marker.terminator === \"parenthesis\" ? \")\" : \"\";\n\n return `${markerString}${terminator}`;\n}\n\n/**\n * Converts an integer to its Roman numeral representation.\n * Supports numbers from 1 and above.\n * @param num The integer to convert.\n * @returns The Roman numeral string.\n */\nfunction integerToRoman(num: number): string {\n const values =\n [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n const symbols =\n ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n let roman = '';\n for (let i = 0; i < values.length; i++) {\n while (num >= values[i]) {\n roman += symbols[i];\n num -= values[i];\n }\n }\n\n return roman;\n}\n\n/**\n * Converts an integer to its alphabetic representation (A-Z, AA-ZZ, etc.).\n * Used for ordered list markers with alphabetic styles.\n * @param num The integer to convert (1-based).\n * @returns The alphabetic string for the given number.\n */\nfunction integerToAlpha(num: number): string {\n const letterOffset = (num - 1) % 26;\n const letter = String.fromCharCode(65 + letterOffset);\n const depth = Math.ceil(num / 26);\n return letter.repeat(depth);\n}\n"]}