Skip to content

Commit

Permalink
Updated the specs to fit XD 19
Browse files Browse the repository at this point in the history
  • Loading branch information
pklaschka committed May 23, 2019
1 parent bfe0595 commit 648f6e1
Show file tree
Hide file tree
Showing 10 changed files with 181 additions and 107 deletions.
Binary file added Icons.xd
Binary file not shown.
Binary file added dist/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,26 @@
"name": "My plugin",
"version": "0.0.1",
"description": "Description of your plugin.",
"summary": "Summary of your plugin",
"releaseNotes": "Release note",
"keywords": [
],
"languages": [
"en"
],
"website": "https://mywebsite.com",
"author": "Your Name",
"helpUrl": "https://mywebsite.com/help",
"icons": [
{ "width": 24, "height": 24, "path": "icons/[email protected]" },
{ "width": 48, "height": 48, "path": "icons/[email protected]" },
{ "width": 96, "height": 96, "path": "icons/[email protected]" },
{ "width": 144, "height": 144, "path": "icons/[email protected]" },
{ "width": 192, "height": 192, "path": "icons/[email protected]" }
],
"host": {
"app": "XD",
"minVersion": "13.0.0"
"minVersion": "19.0"
},
"uiEntryPoints": [
{
Expand Down
105 changes: 0 additions & 105 deletions types/cloud.ts

This file was deleted.

98 changes: 98 additions & 0 deletions types/interactions.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
import {Artboard, SceneNode} from "./scenegraph";

/**
* The `interactions` module represents all document interactions.
*
* **Since:** XD 19
*
* @example ```javascript
* // Get the home Artboard
const home = interactions.homeArtboard;
console.log(`Home artboard name: ${home.name} guid: ${home.guid}`);
// Get all of the document interactions
const allInter = interactions.allInteractions;
allInter.forEach(inter => {
console.log(`triggerNode guid: ${inter.triggerNode.guid}`);
console.log(`triggerNode Name: ${inter.triggerNode.name}`);
console.log(JSON.stringify(inter.interactions, null, 2));
})
```
*/
declare class interactions {
/**
* The home artboard of the interaction model. This is a special designation indicating this is the first artboard to display in a shared prototype.
*/
public static readonly homeArtboard?: Artboard;

/**
* Get all interactions by serializing the document interactions to JSON. An array of all the interactions is returned.
*/
public static readonly allInteractions: Array<{ triggerNode: SceneNode, interactions: Array<InteractionData> }>;
}

/**
* @example ```javascript
* {
trigger: {
type: 'tap'
},
action: {
type: 'goToArtboard',
destination:
Artboard ('iPhone 6/7/8') {
width: 375, height: 667
global X,Y: 1040, -14
parent: RootNode
children: [Group, Group, Group]
fill: ffffffff
},
preserveScrollPosition: false,
transition: [transitionData]
}
}
* ```
*/
type InteractionData = {
trigger: {
/**
* Possible values: `tap`, `voice`, `time`, `drag`
*/
type: 'tap' | 'voice' | 'time' | 'drag'
}

action: {
/**
* Possible values: `goToArtboard`, `overlay`, `speak`, `goBack`
*/
type: 'goToArtboard' | 'overlay' | 'speak' | 'goBack';
/**
* The destination scenegraph node
*/
destination: SceneNode;

/**
* Fixed scroll position indicator
*/
preserveScrollPosition: boolean;

/**
* Data about transitions triggered by `trigger`
*/
transition: Array<TransitionData>;
}
}

type TransitionData = {
/**
* Possible values: `autoAnimate´, `dissolve`, `push`, `slide`, `none`
*/
type: 'autoAnimate' | 'dissolve' | 'push' | 'slide' | 'none';

/**
* Possible values: `linear`, `ease-in`, `ease-out`, `ease-in-out`, `wind-up`, `bounce`, `snap`
*/
easing: 'linear' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'wind-up' | 'bounce' | 'snap';
}

export = interactions;
68 changes: 67 additions & 1 deletion types/scenegraph.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,49 @@ declare class Path extends GraphicNode {
public pathData: string;
}

/**
* Polygon leaf node shape.
*
* @example ```javascript
*let polygon = new Polygon();
polygon.width = 100;
polygon.height = 25;
polygon.fill = new Color("red");
polygon.cornerCount = 5;
polygon.setAllCornerRadii(10);
selection.insertionParent.addChild(polygon);
selection.items = [polygon];
* ```
*/
declare class Polygon extends GraphicNode {
public width: number;
public height: number;
/**
* Number of vertices of a polygon.
*/
public cornerCount: number;

/**
* True if any of the Polygon's corners is rounded (corner radius > 0).
*/
public readonly hasRoundedCorners: boolean;

/**
* To set all corners to the same value, use setAllCornerRadii.
*
* All numbers must be >= 0
*
* @default [0,0,...,0]
*/
public cornerRadii: number[];

/**
* Set the rounding radius of all corners of the Polygon to the same value.
* @param {number} radius The radius that'll get used for all corners
*/
public setAllCornerRadii(radius: number): void;
}

/**
* BooleanGroup container node - although it has fill/stroke/etc. properties like a leaf shape node, it is a container with children. Its visual appearance is determined by generating a path via a nondestructive boolean operation on all its children’s paths.
*
Expand Down Expand Up @@ -980,6 +1023,23 @@ declare class Text extends GraphicNode {
* Always false for point text. For area text, true if the text does not fit in the content box and its bottom is being clipped.
*/
public readonly clippedByArea: boolean;

/**
* **Since:** XD 19
*
* Set strikethrough across all style ranges, or get the strikethrough of the last style range (strikethrough of all the text if one range covers all the text).
* @default false
*/
public strikethrough: boolean;

/**
* **Since:** XD 19
*
* Set textTransform ("none" or "uppercase" or "lowercase" or "titlecase") across all style ranges, or get the textTransform of the last style range.
*
* @default 'none'
*/
public textTransform: 'none' | 'uppercase' | 'lowercase' | 'titlecase';
}

/**
Expand Down Expand Up @@ -1035,6 +1095,11 @@ declare class SymbolInstance extends SceneNode {
*/
public readonly symbolId: string;

/**
* Reports if this symbol is a master symbol or not.
*/
public readonly isMaster: boolean;

/**
* Adds a child node to this container node. You can only add leaf nodes this way; to create structured subtrees of content, use commands.
* @param {SceneNode} node Child to add
Expand Down Expand Up @@ -1191,7 +1256,7 @@ declare class RootNode extends SceneNode {
* **Since:** XD 14
* Object representing the current selection state and edit context. Also available as the first argument passed to your plugin command handler function.
*/
const selection: Selection;
const selection: SceneNodeList;

/**
* **Since:** XD 14
Expand All @@ -1208,6 +1273,7 @@ export {
Ellipse,
Line,
Path,
Polygon,
BooleanGroup,
Text,
Group,
Expand Down

0 comments on commit 648f6e1

Please sign in to comment.