Introduces a widget system where domains register UI fragments into named slots (container_nav, container_card, account_page, account_link). Host apps iterate widgets generically without naming any domain. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
23 lines
666 B
Python
23 lines
666 B
Python
"""Per-domain widget registration.
|
|
|
|
Called once at startup after domain services are registered.
|
|
Only registers widgets for domains that are actually available.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
|
|
def register_all_widgets() -> None:
|
|
from shared.services.registry import services
|
|
|
|
if services.has("calendar"):
|
|
from .calendar_widgets import register_calendar_widgets
|
|
register_calendar_widgets()
|
|
|
|
if services.has("market"):
|
|
from .market_widgets import register_market_widgets
|
|
register_market_widgets()
|
|
|
|
if services.has("cart"):
|
|
from .cart_widgets import register_cart_widgets
|
|
register_cart_widgets()
|