Skip to content

Commit 8a36f2d

Browse files
committed
XD 25 changelog and docs polish
1 parent 47057eb commit 8a36f2d

File tree

3 files changed

+24
-9
lines changed

3 files changed

+24
-9
lines changed

changes.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
XD Release 25.1.12 (December 2019)
4+
-------------------------------------
5+
6+
XD 25 is a minor bug-fix release with no new features for end users. But it adds two small improvements for plugins:
7+
8+
* New [`application.activeDocument` API](./reference/application.md#module_application-activeDocument) providing information about the document.
9+
* Fixed bug where `scenegraph.root.guid` did not return a valid guid; it now returns the same value as `application.activeDocument.guid`.
10+
11+
312
XD Release 24.0.22 (November 2019)
413
-------------------------------------
514

@@ -71,7 +80,7 @@ After a stabilization period, plugins using panel UI are now published in the Pl
7180
### Fixes and improvements
7281

7382
* Fixed bugs related to `editDocument()` usage (also fixed in XD 21.1.12).
74-
* PUT/POST requests on Windows were including an unwanted `Transfer-Encoding` header, which interfered with uploading data to services like Amazon S3.
83+
* PUT/POST requests on Windows were including an unwanted `Transfer-Encoding` header, which interfered with uploading data to services like Amazon S3 (e.g. giving you errors related to `Content-Length`).
7584
* Plugins can now copy text to the clipboard in response to a panel UI DOM event without needing to call `editDocument()`.
7685

7786

reference/application.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -186,22 +186,26 @@ console.log("OS locale:", application.systemLocale); // e.g. "en_US"
186186

187187
### *application.activeDocument : <code>DocumentInfo</code>*
188188

189-
Represents the active document. Provides the document guid and current saved name.
189+
Information about the document which this instance of the plugin is attached to.
190+
191+
> **Tip**
192+
> _This does **not** indicate the frontmost "active" document window in the XD application._
193+
> In XD, each document window [loads a separate copy of your plugin](./core/lifecycle.md#plugin-loading). When a given instance of your plugin calls this API, you will always receive information about the document that this instance of the plugin is attached to, even if it's not the active window.
190194
191195
**Kind**: static property of [<code>application</code>](#module_application)
192196
**Read only**: true
193197

194198
**Typedef DocumentInfo**
195199

196-
| Property | Type | Description |
197-
| ---------- | ----------------- | ---------------------------------------------------|
198-
| name | string | Document name as displayed in the document window. |
199-
| guid | string | Unique document identifier that does not change. |
200+
| Property | Type | Description |
201+
| ---------- | ---------- | --------------------------------------------------- |
202+
| name | string | Document name as displayed in the titlebar. For untitled documents, this will be a localized string such as "Untitled-1." |
203+
| guid | string | *Semi*-unique document identifier. Duplicating an .xd file on disk will result in two files with the same GUID. Duplicating a document via "Save As" will change its GUID; thus two *cloud* documents will never have the same GUID. The GUID of an Untitled document doesn't change when it is saved for the first time. <br><br>This returns the same value as `scenegraph.root.guid`. |
200204

201205
**Example**
202206
```js
203-
var application = require("application");
207+
let application = require("application");
204208
let documentInfo = application.activeDocument;
205-
console.log(Document title: + documentInfo.name);
206-
console.log(Document unique Id: + documentInfo.guid);
209+
console.log("Document title: " + documentInfo.name);
210+
console.log("Document ID: " + documentInfo.guid);
207211
```

reference/scenegraph.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ Base class of all scenegraph nodes. Nodes will always be an instance of some _su
167167
### *sceneNode.guid : <code>string</code>*
168168
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.
169169

170+
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.
171+
170172
**Kind**: instance property of [<code>SceneNode</code>](#SceneNode)
171173
**Read only**: true
172174

0 commit comments

Comments
 (0)