ourui 0.2.2__tar.gz → 0.3.0__tar.gz
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.
- {ourui-0.2.2 → ourui-0.3.0}/PKG-INFO +2 -2
- {ourui-0.2.2 → ourui-0.3.0}/README.md +1 -1
- {ourui-0.2.2 → ourui-0.3.0}/ourui/emit/html.py +15 -20
- {ourui-0.2.2 → ourui-0.3.0}/ourui/pipeline.py +1 -2
- {ourui-0.2.2 → ourui-0.3.0}/ourui/theme.py +5 -1
- {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/PKG-INFO +2 -2
- {ourui-0.2.2 → ourui-0.3.0}/pyproject.toml +1 -1
- {ourui-0.2.2 → ourui-0.3.0}/LICENSE +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/analysis/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/analysis/components.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/cli.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/design/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/design/resolve.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/emit/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/emit/js.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/intent.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/layout.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/presentation.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/render.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/completions.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/protocol.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/server.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/node.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/parse/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/hmr.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/invoke.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/session.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/serialize/__init__.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui/ui.py +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/SOURCES.txt +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/dependency_links.txt +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/entry_points.txt +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/top_level.txt +0 -0
- {ourui-0.2.2 → ourui-0.3.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ourui
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Python-first UI compiler — write intent in Python, emit HTML/CSS/JS
|
|
5
5
|
Author: OurUI contributors
|
|
6
6
|
License: MIT License
|
|
@@ -46,7 +46,7 @@ Description-Content-Type: text/markdown
|
|
|
46
46
|
License-File: LICENSE
|
|
47
47
|
Dynamic: license-file
|
|
48
48
|
|
|
49
|
-
# ourui 0.
|
|
49
|
+
# ourui 0.3.0
|
|
50
50
|
|
|
51
51
|
Python package for the **OurUI** compiler and runtime.
|
|
52
52
|
|
|
@@ -4,7 +4,7 @@ import html
|
|
|
4
4
|
from typing import Any
|
|
5
5
|
|
|
6
6
|
from ourui.emit.js import emit_js
|
|
7
|
-
from ourui.theme import COLOR_TOKEN_NAMES,
|
|
7
|
+
from ourui.theme import COLOR_TOKEN_NAMES, emit_tokens_css
|
|
8
8
|
|
|
9
9
|
# Semantic role → HTML tag (emitter-only decision)
|
|
10
10
|
_ROLE_TAG: dict[str, str] = {
|
|
@@ -20,6 +20,8 @@ _ROLE_TAG: dict[str, str] = {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
_BASE_CSS = """\
|
|
23
|
+
/* Host-private chrome (layout / structure). Not Design System knowledge.
|
|
24
|
+
Tone colors come from Resolved Design (CSS vars + per-node rules). */
|
|
23
25
|
.ourui-root {
|
|
24
26
|
font-family: system-ui, sans-serif;
|
|
25
27
|
line-height: 1.5;
|
|
@@ -286,18 +288,13 @@ def apply_state_values(rtr: dict[str, Any], state_values: dict[str, Any] | None)
|
|
|
286
288
|
return out
|
|
287
289
|
|
|
288
290
|
|
|
289
|
-
def emit_css(
|
|
290
|
-
|
|
291
|
-
*,
|
|
292
|
-
resolved_design: Any = None,
|
|
293
|
-
) -> str:
|
|
294
|
-
"""Emit host CSS. Prefer Resolved Design tokens + per-node rules (Host Contract)."""
|
|
291
|
+
def emit_css(*, resolved_design: Any) -> str:
|
|
292
|
+
"""Emit host CSS from Resolved Design (Host Contract — required)."""
|
|
295
293
|
rd = _as_resolved_design(resolved_design)
|
|
296
|
-
if rd is
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
token_block
|
|
300
|
-
return token_block + _BASE_CSS
|
|
294
|
+
if rd is None:
|
|
295
|
+
raise TypeError("resolved_design is required (Host Contract: RTR + Resolved Design)")
|
|
296
|
+
token_block = emit_tokens_css(_tokens_from_resolved(rd))
|
|
297
|
+
return token_block + _BASE_CSS + _emit_resolved_node_css(rd)
|
|
301
298
|
|
|
302
299
|
|
|
303
300
|
def emit_html_document(
|
|
@@ -306,10 +303,9 @@ def emit_html_document(
|
|
|
306
303
|
title: str = "OurUI",
|
|
307
304
|
state_values: dict[str, Any] | None = None,
|
|
308
305
|
hmr: bool = False,
|
|
309
|
-
|
|
310
|
-
resolved_design: Any = None,
|
|
306
|
+
resolved_design: Any,
|
|
311
307
|
) -> str:
|
|
312
|
-
"""Emit HTML from Host Contract inputs: RTR + Resolved Design (
|
|
308
|
+
"""Emit HTML from Host Contract inputs: RTR + Resolved Design (both required)."""
|
|
313
309
|
rtr = apply_state_values(rtr, state_values)
|
|
314
310
|
nodes = rtr["nodes"]
|
|
315
311
|
roots = rtr["roots"]
|
|
@@ -319,7 +315,7 @@ def emit_html_document(
|
|
|
319
315
|
body_lines.append(" </div>")
|
|
320
316
|
|
|
321
317
|
js = emit_js(rtr, hmr=hmr).rstrip("\n")
|
|
322
|
-
css = emit_css(
|
|
318
|
+
css = emit_css(resolved_design=resolved_design).rstrip("\n")
|
|
323
319
|
parts = [
|
|
324
320
|
"<!DOCTYPE html>",
|
|
325
321
|
'<html lang="en">',
|
|
@@ -346,14 +342,13 @@ def emit_bundle(
|
|
|
346
342
|
rtr: dict[str, Any],
|
|
347
343
|
*,
|
|
348
344
|
title: str = "OurUI",
|
|
349
|
-
|
|
350
|
-
resolved_design: Any = None,
|
|
345
|
+
resolved_design: Any,
|
|
351
346
|
) -> dict[str, str]:
|
|
352
347
|
"""Serializable emit artifacts (I10): html + css + js."""
|
|
353
348
|
return {
|
|
354
349
|
"html": emit_html_document(
|
|
355
|
-
rtr, title=title,
|
|
350
|
+
rtr, title=title, resolved_design=resolved_design
|
|
356
351
|
),
|
|
357
|
-
"css": emit_css(
|
|
352
|
+
"css": emit_css(resolved_design=resolved_design),
|
|
358
353
|
"js": emit_js(rtr),
|
|
359
354
|
}
|
|
@@ -72,6 +72,7 @@ def compile_dump(path: str | Path) -> dict[str, Any]:
|
|
|
72
72
|
"presentation_graph": True,
|
|
73
73
|
"resolved_design": True,
|
|
74
74
|
"host_contract": True,
|
|
75
|
+
"host_contract_primary": True,
|
|
75
76
|
},
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -96,7 +97,6 @@ def emit_html(
|
|
|
96
97
|
title=doc_title,
|
|
97
98
|
state_values=state_values,
|
|
98
99
|
hmr=hmr,
|
|
99
|
-
tokens=artifacts["semantic_graph"].tokens,
|
|
100
100
|
resolved_design=artifacts["resolved_design"],
|
|
101
101
|
)
|
|
102
102
|
|
|
@@ -107,6 +107,5 @@ def emit_all(path: str | Path, *, title: str | None = None) -> dict[str, str]:
|
|
|
107
107
|
return emit_bundle(
|
|
108
108
|
artifacts["rtr"].to_dict(),
|
|
109
109
|
title=doc_title,
|
|
110
|
-
tokens=artifacts["semantic_graph"].tokens,
|
|
111
110
|
resolved_design=artifacts["resolved_design"],
|
|
112
111
|
)
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
"""OurUI design tokens —
|
|
1
|
+
"""OurUI design tokens — pack seed + CSS var helpers (not emit authority).
|
|
2
|
+
|
|
3
|
+
Emit consumes Resolved Design (RFC-003). DEFAULT_* / default_tokens() seed
|
|
4
|
+
`ourui.design.resolve` / `ui.Theme` analysis only.
|
|
5
|
+
"""
|
|
2
6
|
|
|
3
7
|
from __future__ import annotations
|
|
4
8
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: ourui
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Python-first UI compiler — write intent in Python, emit HTML/CSS/JS
|
|
5
5
|
Author: OurUI contributors
|
|
6
6
|
License: MIT License
|
|
@@ -46,7 +46,7 @@ Description-Content-Type: text/markdown
|
|
|
46
46
|
License-File: LICENSE
|
|
47
47
|
Dynamic: license-file
|
|
48
48
|
|
|
49
|
-
# ourui 0.
|
|
49
|
+
# ourui 0.3.0
|
|
50
50
|
|
|
51
51
|
Python package for the **OurUI** compiler and runtime.
|
|
52
52
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|