@sdeck/plugin-spotify 0.1.0 → 0.2.0
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/dist/api.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -872
- package/dist/index.js.map +6 -18
- package/package.json +5 -5
- package/src/api.ts +2 -2
- package/src/index.tsx +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdeck/plugin-spotify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Built-in sdeck integration. Spotify: now playing and playback control.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"test": "bun test"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@sdeck/plugin": "^0.
|
|
36
|
-
"@sdeck/schema": "^0.
|
|
35
|
+
"@sdeck/plugin": "^0.2.0",
|
|
36
|
+
"@sdeck/schema": "^0.2.0",
|
|
37
37
|
"react": ">=19.3"
|
|
38
38
|
},
|
|
39
39
|
"peerDependenciesMeta": {
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@sdeck/plugin": "0.
|
|
52
|
-
"@sdeck/schema": "0.
|
|
51
|
+
"@sdeck/plugin": "0.2.0",
|
|
52
|
+
"@sdeck/schema": "0.2.0"
|
|
53
53
|
},
|
|
54
54
|
"repository": {
|
|
55
55
|
"type": "git",
|
package/src/api.ts
CHANGED
|
@@ -60,7 +60,7 @@ export class RateLimited extends Error {
|
|
|
60
60
|
|
|
61
61
|
/** Not signed in: there is nothing to retry until the user signs in. */
|
|
62
62
|
export class SignedOut extends Error {
|
|
63
|
-
constructor(message = "Sign in to Spotify from the plugin's
|
|
63
|
+
constructor(message = "Sign in to Spotify from the plugin's settings") {
|
|
64
64
|
super(message);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -131,7 +131,7 @@ export class SpotifyClient {
|
|
|
131
131
|
return page("sdeck is connected to Spotify. You can close this tab.");
|
|
132
132
|
} catch (error) {
|
|
133
133
|
close(error as Error);
|
|
134
|
-
return page("Signing in failed. See the plugin's
|
|
134
|
+
return page("Signing in failed. See the plugin's settings in sdeck.");
|
|
135
135
|
}
|
|
136
136
|
},
|
|
137
137
|
});
|
package/src/index.tsx
CHANGED
|
@@ -209,7 +209,7 @@ const playPause = defineAction({
|
|
|
209
209
|
icon: "play",
|
|
210
210
|
slots: ["key", "sensor"],
|
|
211
211
|
settings: {
|
|
212
|
-
cover: { type: "boolean", label: "Show the cover art", default: true },
|
|
212
|
+
cover: { type: "boolean", label: "Show the cover art", default: true, appearance: true },
|
|
213
213
|
},
|
|
214
214
|
run: async () => {
|
|
215
215
|
const before = (await readPlayer()).playing;
|
|
@@ -292,6 +292,7 @@ const nowPlaying = defineAction({
|
|
|
292
292
|
],
|
|
293
293
|
},
|
|
294
294
|
},
|
|
295
|
+
display: true,
|
|
295
296
|
run: async () => ({ result: await readPlayer() }),
|
|
296
297
|
component: ({ settings, slot, plugin }) => {
|
|
297
298
|
const act = () => {
|
|
@@ -539,7 +540,7 @@ const addToPlaylist = defineAction({
|
|
|
539
540
|
source: "playlists",
|
|
540
541
|
description: "Yours, and ones you collaborate on.",
|
|
541
542
|
},
|
|
542
|
-
text: { type: "text", label: "Text", placeholder: "Shown under the icon" },
|
|
543
|
+
text: { type: "text", label: "Text", placeholder: "Shown under the icon", appearance: true },
|
|
543
544
|
},
|
|
544
545
|
run: async ({ settings }) => {
|
|
545
546
|
if (!settings.playlist) throw new Error("Pick a playlist in the key's settings");
|
|
@@ -588,7 +589,7 @@ const play = defineAction({
|
|
|
588
589
|
default: false,
|
|
589
590
|
visibleIf: { mode: "play" },
|
|
590
591
|
},
|
|
591
|
-
text: { type: "text", label: "Text", placeholder: "Shown under the icon" },
|
|
592
|
+
text: { type: "text", label: "Text", placeholder: "Shown under the icon", appearance: true },
|
|
592
593
|
},
|
|
593
594
|
run: async ({ settings }) => {
|
|
594
595
|
const target = spotifyUri(settings.item);
|
|
@@ -674,7 +675,7 @@ const device = defineAction({
|
|
|
674
675
|
source: "devices",
|
|
675
676
|
description: "Only devices with Spotify open are listed.",
|
|
676
677
|
},
|
|
677
|
-
text: { type: "text", label: "Text", placeholder: "Shown under the icon" },
|
|
678
|
+
text: { type: "text", label: "Text", placeholder: "Shown under the icon", appearance: true },
|
|
678
679
|
},
|
|
679
680
|
run: async ({ settings }) => {
|
|
680
681
|
if (!settings.device) throw new Error("Pick a device in the key's settings");
|
|
@@ -722,7 +723,7 @@ const playlistOptions = async (writable: boolean): Promise<SelectOption[]> =>
|
|
|
722
723
|
export default definePlugin({
|
|
723
724
|
id: "@sdeck/plugin-spotify",
|
|
724
725
|
name: "Spotify",
|
|
725
|
-
version: "0.
|
|
726
|
+
version: "0.2.0",
|
|
726
727
|
namespace: "spotify",
|
|
727
728
|
description:
|
|
728
729
|
"Now playing, playback, Liked Songs, playlists and devices through the Spotify Web API.",
|