plexi-sdk 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- plexi_sdk/__init__.py +477 -0
- plexi_sdk/_app.py +1077 -0
- plexi_sdk/_constants.py +52 -0
- plexi_sdk/_emitter.py +1466 -0
- plexi_sdk/_pipe.py +92 -0
- plexi_sdk/_protocol.py +48 -0
- plexi_sdk/_render_context.py +976 -0
- plexi_sdk/_types.py +139 -0
- plexi_sdk/midi.py +222 -0
- plexi_sdk/py.typed +1 -0
- plexi_sdk/templates/__init__.py +0 -0
- plexi_sdk/templates/app_init.py +72 -0
- plexi_sdk/testing.py +451 -0
- plexi_sdk/ui.py +1535 -0
- plexi_sdk/widgets/__init__.py +27 -0
- plexi_sdk/widgets/button.py +60 -0
- plexi_sdk/widgets/keymap.py +51 -0
- plexi_sdk/widgets/list_view.py +159 -0
- plexi_sdk/widgets/scroll.py +100 -0
- plexi_sdk/widgets/text_area.py +218 -0
- plexi_sdk/widgets/text_buffer.py +337 -0
- plexi_sdk/widgets/text_input.py +70 -0
- plexi_sdk-0.4.0.dist-info/METADATA +127 -0
- plexi_sdk-0.4.0.dist-info/RECORD +25 -0
- plexi_sdk-0.4.0.dist-info/WHEEL +4 -0
plexi_sdk/_constants.py
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
# ── SDK version (single source of truth) ──────────────────────────────────────
|
|
4
|
+
_SDK_VERSION = "0.5.0"
|
|
5
|
+
|
|
6
|
+
# ── Font sizes (float, points) ────────────────────────────────────────────────
|
|
7
|
+
TITLE = 22.0
|
|
8
|
+
HEADING = 18.0
|
|
9
|
+
BODY = 15.0
|
|
10
|
+
CAPTION = 13.0
|
|
11
|
+
HINT = 12.0
|
|
12
|
+
MONO_BODY = 14.0
|
|
13
|
+
MONO_SMALL = 12.0
|
|
14
|
+
|
|
15
|
+
# ── Layout (float, pixels) ────────────────────────────────────────────────────
|
|
16
|
+
PAD = 16.0
|
|
17
|
+
PAD_TIGHT = 8.0
|
|
18
|
+
HEADER_H = 48.0
|
|
19
|
+
STATUS_H = 44.0
|
|
20
|
+
|
|
21
|
+
# ── Colors (hex strings, Catppuccin Mocha) ────────────────────────────────────
|
|
22
|
+
BG = "#1e1e2e"
|
|
23
|
+
SURFACE = "#313244"
|
|
24
|
+
HIGHLIGHT = "#45475a"
|
|
25
|
+
ACCENT = "#89b4fa"
|
|
26
|
+
MUTED = "#6c7086"
|
|
27
|
+
FG = "#cdd6f4"
|
|
28
|
+
RED = "#f38ba8"
|
|
29
|
+
GREEN = "#a6e3a1"
|
|
30
|
+
YELLOW = "#f9e2af"
|
|
31
|
+
|
|
32
|
+
# ── Notification priority tiers ───────────────────────────────────────────────
|
|
33
|
+
# Higher = more urgent. Queue sorts priority DESC, arrival ASC. See the
|
|
34
|
+
# NOTIFICATIONS block in the module docstring for guidance on which tier to
|
|
35
|
+
# pick. Range 0..200 is the "app band" — stay inside it. A future release
|
|
36
|
+
# may reserve priorities above 200 for user overrides so apps can't yell
|
|
37
|
+
# themselves to the top; staying in-band today keeps you forward-compatible.
|
|
38
|
+
PRIORITY_LOW = 0
|
|
39
|
+
PRIORITY_NORMAL = 50
|
|
40
|
+
PRIORITY_HIGH = 100
|
|
41
|
+
PRIORITY_CRITICAL = 200
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def rgba(r: int, g: int, b: int, a: int = 255) -> str:
|
|
45
|
+
"""Return an 8-digit hex color string #rrggbbaa."""
|
|
46
|
+
return f"#{r:02x}{g:02x}{b:02x}{a:02x}"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def dim(hex_color: str, alpha: int) -> str:
|
|
50
|
+
"""Return hex_color with the given alpha (0-255). Strips existing alpha."""
|
|
51
|
+
h = hex_color.lstrip("#")[:6]
|
|
52
|
+
return f"#{h}{alpha:02x}"
|