"""Inline SVG icons for the marketplace category pills. Source: Heroicons v2 (MIT license, https://heroicons.com). The SVG path markup is copied directly into this dict — there's no runtime dependency on the Heroicons package, and bundling the path data inline keeps the templates self-contained. Keyed by the canonical category names from ``src/store_categories.py`` (plus ``"Other"`` for plugins without a category). """ from __future__ import annotations from typing import Optional # Each value is the inner ```` markup for a 24x24 outline icon. # The wrapping ```` element is supplied by the caller (template) so we # don't bake in size/stroke attrs and the icon scales with the surrounding # pill. _PATHS: dict[str, str] = { "Code & Engineering": ( '' ), "Data & Analytics": ( '' ), "Documentation": ( '' ), "Productivity": ( '' ), "Communication": ( '' ), "DevOps & Infra": ( '' ), "Security": ( '' ), "Research": ( '' ), "Other": ( '' ), } def icon_svg(category: Optional[str]) -> str: """Return the inner ```` markup for ``category``. Unknown / missing categories fall back to the ``"Other"`` folder icon. The caller wraps in ```` to apply size + stroke. """ return _PATHS.get(category or "Other", _PATHS["Other"]) def all_keys() -> list[str]: """Stable list of category keys this module supplies an icon for.""" return list(_PATHS.keys()) def all_paths() -> dict[str, str]: """Return a copy of the full ``{category_name: }`` map. Consumed by the marketplace template so the frontend renders SVG icons without round-tripping a per-icon API call. """ return dict(_PATHS)