Coverage for src / lexigram / ui / hooks.py: 100%

9 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-08-10 04:11 +0800

1"""Root hook payload surface for lexigram-ui. 

2 

3Defines canonical payload dataclasses for server-rendered UI component hook 

4points. Actual hook registration and invocation use the framework's 

5string-keyed ``HookRegistryProtocol`` action/filter APIs. 

6""" 

7 

8from __future__ import annotations 

9 

10from dataclasses import dataclass 

11 

12__all__ = [ 

13 "UIComponentRenderedHook", 

14 "UITemplateRenderedHook", 

15] 

16 

17 

18@dataclass(frozen=True, kw_only=True) 

19class UIComponentRenderedHook: 

20 """Payload fired after a UI component completes rendering. 

21 

22 Attributes: 

23 component_name: Qualified name of the component class that rendered. 

24 """ 

25 

26 component_name: str 

27 

28 

29@dataclass(frozen=True, kw_only=True) 

30class UITemplateRenderedHook: 

31 """Payload fired after a template is rendered to its final HTML output. 

32 

33 Attributes: 

34 template_name: Name or path of the template that was rendered. 

35 """ 

36 

37 template_name: str