diff --git a/gatsby-config.js b/gatsby-config.js index 6722829e8..57780f02d 100644 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -238,6 +238,10 @@ module.exports = { title: "SolidColorShapeNode", path: "references/document-sandbox/document-apis/classes/SolidColorShapeNode.md", }, + { + title: "StandaloneTextNode", + path: "references/document-sandbox/document-apis/classes/StandaloneTextNode.md", + }, { title: "StrokableNode", path: "references/document-sandbox/document-apis/classes/StrokableNode.md", @@ -254,6 +258,10 @@ module.exports = { title: "TextNode", path: "references/document-sandbox/document-apis/classes/TextNode.md", }, + { + title: "ThreadedTextNode", + path: "references/document-sandbox/document-apis/classes/ThreadedTextNode.md", + }, { title: "UnavailableFont", path: "references/document-sandbox/document-apis/classes/UnavailableFont.md", @@ -284,6 +292,10 @@ module.exports = { title: "AutoHeightTextLayout", path: "references/document-sandbox/document-apis/interfaces/AutoHeightTextLayout.md", }, + { + title: "AutoWidthTextLayout", + path: "references/document-sandbox/document-apis/interfaces/AutoWidthTextLayout.md", + }, { title: "BaseParagraphStyles", path: "references/document-sandbox/document-apis/interfaces/BaseParagraphStyles.md", @@ -368,10 +380,6 @@ module.exports = { title: "Point", path: "references/document-sandbox/document-apis/interfaces/Point.md", }, - { - title: "PointTextLayout", - path: "references/document-sandbox/document-apis/interfaces/PointTextLayout.md", - }, { title: "Rect", path: "references/document-sandbox/document-apis/interfaces/Rect.md", diff --git a/src/pages/references/changelog.md b/src/pages/references/changelog.md index 8800ba491..e666cebd1 100644 --- a/src/pages/references/changelog.md +++ b/src/pages/references/changelog.md @@ -22,6 +22,15 @@ contributors: # Changelog +## 2025-05-27 + +### Added + +- 4 new Resize HLAPIs have been added to the [Node](./document-sandbox/document-apis/classes/Node.md) class as experimental features. +- [`TextNode()`](./document-sandbox/document-apis/classes/TextNode.md) is now an abstract base class with two specialized subclasses: + - [StandaloneTextNode](./document-sandbox/document-apis/classes/StandaloneTextNode.md): Does not support "area text" layout. + - [ThreadedTextNode](./document-sandbox/document-apis/classes/ThreadedTextNode.md): Only supports "area text" layout. + ## 2025-05-26 ### Added diff --git a/src/pages/references/document-sandbox/document-apis/classes/ArtboardNode.md b/src/pages/references/document-sandbox/document-apis/classes/ArtboardNode.md index 9834a91be..3994efb27 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/ArtboardNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/ArtboardNode.md @@ -16,7 +16,7 @@ Please note that creating and deleting an artboard in a single frame will crash ## Implements -- [`IRectangularNode`](../interfaces/IRectangularNode.md) +- `Readonly`<[`IRectangularNode`](../interfaces/IRectangularNode.md)\> - [`ContainerNode`](../interfaces/ContainerNode.md) ## Accessors @@ -114,6 +114,7 @@ The background fill of the artboard. Artboards must always have a fill. • `get` **height**(): `number` The height of the artboard. +Shares the same dimensions as the parent page and other artboards within the parent page. #### Returns @@ -194,6 +195,7 @@ meaningful comparison or conversion between the bounds or coordinate spaces of s • `get` **width**(): `number` The width of the artboard. +Shares the same dimensions as the parent page and other artboards within the parent page. #### Returns diff --git a/src/pages/references/document-sandbox/document-apis/classes/ComplexShapeNode.md b/src/pages/references/document-sandbox/document-apis/classes/ComplexShapeNode.md index 4551f1bfc..aa26b8aac 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/ComplexShapeNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/ComplexShapeNode.md @@ -379,6 +379,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToHeight`](FillableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToWidth`](FillableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToCover`](FillableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToFitWithin`](FillableNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/Editor.md b/src/pages/references/document-sandbox/document-apis/classes/Editor.md index 5bbcb2a53..a16a5b3cb 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/Editor.md +++ b/src/pages/references/document-sandbox/document-apis/classes/Editor.md @@ -138,15 +138,38 @@ Transform values default to 0. ### createText() -• **createText**(): [`TextNode`](TextNode.md) +#### createText() -#### Returns +• **createText**(): [`StandaloneTextNode`](StandaloneTextNode.md) + +##### Returns -[`TextNode`](TextNode.md) +[`StandaloneTextNode`](StandaloneTextNode.md) a text node with default styles. The text content is initially empty, so the text node will be -invisible until its `fullContent` property's `text` is set. Creates point text, so the node's width will automatically -adjust to accommodate whatever text is set. +invisible until its `fullContent` property's `text` is set. Creates auto-width text, so the node's width will +automatically adjust to accommodate whatever text is set. + +##### Deprecated + +- Initial text content is always expected so please use `createText(textContent: string): StandaloneTextNode`. + +#### createText(textContent) + +• **createText**(`textContent`): [`StandaloneTextNode`](StandaloneTextNode.md) + +##### Parameters + +• **textContent**: `string` + +the initial string to show. + +##### Returns + +[`StandaloneTextNode`](StandaloneTextNode.md) + +a text node with default styles. Creates auto-width text, so the node's width will automatically adjust +to accommodate the given text content. Note: the registration point of this text node is not guaranteed to be at the top-left of the bounding box of its insertion parent. Recommend using `setPositionInParent` over `translation` to set the position. diff --git a/src/pages/references/document-sandbox/document-apis/classes/EllipseNode.md b/src/pages/references/document-sandbox/document-apis/classes/EllipseNode.md index 201ea3ab0..ce7b127ab 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/EllipseNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/EllipseNode.md @@ -422,6 +422,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToHeight`](FillableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToWidth`](FillableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToCover`](FillableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToFitWithin`](FillableNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/FillableNode.md b/src/pages/references/document-sandbox/document-apis/classes/FillableNode.md index 2f52d08fc..f1162f68e 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/FillableNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/FillableNode.md @@ -389,6 +389,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`rescaleProportionalToHeight`](StrokableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`rescaleProportionalToWidth`](StrokableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`resizeToCover`](StrokableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`resizeToFitWithin`](StrokableNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/GridCellNode.md b/src/pages/references/document-sandbox/document-apis/classes/GridCellNode.md index 4965a2471..e42c8fa37 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/GridCellNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/GridCellNode.md @@ -394,6 +394,110 @@ New content to display. Currently must be a [BitmapImage](../interfaces/BitmapIm --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`MediaContainerNode`](MediaContainerNode.md).[`rescaleProportionalToHeight`](MediaContainerNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`MediaContainerNode`](MediaContainerNode.md).[`rescaleProportionalToWidth`](MediaContainerNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`MediaContainerNode`](MediaContainerNode.md).[`resizeToCover`](MediaContainerNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`MediaContainerNode`](MediaContainerNode.md).[`resizeToFitWithin`](MediaContainerNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/GridLayoutNode.md b/src/pages/references/document-sandbox/document-apis/classes/GridLayoutNode.md index 3e63c6002..09c632bc1 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/GridLayoutNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/GridLayoutNode.md @@ -130,6 +130,13 @@ The background fill of the GridLayout. • `get` **height**(): `number` The height of the node. +Must be at least MIN_DIMENSION. + +• `set` **height**(`value`): `void` + +#### Parameters + +• **value**: `number` #### Returns @@ -312,6 +319,13 @@ meaningful comparison or conversion between the bounds or coordinate spaces of s • `get` **width**(): `number` The width of the node. +Must be at least MIN_DIMENSION. + +• `set` **width**(`value`): `void` + +#### Parameters + +• **value**: `number` #### Returns @@ -386,6 +400,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/GroupNode.md b/src/pages/references/document-sandbox/document-apis/classes/GroupNode.md index 37ee509df..90091b5d4 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/GroupNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/GroupNode.md @@ -399,6 +399,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/ImageRectangleNode.md b/src/pages/references/document-sandbox/document-apis/classes/ImageRectangleNode.md index 3232bc696..066a51bab 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/ImageRectangleNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/ImageRectangleNode.md @@ -377,6 +377,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/ItemList.md b/src/pages/references/document-sandbox/document-apis/classes/ItemList.md index 4a005520a..63fc3cce7 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/ItemList.md +++ b/src/pages/references/document-sandbox/document-apis/classes/ItemList.md @@ -89,7 +89,7 @@ removed from their previous parent, if any – or if an item is already in _this #### Throws -- if item has a different parent and item is a [TextNode](TextNode.md) that's a part of a Text Flow, or if item's children subtree contains a TextNode who is a part of a Text Flow. +- if item has a different parent and item is a [ThreadedTextNode](ThreadedTextNode.md), or if item's children subtree contains a [ThreadedTextNode](ThreadedTextNode.md). --- @@ -147,7 +147,7 @@ if any – or if it's already in _this_ list, its index is simply changed. No-op #### Throws -- if newItem has a different parent and it is a [TextNode](TextNode.md) that's a part of a Text Flow, or if newItem's children subtree contains a TextNode who is a part of a Text Flow. +- if newItem has a different parent and it is a [ThreadedTextNode](ThreadedTextNode.md), or if newItem's children subtree contains a [ThreadedTextNode](ThreadedTextNode.md). --- @@ -171,7 +171,7 @@ if any – or if it's already in _this_ list, its index is simply changed. No-op #### Throws -- if newItem has a different parent and it is a [TextNode](TextNode.md) that's a part of a Text Flow, or if newItem's children subtree contains a TextNode who is a part of a Text Flow. +- if newItem has a different parent and it is a [ThreadedTextNode](ThreadedTextNode.md), or if newItem's children subtree contains a [ThreadedTextNode](ThreadedTextNode.md). --- @@ -297,7 +297,7 @@ changed. No-op if both arguments are the same item. #### Throws -- if newItem has a different parent and newItem is a [TextNode](TextNode.md) that's a part of a Text Flow, or if newItem's children subtree contains a TextNode who is a part of a Text Flow. +- if newItem has a different parent and newItem is a [ThreadedTextNode](ThreadedTextNode.md), or if newItem's children subtree contains a [ThreadedTextNode](ThreadedTextNode.md). --- diff --git a/src/pages/references/document-sandbox/document-apis/classes/LineNode.md b/src/pages/references/document-sandbox/document-apis/classes/LineNode.md index 432a9480f..104ee97c5 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/LineNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/LineNode.md @@ -488,6 +488,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`rescaleProportionalToHeight`](StrokableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`rescaleProportionalToWidth`](StrokableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`resizeToCover`](StrokableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`resizeToFitWithin`](StrokableNode.md#resizetofitwithin) + +--- + ### setEndPoints() • **setEndPoints**(`startX`, `startY`, `endX`, `endY`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/MediaContainerNode.md b/src/pages/references/document-sandbox/document-apis/classes/MediaContainerNode.md index a22987c5c..96121056f 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/MediaContainerNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/MediaContainerNode.md @@ -397,6 +397,110 @@ New content to display. Currently must be a [BitmapImage](../interfaces/BitmapIm --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/Node.md b/src/pages/references/document-sandbox/document-apis/classes/Node.md index 45f9e2074..cbb1ba42f 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/Node.md +++ b/src/pages/references/document-sandbox/document-apis/classes/Node.md @@ -352,6 +352,94 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/PageNode.md b/src/pages/references/document-sandbox/document-apis/classes/PageNode.md index 1e2bd660c..206f1dca9 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/PageNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/PageNode.md @@ -14,7 +14,7 @@ To create new pages, see [PageList.addPage](PageList.md#addpage). ## Implements -- `Readonly`<[`IRectangularNode`](../interfaces/IRectangularNode.md)\> +- [`IRectangularNode`](../interfaces/IRectangularNode.md) ## Accessors @@ -67,6 +67,13 @@ To create new artboards, see [ArtboardList.addArtboard](ArtboardList.md#addartbo The height of the node. All Artboards within a page share the same dimensions. +Must be at least MIN_PAGE_DIMENSION and no larger than MAX_PAGE_DIMENSION. + +• `set` **height**(`value`): `void` + +#### Parameters + +• **value**: `number` #### Returns @@ -140,6 +147,13 @@ The node's type. The width of the node. All Artboards within a page share the same dimensions. +Must be at least MIN_PAGE_DIMENSION and no larger than MAX_PAGE_DIMENSION. + +• `set` **width**(`value`): `void` + +#### Parameters + +• **value**: `number` #### Returns diff --git a/src/pages/references/document-sandbox/document-apis/classes/PathNode.md b/src/pages/references/document-sandbox/document-apis/classes/PathNode.md index 6c7f55189..f57cdc6bc 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/PathNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/PathNode.md @@ -414,6 +414,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToHeight`](FillableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToWidth`](FillableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToCover`](FillableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToFitWithin`](FillableNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/RectangleNode.md b/src/pages/references/document-sandbox/document-apis/classes/RectangleNode.md index b885012e2..d5fd645a6 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/RectangleNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/RectangleNode.md @@ -527,6 +527,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToHeight`](FillableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`rescaleProportionalToWidth`](FillableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToCover`](FillableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`FillableNode`](FillableNode.md).[`resizeToFitWithin`](FillableNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/SolidColorShapeNode.md b/src/pages/references/document-sandbox/document-apis/classes/SolidColorShapeNode.md index c4d35a594..1eae67f57 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/SolidColorShapeNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/SolidColorShapeNode.md @@ -359,6 +359,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/StandaloneTextNode.md b/src/pages/references/document-sandbox/document-apis/classes/StandaloneTextNode.md new file mode 100644 index 000000000..60310d46c --- /dev/null +++ b/src/pages/references/document-sandbox/document-apis/classes/StandaloneTextNode.md @@ -0,0 +1,702 @@ +[@express-document-sdk](../overview.md) / StandaloneTextNode + +# Class: StandaloneTextNode + +A StandaloneTextNode represents a text display frame in the scenegraph. It displays an entire piece of text. +The StandaloneTextNode does not directly hold the text content and styles – instead it refers to a [TextContentModel](TextContentModel.md). + +To create new a single-frame piece of text, see [Editor.createText](Editor.md#createtext). + +## Extends + +- [`TextNode`](TextNode.md) + +## Accessors + +### addOnData + +• `get` **addOnData**(): [`AddOnData`](AddOnData.md) + +Get [AddOnData](AddOnData.md) reference for managing the private metadata on this node for this add-on. + +#### Returns + +[`AddOnData`](AddOnData.md) + +--- + +### allChildren + +• `get` **allChildren**(): `Readonly`<`Iterable`<[`Node`](Node.md), `any`, `any`\>\> + +Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or +GroupNode also provide a mutable [ContainerNode.children](../interfaces/ContainerNode.md#children) list. Other nodes with a more specific structure can +hold children in various discrete "slots"; this `allChildren` list includes *all* such children and reflects their +overall display z-order. + +The children of a Node are always other Node classes (never the more minimal BaseNode). + +#### Returns + +`Readonly`<`Iterable`<[`Node`](Node.md), `any`, `any`\>\> + +--- + +### blendMode + +• `get` **blendMode**(): [`BlendMode`](../enumerations/BlendMode.md) + +Blend mode determines how a node is composited onto the content below it. The default value is +[BlendMode.normal](../enumerations/BlendMode.md#normal) for most nodes, and [BlendMode.passThrough](../enumerations/BlendMode.md#passthrough) for GroupNodes. + +• `set` **blendMode**(`value`): `void` + +#### Parameters + +• **value**: [`BlendMode`](../enumerations/BlendMode.md) + +#### Returns + +[`BlendMode`](../enumerations/BlendMode.md) + +--- + +### boundsInParent + +• `get` **boundsInParent**(): `Readonly`<[`Rect`](../interfaces/Rect.md)\> + +An axis-aligned box in the parent’s coordinate space encompassing the node’s layout bounds (its +[boundsLocal](VisualNode.md#boundslocal), as transformed by its position and rotation relative to the parent). If the node has +rotation, the top-left of its boundsLocal box (aligned to its own axes) is not necessarily located at the +top-left of the boundsInParent box (since it's aligned to the parent's axes). This value is well-defined +even for an orphan node with no parent. + +#### Returns + +`Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Note: The bounding box of an orphaned TextNode may become different after it is placed on a +page. It is recommended to use this property only when the node is placed on a page. + +--- + +### boundsLocal + +• `get` **boundsLocal**(): `Readonly`<[`Rect`](../interfaces/Rect.md)\> + +The bounding box of the node, expressed in the node's local coordinate space (which may be shifted or rotated +relative to its parent). Generally matches the selection outline seen in the UI, encompassing the vector path +"spine" of the shape as well as its stroke, but excluding effects such as shadows. + +The top-left corner of the bounding box corresponds to the visual top-left corner of the node, but this value is +*not* necessarily (0,0) – this is especially true for Text and Path nodes. + +#### Returns + +`Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Note: The bounding box of the orphaned TextNode may be different from the bounding box of the node placed on a +page. It is recommended to use this property only when the node is placed on a page. + +--- + +### centerPointLocal + +• `get` **centerPointLocal**(): `Readonly`<[`Point`](../interfaces/Point.md)\> + +Position of the node's centerpoint in its own local coordinate space, i.e. the center of the boundsLocal box. + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +Note: The center of the orphaned TextNode may be different from the center of the node placed on a page. It is +recommended to use this property only when the node is placed on a page. + +--- + +### fullContent + +• `get` **fullContent**(): [`TextContentModel`](TextContentModel.md) + +The model containing the complete text string and its styles, only part of which may be visible within the bounds of +this specific TextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a +fixed-size frame using [AreaTextLayout](../interfaces/AreaTextLayout.md) does not fit all the (remaining) text. + +Note: When traversing the scenegraph in search of text content, bear in mind that multiple TextNodes may refer to the +same single [TextContentModel](TextContentModel.md); this can give the impression that the same text is duplicated multiple times when it is +not. Use [TextContentModel](TextContentModel.md).id to determine whether a given piece of text content is unique or if it's already been +encountered before. + +#### Returns + +[`TextContentModel`](TextContentModel.md) + +--- + +### id + +• `get` **id**(): `string` + +A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is +moved to a different part of the document. + +#### Returns + +`string` + +--- + +### layout + +• `get` **layout**(): `Readonly`<[`AutoWidthTextLayout`](../interfaces/AutoWidthTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`UnsupportedTextLayout`](../interfaces/UnsupportedTextLayout.md)\> + + + +**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`. + +• `set` **layout**(`layout`): `void` + + + +**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`. + +Sets the layout mode of the TextNode "frame." + +[AreaTextLayout](../interfaces/AreaTextLayout.md) is not supported by single-frame text. + +#### Throws + +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 + +if [StandaloneTextNode](StandaloneTextNode.md) is not a part of a multi-frame text content flow and the layout is [AreaTextLayout](../interfaces/AreaTextLayout.md). + +#### Parameters + +• **layout**: [`AutoWidthTextLayout`](../interfaces/AutoWidthTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) + +#### Returns + +`Readonly`<[`AutoWidthTextLayout`](../interfaces/AutoWidthTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`UnsupportedTextLayout`](../interfaces/UnsupportedTextLayout.md)\> + +The layout mode of the TextNode "frame." + +--- + +### locked + +• `get` **locked**(): `boolean` + +The node's lock/unlock state. Locked nodes are excluded from the selection (see [Context.selection](Context.md#selection)), and +cannot be edited by the user in the UI unless they are unlocked first. Operations on locked nodes using the API +are permitted. However, please consider if modifying a locked node would align with user expectations +before using the API to make changes to locked nodes. + +• `set` **locked**(`locked`): `void` + +#### Parameters + +• **locked**: `boolean` + +#### Returns + +`boolean` + +--- + +### nextTextNode + +• `get` **nextTextNode**(): `undefined` + +The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size +([AreaTextLayout](../interfaces/AreaTextLayout.md)), any text content that does not fit within this node's area will be clipped. + +To get *all* TextNodes that the text content may be split across, use `TextNode.fullContent.allTextNodes`. + +#### Returns + +`undefined` + +--- + +### opacity + +• `get` **opacity**(): `number` + +The node's opacity, from 0.0 to 1.0 + +• `set` **opacity**(`opacity`): `void` + +#### Parameters + +• **opacity**: `number` + +#### Returns + +`number` + +--- + +### parent + +• `get` **parent**(): `undefined` \| [`BaseNode`](BaseNode.md) + +The node's parent. The parent chain will eventually reach ExpressRootNode for all nodes that are part of the document +content. + +Nodes that have been deleted are "orphaned," with a parent chain that terminates in `undefined` without reaching the +root node. Such nodes cannot be selected, so it is unlikely to encounter one unless you retain a reference to a node +that was part of the document content earlier. Deleted nodes can be reattached to the scenegraph, e.g. via Undo. + +#### Returns + +`undefined` \| [`BaseNode`](BaseNode.md) + +--- + +### rotation + +• `get` **rotation**(): `number` + +The node's local rotation angle in degrees, relative to its parent's axes. Use `setRotationInParent` to +change rotation by rotating around a defined centerpoint. + +#### Returns + +`number` + +--- + +### rotationInScreen + +• `get` **rotationInScreen**(): `number` + +The node's total rotation angle in degrees, relative to the overall global view of the document – including any +cumulative rotation from the node's parent containers. + +#### Returns + +`number` + +--- + +### text + +• `get` **text**(): `string` + +The text string content which is partially *or* fully displayed in this TextNode "frame." +WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return +the *entire* text content string. + +#### Deprecated + +- Use the text getter on [TextContentModel](TextContentModel.md) instead. Access it via `TextNode.fullContent.text`. + +• `set` **text**(`textContent`): `void` + +Sets the text content of the TextNode. +WARNING: If a piece of text content flows across several TextNodes, +*each* TextNode's `text` setter will sets the *entire* text content string. + +#### Deprecated + +- Use the text setter on [TextContentModel](TextContentModel.md) instead. Access it via `TextNode.fullContent.text`. + +#### Parameters + +• **textContent**: `string` + +#### Returns + +`string` + +--- + +### textAlignment + +• `get` **textAlignment**(): [`TextAlignment`](../enumerations/TextAlignment.md) + +The horizontal text alignment of the TextNode. Alignment is always the same across this node's entire text content. + +• `set` **textAlignment**(`alignment`): `void` + +#### Parameters + +• **alignment**: [`TextAlignment`](../enumerations/TextAlignment.md) + +#### Returns + +[`TextAlignment`](../enumerations/TextAlignment.md) + +--- + +### topLeftLocal + +• `get` **topLeftLocal**(): `Readonly`<[`Point`](../interfaces/Point.md)\> + +Position of the node's top-left corner in its own local coordinate space, equal to (boundsLocal.x, +boundsLocal.y). If the node is rotated, this is not the same as the top-left corner of +boundsInParent. + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +Note: The top-left of the orphaned TextNode may be different from the top-left of the node placed on a +page. It is recommended to use this property only when the node is placed on a page. + +--- + +### transformMatrix + +• `get` **transformMatrix**(): [`mat2d`](https://glmatrix.net/docs/module-mat2d.html) + +The node's transform matrix relative to its parent. + +#### Returns + +[`mat2d`](https://glmatrix.net/docs/module-mat2d.html) + +--- + +### translation + +• `get` **translation**(): `Readonly`<[`Point`](../interfaces/Point.md)\> + +The translation of the node along its parent's axes. This is identical to the translation component of +`transformMatrix`. It is often simpler to set a node's position using `setPositionInParent` than by +setting translation directly. + +• `set` **translation**(`value`): `void` + +#### Parameters + +• **value**: [`Point`](../interfaces/Point.md) + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +--- + +### type + +• `get` **type**(): [`SceneNodeType`](../enumerations/SceneNodeType.md) + +The node's type. + +#### Returns + +[`SceneNodeType`](../enumerations/SceneNodeType.md) + +--- + +### visualEffects + +• `get` **visualEffects**(): readonly [`VisualEffectType`](../enumerations/VisualEffectType.md)[] + +#### Returns + +readonly [`VisualEffectType`](../enumerations/VisualEffectType.md)[] + +The list of visual effects applied to the TextNode. + +--- + +### visualRoot + +• `get` **visualRoot**(): [`VisualNode`](VisualNode.md) + +The highest ancestor that still has visual presence in the document. Typically an Artboard, but for orphaned +content, it will be the root of the deleted content (which might be this node itself). + +Nodes that are both in the same visualRoot subtree lie within the same "visual space" of the document's +structure. Nodes that are in different visual roots have no spatial relation to one another; there is no +meaningful comparison or conversion between the bounds or coordinate spaces of such nodes. + +#### Returns + +[`VisualNode`](VisualNode.md) + +## Methods + +### boundsInNode() + +• **boundsInNode**(`targetNode`): `Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Convert the node's [boundsLocal](VisualNode.md#boundslocal) to an axis-aligned bounding box in the coordinate space of the target +node. Both nodes must share the same [visualRoot](VisualNode.md#visualroot), but can lie anywhere within that subtree +relative to one another (the target node need not be an ancestor of this node, nor vice versa). + +#### Parameters + +• **targetNode**: [`VisualNode`](VisualNode.md) + +#### Returns + +`Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Note: The bounding box of an orphaned TextNode may become different after it is placed on a +page. It is recommended to use this method only when the node is placed on a page. + +#### Inherited from + +[`TextNode`](TextNode.md).[`boundsInNode`](TextNode.md#boundsinnode) + +--- + +### isStandaloneText() + +• **isStandaloneText**(): `this is StandaloneTextNode` + +Helper method to determine if the text is standalone. + +#### Returns + +`this is StandaloneTextNode` + +#### Inherited from + +[`TextNode`](TextNode.md).[`isStandaloneText`](TextNode.md#isstandalonetext) + +--- + +### isThreadedText() + +• **isThreadedText**(): `this is ThreadedTextNode` + +Helper method to determine if the text is in a flow. + +#### Returns + +`this is ThreadedTextNode` + +#### Inherited from + +[`TextNode`](TextNode.md).[`isThreadedText`](TextNode.md#isthreadedtext) + +--- + +### localPointInNode() + +• **localPointInNode**(`localPoint`, `targetNode`): `Readonly`<[`Point`](../interfaces/Point.md)\> + +Convert a point given in the node’s local coordinate space to a point in the coordinate space of the target node. +Both nodes must share the same [visualRoot](VisualNode.md#visualroot), but can lie anywhere within that subtree relative to one +another (the target node need not be an ancestor of this node, nor vice versa). + +#### Parameters + +• **localPoint**: [`Point`](../interfaces/Point.md) + +• **targetNode**: [`VisualNode`](VisualNode.md) + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +#### Inherited from + +[`TextNode`](TextNode.md).[`localPointInNode`](TextNode.md#localpointinnode) + +--- + +### removeFromParent() + +• **removeFromParent**(): `void` + +Removes the node from its parent - effectively deleting it, if the node is not re-added to another parent before the +document is closed. + +If parent is a basic ContainerNode, this is equivalent to `node.parent.children.remove(node)`. For nodes with other +child "slots," removes the child from whichever slot it resides in, if possible. Throws if the slot does not permit +removal. No-op if node is already an orphan. + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`removeFromParent`](TextNode.md#removefromparent) + +--- + +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`rescaleProportionalToHeight`](TextNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`rescaleProportionalToWidth`](TextNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`resizeToCover`](TextNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`resizeToFitWithin`](TextNode.md#resizetofitwithin) + +--- + +### setPositionInParent() + +• **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` + +Move the node so the given `localRegistrationPoint` in its local coordinates is placed at the given +`parentPoint` in its parent's coordinates (taking into account any rotation on this node, etc.). + +#### Parameters + +• **parentPoint**: [`Point`](../interfaces/Point.md) + +Point in this node's parent's coordinate space to move `localRegistrationPoint` to + +• **localRegistrationPoint**: [`Point`](../interfaces/Point.md) + +Point in this node's local coordinate space to align with `parentPoint` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`setPositionInParent`](TextNode.md#setpositioninparent) + +#### Example + +Center a rectangle within its parent artboard: + +```js +rectangle.setPositionInParent( + { x: artboard.width / 2, y: artboard.height / 2 }, + { x: rectangle.width / 2, y: rectangle.height / 2 } +); +``` + +--- + +### setRotationInParent() + +• **setRotationInParent**(`angleInDegrees`, `localRotationPoint`): `void` + +Set the node’s rotation angle relative to its parent to exactly the given value, keeping the given point in the +node’s local coordinate space at a fixed location within the parent. Disregards any rotation the node may already +have had. The angle set here may not be the absolute rotation angle seen on screen, if the parent or other +ancestors also have rotation of their own. + +#### Parameters + +• **angleInDegrees**: `number` + +Angle in degrees. + +• **localRotationPoint**: [`Point`](../interfaces/Point.md) + +Point to rotate around, in node's local coordinates. + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`setRotationInParent`](TextNode.md#setrotationinparent) + +#### Example + +Rotate the rectangle 45 degrees clockwise around its centerpoint: + +```js +rectangle.setRotationInParent(45, { x: rectangle.width / 2, y: rectangle.height / 2 }); +``` diff --git a/src/pages/references/document-sandbox/document-apis/classes/StrokableNode.md b/src/pages/references/document-sandbox/document-apis/classes/StrokableNode.md index 5527a4f15..7388d247b 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/StrokableNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/StrokableNode.md @@ -370,6 +370,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/StrokeShapeNode.md b/src/pages/references/document-sandbox/document-apis/classes/StrokeShapeNode.md index e543b4bd5..df45cd8ed 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/StrokeShapeNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/StrokeShapeNode.md @@ -361,6 +361,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`rescaleProportionalToHeight`](StrokableNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`rescaleProportionalToWidth`](StrokableNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`resizeToCover`](StrokableNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`StrokableNode`](StrokableNode.md).[`resizeToFitWithin`](StrokableNode.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/TextContentModel.md b/src/pages/references/document-sandbox/document-apis/classes/TextContentModel.md index 3bd39dfe6..1dc4d69ae 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/TextContentModel.md +++ b/src/pages/references/document-sandbox/document-apis/classes/TextContentModel.md @@ -2,7 +2,8 @@ # Class: TextContentModel -Represents a complete piece of text content flow, which may be split across multiple [TextNode](TextNode.md) frames for display. +Represents a complete piece of text content, which may be contained within a single [StandaloneTextNode](StandaloneTextNode.md) *or* +split across multiple [ThreadedTextNode](ThreadedTextNode.md) frames for display. Use this model to get or modify the text string and the style ranges applied to it. ## Accessors @@ -12,10 +13,10 @@ Use this model to get or modify the text string and the style ranges applied to • `get` **allTextNodes**(): `Readonly`<`Iterable`<[`TextNode`](TextNode.md), `any`, `any`\>\> Get ordered list of all [TextNode](TextNode.md)s that display this text content in the scenegraph. The text content -starts in the first [TextNode](TextNode.md) "frame", and then flows into the second node once it has filled the first one. The ending of the -text content may not be visible at all, if the last [TextNode](TextNode.md) "frame" is not large enough to accommodate it. +starts in the first [ThreadedTextNode](ThreadedTextNode.md) "frame", and then flows into the second node once it has filled the first one. The ending of the +text content may not be visible at all, if the last [ThreadedTextNode](ThreadedTextNode.md) "frame" is not large enough to accommodate it. -If there are multiple [TextNode](TextNode.md)s, all of them must be configured to use [AreaTextLayout](../interfaces/AreaTextLayout.md). +If there are multiple [ThreadedTextNode](ThreadedTextNode.md)s, all of them must be configured to use [AreaTextLayout](../interfaces/AreaTextLayout.md). #### Returns @@ -109,7 +110,7 @@ readonly [`ParagraphStylesRange`](../interfaces/ParagraphStylesRange.md)[] • `get` **text**(): `string` -The complete text string, which may span multiple [TextNode](TextNode.md) "frames" in the scenegraph. +The complete text string, which may span multiple [ThreadedTextNode](ThreadedTextNode.md) "frames" in the scenegraph. • `set` **text**(`textContent`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/TextNode.md b/src/pages/references/document-sandbox/document-apis/classes/TextNode.md index 31a51cb2a..eefb0723c 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/TextNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/TextNode.md @@ -1,18 +1,21 @@ [@express-document-sdk](../overview.md) / TextNode -# Class: TextNode +# Class: `abstract` TextNode -A TextNode represents a text display frame in the scenegraph. It may display an entire piece of text, or sometimes just -a subset of longer text that flows across multiple TextNode "frames". Because of this, the TextNode does not directly hold -the text content and styles – instead it refers to a [TextContentModel](TextContentModel.md), which may be shared across multiple TextNode frames. - -To create new a single-frame piece of text, see [Editor.createText](Editor.md#createtext). APIs are not yet available to create -multi-frame text flows. +TextNode is an abstract base class representing text displayed in the scenegraph, regardless of whether it's a fully +self-contained [StandaloneTextNode](StandaloneTextNode.md) or one [ThreadedTextNode](ThreadedTextNode.md) "frame" of multiple in a larger flow. The +APIs on TextNode and its [TextContentModel](TextContentModel.md) allow you to generically work with text without needing to know +which of those subtypes you are dealing with. ## Extends - [`Node`](Node.md) +## Extended by + +- [`StandaloneTextNode`](StandaloneTextNode.md) +- [`ThreadedTextNode`](ThreadedTextNode.md) + ## Accessors ### addOnData @@ -77,6 +80,9 @@ even for an orphan node with no parent. `Readonly`<[`Rect`](../interfaces/Rect.md)\> +Note: The bounding box of an orphaned TextNode may become different after it is placed on a +page. It is recommended to use this property only when the node is placed on a page. + --- ### boundsLocal @@ -94,6 +100,9 @@ The top-left corner of the bounding box corresponds to the visual top-left corne `Readonly`<[`Rect`](../interfaces/Rect.md)\> +Note: The bounding box of the orphaned TextNode may be different from the bounding box of the node placed on a +page. It is recommended to use this property only when the node is placed on a page. + --- ### centerPointLocal @@ -145,42 +154,15 @@ moved to a different part of the document. ### layout -• `get` **layout**(): `Readonly`<[`PointTextLayout`](../interfaces/PointTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`AreaTextLayout`](../interfaces/AreaTextLayout.md) \| [`UnsupportedTextLayout`](../interfaces/UnsupportedTextLayout.md)\> - - - -**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`. - -• `set` **layout**(`layout`): `void` +• `get` **layout**(): `Readonly`<[`AutoWidthTextLayout`](../interfaces/AutoWidthTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`AreaTextLayout`](../interfaces/AreaTextLayout.md) \| [`UnsupportedTextLayout`](../interfaces/UnsupportedTextLayout.md)\> **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`. -Sets the layout mode of the TextNode "frame." - -If this TextNode is part of a multi-frame text content flow, it must be configured to use [AreaTextLayout](../interfaces/AreaTextLayout.md). Other -layout modes, except for [AreaTextLayout](../interfaces/AreaTextLayout.md), are only available for single-frame text. - -#### Throws - -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 - -if [TextNode](TextNode.md) is part of a multi-frame text content flow and the layout is not [AreaTextLayout](../interfaces/AreaTextLayout.md). - -#### Throws - -if [TextNode](TextNode.md) is not a part of a multi-frame text content flow and the layout is [AreaTextLayout](../interfaces/AreaTextLayout.md). - -#### Parameters - -• **layout**: [`PointTextLayout`](../interfaces/PointTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`AreaTextLayout`](../interfaces/AreaTextLayout.md) - #### Returns -`Readonly`<[`PointTextLayout`](../interfaces/PointTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`AreaTextLayout`](../interfaces/AreaTextLayout.md) \| [`UnsupportedTextLayout`](../interfaces/UnsupportedTextLayout.md)\> +`Readonly`<[`AutoWidthTextLayout`](../interfaces/AutoWidthTextLayout.md) \| [`AutoHeightTextLayout`](../interfaces/AutoHeightTextLayout.md) \| [`AreaTextLayout`](../interfaces/AreaTextLayout.md) \| [`UnsupportedTextLayout`](../interfaces/UnsupportedTextLayout.md)\> The layout mode of the TextNode "frame." @@ -209,7 +191,7 @@ before using the API to make changes to locked nodes. ### nextTextNode -• `get` **nextTextNode**(): `undefined` \| [`TextNode`](TextNode.md) +• `get` `abstract` **nextTextNode**(): `undefined` \| [`ThreadedTextNode`](ThreadedTextNode.md) The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size ([AreaTextLayout](../interfaces/AreaTextLayout.md)), any text content that does not fit within this node's area will be clipped. @@ -218,7 +200,7 @@ To get *all* TextNodes that the text content may be split across, use `TextNode. #### Returns -`undefined` \| [`TextNode`](TextNode.md) +`undefined` \| [`ThreadedTextNode`](ThreadedTextNode.md) --- @@ -439,12 +421,39 @@ relative to one another (the target node need not be an ancestor of this node, n `Readonly`<[`Rect`](../interfaces/Rect.md)\> -#### Inherited from +Note: The bounding box of an orphaned TextNode may become different after it is placed on a +page. It is recommended to use this method only when the node is placed on a page. + +#### Overrides [`Node`](Node.md).[`boundsInNode`](Node.md#boundsinnode) --- +### isStandaloneText() + +• **isStandaloneText**(): `this is StandaloneTextNode` + +Helper method to determine if the text is standalone. + +#### Returns + +`this is StandaloneTextNode` + +--- + +### isThreadedText() + +• **isThreadedText**(): `this is ThreadedTextNode` + +Helper method to determine if the text is in a flow. + +#### Returns + +`this is ThreadedTextNode` + +--- + ### localPointInNode() • **localPointInNode**(`localPoint`, `targetNode`): `Readonly`<[`Point`](../interfaces/Point.md)\> @@ -490,6 +499,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/classes/ThreadedTextNode.md b/src/pages/references/document-sandbox/document-apis/classes/ThreadedTextNode.md new file mode 100644 index 000000000..47ef18ad7 --- /dev/null +++ b/src/pages/references/document-sandbox/document-apis/classes/ThreadedTextNode.md @@ -0,0 +1,699 @@ +[@express-document-sdk](../overview.md) / ThreadedTextNode + +# Class: ThreadedTextNode + +A ThreadedTextNode represents a text display frame in the scenegraph. It is a subset of longer text that flows across +multiple TextNode "frames". Because of this, the TextNode does not directly hold the text content and styles – +instead it refers to a [TextContentModel](TextContentModel.md), which may be shared across multiple ThreadedTextNode frames. + +APIs are not yet available to create multi-frame text flows. + +## Extends + +- [`TextNode`](TextNode.md) + +## Accessors + +### addOnData + +• `get` **addOnData**(): [`AddOnData`](AddOnData.md) + +Get [AddOnData](AddOnData.md) reference for managing the private metadata on this node for this add-on. + +#### Returns + +[`AddOnData`](AddOnData.md) + +--- + +### allChildren + +• `get` **allChildren**(): `Readonly`<`Iterable`<[`Node`](Node.md), `any`, `any`\>\> + +Returns a read-only list of all children of the node. General-purpose content containers such as ArtboardNode or +GroupNode also provide a mutable [ContainerNode.children](../interfaces/ContainerNode.md#children) list. Other nodes with a more specific structure can +hold children in various discrete "slots"; this `allChildren` list includes *all* such children and reflects their +overall display z-order. + +The children of a Node are always other Node classes (never the more minimal BaseNode). + +#### Returns + +`Readonly`<`Iterable`<[`Node`](Node.md), `any`, `any`\>\> + +--- + +### blendMode + +• `get` **blendMode**(): [`BlendMode`](../enumerations/BlendMode.md) + +Blend mode determines how a node is composited onto the content below it. The default value is +[BlendMode.normal](../enumerations/BlendMode.md#normal) for most nodes, and [BlendMode.passThrough](../enumerations/BlendMode.md#passthrough) for GroupNodes. + +• `set` **blendMode**(`value`): `void` + +#### Parameters + +• **value**: [`BlendMode`](../enumerations/BlendMode.md) + +#### Returns + +[`BlendMode`](../enumerations/BlendMode.md) + +--- + +### boundsInParent + +• `get` **boundsInParent**(): `Readonly`<[`Rect`](../interfaces/Rect.md)\> + +An axis-aligned box in the parent’s coordinate space encompassing the node’s layout bounds (its +[boundsLocal](VisualNode.md#boundslocal), as transformed by its position and rotation relative to the parent). If the node has +rotation, the top-left of its boundsLocal box (aligned to its own axes) is not necessarily located at the +top-left of the boundsInParent box (since it's aligned to the parent's axes). This value is well-defined +even for an orphan node with no parent. + +#### Returns + +`Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Note: The bounding box of an orphaned TextNode may become different after it is placed on a +page. It is recommended to use this property only when the node is placed on a page. + +--- + +### boundsLocal + +• `get` **boundsLocal**(): `Readonly`<[`Rect`](../interfaces/Rect.md)\> + +The bounding box of the node, expressed in the node's local coordinate space (which may be shifted or rotated +relative to its parent). Generally matches the selection outline seen in the UI, encompassing the vector path +"spine" of the shape as well as its stroke, but excluding effects such as shadows. + +The top-left corner of the bounding box corresponds to the visual top-left corner of the node, but this value is +*not* necessarily (0,0) – this is especially true for Text and Path nodes. + +#### Returns + +`Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Note: The bounding box of the orphaned TextNode may be different from the bounding box of the node placed on a +page. It is recommended to use this property only when the node is placed on a page. + +--- + +### centerPointLocal + +• `get` **centerPointLocal**(): `Readonly`<[`Point`](../interfaces/Point.md)\> + +Position of the node's centerpoint in its own local coordinate space, i.e. the center of the boundsLocal box. + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +Note: The center of the orphaned TextNode may be different from the center of the node placed on a page. It is +recommended to use this property only when the node is placed on a page. + +--- + +### fullContent + +• `get` **fullContent**(): [`TextContentModel`](TextContentModel.md) + +The model containing the complete text string and its styles, only part of which may be visible within the bounds of +this specific TextNode "frame." The full text content flow may be split across multiple frames, and/or it may be clipped if a +fixed-size frame using [AreaTextLayout](../interfaces/AreaTextLayout.md) does not fit all the (remaining) text. + +Note: When traversing the scenegraph in search of text content, bear in mind that multiple TextNodes may refer to the +same single [TextContentModel](TextContentModel.md); this can give the impression that the same text is duplicated multiple times when it is +not. Use [TextContentModel](TextContentModel.md).id to determine whether a given piece of text content is unique or if it's already been +encountered before. + +#### Returns + +[`TextContentModel`](TextContentModel.md) + +--- + +### id + +• `get` **id**(): `string` + +A unique identifier for this node that stays the same when the file is closed & reopened, or if the node is +moved to a different part of the document. + +#### Returns + +`string` + +--- + +### layout + +• `get` **layout**(): `Readonly`<[`AreaTextLayout`](../interfaces/AreaTextLayout.md)\> + + + +**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`. + +• `set` **layout**(`layout`): `void` + + + +**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`. + +Sets the layout mode of the TextNode "frame." + +Only [AreaTextLayout](../interfaces/AreaTextLayout.md), with fully fixed bounds, is currently supported by threaded text. + +#### Throws + +if [ThreadedTextNode](ThreadedTextNode.md) is part of a multi-frame text content flow and the layout is not [AreaTextLayout](../interfaces/AreaTextLayout.md). + +#### Parameters + +• **layout**: [`AreaTextLayout`](../interfaces/AreaTextLayout.md) + +#### Returns + +`Readonly`<[`AreaTextLayout`](../interfaces/AreaTextLayout.md)\> + +The layout mode of the TextNode "frame." + +--- + +### locked + +• `get` **locked**(): `boolean` + +The node's lock/unlock state. Locked nodes are excluded from the selection (see [Context.selection](Context.md#selection)), and +cannot be edited by the user in the UI unless they are unlocked first. Operations on locked nodes using the API +are permitted. However, please consider if modifying a locked node would align with user expectations +before using the API to make changes to locked nodes. + +• `set` **locked**(`locked`): `void` + +#### Parameters + +• **locked**: `boolean` + +#### Returns + +`boolean` + +--- + +### nextTextNode + +• `get` **nextTextNode**(): `undefined` \| [`ThreadedTextNode`](ThreadedTextNode.md) + +The next TextNode that text overflowing this node will spill into, if any. If undefined and this TextNode is fixed size +([AreaTextLayout](../interfaces/AreaTextLayout.md)), any text content that does not fit within this node's area will be clipped. + +To get *all* TextNodes that the text content may be split across, use `TextNode.fullContent.allTextNodes`. + +#### Returns + +`undefined` \| [`ThreadedTextNode`](ThreadedTextNode.md) + +--- + +### opacity + +• `get` **opacity**(): `number` + +The node's opacity, from 0.0 to 1.0 + +• `set` **opacity**(`opacity`): `void` + +#### Parameters + +• **opacity**: `number` + +#### Returns + +`number` + +--- + +### parent + +• `get` **parent**(): `undefined` \| [`BaseNode`](BaseNode.md) + +The node's parent. The parent chain will eventually reach ExpressRootNode for all nodes that are part of the document +content. + +Nodes that have been deleted are "orphaned," with a parent chain that terminates in `undefined` without reaching the +root node. Such nodes cannot be selected, so it is unlikely to encounter one unless you retain a reference to a node +that was part of the document content earlier. Deleted nodes can be reattached to the scenegraph, e.g. via Undo. + +#### Returns + +`undefined` \| [`BaseNode`](BaseNode.md) + +--- + +### rotation + +• `get` **rotation**(): `number` + +The node's local rotation angle in degrees, relative to its parent's axes. Use `setRotationInParent` to +change rotation by rotating around a defined centerpoint. + +#### Returns + +`number` + +--- + +### rotationInScreen + +• `get` **rotationInScreen**(): `number` + +The node's total rotation angle in degrees, relative to the overall global view of the document – including any +cumulative rotation from the node's parent containers. + +#### Returns + +`number` + +--- + +### text + +• `get` **text**(): `string` + +The text string content which is partially *or* fully displayed in this TextNode "frame." +WARNING: If a piece of text content flows across several TextNodes, *each* TextNode's `text` getter will return +the *entire* text content string. + +#### Deprecated + +- Use the text getter on [TextContentModel](TextContentModel.md) instead. Access it via `TextNode.fullContent.text`. + +• `set` **text**(`textContent`): `void` + +Sets the text content of the TextNode. +WARNING: If a piece of text content flows across several TextNodes, +*each* TextNode's `text` setter will sets the *entire* text content string. + +#### Deprecated + +- Use the text setter on [TextContentModel](TextContentModel.md) instead. Access it via `TextNode.fullContent.text`. + +#### Parameters + +• **textContent**: `string` + +#### Returns + +`string` + +--- + +### textAlignment + +• `get` **textAlignment**(): [`TextAlignment`](../enumerations/TextAlignment.md) + +The horizontal text alignment of the TextNode. Alignment is always the same across this node's entire text content. + +• `set` **textAlignment**(`alignment`): `void` + +#### Parameters + +• **alignment**: [`TextAlignment`](../enumerations/TextAlignment.md) + +#### Returns + +[`TextAlignment`](../enumerations/TextAlignment.md) + +--- + +### topLeftLocal + +• `get` **topLeftLocal**(): `Readonly`<[`Point`](../interfaces/Point.md)\> + +Position of the node's top-left corner in its own local coordinate space, equal to (boundsLocal.x, +boundsLocal.y). If the node is rotated, this is not the same as the top-left corner of +boundsInParent. + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +Note: The top-left of the orphaned TextNode may be different from the top-left of the node placed on a +page. It is recommended to use this property only when the node is placed on a page. + +--- + +### transformMatrix + +• `get` **transformMatrix**(): [`mat2d`](https://glmatrix.net/docs/module-mat2d.html) + +The node's transform matrix relative to its parent. + +#### Returns + +[`mat2d`](https://glmatrix.net/docs/module-mat2d.html) + +--- + +### translation + +• `get` **translation**(): `Readonly`<[`Point`](../interfaces/Point.md)\> + +The translation of the node along its parent's axes. This is identical to the translation component of +`transformMatrix`. It is often simpler to set a node's position using `setPositionInParent` than by +setting translation directly. + +• `set` **translation**(`value`): `void` + +#### Parameters + +• **value**: [`Point`](../interfaces/Point.md) + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +--- + +### type + +• `get` **type**(): [`SceneNodeType`](../enumerations/SceneNodeType.md) + +The node's type. + +#### Returns + +[`SceneNodeType`](../enumerations/SceneNodeType.md) + +--- + +### visualEffects + +• `get` **visualEffects**(): readonly [`VisualEffectType`](../enumerations/VisualEffectType.md)[] + +#### Returns + +readonly [`VisualEffectType`](../enumerations/VisualEffectType.md)[] + +The list of visual effects applied to the TextNode. + +--- + +### visualRoot + +• `get` **visualRoot**(): [`VisualNode`](VisualNode.md) + +The highest ancestor that still has visual presence in the document. Typically an Artboard, but for orphaned +content, it will be the root of the deleted content (which might be this node itself). + +Nodes that are both in the same visualRoot subtree lie within the same "visual space" of the document's +structure. Nodes that are in different visual roots have no spatial relation to one another; there is no +meaningful comparison or conversion between the bounds or coordinate spaces of such nodes. + +#### Returns + +[`VisualNode`](VisualNode.md) + +## Methods + +### boundsInNode() + +• **boundsInNode**(`targetNode`): `Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Convert the node's [boundsLocal](VisualNode.md#boundslocal) to an axis-aligned bounding box in the coordinate space of the target +node. Both nodes must share the same [visualRoot](VisualNode.md#visualroot), but can lie anywhere within that subtree +relative to one another (the target node need not be an ancestor of this node, nor vice versa). + +#### Parameters + +• **targetNode**: [`VisualNode`](VisualNode.md) + +#### Returns + +`Readonly`<[`Rect`](../interfaces/Rect.md)\> + +Note: The bounding box of an orphaned TextNode may become different after it is placed on a +page. It is recommended to use this method only when the node is placed on a page. + +#### Inherited from + +[`TextNode`](TextNode.md).[`boundsInNode`](TextNode.md#boundsinnode) + +--- + +### isStandaloneText() + +• **isStandaloneText**(): `this is StandaloneTextNode` + +Helper method to determine if the text is standalone. + +#### Returns + +`this is StandaloneTextNode` + +#### Inherited from + +[`TextNode`](TextNode.md).[`isStandaloneText`](TextNode.md#isstandalonetext) + +--- + +### isThreadedText() + +• **isThreadedText**(): `this is ThreadedTextNode` + +Helper method to determine if the text is in a flow. + +#### Returns + +`this is ThreadedTextNode` + +#### Inherited from + +[`TextNode`](TextNode.md).[`isThreadedText`](TextNode.md#isthreadedtext) + +--- + +### localPointInNode() + +• **localPointInNode**(`localPoint`, `targetNode`): `Readonly`<[`Point`](../interfaces/Point.md)\> + +Convert a point given in the node’s local coordinate space to a point in the coordinate space of the target node. +Both nodes must share the same [visualRoot](VisualNode.md#visualroot), but can lie anywhere within that subtree relative to one +another (the target node need not be an ancestor of this node, nor vice versa). + +#### Parameters + +• **localPoint**: [`Point`](../interfaces/Point.md) + +• **targetNode**: [`VisualNode`](VisualNode.md) + +#### Returns + +`Readonly`<[`Point`](../interfaces/Point.md)\> + +#### Inherited from + +[`TextNode`](TextNode.md).[`localPointInNode`](TextNode.md#localpointinnode) + +--- + +### removeFromParent() + +• **removeFromParent**(): `void` + +Removes the node from its parent - effectively deleting it, if the node is not re-added to another parent before the +document is closed. + +If parent is a basic ContainerNode, this is equivalent to `node.parent.children.remove(node)`. For nodes with other +child "slots," removes the child from whichever slot it resides in, if possible. Throws if the slot does not permit +removal. No-op if node is already an orphan. + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`removeFromParent`](TextNode.md#removefromparent) + +--- + +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`rescaleProportionalToHeight`](TextNode.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`rescaleProportionalToWidth`](TextNode.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`resizeToCover`](TextNode.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`resizeToFitWithin`](TextNode.md#resizetofitwithin) + +--- + +### setPositionInParent() + +• **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` + +Move the node so the given `localRegistrationPoint` in its local coordinates is placed at the given +`parentPoint` in its parent's coordinates (taking into account any rotation on this node, etc.). + +#### Parameters + +• **parentPoint**: [`Point`](../interfaces/Point.md) + +Point in this node's parent's coordinate space to move `localRegistrationPoint` to + +• **localRegistrationPoint**: [`Point`](../interfaces/Point.md) + +Point in this node's local coordinate space to align with `parentPoint` + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`setPositionInParent`](TextNode.md#setpositioninparent) + +#### Example + +Center a rectangle within its parent artboard: + +```js +rectangle.setPositionInParent( + { x: artboard.width / 2, y: artboard.height / 2 }, + { x: rectangle.width / 2, y: rectangle.height / 2 } +); +``` + +--- + +### setRotationInParent() + +• **setRotationInParent**(`angleInDegrees`, `localRotationPoint`): `void` + +Set the node’s rotation angle relative to its parent to exactly the given value, keeping the given point in the +node’s local coordinate space at a fixed location within the parent. Disregards any rotation the node may already +have had. The angle set here may not be the absolute rotation angle seen on screen, if the parent or other +ancestors also have rotation of their own. + +#### Parameters + +• **angleInDegrees**: `number` + +Angle in degrees. + +• **localRotationPoint**: [`Point`](../interfaces/Point.md) + +Point to rotate around, in node's local coordinates. + +#### Returns + +`void` + +#### Inherited from + +[`TextNode`](TextNode.md).[`setRotationInParent`](TextNode.md#setrotationinparent) + +#### Example + +Rotate the rectangle 45 degrees clockwise around its centerpoint: + +```js +rectangle.setRotationInParent(45, { x: rectangle.width / 2, y: rectangle.height / 2 }); +``` diff --git a/src/pages/references/document-sandbox/document-apis/classes/UnknownNode.md b/src/pages/references/document-sandbox/document-apis/classes/UnknownNode.md index 4204782be..943da7950 100644 --- a/src/pages/references/document-sandbox/document-apis/classes/UnknownNode.md +++ b/src/pages/references/document-sandbox/document-apis/classes/UnknownNode.md @@ -340,6 +340,110 @@ removal. No-op if node is already an orphan. --- +### rescaleProportionalToHeight() + +• **rescaleProportionalToHeight**(`height`): `void` + + + +**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`. + +Changes the height to the given value and the width to the given height multiplied by the aspect ratio. + +#### Parameters + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToHeight`](Node.md#rescaleproportionaltoheight) + +--- + +### rescaleProportionalToWidth() + +• **rescaleProportionalToWidth**(`width`): `void` + + + +**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`. + +Changes the width to the given value and the height to the given width multiplied by the aspect ratio. + +#### Parameters + +• **width**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`rescaleProportionalToWidth`](Node.md#rescaleproportionaltowidth) + +--- + +### resizeToCover() + +• **resizeToCover**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to cover a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToCover`](Node.md#resizetocover) + +--- + +### resizeToFitWithin() + +• **resizeToFitWithin**(`width`, `height`): `void` + + + +**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`. + +Resizes the node to fit within a box with the given dimensions. + +If the node doesn't have a fixed aspect ratio then this will resize the node to the given width and height. + +#### Parameters + +• **width**: `number` + +• **height**: `number` + +#### Returns + +`void` + +#### Inherited from + +[`Node`](Node.md).[`resizeToFitWithin`](Node.md#resizetofitwithin) + +--- + ### setPositionInParent() • **setPositionInParent**(`parentPoint`, `localRegistrationPoint`): `void` diff --git a/src/pages/references/document-sandbox/document-apis/interfaces/PointTextLayout.md b/src/pages/references/document-sandbox/document-apis/interfaces/AutoWidthTextLayout.md similarity index 83% rename from src/pages/references/document-sandbox/document-apis/interfaces/PointTextLayout.md rename to src/pages/references/document-sandbox/document-apis/interfaces/AutoWidthTextLayout.md index aeabd021f..81f23ce3f 100644 --- a/src/pages/references/document-sandbox/document-apis/interfaces/PointTextLayout.md +++ b/src/pages/references/document-sandbox/document-apis/interfaces/AutoWidthTextLayout.md @@ -1,6 +1,6 @@ -[@express-document-sdk](../overview.md) / PointTextLayout +[@express-document-sdk](../overview.md) / AutoWidthTextLayout -# Interface: PointTextLayout +# Interface: AutoWidthTextLayout diff --git a/src/pages/references/document-sandbox/document-apis/overview.md b/src/pages/references/document-sandbox/document-apis/overview.md index 05b0d38ce..fa542b73e 100644 --- a/src/pages/references/document-sandbox/document-apis/overview.md +++ b/src/pages/references/document-sandbox/document-apis/overview.md @@ -53,10 +53,12 @@ - [RectangleNode](classes/RectangleNode.md) - [RestrictedItemList](classes/RestrictedItemList.md) - [SolidColorShapeNode](classes/SolidColorShapeNode.md) +- [StandaloneTextNode](classes/StandaloneTextNode.md) - [StrokableNode](classes/StrokableNode.md) - [StrokeShapeNode](classes/StrokeShapeNode.md) - [TextContentModel](classes/TextContentModel.md) - [TextNode](classes/TextNode.md) +- [ThreadedTextNode](classes/ThreadedTextNode.md) - [UnavailableFont](classes/UnavailableFont.md) - [UnknownNode](classes/UnknownNode.md) - [Viewport](classes/Viewport.md) @@ -66,6 +68,7 @@ - [AreaTextLayout](interfaces/AreaTextLayout.md) - [AutoHeightTextLayout](interfaces/AutoHeightTextLayout.md) +- [AutoWidthTextLayout](interfaces/AutoWidthTextLayout.md) - [BaseParagraphStyles](interfaces/BaseParagraphStyles.md) - [BitmapImage](interfaces/BitmapImage.md) - [CharacterStyles](interfaces/CharacterStyles.md) @@ -86,7 +89,6 @@ - [ParagraphStylesRange](interfaces/ParagraphStylesRange.md) - [ParagraphStylesRangeInput](interfaces/ParagraphStylesRangeInput.md) - [Point](interfaces/Point.md) -- [PointTextLayout](interfaces/PointTextLayout.md) - [Rect](interfaces/Rect.md) - [RectangleGeometry](interfaces/RectangleGeometry.md) - [SolidColorStroke](interfaces/SolidColorStroke.md)