Skip to content

Commit 5539364

Browse files
authored
Merge pull request #129 from AdobeDocs/unzela/Docs_Update
Updated docs for Resize API and TextNode class
2 parents a4bafa2 + 9e74aec commit 5539364

28 files changed

+3297
-62
lines changed

gatsby-config.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ module.exports = {
238238
title: "SolidColorShapeNode",
239239
path: "references/document-sandbox/document-apis/classes/SolidColorShapeNode.md",
240240
},
241+
{
242+
title: "StandaloneTextNode",
243+
path: "references/document-sandbox/document-apis/classes/StandaloneTextNode.md",
244+
},
241245
{
242246
title: "StrokableNode",
243247
path: "references/document-sandbox/document-apis/classes/StrokableNode.md",
@@ -254,6 +258,10 @@ module.exports = {
254258
title: "TextNode",
255259
path: "references/document-sandbox/document-apis/classes/TextNode.md",
256260
},
261+
{
262+
title: "ThreadedTextNode",
263+
path: "references/document-sandbox/document-apis/classes/ThreadedTextNode.md",
264+
},
257265
{
258266
title: "UnavailableFont",
259267
path: "references/document-sandbox/document-apis/classes/UnavailableFont.md",
@@ -284,6 +292,10 @@ module.exports = {
284292
title: "AutoHeightTextLayout",
285293
path: "references/document-sandbox/document-apis/interfaces/AutoHeightTextLayout.md",
286294
},
295+
{
296+
title: "AutoWidthTextLayout",
297+
path: "references/document-sandbox/document-apis/interfaces/AutoWidthTextLayout.md",
298+
},
287299
{
288300
title: "BaseParagraphStyles",
289301
path: "references/document-sandbox/document-apis/interfaces/BaseParagraphStyles.md",
@@ -368,10 +380,6 @@ module.exports = {
368380
title: "Point",
369381
path: "references/document-sandbox/document-apis/interfaces/Point.md",
370382
},
371-
{
372-
title: "PointTextLayout",
373-
path: "references/document-sandbox/document-apis/interfaces/PointTextLayout.md",
374-
},
375383
{
376384
title: "Rect",
377385
path: "references/document-sandbox/document-apis/interfaces/Rect.md",

src/pages/references/changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,15 @@ contributors:
2222

2323
# Changelog
2424

25+
## 2025-05-27
26+
27+
### Added
28+
29+
- 4 new Resize HLAPIs have been added to the [Node](./document-sandbox/document-apis/classes/Node.md) class as experimental features.
30+
- [`TextNode()`](./document-sandbox/document-apis/classes/TextNode.md) is now an abstract base class with two specialized subclasses:
31+
- [StandaloneTextNode](./document-sandbox/document-apis/classes/StandaloneTextNode.md): Does not support "area text" layout.
32+
- [ThreadedTextNode](./document-sandbox/document-apis/classes/ThreadedTextNode.md): Only supports "area text" layout.
33+
2534
## 2025-05-26
2635

2736
### Added

src/pages/references/document-sandbox/document-apis/classes/ArtboardNode.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Please note that creating and deleting an artboard in a single frame will crash
1616

1717
## Implements
1818

19-
- [`IRectangularNode`](../interfaces/IRectangularNode.md)
19+
- `Readonly`<[`IRectangularNode`](../interfaces/IRectangularNode.md)\>
2020
- [`ContainerNode`](../interfaces/ContainerNode.md)
2121

2222
## Accessors
@@ -114,6 +114,7 @@ The background fill of the artboard. Artboards must always have a fill.
114114
`get` **height**(): `number`
115115

116116
The height of the artboard.
117+
Shares the same dimensions as the parent page and other artboards within the parent page.
117118

118119
#### Returns
119120

@@ -194,6 +195,7 @@ meaningful comparison or conversion between the bounds or coordinate spaces of s
194195
`get` **width**(): `number`
195196

196197
The width of the artboard.
198+
Shares the same dimensions as the parent page and other artboards within the parent page.
197199

198200
#### Returns
199201

src/pages/references/document-sandbox/document-apis/classes/ComplexShapeNode.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,110 @@ removal. No-op if node is already an orphan.
379379

380380
---
381381

382+
### rescaleProportionalToHeight()
383+
384+
**rescaleProportionalToHeight**(`height`): `void`
385+
386+
<InlineAlert slots="text" variant="warning"/>
387+
388+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
389+
390+
Changes the height to the given value and the width to the given height multiplied by the aspect ratio.
391+
392+
#### Parameters
393+
394+
**height**: `number`
395+
396+
#### Returns
397+
398+
`void`
399+
400+
#### Inherited from
401+
402+
[`FillableNode`](FillableNode.md).[`rescaleProportionalToHeight`](FillableNode.md#rescaleproportionaltoheight)
403+
404+
---
405+
406+
### rescaleProportionalToWidth()
407+
408+
**rescaleProportionalToWidth**(`width`): `void`
409+
410+
<InlineAlert slots="text" variant="warning"/>
411+
412+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
413+
414+
Changes the width to the given value and the height to the given width multiplied by the aspect ratio.
415+
416+
#### Parameters
417+
418+
**width**: `number`
419+
420+
#### Returns
421+
422+
`void`
423+
424+
#### Inherited from
425+
426+
[`FillableNode`](FillableNode.md).[`rescaleProportionalToWidth`](FillableNode.md#rescaleproportionaltowidth)
427+
428+
---
429+
430+
### resizeToCover()
431+
432+
**resizeToCover**(`width`, `height`): `void`
433+
434+
<InlineAlert slots="text" variant="warning"/>
435+
436+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
437+
438+
Resizes the node to cover a box with the given dimensions.
439+
440+
If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
441+
442+
#### Parameters
443+
444+
**width**: `number`
445+
446+
**height**: `number`
447+
448+
#### Returns
449+
450+
`void`
451+
452+
#### Inherited from
453+
454+
[`FillableNode`](FillableNode.md).[`resizeToCover`](FillableNode.md#resizetocover)
455+
456+
---
457+
458+
### resizeToFitWithin()
459+
460+
**resizeToFitWithin**(`width`, `height`): `void`
461+
462+
<InlineAlert slots="text" variant="warning"/>
463+
464+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
465+
466+
Resizes the node to fit within a box with the given dimensions.
467+
468+
If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
469+
470+
#### Parameters
471+
472+
**width**: `number`
473+
474+
**height**: `number`
475+
476+
#### Returns
477+
478+
`void`
479+
480+
#### Inherited from
481+
482+
[`FillableNode`](FillableNode.md).[`resizeToFitWithin`](FillableNode.md#resizetofitwithin)
483+
484+
---
485+
382486
### setPositionInParent()
383487

384488
**setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void`

src/pages/references/document-sandbox/document-apis/classes/Editor.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,38 @@ Transform values default to 0.
138138

139139
### createText()
140140

141-
**createText**(): [`TextNode`](TextNode.md)
141+
#### createText()
142142

143-
#### Returns
143+
**createText**(): [`StandaloneTextNode`](StandaloneTextNode.md)
144+
145+
##### Returns
144146

145-
[`TextNode`](TextNode.md)
147+
[`StandaloneTextNode`](StandaloneTextNode.md)
146148

147149
a text node with default styles. The text content is initially empty, so the text node will be
148-
invisible until its `fullContent` property's `text` is set. Creates point text, so the node's width will automatically
149-
adjust to accommodate whatever text is set.
150+
invisible until its `fullContent` property's `text` is set. Creates auto-width text, so the node's width will
151+
automatically adjust to accommodate whatever text is set.
152+
153+
##### Deprecated
154+
155+
- Initial text content is always expected so please use `createText(textContent: string): StandaloneTextNode`.
156+
157+
#### createText(textContent)
158+
159+
**createText**(`textContent`): [`StandaloneTextNode`](StandaloneTextNode.md)
160+
161+
##### Parameters
162+
163+
**textContent**: `string`
164+
165+
the initial string to show.
166+
167+
##### Returns
168+
169+
[`StandaloneTextNode`](StandaloneTextNode.md)
170+
171+
a text node with default styles. Creates auto-width text, so the node's width will automatically adjust
172+
to accommodate the given text content.
150173

151174
Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its
152175
insertion parent. Recommend using `setPositionInParent` over `translation` to set the position.

src/pages/references/document-sandbox/document-apis/classes/EllipseNode.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,110 @@ removal. No-op if node is already an orphan.
422422

423423
---
424424

425+
### rescaleProportionalToHeight()
426+
427+
**rescaleProportionalToHeight**(`height`): `void`
428+
429+
<InlineAlert slots="text" variant="warning"/>
430+
431+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
432+
433+
Changes the height to the given value and the width to the given height multiplied by the aspect ratio.
434+
435+
#### Parameters
436+
437+
**height**: `number`
438+
439+
#### Returns
440+
441+
`void`
442+
443+
#### Inherited from
444+
445+
[`FillableNode`](FillableNode.md).[`rescaleProportionalToHeight`](FillableNode.md#rescaleproportionaltoheight)
446+
447+
---
448+
449+
### rescaleProportionalToWidth()
450+
451+
**rescaleProportionalToWidth**(`width`): `void`
452+
453+
<InlineAlert slots="text" variant="warning"/>
454+
455+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
456+
457+
Changes the width to the given value and the height to the given width multiplied by the aspect ratio.
458+
459+
#### Parameters
460+
461+
**width**: `number`
462+
463+
#### Returns
464+
465+
`void`
466+
467+
#### Inherited from
468+
469+
[`FillableNode`](FillableNode.md).[`rescaleProportionalToWidth`](FillableNode.md#rescaleproportionaltowidth)
470+
471+
---
472+
473+
### resizeToCover()
474+
475+
**resizeToCover**(`width`, `height`): `void`
476+
477+
<InlineAlert slots="text" variant="warning"/>
478+
479+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
480+
481+
Resizes the node to cover a box with the given dimensions.
482+
483+
If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
484+
485+
#### Parameters
486+
487+
**width**: `number`
488+
489+
**height**: `number`
490+
491+
#### Returns
492+
493+
`void`
494+
495+
#### Inherited from
496+
497+
[`FillableNode`](FillableNode.md).[`resizeToCover`](FillableNode.md#resizetocover)
498+
499+
---
500+
501+
### resizeToFitWithin()
502+
503+
**resizeToFitWithin**(`width`, `height`): `void`
504+
505+
<InlineAlert slots="text" variant="warning"/>
506+
507+
**IMPORTANT:** This is currently ***experimental only*** and should not be used in any add-ons you will be distributing until it has been declared stable. To use it, you will first need to set the `experimentalApis` flag to `true` in the [`requirements`](../../../manifest/index.md#requirements) section of the `manifest.json`.
508+
509+
Resizes the node to fit within a box with the given dimensions.
510+
511+
If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height.
512+
513+
#### Parameters
514+
515+
**width**: `number`
516+
517+
**height**: `number`
518+
519+
#### Returns
520+
521+
`void`
522+
523+
#### Inherited from
524+
525+
[`FillableNode`](FillableNode.md).[`resizeToFitWithin`](FillableNode.md#resizetofitwithin)
526+
527+
---
528+
425529
### setPositionInParent()
426530

427531
**setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void`

0 commit comments

Comments
 (0)