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.
Files changed (38) hide show
  1. {ourui-0.2.2 → ourui-0.3.0}/PKG-INFO +2 -2
  2. {ourui-0.2.2 → ourui-0.3.0}/README.md +1 -1
  3. {ourui-0.2.2 → ourui-0.3.0}/ourui/emit/html.py +15 -20
  4. {ourui-0.2.2 → ourui-0.3.0}/ourui/pipeline.py +1 -2
  5. {ourui-0.2.2 → ourui-0.3.0}/ourui/theme.py +5 -1
  6. {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/PKG-INFO +2 -2
  7. {ourui-0.2.2 → ourui-0.3.0}/pyproject.toml +1 -1
  8. {ourui-0.2.2 → ourui-0.3.0}/LICENSE +0 -0
  9. {ourui-0.2.2 → ourui-0.3.0}/ourui/__init__.py +0 -0
  10. {ourui-0.2.2 → ourui-0.3.0}/ourui/analysis/__init__.py +0 -0
  11. {ourui-0.2.2 → ourui-0.3.0}/ourui/analysis/components.py +0 -0
  12. {ourui-0.2.2 → ourui-0.3.0}/ourui/cli.py +0 -0
  13. {ourui-0.2.2 → ourui-0.3.0}/ourui/design/__init__.py +0 -0
  14. {ourui-0.2.2 → ourui-0.3.0}/ourui/design/resolve.py +0 -0
  15. {ourui-0.2.2 → ourui-0.3.0}/ourui/emit/__init__.py +0 -0
  16. {ourui-0.2.2 → ourui-0.3.0}/ourui/emit/js.py +0 -0
  17. {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/__init__.py +0 -0
  18. {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/intent.py +0 -0
  19. {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/layout.py +0 -0
  20. {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/presentation.py +0 -0
  21. {ourui-0.2.2 → ourui-0.3.0}/ourui/lowering/render.py +0 -0
  22. {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/__init__.py +0 -0
  23. {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/completions.py +0 -0
  24. {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/protocol.py +0 -0
  25. {ourui-0.2.2 → ourui-0.3.0}/ourui/lsp/server.py +0 -0
  26. {ourui-0.2.2 → ourui-0.3.0}/ourui/node.py +0 -0
  27. {ourui-0.2.2 → ourui-0.3.0}/ourui/parse/__init__.py +0 -0
  28. {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/__init__.py +0 -0
  29. {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/hmr.py +0 -0
  30. {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/invoke.py +0 -0
  31. {ourui-0.2.2 → ourui-0.3.0}/ourui/runtime/session.py +0 -0
  32. {ourui-0.2.2 → ourui-0.3.0}/ourui/serialize/__init__.py +0 -0
  33. {ourui-0.2.2 → ourui-0.3.0}/ourui/ui.py +0 -0
  34. {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/SOURCES.txt +0 -0
  35. {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/dependency_links.txt +0 -0
  36. {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/entry_points.txt +0 -0
  37. {ourui-0.2.2 → ourui-0.3.0}/ourui.egg-info/top_level.txt +0 -0
  38. {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.2.2
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.2.2
49
+ # ourui 0.3.0
50
50
 
51
51
  Python package for the **OurUI** compiler and runtime.
52
52
 
@@ -1,4 +1,4 @@
1
- # ourui 0.2.2
1
+ # ourui 0.3.0
2
2
 
3
3
  Python package for the **OurUI** compiler and runtime.
4
4
 
@@ -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, default_tokens, emit_tokens_css
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
- tokens: dict[str, dict[str, str]] | None = None,
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 not None:
297
- token_block = emit_tokens_css(_tokens_from_resolved(rd))
298
- return token_block + _BASE_CSS + _emit_resolved_node_css(rd)
299
- token_block = emit_tokens_css(tokens or default_tokens())
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
- tokens: dict[str, dict[str, str]] | None = None,
310
- resolved_design: Any = None,
306
+ resolved_design: Any,
311
307
  ) -> str:
312
- """Emit HTML from Host Contract inputs: RTR + Resolved Design (+ optional tokens fallback)."""
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(tokens, resolved_design=resolved_design).rstrip("\n")
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
- tokens: dict[str, dict[str, str]] | None = None,
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, tokens=tokens, resolved_design=resolved_design
350
+ rtr, title=title, resolved_design=resolved_design
356
351
  ),
357
- "css": emit_css(tokens, resolved_design=resolved_design),
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 — native registry (not a third-party theme clone)."""
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.2.2
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.2.2
49
+ # ourui 0.3.0
50
50
 
51
51
  Python package for the **OurUI** compiler and runtime.
52
52
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ourui"
7
- version = "0.2.2"
7
+ version = "0.3.0"
8
8
  description = "Python-first UI compiler — write intent in Python, emit HTML/CSS/JS"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
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