Part 1: Understanding plugin basics
Part 2: Creating a "button frame" plugin
- Adobe XD API Reference
- Finished code from this part
function example1<T>(x: any): asserts x is T { } | |
function example2<T>(x: any): x is T { return true; } |
Part 1: Understanding plugin basics
Part 2: Creating a "button frame" plugin
Part 1: Understanding plugin basics
Part 2: Creating a "button frame" plugin
/* | |
* Sample plugin code for Adobe XD. | |
* | |
* Visit http://adobexdplatform.com/ for API docs and more sample code. | |
*/ | |
var {Rectangle, Color} = require("scenegraph"); | |
var dialog; |
/* | |
* Sample plugin code for Adobe XD. | |
* | |
* Visit http://adobexdplatform.com/ for API docs and more sample code. | |
*/ | |
var {Rectangle, Color} = require("scenegraph"); | |
function createRectangle(selection) { | |
var textNode = selection.items[0]; |
var fs = require("uxp").storage.localFileSystem; | |
function loadStyleguideFile(selection) { | |
return fs.getFileForOpening() | |
.then(function (file) { | |
console.log("User chose file: " + file); | |
return file.read(); | |
}) | |
.then(function (text) { | |
var json = JSON.parse(text); |
var dialog; | |
function createDialog() { | |
dialog = document.createElement("dialog"); | |
dialog.innerHTML = ` | |
<form method="dialog"> | |
<h1>Hello, world!</h1> | |
<hr> | |
<footer> | |
<!-- Ok button is special: it will automatically close the dialog for us --> |
/* | |
* Sample plugin code for Adobe XD. | |
* | |
* Visit http://adobexdplatform.com/ for API docs and more sample code. | |
*/ | |
var {Rectangle, Color} = require("scenegraph"); | |
function createRectangle(selection) { | |
// Insert a red square in the current artboard or group/container |
diff --git a/Base.lproj/Main.storyboard b/Base.lproj/Main.storyboard | |
index 5344907..1f78691 100644 | |
--- a/Base.lproj/Main.storyboard | |
+++ b/Base.lproj/Main.storyboard | |
@@ -1,7 +1,7 @@ | |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
-<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="9060" systemVersion="14F1021" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS"> | |
+<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS"> | |
<dependencies> | |
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9060"/> |
// If "const" is to the LEFT of "*" it applies to the object being pointed at | |
// If "const" is to the RIGHT of "*" it applies to the variable holding the pointer address | |
const T* ptr; // object is immutable | |
T const* ptr; // " | |
T* const ptr; // 'ptr' cannot be changed to point to a different address, but object is not immutable | |
// (i.e. the variable is const, not the thing it points to) | |
const T* const ptr; // object is immutable AND 'ptr' cannot be changed to point to a different address |