Skip to content

Commit

Permalink
Merge branch 'spicetify:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Lseoksee authored Sep 28, 2024
2 parents 6e5c1f6 + 8e1926d commit 95c4ecd
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 35 deletions.
20 changes: 11 additions & 9 deletions CustomApps/lyrics-plus/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@

.lyrics-lyricsContainer-Loading {
align-self: center;
grid-area: 1/1/-1/-1;
grid-area: 1 / 1 / -1 / -1;
}

.lyrics-lyricsContainer-LyricsUnavailablePage {
align-items: center;
color: var(--lyrics-color-inactive);
display: flex;
grid-area: 1/1/-1/-1;
grid-area: 1 / 1 / -1 / -1;
height: 100%;
justify-content: center;
padding: 20px;
Expand All @@ -82,7 +82,7 @@
}

.lyrics-lyricsContainer-UnsyncedLyricsPage {
grid-area: 1/1/-1/-1;
grid-area: 1 / 1 / -1 / -1;
grid-template-rows: 1fr 20px;
user-select: text;
text-align: var(--lyrics-align-text);
Expand All @@ -100,7 +100,7 @@

.lyrics-lyricsContainer-SyncedLyricsPage {
display: grid;
grid-area: 1/1/-1/-1;
grid-area: 1 / 1 / -1 / -1;
grid-template-rows: 1fr 30px;
overflow: hidden;
text-align: var(--lyrics-align-text);
Expand All @@ -110,14 +110,14 @@
.lyrics-lyricsContainer-LyricsBackground {
background-color: var(--lyrics-color-background);
background-image: var(--lyrics-background-noise);
grid-area: 1/1/-1/-1;
grid-area: 1 / 1 / -1 / -1;
transition: background-color 0.25s ease-out;
}

.lyrics-lyricsContainer-Provider {
align-self: end;
color: var(--lyrics-color-inactive);
grid-area: 2/1/-1/-1;
grid-area: 2 / 1 / -1 / -1;
justify-self: stretch;
height: 25px;
overflow: hidden;
Expand All @@ -129,7 +129,7 @@

.lyrics-lyricsContainer-SyncedLyrics {
--lyrics-line-height: calc(4px + var(--lyrics-font-size));
grid-area: 1/1/-2/-1;
grid-area: 1 / 1 / -2 / -1;
height: 0;
}

Expand Down Expand Up @@ -308,11 +308,13 @@ div.lyrics-tabBar-headerItemLink {

.lyrics-lyricsContainer-Karaoke-Word {
color: var(--lyrics-color-inactive);
background-image: linear-gradient(to right,
background-image: linear-gradient(
to right,
var(--lyrics-color-active),
var(--lyrics-color-active) 45%,
var(--lyrics-color-inactive) 55%,
var(--lyrics-color-inactive));
var(--lyrics-color-inactive)
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 225% 100%;
Expand Down
21 changes: 14 additions & 7 deletions CustomApps/new-releases/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,20 @@ async function getArtistList() {
}

async function getArtistEverything(artist) {
const { queryArtistDiscographyAll } = Spicetify.GraphQL.Definitions;
const { data, errors } = await Spicetify.GraphQL.Request(queryArtistDiscographyAll, {
uri: artist.uri,
offset: 0,
// Limit 100 since GraphQL has resource limit
limit: 100,
});
const { data, errors } = await Spicetify.GraphQL.Request(
{
name: "queryArtistDiscographyAll",
operation: "query",
sha256Hash: "9380995a9d4663cbcb5113fef3c6aabf70ae6d407ba61793fd01e2a1dd6929b0",
value: null,
},
{
uri: artist.uri,
offset: 0,
// Limit 100 since GraphQL has resource limit
limit: 100,
}
);
if (errors) throw errors;

const releases = data?.artistUnion.discography.all.items.flatMap((r) => r.releases.items);
Expand Down
8 changes: 2 additions & 6 deletions CustomApps/new-releases/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ option {
width: 28px;
visibility: hidden;
opacity: 0;
transition:
visibility 0s,
opacity 0.3s ease;
transition: visibility 0s, opacity 0.3s ease;
}

.main-card-closeButton:active {
Expand All @@ -167,9 +165,7 @@ option {
.main-card-card:hover .main-card-closeButton {
visibility: visible;
opacity: 1;
transition:
visibility 0s,
opacity 0.3s ease;
transition: visibility 0s, opacity 0.3s ease;
}

.new-releases-header + .main-gridContainer-gridContainer {
Expand Down
23 changes: 18 additions & 5 deletions jsHelper/sidebarConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,26 @@ color: var(--spice-button-disabled);
(async () => {
await new Promise((res) => Spicetify.Events.webpackLoaded.on(res));
if (document.querySelector(".Root__globalNav")) {
Spicetify.showNotification(
"Sidebar config is not supported on global navbar. Please disable it with `spicetify config sidebar_config 0` command.",
false,
7000
);
Spicetify.Snackbar?.enqueueCustomSnackbar("sidebar-config", {
keyPrefix: "sidebar-config",
autoHideDuration: 7500,
children: Spicetify.ReactComponent.Snackbar.wrapper({
children: Spicetify.ReactComponent.Snackbar.simpleLayout({
center: Spicetify.React.createElement("div", {
dangerouslySetInnerHTML: {
__html:
"Sidebar config is not supported when Global Navbar is enabled. In Powershell, please run <code>spicetify config sidebar_config 0</code> command and then re-apply spicetify with <code>spicetify apply</code>.",
},
style: {
"text-size": "12px",
},
}),
}),
}),
});
isGlobalNavbar = true;
}

if (!isGlobalNavbar) {
new Spicetify.Menu.Item(
"사이드바 수정하기",
Expand Down
9 changes: 6 additions & 3 deletions src/apply/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,14 +333,17 @@ func insertNavLink(str string, appNameArray string) string {
}

// Global Navbar <= 1.2.45
globalNavBarMatch := utils.FindMatch(str, `(,[a-zA-Z_\$][\w\$]*===(?:[a-zA-Z_\$][\w\$]*\.){2}HOME_NEXT_TO_NAVIGATION&&.+?)\]`)
utils.ReplaceOnce(&str, `(,[a-zA-Z_\$][\w\$]*===(?:[a-zA-Z_\$][\w\$]*\.){2}HOME_NEXT_TO_NAVIGATION&&.+?)\]`, func(submatches ...string) string {
return fmt.Sprintf("%s,Spicetify._renderNavLinks([%s], true)]", submatches[1], appNameArray)
})

// Global Navbar >= 1.2.46
utils.ReplaceOnce(&str, `("global-nav-bar".*?)(\(0,\s*[a-zA-Z_\$][\w\$]*\.jsx\))(\(\s*\w+,\s*\{\s*className:\w*\s*\}\s*\))`, func(submatches ...string) string {
return fmt.Sprintf("%s[%s%s,Spicetify._renderNavLinks([%s], true)].flat()", submatches[1], submatches[2], submatches[3], appNameArray)
})
if len(globalNavBarMatch) == 0 {
utils.ReplaceOnce(&str, `("global-nav-bar".*?)(\(0,\s*[a-zA-Z_\$][\w\$]*\.jsx\))(\(\s*\w+,\s*\{\s*className:\w*\s*\}\s*\))`, func(submatches ...string) string {
return fmt.Sprintf("%s[%s%s,Spicetify._renderNavLinks([%s], true)].flat()", submatches[1], submatches[2], submatches[3], appNameArray)
})
}

return str
}
Expand Down
15 changes: 10 additions & 5 deletions src/preprocess/preprocess.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,20 @@ func exposeAPIs_main(input string) string {
croppedInput := utils.FindFirstMatch(input, `.*value:"contextmenu"`)[0]
react := utils.FindLastMatch(croppedInput, `([a-zA-Z_\$][\w\$]*)\.useRef`)[1]
candicates := utils.FindLastMatch(croppedInput, `\(\{[^}]*menu:([a-zA-Z_\$][\w\$]*),[^}]*trigger:([a-zA-Z_\$][\w\$]*),[^}]*triggerRef:([a-zA-Z_\$][\w\$]*)`)
oldCandicates := utils.FindLastMatch(croppedInput, `([a-zA-Z_\$][\w\$]*)=[\w_$]+\.menu[^}]*,([a-zA-Z_\$][\w\$]*)=[\w_$]+\.trigger[^}]*,([a-zA-Z_\$][\w\$]*)=[\w_$]+\.triggerRef`)
var menu, trigger, target string
if len(candicates) == 0 {
menu = "e.menu"
trigger = "e.trigger"
target = "e.triggerRef"
} else {
if len(oldCandicates) != 0 {
menu = oldCandicates[1]
trigger = oldCandicates[2]
target = oldCandicates[3]
} else if len(candicates) != 0 {
menu = candicates[1]
trigger = candicates[2]
target = candicates[3]
} else {
menu = "e.menu"
trigger = "e.trigger"
target = "e.triggerRef"
}

utils.Replace(&input, `\(0,([\w_$]+)\.jsx\)\([\w_$]+\.[\w_$]+,\{value:"contextmenu"[^\}]+\}\)\}\)`, func(submatches ...string) string {
Expand Down

0 comments on commit 95c4ecd

Please sign in to comment.