@spicetify/kit 0.3.0 → 0.3.1

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.
@@ -3,7 +3,7 @@
3
3
  "kind": "lib",
4
4
  "hidden": true,
5
5
  "preview": "./assets/PREVIEW.png",
6
- "version": "1.10.1",
6
+ "version": "1.10.4",
7
7
  "compat": ["0.3.0"],
8
8
  "authors": ["spicetify", "Delusoire"],
9
9
  "description": "The standard library",
@@ -25,6 +25,7 @@ export interface PopupModalCompatibility {
25
25
  }
26
26
 
27
27
  export interface DaemonCapabilities {
28
+ acquireWindowControls?(onDisconnect: (error: Error) => void): Promise<{ release(): Promise<void> }>;
28
29
  available(): Promise<boolean>;
29
30
  apply(): Promise<unknown>;
30
31
  blockUpdates(): Promise<unknown>;
@@ -5,11 +5,10 @@
5
5
 
6
6
  import { React } from "../expose/React.ts";
7
7
  import { createIconComponent } from "../createIconComponent.tsx";
8
- import { transformer } from "../../mixin.ts";
9
8
  import { Platform } from "../expose/Platform.ts";
10
9
  import { warn } from "../logger.ts";
11
10
  import { classnames } from "../webpack/ClassNames.ts";
12
- import { ScrollableContainer, Tooltip } from "../webpack/ReactComponents.ts";
11
+ import { Tooltip } from "../webpack/ReactComponents.ts";
13
12
  import { UI } from "../webpack/ComponentLibrary.ts";
14
13
  import { mountRegistryAnchor } from "./mount.ts";
15
14
  import { Registry } from "./registry.ts";
@@ -29,52 +28,6 @@ export default registry;
29
28
 
30
29
  let refresh: React.DispatchWithoutAction | undefined;
31
30
 
32
- declare global {
33
- var __renderNavLinks: () => React.ReactNode;
34
- }
35
-
36
- globalThis.__renderNavLinks = () =>
37
- React.createElement(() => {
38
- [, refresh] = React.useReducer((n) => n + 1, 0);
39
-
40
- if (!ScrollableContainer) {
41
- return;
42
- }
43
-
44
- return (
45
- <ScrollableContainer className="custom-navlinks-scrollable_container" onlyHorizontalWheel>
46
- {registry.all()}
47
- </ScrollableContainer>
48
- );
49
- });
50
- transformer(
51
- (emit) => (str) => {
52
- emit();
53
-
54
- str = str.replace(
55
- /{(?=[^{}]*(?:{[^{}]*(?:{[^{}]*(?:{[^{}]*}[^{}]*)*}[^{}]*)*}[^{}]*)*(?<=[,{])"data-testid":"global-nav-bar")([^{}]*(?:{[^{}]*(?:{[^{}]*(?:{[^{}]*}[^{}]*)*}[^{}]*)*}[^{}]*)*(?<=[,{]))children:([^{}]*(?:{[^{}]*(?:{[^{}]*(?:{[^{}]*}[^{}]*)*}[^{}]*)*}[^{}]*)*)(,[^{}]*(?:{[^{}]*(?:{[^{}]*(?:{[^{}]*}[^{}]*)*}[^{}]*)*}[^{}]*)*|)}/,
56
- "{$1children:(function(children){const p=children[0].props;p.children=[p.children,__renderNavLinks()].flat();return children})($2)$3}",
57
- );
58
-
59
- return str;
60
- },
61
- {
62
- glob: /^\/xpui\.js/,
63
- },
64
- );
65
- transformer(
66
- (emit) => (str) => {
67
- emit();
68
-
69
- str = str.replace('["","/","/home/",', '["","/","/home/","/bespoke/*",');
70
-
71
- return str;
72
- },
73
- {
74
- glob: /^\/dwp\-top\-bar\.js/,
75
- },
76
- );
77
-
78
31
  mountRegistryAnchor({
79
32
  className: "spicetify-navlinks-anchor",
80
33
  registry,
@@ -88,8 +41,8 @@ mountRegistryAnchor({
88
41
  // A real flex box, not the default display:contents. The history-buttons
89
42
  // wrapper spaces its children with a wide gap meant to separate button
90
43
  // groups; as one box the anchor takes that gap once (separating our links
91
- // from the back/forward group), while the nav links inside space
92
- // themselves with the client's own 8px navlink margins.
44
+ // from the back/forward group), while the nav links inside are spaced by
45
+ // the anchor's own gap (stdlib index.scss).
93
46
  hostDisplay: "flex",
94
47
  });
95
48
 
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { React } from "../expose/React.ts";
7
7
  import { createIconComponent } from "../createIconComponent.tsx";
8
- import { transformer } from "../../mixin.ts";
9
8
  import { Tooltip } from "../webpack/ReactComponents.ts";
10
9
  import { UI } from "../webpack/ComponentLibrary.ts";
11
10
  import { classnames } from "../webpack/ClassNames.ts";
@@ -27,24 +26,6 @@ export default registry;
27
26
 
28
27
  let refresh: React.DispatchWithoutAction | undefined;
29
28
 
30
- declare global {
31
- var __renderPlaybarBarControls: any;
32
- }
33
-
34
- globalThis.__renderPlaybarBarControls = () => registry.all().reverse();
35
- transformer(
36
- (emit) => (str) => {
37
- emit();
38
-
39
- str = str.replace(/(children:\[)([^\[]*djJumpButtonFactory)/, "$1...__renderPlaybarBarControls(),$2");
40
-
41
- return str;
42
- },
43
- {
44
- glob: /^\/xpui\.js/,
45
- },
46
- );
47
-
48
29
  mountRegistryAnchor({
49
30
  className: "spicetify-playbar-buttons",
50
31
  registry,
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { React } from "../expose/React.ts";
7
7
  import { createIconComponent } from "../createIconComponent.tsx";
8
- import { transformer } from "../../mixin.ts";
9
8
  import { Tooltip } from "../webpack/ReactComponents.ts";
10
9
  import { UI } from "../webpack/ComponentLibrary.ts";
11
10
  import { mountRegistryAnchor } from "./mount.ts";
@@ -26,24 +25,6 @@ export default registry;
26
25
 
27
26
  let refresh: React.DispatchWithoutAction | undefined;
28
27
 
29
- declare global {
30
- var __renderNowPlayingWidgets: any;
31
- }
32
-
33
- globalThis.__renderNowPlayingWidgets = () => registry.all();
34
- transformer(
35
- (emit) => (str) => {
36
- emit();
37
-
38
- str = str.replace(/(hideButtonFactory[^\]]*)/, "$1,...__renderNowPlayingWidgets()");
39
-
40
- return str;
41
- },
42
- {
43
- glob: /^\/xpui\.js/,
44
- },
45
- );
46
-
47
28
  mountRegistryAnchor({
48
29
  className: "spicetify-playbar-widgets",
49
30
  registry,
@@ -3,7 +3,6 @@
3
3
  * SPDX-License-Identifier: GPL-3.0-or-later
4
4
  */
5
5
 
6
- import { transformer } from "../../mixin.ts";
7
6
  import { Platform } from "../expose/Platform.ts";
8
7
  import { React } from "../expose/React.ts";
9
8
  import { mountRegistryAnchor } from "./mount.ts";
@@ -25,28 +24,7 @@ export default registry;
25
24
  let refresh: (() => void) | undefined;
26
25
  let historyHooked = false;
27
26
 
28
- declare global {
29
- var __renderRoutes: any;
30
- }
31
-
32
- globalThis.__renderRoutes = () => registry.all();
33
- transformer(
34
- (emit) => (str) => {
35
- emit();
36
-
37
- str = str.replace(
38
- /(\(0,[a-zA-Z_$][\w$]*\.jsx\)\([a-zA-Z_$][\w$]*\.[a-zA-Z_$][\w$]*,\{[^{]*path:"\/search\/\*")/,
39
- "...__renderRoutes(),$1",
40
- );
41
-
42
- return str;
43
- },
44
- {
45
- glob: /^\/xpui\.js/,
46
- },
47
- );
48
-
49
- // Transform-free path: the client router never learns module routes, so a
27
+ // The client router never learns module routes, so a
50
28
  // history-driven overlay covers the main view whenever the current path
51
29
  // matches a registered <Route>. The client renders its own not-found page
52
30
  // underneath; back/forward keep working because only real history is used.
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { React } from "../expose/React.ts";
7
7
  import { createIconComponent } from "../createIconComponent.tsx";
8
- import { transformer } from "../../mixin.ts";
9
8
  import { Tooltip } from "../webpack/ReactComponents.ts";
10
9
  import { UI } from "../webpack/ComponentLibrary.ts";
11
10
  import { mountRegistryAnchor } from "./mount.ts";
@@ -26,29 +25,6 @@ export default registry;
26
25
 
27
26
  let refresh: React.DispatchWithoutAction | undefined;
28
27
 
29
- declare global {
30
- var __renderTopbarLeftButtons: () => React.ReactNode;
31
- }
32
-
33
- globalThis.__renderTopbarLeftButtons = () =>
34
- React.createElement(() => {
35
- [, refresh] = React.useReducer((n) => n + 1, 0);
36
-
37
- return <>{registry.all()}</>;
38
- });
39
- transformer(
40
- (emit) => (str) => {
41
- emit();
42
-
43
- str = str.replace(/("top-bar-forward-button"[^\]]*)/g, "$1,__renderTopbarLeftButtons()");
44
-
45
- return str;
46
- },
47
- {
48
- glob: /^\/xpui\.js/,
49
- },
50
- );
51
-
52
28
  mountRegistryAnchor({
53
29
  className: "spicetify-topbar-left-buttons",
54
30
  registry,
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { React } from "../expose/React.ts";
7
7
  import { createIconComponent } from "../createIconComponent.tsx";
8
- import { transformer } from "../../mixin.ts";
9
8
  import { Tooltip } from "../webpack/ReactComponents.ts";
10
9
  import { UI } from "../webpack/ComponentLibrary.ts";
11
10
  import { mountRegistryAnchor } from "./mount.ts";
@@ -26,29 +25,6 @@ export default registry;
26
25
 
27
26
  let refresh: React.DispatchWithoutAction | undefined;
28
27
 
29
- declare global {
30
- var __renderTopbarRightButtons: () => React.ReactNode;
31
- }
32
-
33
- globalThis.__renderTopbarRightButtons = () =>
34
- React.createElement(() => {
35
- [, refresh] = React.useReducer((n) => n + 1, 0);
36
-
37
- return <>{registry.all().reverse()}</>;
38
- });
39
- transformer(
40
- (emit) => (str) => {
41
- emit();
42
-
43
- str = str.replace(/("login-button"[^\}]*\}[^\}]*\}[^\}]*\}\))/, "$1,__renderTopbarRightButtons()");
44
-
45
- return str;
46
- },
47
- {
48
- glob: /^\/xpui\.js/,
49
- },
50
- );
51
-
52
28
  mountRegistryAnchor({
53
29
  className: "spicetify-topbar-right-buttons",
54
30
  registry,
@@ -1,109 +0,0 @@
1
- {
2
- "main": {
3
- "topbar": {
4
- "wrapper": "NXttmW3KPwE1r4Am",
5
- "left": {
6
- "button": {
7
- "wrapper": "kUHE42xvQVzWqabl",
8
- "icon": {
9
- "wrapper": "IYDlXmBmmUKHveMzIPCF"
10
- }
11
- },
12
- "button_t": {
13
- "wrapper": "_Bg_zSvFrEutyacG"
14
- }
15
- },
16
- "right": {
17
- "button": {
18
- "wrapper": "kUHE42xvQVzWqabl"
19
- },
20
- "button_t": {
21
- "wrapper": "sXjzYBob5Y4psogB"
22
- },
23
- "upgrade_button": {
24
- "wrapper": "Upqw01TOXETOmR5Td7Dj"
25
- }
26
- }
27
- },
28
- "playbar": {
29
- "widget": {},
30
- "controls": {},
31
- "buttons": {
32
- "button": {
33
- "wrapper": "_EuXSrqTA94N1Evn",
34
- "wrapper__active": "v1kNYVvW5P8Wa4jS",
35
- "wrapper__indicator": "EHxL6K_6WWDlTCZP6x5w"
36
- }
37
- }
38
- },
39
- "navbar": {
40
- "link": {
41
- "wrapper": "kUHE42xvQVzWqabl",
42
- "container": "kUHE42xvQVzWqabl",
43
- "container__active": "kUHE42xvQVzWqabl"
44
- }
45
- },
46
- "global_navbar": {},
47
- "sidebar": {},
48
- "panel": {}
49
- },
50
- "tracklist": {
51
- "column_header": "F_VvNCRKZ2cKj1a9"
52
- },
53
- "search_chips": {
54
- "wrapper_wrapper": "qZHfdckfFVY5AURF",
55
- "wrapper": "x_HLN829yDsvJDgl",
56
- "container": "dxlv5wfAu8zgm7HY",
57
- "chip": "U4idT8HUFwfj7PWP"
58
- },
59
- "modal": {
60
- "widget_generator": {
61
- "container": "gx9qsprOAO4ubEFc",
62
- "header": {
63
- "container": "g9sFYudWkUldbuNa",
64
- "close": "Pk4GI8WfBMjS5R2J"
65
- },
66
- "content": {
67
- "container": "ywtSYUL2xRwVlvSo"
68
- }
69
- },
70
- "track_credits": {
71
- "container": "p5LJBmlswjcRT458",
72
- "header": {
73
- "container": "idsrX6VAUY49Eczw",
74
- "close": "_18qFNPzv7Eyyck8"
75
- },
76
- "content": {
77
- "container": "yKG9lWaUWIBUyVCu"
78
- }
79
- }
80
- },
81
- "settings": {
82
- "header": {
83
- "container": "fEEfljGMIEhhmWVi"
84
- },
85
- "section": {
86
- "container": "nWR7PbHjFXQJiYNL"
87
- },
88
- "button": {
89
- "wrapper": "nHgEqWYM1q0omZ6y"
90
- },
91
- "text_input": "e-10451-form-input e-10451-form-control encore-text-body-medium"
92
- },
93
- "scrollable_text": {
94
- "container": "MyaStf5D5Im3gt9M",
95
- "wrapper": "dxlv5wfAu8zgm7HY"
96
- },
97
- "sort_box": {
98
- "list": {
99
- "button": "LQ6y2jhZZtMS7xCr"
100
- }
101
- },
102
- "search_box": {
103
- "container": "S0nU7XTXYMOBcASz",
104
- "expand_button": "eu6ObgEHE5owtzi_"
105
- },
106
- "context_menu": {
107
- "menu_item": "yqG4N5YYcY4uEujt"
108
- }
109
- }