Skip to content

Commit e5dd84f

Browse files
committed
XD 28 docs updates
1 parent 07abf2c commit e5dd84f

File tree

5 files changed

+105
-26
lines changed

5 files changed

+105
-26
lines changed

changes.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Change Log
22

3+
XD Release 28.0.12 (March 2020)
4+
-------------------------------------
5+
XD 28 is a minor update for plugin developers:
6+
7+
* `SceneNode.BLEND_MODE_*` constants for use with the [`SceneNode.blendMode`](./reference/scenegraph.md#SceneNode-blendMode) property (which was introduced in XD 27).
8+
* Quickly look up a scenenode by its GUID with [`scenegraph.getNodeByGUID()`](./reference/scenegraph.md#module_scenegraph-getNodeByGUID).
9+
* Easily check if a scenenode is currently in scope for editing with [`isInEditContext()`](./reference/selection.md#selection-isInEditContext).
10+
11+
### Known Issues
12+
* XD 28 introduces two new types of interaction actions: audio-file playback, and "scroll to" actions. Interactions using these features are not visible to plugins yet (*speech*
13+
playback interactions *are* exposed though). See the [interactions API documentation](./reference/interactions.md#module_interactions-allInteractions) for a complete list of
14+
which interaction types are & aren't exposed to plugins at this time.
15+
16+
[Read more about XD 28 new features for end users on the Adobe blog](https://theblog.adobe.com/xd-march-2020-audio-prototyping-anchor-links-more).
17+
18+
319
XD Release 27.0.12 (February 2020)
420
-------------------------------------
521
XD 27 is a minor update for plugin developers, with one new added API:

known-issues.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- In the past, XD's renderer would fail asserts (possibly even crash) with 0-size objects. I couldn't repro that any more, but unless we're covering it well as an officially supported case, it could easily regress again. There are some other minor bugs though, e.g. sharing fails if you have any 0-width/height artboards and bitmap export fails if any of the top-level items you're trying to export are 0-width/height.
1919
- Longer plugin command names may be truncated in the menu on Windows
2020
- Workaround: keep your plugin command names short!
21-
- Keypress/gamepad, hover, and component state-transition interactions are not returned to plugins yet when requesting the list of interactions on a scenenode or the entire document.
21+
- Some types of interactions are not visible to plugins yet: keypress/gamepad, scrolling, hover, component state transitions, or non-speech audio playback.
2222

2323
## Assets Panel
2424

reference/interactions.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ The `interactions` module and related APIs provide _read only_ information about
1313
* Properties that affect Artboard scrolling behavior: Artboard [`viewportHeight`](./scenegraph.md#Artboard-viewportHeight) and
1414
node [`fixedWhenScrolling`](./scenegraph.md#SceneNode-fixedWhenScrolling).
1515

16-
**Since**: XD 19
16+
> **Tip**
17+
> Interactions are a **fast-changing area** in XD. APIs here have a higher likelihood of becoming deprecated, or lagging behind new XD features, than other parts of XD's plugin APIs.
18+
19+
**Since**: XD 19+ (some APIs added later)
1720

1821
**Example**
1922
```js
@@ -190,7 +193,8 @@ specifies a `triggerNode` and the result of getting [`triggerNode.triggeredInter
190193

191194
May include interactions that are impossible to trigger because the trigger node (or one of its ancestors) has `visible` = false.
192195

193-
Note: currently, this API excludes all of the document's keyboard/gamepad, hover, and component state-transition interactions.
196+
> **Tip**
197+
> Currently, this API excludes some types of interactions: keypress/gamepad, scrolling, hover, component state transitions, or non-speech audio playback.
194198
195199
**Kind**: static property of [<code>interactions</code>](#module_interactions)
196200
**Read only**: true

reference/scenegraph.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ These classes are not scenenode types, but are used extensively in the scenegrap
9292

9393
* [selection](#module_scenegraph-selection) : \![<code>Selection</code>](./selection.md)
9494
* [root](#module_scenegraph-root) : \![<code>RootNode</code>](#RootNode)
95+
* [getNodeByGUID(guid)](#module_scenegraph-getNodeByGUID)`?SceneNode`
9596

9697

9798
* * *
@@ -105,7 +106,6 @@ Object representing the current selection state and [edit context](./core/edit-c
105106
**Read only**: true
106107
**Since**: XD 14
107108

108-
109109
* * *
110110

111111
<a name="module_scenegraph-root"></a>
@@ -117,6 +117,37 @@ Root node of the current document's scenegraph. Also available as the second arg
117117
**Read only**: true
118118
**Since**: XD 14
119119

120+
* * *
121+
122+
<a name="module_scenegraph-getNodeByGUID"></a>
123+
124+
### *scenegraph.getNodeByGUID(guid)*
125+
**Since**: XD 28
126+
127+
Returns the scenenode in this document that has the given [node GUID](#SceneNode-guid). Returns undefined if no such node exists connected
128+
to the scenegraph tree (detached/orphan nodes will not be found). This provides a fast way of persistently remembering a node across plugin
129+
operations and even across document open/closes.
130+
131+
**Kind**: static method of [<code>scenegraph</code>](#module_scenegraph)
132+
**Returns**: `?SceneNode`
133+
134+
| Param | Type | Description |
135+
| ------- | ------- | ------------- |
136+
| guid | string | SceneNode GUID -- must be all lowercase, as returned by the [`guid` getter](#SceneNode-guid). |
137+
138+
**Example**
139+
```js
140+
let node = scenegraph.selection.items[0];
141+
let guid = node.guid;
142+
143+
// ...later on:
144+
let sameNode = scenegraph.getNodeByGUID(guid);
145+
if (sameNode) {
146+
// ^ Always check if node still exists - user may have deleted it
147+
console.log("Found node again!", sameNode);
148+
}
149+
```
150+
120151

121152
* * *
122153

@@ -166,10 +197,14 @@ Base class of all scenegraph nodes. Nodes will always be an instance of some _su
166197
<a name="SceneNode-guid"></a>
167198

168199
### *sceneNode.guid : <code>string</code>*
169-
Returns 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. Cut-Paste will result in a new guid, however.
200+
Returns 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. Cut-Paste will result in a new GUID, however.
201+
202+
The GUID is guaranteed unique _within_ the current document, but _other_ documents may contain the same GUID value. For example, if the user makes a copy of an XD file, both files will use the same GUIDs.
170203

171204
The GUID of the [root node](#module_scenegraph-root) changes if the document is duplicated via Save As. See [`application.activeDocument.guid`](./application.md#module_application-activeDocument) for details.
172205

206+
Node objects can be destroyed and recreated during operations such as Undo/Redo, so if you need to store a reference to a node even between operations in the _same_ session, it's best to store the GUID and then retrieve the node later via [`getNodeByGuid()`](#module_scenegraph-getNodeByGUID).
207+
173208
**Kind**: instance property of [<code>SceneNode</code>](#SceneNode)
174209
**Read only**: true
175210

@@ -267,9 +302,17 @@ Node's opacity setting. The overall visual opacity seen in the document is deter
267302

268303
Blend mode determines how a node is composited onto the content below it.
269304

305+
One of: `SceneNode.BLEND_MODE_PASSTHROUGH`, `BLEND_MODE_NORMAL`, `BLEND_MODE_MULTIPLY`, `BLEND_MODE_DARKEN`, `BLEND_MODE_COLOR_BURN`, `BLEND_MODE_LIGHTEN`, `BLEND_MODE_SCREEN`, `BLEND_MODE_COLOR_DODGE`, `BLEND_MODE_OVERLAY`, `BLEND_MODE_SOFT_LIGHT`,
306+
`BLEND_MODE_HARD_LIGHT`, `BLEND_MODE_DIFFERENCE`, `BLEND_MODE_EXCLUSION`, `BLEND_MODE_HUE`, `BLEND_MODE_SATURATION`, `BLEND_MODE_COLOR`, `BLEND_MODE_LUMINOSITY`.
307+
270308
_Note:_ for leaf nodes (GraphicNode), the XD UI may show leaf nodes as blend mode "Normal" even when the underlying value is `BLEND_MODE_PASSTHROUGH`. This is because "Pass Through" and "Normal" are essentially equivalent for leaf nodes -- they only differ
271309
in appearance when a node has children.
272310

311+
**Example**
312+
```js
313+
node.blendMode = scenegraph.SceneNode.BLEND_MODE_LUMINOSITY;
314+
```
315+
273316
**Kind**: instance property of [<code>SceneNode</code>](#SceneNode)
274317

275318
* * *
@@ -504,7 +547,7 @@ is an [Interaction object](./interactions.md#Interaction) which describes a gest
504547

505548
Note: If this node (or one of its ancestors) has `visible` = false, tap and drag interactions on it will not be triggered.
506549

507-
Currently, this API excludes any keyboard/gamepad, hover, and component state-transition interactions on this node.
550+
Currently, this API excludes some types of interactions: keypress/gamepad, scrolling, hover, component state transitions, or non-speech audio playback.
508551

509552
**Example**
510553
```js

reference/selection.md

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,10 @@ You can also access this object from the [`scenegraph.selection`](./scenegraph.m
4545
* [.itemsIncludingLocked](#selection-itemsIncludingLocked) : <code>!Array&lt;!SceneNode&gt;</code>
4646
* [.hasArtwork](#selection-hasArtwork) : <code>boolean</code>
4747
* [.hasArtboards](#selection-hasArtboards) : <code>boolean</code>
48-
* [.editContext](#selection-editContext) : <code>!SceneNode</code>
4948
* [.insertionParent](#selection-insertionParent) : <code>!SceneNode</code>
5049
* [.focusedArtboard](#selection-focusedArtboard) : <code>?Artboard</code>
50+
* [.editContext](#selection-editContext) : <code>!SceneNode</code>
51+
* [.isInEditContext(node)](#selection-isInEditContext)`boolean`
5152

5253

5354
* * *
@@ -116,6 +117,29 @@ True if the selection isn’t empty and consists of one or more Artboards. Never
116117

117118
* * *
118119

120+
<a name="selection-insertionParent"></a>
121+
122+
### selection.insertionParent : <code>\![SceneNode](scenegraph.md#SceneNode)</code>
123+
The preferred parent to insert newly added content into. Takes into account the current edit context as well as the "focused artboard" if in the root context.
124+
Typically this is the same parent where, for example, XD's shape drawing tools would add items.
125+
126+
_Selected items are not necessarily all immediate children of the `insertionParent`._ They can be anywhere within the [edit context's](/reference/core/edit-context.md) scope.
127+
128+
**Kind**: instance property of [<code>selection</code>](#selection)
129+
**Read only**: true
130+
131+
* * *
132+
133+
<a name="selection-focusedArtboard"></a>
134+
135+
### selection.focusedArtboard : <code>?[Artboard](scenegraph.md#Artboard)</code>
136+
The artboard the user is currently most focused on (via recent selection or edit operations). May be null, for example if no artboards exist or if the user just deleted an artboard.
137+
138+
**Kind**: instance property of [<code>selection</code>](#selection)
139+
**Read only**: true
140+
141+
* * *
142+
119143
<a name="selection-editContext"></a>
120144

121145
### selection.editContext : <code>\![SceneNode](scenegraph.md#SceneNode)</code>
@@ -137,26 +161,18 @@ operation ends:
137161

138162
* * *
139163

140-
<a name="selection-insertionParent"></a>
141-
142-
### selection.insertionParent : <code>\![SceneNode](scenegraph.md#SceneNode)</code>
143-
The preferred parent to insert newly added content into. Takes into account the current edit context as well as the "focused artboard" if in the root context.
144-
Typically this is the same parent where, for example, XD's shape drawing tools would add items.
145-
146-
_Selected items are not necessarily all immediate children of the `insertionParent`._ They can be anywhere within the [edit context's](/reference/core/edit-context.md) scope.
147-
148-
**Kind**: instance property of [<code>selection</code>](#selection)
149-
**Read only**: true
150-
151-
* * *
152-
153-
<a name="selection-focusedArtboard"></a>
164+
<a name="selection-isInEditContext"></a>
154165

155-
### selection.focusedArtboard : <code>?[Artboard](scenegraph.md#Artboard)</code>
156-
The artboard the user is currently most focused on (via recent selection or edit operations). May be null, for example if no artboards exist or if the user just deleted an artboard.
166+
### *selection.isInEditContext(node)*
167+
**Since**: XD 28
157168

158-
**Kind**: instance property of [<code>selection</code>](#selection)
159-
**Read only**: true
169+
Returns true if the node is accessible for editing in the scope of the current edit context.
170+
If false, the node cannot be edited given the user's current selection.
171+
Nodes that are currently selected are always in the current edit context.
160172

161-
* * *
173+
**Kind**: instance method of [<code>selection</code>](#selection)
174+
**Returns**: `boolean`
162175

176+
| Param | Type |
177+
| -------| ------- |
178+
| node | !SceneNode |

0 commit comments

Comments
 (0)