xcomponent 0.6.1__tar.gz → 0.6.2__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.
- {xcomponent-0.6.1 → xcomponent-0.6.2}/CHANGELOG.md +4 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/Cargo.lock +1 -1
- {xcomponent-0.6.1 → xcomponent-0.6.2}/Cargo.toml +1 -1
- {xcomponent-0.6.1 → xcomponent-0.6.2}/PKG-INFO +1 -2
- {xcomponent-0.6.1 → xcomponent-0.6.2}/pyproject.toml +1 -1
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/grammar.pest +2 -2
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_if_expr.py +17 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/uv.lock +2 -2
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/build-sdist.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/build-wheels.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/publish-doc.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/publish-pypi.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/release.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/tests-artifacts.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.github/workflows/tests.yml +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.gitignore +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/.python-version +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/Justfile +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/LICENSE +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/README.md +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/docs/Makefile +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/docs/source/conf.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/docs/source/develop/.gitkeep +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/docs/source/index.md +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/docs/source/user/changelog.md +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/docs/source/user/getting_started.md +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/scripts/get_version.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/scripts/write_changelog.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/python/xcomponent/__init__.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/python/xcomponent/py.typed +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/python/xcomponent/service/__init__.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/python/xcomponent/service/catalog.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/python/xcomponent/xcore.pyi +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/catalog/catalog.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/catalog/mod.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/context.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/ast/eval.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/ast/mod.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/ast/model.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/ast/parse.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/mod.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/parser.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/expression/tokens.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/lib.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/markup/grammar.pest +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/markup/mod.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/markup/parser.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/src/rust/markup/tokens.rs +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/__init__.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/__init__.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/conftest.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_binary_eq.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_binary_op.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_binary_op_bool.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_default_values.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_field_access.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_for_expr.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_func.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_let.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_nested.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_render_comment.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_str_method.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_types.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/expression/test_unary.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_core.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_named_component.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_attributes.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_context.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_globals.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_globals_obj.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_globals_obj2.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_nested_dict.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_nested_node.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_node.py +0 -0
- {xcomponent-0.6.1 → xcomponent-0.6.2}/tests/unittests/test_render_script.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xcomponent
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.2
|
|
4
4
|
Classifier: License :: OSI Approved :: MIT License
|
|
5
5
|
Classifier: Programming Language :: Python :: 3
|
|
6
6
|
Classifier: Programming Language :: Python :: 3.11
|
|
@@ -20,7 +20,6 @@ Requires-Dist: sphinx-autodoc2>=0.5.0,<1 ; extra == 'docs'
|
|
|
20
20
|
Provides-Extra: docs
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Summary: A component base template engige - inspired by JSX
|
|
23
|
-
Author: Guillaume Gauvrit <guillaume@gauvr.it>
|
|
24
23
|
Author-email: Guillaume Gauvrit <guillaume@gauvr.it>
|
|
25
24
|
License: MIT
|
|
26
25
|
Requires-Python: >=3.11
|
|
@@ -49,7 +49,7 @@ comment_expression = _{ "/*" ~ comment ~ "*/" }
|
|
|
49
49
|
comment = { (!"*/" ~ ANY)* }
|
|
50
50
|
|
|
51
51
|
component = { markup_element | markup_fragment }
|
|
52
|
-
markup_node
|
|
52
|
+
markup_node = _{ markup_element | markup_fragment | markup_comment | markup_text | markup_expression }
|
|
53
53
|
markup_element = _{ markup_self_closing_element | markup_normal_element }
|
|
54
54
|
|
|
55
55
|
markup_normal_element = {
|
|
@@ -65,7 +65,7 @@ markup_open_fragment = _{ "<>" }
|
|
|
65
65
|
markup_close_fragment = _{ "</>" }
|
|
66
66
|
markup_attribute = _{ markup_attr_name ~ ("=" ~ markup_attr_value)? }
|
|
67
67
|
markup_comment = _{ "<!--" ~ (!"-->" ~ ANY)* ~ "-->" }
|
|
68
|
-
markup_expression = _{ "{" ~
|
|
68
|
+
markup_expression = _{ "{" ~ whitespace* ~ expression ~ whitespace* ~ "}" }
|
|
69
69
|
|
|
70
70
|
markup_ident = @{ ASCII_ALPHANUMERIC ~ (ASCII_ALPHANUMERIC | "_" )* }
|
|
71
71
|
markup_attr_name = @{ (ASCII_ALPHA | "_" ) ~ (ASCII_ALPHANUMERIC | "_" | "-" | ":" | "." )* }
|
|
@@ -45,6 +45,21 @@ def IfComponent(a: bool) -> str:
|
|
|
45
45
|
return """<>{if a { <p>Ha ha!</p> } }</>"""
|
|
46
46
|
|
|
47
47
|
|
|
48
|
+
@catalog.component
|
|
49
|
+
def Hint(text: str | None = None) -> str:
|
|
50
|
+
return """
|
|
51
|
+
<>
|
|
52
|
+
{
|
|
53
|
+
if text {
|
|
54
|
+
<span>
|
|
55
|
+
{text}
|
|
56
|
+
</span>
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
</>
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
|
|
48
63
|
@pytest.mark.parametrize(
|
|
49
64
|
"result,expected",
|
|
50
65
|
[
|
|
@@ -62,6 +77,8 @@ def IfComponent(a: bool) -> str:
|
|
|
62
77
|
pytest.param(IfSelfClosedComponent(False), ""),
|
|
63
78
|
pytest.param(IfComponent(True), "<p>Ha ha!</p>"),
|
|
64
79
|
pytest.param(IfComponent(False), ""),
|
|
80
|
+
pytest.param(Hint(), ""),
|
|
81
|
+
pytest.param(Hint("I exist"), "<span>I exist</span>"),
|
|
65
82
|
],
|
|
66
83
|
)
|
|
67
84
|
def test_if(result: str, expected: str):
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
version = 1
|
|
2
|
-
revision =
|
|
2
|
+
revision = 3
|
|
3
3
|
requires-python = ">=3.11"
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
@@ -598,7 +598,7 @@ wheels = [
|
|
|
598
598
|
|
|
599
599
|
[[package]]
|
|
600
600
|
name = "xcomponent"
|
|
601
|
-
version = "0.6.
|
|
601
|
+
version = "0.6.2"
|
|
602
602
|
source = { editable = "." }
|
|
603
603
|
|
|
604
604
|
[package.optional-dependencies]
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|