Skip to content

Commit c77623b

Browse files
rxrisurfbryce
andauthored
fix: adapt regexes for 1.2.35 (#2958)
Co-authored-by: surfbryce <80861823+surfbryce@users.noreply.github.com>
1 parent 6591a1a commit c77623b

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

jsHelper/spicetifyWrapper.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,9 @@ window.Spicetify = {
265265
"StoreProvider",
266266
"PlatformProvider",
267267
"Dropdown",
268-
"MenuSubMenuItem"
268+
"MenuSubMenuItem",
269+
"Navigation",
270+
"ScrollableContainer"
269271
])
270272
},
271273
{
@@ -557,7 +559,12 @@ window.Spicetify = {
557559
m => m.toString().includes("?highlight") && m.toString().includes("headerText") && m.toString().includes("imageContainer")
558560
),
559561
Hero: functionModules.find(m => m?.toString().includes('"herocard-click-handler"')),
560-
CardImage: functionModules.find(m => m.toString().includes("isHero") && m.toString().includes("withWaves")),
562+
CardImage: functionModules.find(
563+
m =>
564+
m.toString().includes("isHero") &&
565+
(m.toString().includes("withWaves") || m.toString().includes("isCircular")) &&
566+
m.toString().includes("imageWrapper")
567+
),
561568
...Object.fromEntries(cards)
562569
},
563570
Router: functionModules.find(m => m.toString().includes("navigationType") && m.toString().includes("static")),
@@ -1038,7 +1045,7 @@ Spicetify._getStyledClassName = (args, component) => {
10381045

10391046
Spicetify.getFontStyle = font => {
10401047
if (!font || !Spicetify._fontStyle) return;
1041-
let rawStyle = Spicetify._fontStyle({ variant: font })
1048+
let rawStyle = Spicetify._fontStyle({ variant: font, $variant: font })
10421049
.filter(style => typeof style === "string")
10431050
.join("");
10441051
// Clean up empty rulesets

src/apply/apply.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ func getColorCSS(scheme map[string]string) string {
219219
func insertCustomApp(jsPath string, flags Flag) {
220220
utils.ModifyFile(jsPath, func(content string) string {
221221
const REACT_REGEX = `([\w_\$][\w_\$\d]*(?:\(\))?)\.lazy\(\((?:\(\)=>|function\(\)\{return )(\w+)\.(\w+)\(\d+\)\.then\(\w+\.bind\(\w+,\d+\)\)\}?\)\)`
222-
const REACT_ELEMENT_REGEX = `(\[\w_\$][\w_\$\d]*(?:\(\))?\.createElement|\([\w$\.,]+\))\(([\w\.]+),\{path:"\/collection"(?:,(element|children)?[:.\w,{}()/*"]+)?\}`
222+
const REACT_ELEMENT_REGEX = `(\[\w_\$][\w_\$\d]*(?:\(\))?\.createElement|\([\w$\.,]+\))\(([\w\.]+),\{path:"\/collection"(?:,(element|children)?[:.\w,{}()$/*"]+)?\}`
223223
reactSymbs := utils.FindSymbol(
224224
"Custom app React symbols",
225225
content,

src/preprocess/preprocess.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ func exposeAPIs_vendor(input string) string {
611611

612612
utils.ReplaceOnce(
613613
&input,
614-
`\(function\(\w+\)\{return \w+\.variant\?function\(\w+\)\{`,
614+
`\(function\(\w+\)\{return \w+\.\$?variant\?function\(\w+\)\{`,
615615
func(submatches ...string) string {
616616
return fmt.Sprintf("Spicetify._fontStyle=%s", submatches[0])
617617
})

src/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ func FindSymbol(debugInfo, content string, clues []string) []string {
278278
}
279279

280280
if len(debugInfo) > 0 {
281-
PrintError("cannot find symbol for " + debugInfo)
281+
PrintError("Cannot find symbol for " + debugInfo)
282282
}
283283

284284
return nil

0 commit comments

Comments
 (0)