Skip to content

Commit c8ea9bc

Browse files
Plugin Working
1 parent 62e66ef commit c8ea9bc

File tree

7 files changed

+64
-64
lines changed

7 files changed

+64
-64
lines changed

ui-vue-starter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"clean-webpack-plugin": "^2.0.2",
1717
"copy-webpack-plugin": "^5.0.3",
1818
"css-loader": "^5.2.0",
19-
"style-loader": "^2.0.0",
2019
"file-loader": "^5.1.0",
2120
"nodemon": "^2.0.7",
21+
"style-loader": "^2.0.0",
2222
"vue-loader": "^15.9.6",
2323
"webpack": "^4.32.2",
24-
"webpack-cli": "^4.5.0"
24+
"webpack-cli": "^4.6.0"
2525
},
2626
"dependencies": {
2727
"vue": "^2.6.12",

ui-vue-starter/plugin/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<script src="./main.js"></script>
5+
</head>
6+
<style>
7+
div {
8+
margin: auto;
9+
}
10+
</style>
11+
12+
<body>
13+
<div>
14+
<div id="container"></div>
15+
</div>
16+
</body>
17+
</html>
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
{
2-
"manifestVersion": 4,
3-
"id": "com.adobe.ps.starter.vue",
4-
"name": "Hello World",
2+
"id": "com.adobe.uxp.starter.vue",
3+
"name": "UXP Vue Starter Plugin",
54
"version": "1.0.0",
6-
"main": "main.js",
5+
"main": "index.html",
6+
"manifestVersion": 4,
77
"host": {
88
"app": "PS",
99
"minVersion": "22.0.0"
1010
},
1111
"entrypoints": [
12-
{
13-
"type": "command",
14-
"id": "commandFn",
15-
"label": {
16-
"default": "Show A Dialog"
17-
}
18-
},
1912
{
2013
"type": "panel",
21-
"id": "HelloWorld",
14+
"id": "helloworld",
2215
"label": {
2316
"default": "Hello World"
2417
},
@@ -30,18 +23,30 @@
3023
{
3124
"width": 23,
3225
"height": 23,
33-
"path": "icons/dark.png",
26+
"path": "icons/dark-panel.png",
3427
"scale": [1, 2],
35-
"theme": ["darkest", "dark", "medium"]
28+
"theme": ["darkest", "dark", "medium"],
29+
"species": ["chrome"]
3630
},
3731
{
3832
"width": 23,
3933
"height": 23,
40-
"path": "icons/light.png",
34+
"path": "icons/light-panel.png",
4135
"scale": [1, 2],
42-
"theme": ["lightest", "light"]
36+
"theme": ["lightest", "light"],
37+
"species": ["chrome"]
4338
}
4439
]
4540
}
41+
],
42+
"icons": [
43+
{
44+
"width": 48,
45+
"height": 48,
46+
"path": "icons/plugin.png",
47+
"scale": [1, 2],
48+
"theme": ["darkest", "dark", "medium", "lightest", "light", "all"],
49+
"species": ["pluginList"]
50+
}
4651
]
4752
}

ui-vue-starter/src/hello.vue

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,20 @@
11
<template>
2-
<form style="width: 300px;">
3-
<h1>
2+
<form style="padding: 20px;">
3+
<sp-heading>
44
{{ message }}
5-
</h1>
6-
<p>
5+
</sp-heading>
6+
<sp-body>
77
Button has been clicked {{ count }} times.
8-
</p>
9-
<footer>
10-
<button uxp-variant="cta" v-on:click="increment">Click me</button>
11-
<button type="submit" uxp-variant="primary" v-on:click="close">Done</button>
12-
</footer>
8+
</sp-body>
9+
<sp-button v-on:click="increment">Click me</sp-button>
1310
</form>
1411
</template>
1512

1613
<script>
1714
module.exports = {
18-
props: {
19-
dialog: {
20-
type: Object
21-
}
22-
},
2315
methods: {
2416
increment() {
2517
this.count++;
26-
},
27-
close() {
28-
this.dialog.close();
2918
}
3019
},
3120
data() {
@@ -36,4 +25,4 @@
3625
}
3726
}
3827
}
39-
</script>
28+
</script>

ui-vue-starter/src/main.js

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
1-
const styles = require("./styles.css");
2-
const Vue = require("vue").default;
3-
const hello = require("./hello.vue").default;
1+
import Vue from "vue";
2+
import hello from "./hello.vue";
43

5-
let dialog;
6-
function getDialog() {
7-
if (dialog == null) {
8-
document.body.innerHTML = `<dialog><div id="container"></div></dialog>`;
9-
dialog = document.querySelector("dialog");
10-
var app4 = new Vue({
11-
el: "#container",
12-
components: { hello },
13-
render(h) {
14-
return h(hello, { props: { dialog } });
15-
},
16-
});
17-
}
18-
return dialog;
19-
}
4+
const { entrypoints } = require("uxp");
205

21-
module.exports = {
22-
commands: {
23-
menuCommand: function() {
24-
getDialog().showModal();
6+
entrypoints.setup({
7+
panels: {
8+
helloworld: {
9+
show(event) {
10+
var app4 = new Vue({
11+
el: "#container",
12+
components: { hello },
13+
render(h) {
14+
return h(hello);
15+
},
16+
});
17+
},
2518
},
2619
},
27-
};
20+
});

ui-vue-starter/src/styles.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

ui-vue-starter/webpack.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ module.exports = {
77
output: {
88
path: path.resolve(__dirname, "dist"),
99
filename: "main.js",
10-
libraryTarget: "commonjs2",
1110
},
12-
devtool: "cheap-eval-source-map",
11+
devtool: "cheap-eval-source-map",
1312
externals: {
1413
uxp: "commonjs2 uxp",
1514
photoshop: "commonjs2 photoshop",

0 commit comments

Comments
 (0)