@elgato/cli 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/streamdeck.mjs +1 -1
- package/package.json +1 -1
- package/template/.vscode/settings.json +15 -12
- package/template/com.elgato.template.sdPlugin/manifest.json.ejs +1 -0
- package/template/com.elgato.template.sdPlugin/ui/increment-counter.html +19 -0
- package/template/src/actions/increment-counter.ts.ejs +9 -7
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
/*
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
/* JSON schemas */
|
|
3
|
+
"json.schemas": [
|
|
4
|
+
{
|
|
5
|
+
"fileMatch": [
|
|
6
|
+
"**/manifest.json"
|
|
7
|
+
],
|
|
8
|
+
"url": "https://schemas.elgato.com/streamdeck/plugins/manifest.json"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"fileMatch": [
|
|
12
|
+
"**/layouts/*.json"
|
|
13
|
+
],
|
|
14
|
+
"url": "https://schemas.elgato.com/streamdeck/plugins/layout.json"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
14
17
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
|
|
4
|
+
<head lang="en">
|
|
5
|
+
<title>Increment Counter Settings</title>
|
|
6
|
+
<meta charset="utf-8" />
|
|
7
|
+
<script src="https://cdn.jsdelivr.net/gh/geekyeggo/sdpi-components@v3/dist/sdpi-components.js"></script>
|
|
8
|
+
</head>
|
|
9
|
+
|
|
10
|
+
<body>
|
|
11
|
+
<!--
|
|
12
|
+
Learn more about property inspector components at https://sdpi-components.dev/docs/components
|
|
13
|
+
-->
|
|
14
|
+
<sdpi-item label="Increment By">
|
|
15
|
+
<sdpi-range setting="incrementBy" min="1" max="5" step="1" default="1" showlabels></sdpi-range>
|
|
16
|
+
</sdpi-item>
|
|
17
|
+
</body>
|
|
18
|
+
|
|
19
|
+
</html>
|
|
@@ -6,7 +6,7 @@ import { action, KeyDownEvent, SingletonAction, WillAppearEvent } from "@elgato/
|
|
|
6
6
|
@action({ UUID: "<%- uuid %>.increment" })
|
|
7
7
|
export class IncrementCounter extends SingletonAction<CounterSettings> {
|
|
8
8
|
/**
|
|
9
|
-
* The {@link SingletonAction.onWillAppear} event is useful for setting the visual representation of an action when it
|
|
9
|
+
* The {@link SingletonAction.onWillAppear} event is useful for setting the visual representation of an action when it becomes visible. This could be due to the Stream Deck first
|
|
10
10
|
* starting up, or the user navigating between pages / folders etc.. There is also an inverse of this event in the form of {@link streamDeck.client.onWillDisappear}. In this example,
|
|
11
11
|
* we're setting the title to the "count" that is incremented in {@link IncrementCounter.onKeyDown}.
|
|
12
12
|
*/
|
|
@@ -21,13 +21,14 @@ export class IncrementCounter extends SingletonAction<CounterSettings> {
|
|
|
21
21
|
* settings using `setSettings` and `getSettings`.
|
|
22
22
|
*/
|
|
23
23
|
async onKeyDown(ev: KeyDownEvent<CounterSettings>): Promise<void> {
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
// Update the count from the settings.
|
|
25
|
+
const { settings } = ev.payload;
|
|
26
|
+
settings.incrementBy ??= 1;
|
|
27
|
+
settings.count = (settings.count ?? 0) + settings.incrementBy;
|
|
27
28
|
|
|
28
29
|
// Update the current count in the action's settings, and change the title.
|
|
29
|
-
await ev.action.setSettings(
|
|
30
|
-
await ev.action.setTitle(`${count}`);
|
|
30
|
+
await ev.action.setSettings(settings);
|
|
31
|
+
await ev.action.setTitle(`${settings.count}`);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -35,5 +36,6 @@ export class IncrementCounter extends SingletonAction<CounterSettings> {
|
|
|
35
36
|
* Settings for {@link IncrementCounter}.
|
|
36
37
|
*/
|
|
37
38
|
type CounterSettings = {
|
|
38
|
-
count
|
|
39
|
+
count?: number;
|
|
40
|
+
incrementBy?: number;
|
|
39
41
|
};
|