Skip to content

Use TextLayout instead of TextType #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,8 @@ module.exports = {
path: "references/document-sandbox/document-apis/enumerations/TextAlignment.md",
},
{
title: "TextType",
path: "references/document-sandbox/document-apis/enumerations/TextType.md",
title: "TextLayout",
path: "references/document-sandbox/document-apis/enumerations/TextLayout.md",
},
{
title: "VisualEffectType",
Expand Down
12 changes: 6 additions & 6 deletions src/pages/references/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ contributors:

### Updated

There are a few notable changes regarding the [Color Picker APIs](../references/addonsdk/addonsdk-app.md#showcolorpicker), which have now moved to stable:

- The `initialColor` parameter now accepts a string in `"#RRGGBB[AA]"` format, in addition to the previous HEX number `0xRRGGBB[AA]`—both with optional alpha channel.
- We fixed the return value of the `ColorPickerEvent.colorChange` event, which now correctly handles the color with or without the alpha channel, depending on the value of the `disableAlphaChannel` parameter.
- **Breaking change**: the `ColorPickerEvents` enum has been renamed to `ColorPickerEvent` (singular).
- There are a few notable changes regarding the [Color Picker APIs](../references/addonsdk/addonsdk-app.md#showcolorpicker), which have now moved to stable:
- The `initialColor` parameter now accepts a string in `"#RRGGBB[AA]"` format, in addition to the previous HEX number `0xRRGGBB[AA]`—both with optional alpha channel.
- We fixed the return value of the `ColorPickerEvent.colorChange` event, which now correctly handles the color with or without the alpha channel, depending on the value of the `disableAlphaChannel` parameter.
- **Breaking change**: the `ColorPickerEvents` enum has been renamed to `ColorPickerEvent` (singular).
- Renamed the TextType enumerable to [`TextLayout`](./document-sandbox/document-apis/enumerations/TextLayout.md) in the Text APIs.

## 2025-04-22

Expand Down Expand Up @@ -234,7 +234,7 @@ You must provide trader details by February 16, 2025, to keep your add-on visibl
- Added many new **Text APIs** for improved text management.
- [`TextNode.fullContent`](./document-sandbox/document-apis/classes/TextNode.md#fullcontent) accessor: returns the [`TextContentModel`](./document-sandbox/document-apis/classes/TextContentModel.md) containing the complete text string and its styles associated to the Text Flow (Threaded Text or Overflow Text).
- [`TextNode.nextTextNode`](./document-sandbox/document-apis/classes/TextNode.md#nexttextnode) accessor: gets the next node that overflowing text will spill into.
- [`TextNode.layout`](./document-sandbox/document-apis/classes/TextNode.md#layout) accessor: gets and sets the [`TextType`](./document-sandbox/document-apis/enumerations/TextType.md) of the text node frame.
- [`TextNode.layout`](./document-sandbox/document-apis/classes/TextNode.md#layout) accessor: gets and sets the [`TextLayout`](./document-sandbox/document-apis/enumerations/TextLayout.md) of the text node frame.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this particular change seems ok but we should be careful about updating descriptions of older API changes to reflect the latest state of the API. That may be confusing since this description is now mixing old and new and may not accurately describe any state the API has ever existed in.

In some cases it might even be impossible to keep the links in older changelog entries up to date, e.g. if an API has changed a lot or was removed. We should probably decide a policy for how much to update these entries and what to do if it's impossible to keep links working (would we rather leave the older link and let is 404, or strip the link out of the text, or add a new parenthetical note that links to the newer equivalent API, etc.).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've hit a nerve, @peterflynn! I always struggle with links in the changelog. @nimithajalal suggested archiving the oldest entries, which I'm all in for.
IIRC, the linter is part of the build script, and it'd prevent the merge if it found something wrong there—so we're in this weird situation where we need to fix links even if they've stopped making sense.

- [`TextNode.visualEffects`](./document-sandbox/document-apis/classes/TextNode.md#visualeffects) accessor: list of [`VisualEffectType`](./document-sandbox/document-apis/enumerations/VisualEffectType.md) applied to the text node.
- [`TextContentModel.characterStyleRanges`](./document-sandbox/document-apis/classes/TextContentModel.md#characterstyleranges) accessor: list of [character style](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#color), [`font`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#font), [`fontSize`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#fontsize), [`letterSpacing`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#letterSpacing) and [`underline`](./document-sandbox/document-apis/interfaces/CharacterStyles.md) ranges in the text content, controlling the [`color`](./document-sandbox/document-apis/interfaces/CharacterStyles.md#underline) properties.
- [AvailableFont](./document-sandbox/document-apis/classes/AvailableFont.md) and [UnavailableFont](./document-sandbox/document-apis/classes/UnavailableFont.md) classes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ layout modes, except for [AreaTextLayout](../interfaces/AreaTextLayout.md), are

#### Throws

if changing text layout to/from [TextType.magicFit](../enumerations/TextType.md#magicfit) or [TextType.circular](../enumerations/TextType.md#circular) layout when the text contains font(s) unavailable to the current user.
if changing text layout to/from [TextLayout.magicFit](../enumerations/TextLayout.md#magicfit) or [TextLayout.circular](../enumerations/TextLayout.md#circular) layout when the text contains font(s) unavailable to the current user.

#### Throws

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

_Do not depend on the literal numeric values of these constants_, as they may change. Always reference the enum identifiers in your code.

<InlineAlert slots="text" variant="warning"/>

_Additional arrowhead types may be added in the future._ If your code has different branches or cases depending on arrow type,
always have a default/fallback case to handle any unknown values you may encounter.

## Enumeration Members

### circleFilled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

_Do not depend on the literal numeric values of these constants_, as they may change. Always reference the enum identifiers in your code.

<InlineAlert slots="text" variant="warning"/>

_Additional alignment types may be added in the future._ If your code has different branches or cases depending on text alignment,
always have a default/fallback case to handle any unknown values you may encounter.

## Enumeration Members

### center
Expand All @@ -14,6 +19,12 @@ _Do not depend on the literal numeric values of these constants_, as they may ch

---

### justifyLeft

• **justifyLeft**: `4`

---

### left

• **left**: `1`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[@express-document-sdk](../overview.md) / TextLayout

# Enumeration: TextLayout

<InlineAlert slots="text" variant="warning"/>

_Do not depend on the literal numeric values of these constants_, as they may change. Always reference the enum identifiers in your code.

<InlineAlert slots="text" variant="warning"/>

_Additional text layout types may be added in the future._ If your code has different branches or cases depending on layout type,
always have a default/fallback case to handle any unknown values you may encounter.

## Enumeration Members

### area

• **area**: `1`

Area text: both width and height are explicitly set. If text content is too long to fit, the end of the text will be
clipped. If text content is short, the frame's bounds will occupy extra height that is just blank space.

---

### autoHeight

• **autoHeight**: `2`

Auto-height text: Width is explicitly set, and text wraps to use as much vertical space as necessary to display the
full content.

---

### autoWidth

• **autoWidth**: `3`

Auto-width, aka point text: both width and height are automatically determined based on the content. There is no
automatic line wrapping, so the text will all be on one line unless the text contains explicit newlines.

---

### circular

• **circular**: `4`

Text is arranged in a circle or arc. The API does not yet support setting or reading the details of this layout style.

---

### magicFit

• **magicFit**: `5`

Aka "Dynamic" layout in the UI: text size and styles are automatically varied to create an attractive multi-line layout.
The API does not yet support setting or reading the details of this layout style.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The height of the text node in pixels.

### type

• **type**: [`area`](../enumerations/TextType.md#area)
• **type**: [`area`](../enumerations/TextLayout.md#area)

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

### type

• **type**: [`autoHeight`](../enumerations/TextType.md#autoheight)
• **type**: [`autoHeight`](../enumerations/TextLayout.md#autoheight)

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

### type

• **type**: [`autoWidth`](../enumerations/TextType.md#autowidth)
• **type**: [`autoWidth`](../enumerations/TextLayout.md#autowidth)
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@

### type

• **type**: [`magicFit`](../enumerations/TextType.md#magicfit) \| [`circular`](../enumerations/TextType.md#circular)
• **type**: [`circular`](../enumerations/TextLayout.md#circular) \| [`magicFit`](../enumerations/TextLayout.md#magicfit)
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ Re-exports [TextAlignment](../../enumerations/TextAlignment.md)

---

### TextType
### TextLayout

Re-exports [TextType](../../enumerations/TextType.md)
Re-exports [TextLayout](../../enumerations/TextLayout.md)

---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- [StrokePosition](enumerations/StrokePosition.md)
- [StrokeType](enumerations/StrokeType.md)
- [TextAlignment](enumerations/TextAlignment.md)
- [TextType](enumerations/TextType.md)
- [TextLayout](enumerations/TextLayout.md)
- [VisualEffectType](enumerations/VisualEffectType.md)

## Classes
Expand Down
Loading