factor out kjol auth

This commit is contained in:
2026-07-14 16:49:56 -04:00
parent 7d7b7354df
commit 023599a41b
7 changed files with 1930 additions and 2 deletions

View File

@@ -31,8 +31,12 @@ var faStyleDirs = map[string]string{
var (
// icon="name" / icon: "name"
reIconAttr = regexp.MustCompile(`\bicon\s*(?:=|:)\s*"([a-z0-9][a-z0-9-]*)"`)
// icon={ ... } — dynamic expressions; pull any string literals (ternaries etc.)
reIconBrace = regexp.MustCompile(`\bicon\s*=\s*\{([^}]*)\}`)
// icon={ ... } — a dynamic expression; pull any string literals out of it
// (ternaries etc.). The `$` is optional because both authoring styles in this
// codebase have to be seen: JSX writes icon={"bell"}, while a solid-js/html
// tagged template writes icon=${"bell"}. Missing the second form drops the
// icon from the registry silently — it simply renders blank at runtime.
reIconBrace = regexp.MustCompile(`\bicon\s*=\s*\$?\{([^}]*)\}`)
reStrLit = regexp.MustCompile(`"([a-z0-9][a-z0-9-]*)"`)
reViewBox = regexp.MustCompile(`viewBox="0 0 ([0-9.]+) ([0-9.]+)"`)
rePathD = regexp.MustCompile(`<path[^>]*\bd="([^"]+)"`)