chore: migrate all FA icons to Lucide (@lucide/svelte)
- Replaced all active FontAwesome <span class="fas fa-*"> icons with
Lucide components across 145 files (excluding /idaa/ which is intentional)
- Fixed merge script bug: consolidated lucide-svelte imports into @lucide/svelte
- Replaced dynamic toggle patterns (fa-toggle-on/off) with ToggleRight/ToggleLeft
- Replaced fa-eye/fa-eye-slash with Eye/EyeOff
- Replaced fa-bug/fa-bug-slash with Bug/BugOff
- Replaced fa-sync fa-spin with RefreshCw + animate-spin
- Replaced fa-microchip with Cpu
- Fixed {@const} placement in element_manage_event_file_li.svelte
- Removed obsolete CSS hover rules for .unlock_icon/.lock_icon
- svelte-check: 0 errors, 0 warnings
This commit is contained in:
@@ -110,6 +110,55 @@ FA_TO_LUCIDE = {
|
||||
'fa-archive': 'Archive',
|
||||
'fa-link-slash': 'Unlink',
|
||||
'fa-question-circle': 'HelpCircle',
|
||||
# ── Additional unmapped icons ──────────────────────────────────────────────
|
||||
'fa-compress-arrows-alt':'Minimize2',
|
||||
'fa-expand-arrows-alt': 'Maximize2',
|
||||
'fa-secret': 'ShieldCheck',
|
||||
'fa-user-shield': 'ShieldUser',
|
||||
'fa-user-nurse': 'UserRound',
|
||||
'fa-user-friends': 'Users',
|
||||
'fa-user-plus': 'UserPlus',
|
||||
'fa-user-edit': 'UserRoundPen',
|
||||
'fa-palette': 'Palette',
|
||||
'fa-eraser': 'Eraser',
|
||||
'fa-code': 'Code',
|
||||
'fa-lock-open': 'LockOpen',
|
||||
'fa-unlock': 'LockOpen',
|
||||
'fa-trash-alt': 'Trash2',
|
||||
'fa-folder-open': 'FolderOpen',
|
||||
'fa-minus-circle': 'MinusCircle',
|
||||
'fa-plus-circle': 'PlusCircle',
|
||||
'fa-window-close': 'X',
|
||||
'fa-cut': 'Scissors',
|
||||
'fa-caret-down': 'ChevronDown',
|
||||
'fa-caret-right': 'ChevronRight',
|
||||
'fa-cogs': 'Settings2',
|
||||
'fa-phone': 'Phone',
|
||||
'fa-phone-slash': 'PhoneOff',
|
||||
'fa-flag': 'Flag',
|
||||
'fa-calendar-week': 'CalendarDays',
|
||||
'fa-address-book': 'BookUser',
|
||||
'fa-info-circle': 'Info',
|
||||
'fa-comment-slash': 'MessageX',
|
||||
'fa-paperclip': 'Paperclip',
|
||||
'fa-keyboard': 'Keyboard',
|
||||
'fa-crosshairs': 'Crosshair',
|
||||
'fa-redo': 'RotateCcw',
|
||||
'fa-tools': 'Wrench',
|
||||
'fa-video-slash': 'VideoOff',
|
||||
'fa-home': 'House',
|
||||
'fa-calendar': 'Calendar',
|
||||
'fa-check-square': 'SquareCheck',
|
||||
'fa-square': 'Square',
|
||||
'fa-times-circle': 'CircleX',
|
||||
'fa-undo': 'RotateCcw',
|
||||
'fa-trash-restore': 'ArchiveRestore',
|
||||
'fa-lock-open': 'LockOpen',
|
||||
'fa-compress': 'Minimize2',
|
||||
'fa-expand': 'Maximize2',
|
||||
'fa-grip-lines': 'GripHorizontal',
|
||||
'fa-bars': 'Menu',
|
||||
'fa-refresh': 'RefreshCw',
|
||||
}
|
||||
|
||||
# Skip modifiers — not real icon names
|
||||
@@ -125,7 +174,7 @@ SPAN_RE = re.compile(
|
||||
COMMENT_RE = re.compile(r'(<!--[\s\S]*?-->)')
|
||||
|
||||
# ── Lucide import line ────────────────────────────────────────────────────────
|
||||
IMPORT_RE = re.compile(r"import\s*\{([^}]+)\}\s*from\s*'lucide-svelte'\s*;?")
|
||||
IMPORT_RE = re.compile(r"import\s*\{([^}]+)\}\s*from\s*'@lucide/svelte'\s*;?")
|
||||
|
||||
|
||||
def parse_fa_class(class_str):
|
||||
@@ -199,7 +248,7 @@ def add_import(content, icons):
|
||||
if existing:
|
||||
current = [s.strip() for s in existing.group(1).split(',') if s.strip()]
|
||||
merged = sorted(set(current) | set(sorted_icons))
|
||||
new_import = f"import {{ {', '.join(merged)} }} from 'lucide-svelte';"
|
||||
new_import = f"import {{ {', '.join(merged)} }} from '@lucide/svelte';"
|
||||
return content[:existing.start()] + new_import + content[existing.end():]
|
||||
else:
|
||||
# Insert after the last COMPLETE import statement (handles multiline imports).
|
||||
@@ -211,7 +260,7 @@ def add_import(content, icons):
|
||||
all_imports = list(complete_import_re.finditer(content))
|
||||
if all_imports:
|
||||
pos = all_imports[-1].end()
|
||||
new_line = f"\n import {{ {', '.join(sorted_icons)} }} from 'lucide-svelte';"
|
||||
new_line = f"\n import {{ {', '.join(sorted_icons)} }} from '@lucide/svelte';"
|
||||
return content[:pos] + new_line + content[pos:]
|
||||
# Fallback: add after <script> tag
|
||||
script_tag = content.find('<script')
|
||||
|
||||
Reference in New Issue
Block a user