Skip to content

Commit cec6aa0

Browse files
committed
Added cross-compatible sample
1 parent 4cfcbe7 commit cec6aa0

File tree

13 files changed

+2957
-0
lines changed

13 files changed

+2957
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "com.adobe.cross-compatible-js-sample",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"watch": "webpack -w --mode development",
7+
"build": "webpack --mode development",
8+
"build-ps": "yarn build --env=mode=PS",
9+
"build-xd": "yarn build --env=mode=XD"
10+
},
11+
"devDependencies": {
12+
"@babel/core": "^7.14.6",
13+
"@babel/preset-env": "^7.14.7",
14+
"babel-loader": "^8.2.2",
15+
"copy-webpack-plugin": "^9.0.1",
16+
"css-loader": "^5.2.6",
17+
"html-webpack-plugin": "^5.3.2",
18+
"json-post-process-webpack-plugin": "^2.0.4",
19+
"style-loader": "^3.0.0",
20+
"webpack": "^5.44.0",
21+
"webpack-cli": "^4.7.2"
22+
},
23+
"dependencies": {
24+
"@adobe/xd-plugin-toolkit": "^0.0.1"
25+
}
26+
}
452 Bytes
Loading
501 Bytes
Loading
450 Bytes
Loading
558 Bytes
Loading
893 Bytes
Loading
2.48 KB
Loading
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"id": "com.adobe.cross-compatible-js-sample",
3+
"name": "Cross Compatible JS Sample",
4+
"version": "1.0.0",
5+
"host": [
6+
{
7+
"app": "PS",
8+
"minVersion": "22.0.0"
9+
},
10+
{
11+
"app": "XD",
12+
"minVersion": "36.0.0"
13+
}
14+
],
15+
"main": "index.html",
16+
"manifestVersion": 4,
17+
"entrypoints": [
18+
{
19+
"type": "command",
20+
"id": "about",
21+
"label": {
22+
"default": "About"
23+
}
24+
},
25+
{
26+
"type": "panel",
27+
"id": "plugin",
28+
"label": {
29+
"default": "Cross Compatible JS Sample"
30+
},
31+
"minimumSize": {
32+
"width": 230,
33+
"height": 200
34+
},
35+
"maximumSize": {
36+
"width": 2000,
37+
"height": 2000
38+
},
39+
"preferredDockedSize": {
40+
"width": 350,
41+
"height": 275
42+
},
43+
"preferredFloatingSize": {
44+
"width": 350,
45+
"height": 275
46+
},
47+
"icons": [
48+
{
49+
"width": 23,
50+
"height": 23,
51+
"path": "icons/dark.png",
52+
"scale": [1, 2],
53+
"theme": ["darkest", "dark", "medium"]
54+
},
55+
{
56+
"width": 23,
57+
"height": 23,
58+
"path": "icons/light.png",
59+
"scale": [1, 2],
60+
"theme": ["lightest", "light"]
61+
}
62+
]
63+
}
64+
],
65+
"icons": [
66+
{
67+
"width": 48,
68+
"height": 48,
69+
"path": "icons/plugin.png",
70+
"scale": [1, 2],
71+
"theme": ["dark", "darkest", "medium", "lightest", "light", "all"],
72+
"species": ["pluginList"]
73+
}
74+
]
75+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
html, body {
2+
margin: 0;
3+
height: 100%;
4+
width: 100%;
5+
background-color: var(--uxp-host-background-color);
6+
color: var(--uxp-host-text-color);
7+
}
8+
9+
.container {
10+
display: flex;
11+
flex-direction: column;
12+
padding: 12px;
13+
}
14+
15+
.help {
16+
position: absolute;
17+
right: 0;
18+
}
19+
20+
.heading {
21+
margin-top: 0;
22+
}
23+
24+
.field {
25+
margin-top: 1em;
26+
padding: 0;
27+
}
28+
29+
.textarea {
30+
width: 100%;
31+
}
32+
33+
.create {
34+
width: 50%;
35+
margin-top: 2em;
36+
align-self: center;
37+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8"/>
5+
<link rel="stylesheet" href="./src/index.css" />
6+
</head>
7+
<body>
8+
<sp-action-button id="aboutBtn" class="help" quiet>
9+
<sp-icon name="ui:HelpSmall" size="s" slot="icon"></sp-icon>
10+
</sp-action-button>
11+
<div class="container">
12+
<sp-heading class="heading" size="M">Cross-Compatible JS Sample</sp-heading>
13+
<sp-detail>Currently running on <span id="app"></span>...</sp-detail>
14+
<div class="container field">
15+
<sp-heading>Enter Text</sp-heading>
16+
<sp-textarea id="textarea" class="textarea" placeholder="This is a label..."></sp-textarea>
17+
<sp-button id="create" class="create">Create Label</sp-button>
18+
</div>
19+
</div>
20+
</body>
21+
</html>

0 commit comments

Comments
 (0)