reflex 0.7.12a1__py3-none-any.whl → 0.7.13__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.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

Files changed (55) hide show
  1. reflex/.templates/jinja/app/rxconfig.py.jinja2 +1 -0
  2. reflex/.templates/web/postcss.config.js +0 -1
  3. reflex/.templates/web/utils/state.js +1 -1
  4. reflex/__init__.py +1 -0
  5. reflex/__init__.pyi +1 -0
  6. reflex/app.py +101 -29
  7. reflex/compiler/compiler.py +11 -62
  8. reflex/compiler/templates.py +12 -3
  9. reflex/compiler/utils.py +20 -4
  10. reflex/components/component.py +366 -88
  11. reflex/components/core/helmet.pyi +66 -0
  12. reflex/components/datadisplay/code.py +1 -1
  13. reflex/components/datadisplay/shiki_code_block.py +97 -86
  14. reflex/components/datadisplay/shiki_code_block.pyi +4 -2
  15. reflex/components/el/elements/forms.py +1 -1
  16. reflex/components/lucide/icon.py +2 -1
  17. reflex/components/lucide/icon.pyi +1 -0
  18. reflex/components/plotly/plotly.py +2 -2
  19. reflex/components/plotly/plotly.pyi +2 -3
  20. reflex/components/radix/primitives/accordion.py +1 -1
  21. reflex/components/radix/primitives/drawer.py +1 -1
  22. reflex/components/radix/primitives/form.py +1 -1
  23. reflex/components/radix/themes/base.py +4 -11
  24. reflex/components/radix/themes/components/icon_button.py +2 -2
  25. reflex/components/radix/themes/components/text_field.py +3 -0
  26. reflex/components/radix/themes/components/text_field.pyi +2 -0
  27. reflex/components/radix/themes/layout/list.py +1 -1
  28. reflex/components/tags/iter_tag.py +3 -5
  29. reflex/config.py +57 -7
  30. reflex/constants/__init__.py +0 -2
  31. reflex/event.py +154 -93
  32. reflex/experimental/client_state.py +3 -1
  33. reflex/plugins/__init__.py +7 -0
  34. reflex/plugins/base.py +101 -0
  35. reflex/plugins/tailwind_v3.py +255 -0
  36. reflex/plugins/tailwind_v4.py +258 -0
  37. reflex/state.py +24 -3
  38. reflex/utils/build.py +1 -1
  39. reflex/utils/console.py +1 -1
  40. reflex/utils/exec.py +23 -0
  41. reflex/utils/path_ops.py +26 -6
  42. reflex/utils/prerequisites.py +21 -90
  43. reflex/utils/pyi_generator.py +12 -2
  44. reflex/utils/types.py +15 -1
  45. reflex/vars/base.py +59 -4
  46. reflex/vars/object.py +8 -0
  47. {reflex-0.7.12a1.dist-info → reflex-0.7.13.dist-info}/METADATA +2 -2
  48. {reflex-0.7.12a1.dist-info → reflex-0.7.13.dist-info}/RECORD +52 -50
  49. scripts/hatch_build.py +17 -0
  50. reflex/.templates/jinja/web/tailwind.config.js.jinja2 +0 -66
  51. reflex/.templates/web/styles/tailwind.css +0 -6
  52. reflex/constants/style.py +0 -16
  53. {reflex-0.7.12a1.dist-info → reflex-0.7.13.dist-info}/WHEEL +0 -0
  54. {reflex-0.7.12a1.dist-info → reflex-0.7.13.dist-info}/entry_points.txt +0 -0
  55. {reflex-0.7.12a1.dist-info → reflex-0.7.13.dist-info}/licenses/LICENSE +0 -0
scripts/hatch_build.py CHANGED
@@ -1,5 +1,6 @@
1
1
  """Custom build hook for Hatch."""
2
2
 
3
+ import importlib.util
3
4
  import pathlib
4
5
  import subprocess
5
6
  import sys
@@ -37,6 +38,22 @@ class CustomBuilder(BuildHookInterface):
37
38
  if self.marker().exists():
38
39
  return
39
40
 
41
+ if importlib.util.find_spec("pre_commit") and importlib.util.find_spec("toml"):
42
+ import json
43
+
44
+ import toml
45
+ import yaml
46
+
47
+ reflex_dir = pathlib.Path(__file__).parent.parent
48
+ pre_commit_config = json.loads(
49
+ json.dumps(
50
+ toml.load(reflex_dir / "pyproject.toml")["tool"]["pre-commit"]
51
+ )
52
+ )
53
+ (reflex_dir / ".pre-commit-config.yaml").write_text(
54
+ yaml.dump(pre_commit_config), encoding="utf-8"
55
+ )
56
+
40
57
  if not (pathlib.Path(self.root) / "scripts").exists():
41
58
  return
42
59
 
@@ -1,66 +0,0 @@
1
- {# Helper macro to render JS objects and arrays #}
2
- {% macro render_js(val, indent=2, level=0) -%}
3
- {%- set space = ' ' * (indent * level) -%}
4
- {%- set next_space = ' ' * (indent * (level + 1)) -%}
5
-
6
- {%- if val is mapping -%}
7
- {
8
- {%- for k, v in val.items() %}
9
- {{ next_space }}{{ k if k is string and k.isidentifier() else k|tojson }}: {{ render_js(v, indent, level + 1) }}{{ "," if not loop.last }}
10
- {%- endfor %}
11
- {{ space }}}
12
- {%- elif val is iterable and val is not string -%}
13
- [
14
- {%- for item in val %}
15
- {{ next_space }}{{ render_js(item, indent, level + 1) }}{{ "," if not loop.last }}
16
- {%- endfor %}
17
- {{ space }}]
18
- {%- else -%}
19
- {{ val | tojson }}
20
- {%- endif -%}
21
- {%- endmacro %}
22
-
23
- {# Extract destructured imports from plugin dicts only #}
24
- {%- set imports = [] %}
25
- {%- for plugin in plugins if plugin is mapping and plugin.import is defined %}
26
- {%- set _ = imports.append(plugin.import) %}
27
- {%- endfor %}
28
-
29
- /** @type {import('tailwindcss').Config} */
30
- {%- for imp in imports %}
31
- const { {{ imp.name }} } = require({{ imp.from | tojson }});
32
- {%- endfor %}
33
-
34
- module.exports = {
35
- content: {{ render_js(content) }},
36
- theme: {{ render_js(theme) }},
37
- {% if darkMode is defined %}darkMode: {{ darkMode | tojson }},{% endif %}
38
- {% if corePlugins is defined %}corePlugins: {{ render_js(corePlugins) }},{% endif %}
39
- {% if important is defined %}important: {{ important | tojson }},{% endif %}
40
- {% if prefix is defined %}prefix: {{ prefix | tojson }},{% endif %}
41
- {% if separator is defined %}separator: {{ separator | tojson }},{% endif %}
42
- {% if presets is defined %}
43
- presets: [
44
- {% for preset in presets %}
45
- require({{ preset | tojson }}){{ "," if not loop.last }}
46
- {% endfor %}
47
- ],
48
- {% endif %}
49
- plugins: [
50
- {% for plugin in plugins %}
51
- {% if plugin is mapping %}
52
- {% if plugin.call is defined %}
53
- {{ plugin.call }}(
54
- {%- if plugin.args is defined -%}
55
- {{ render_js(plugin.args) }}
56
- {%- endif -%}
57
- ){{ "," if not loop.last }}
58
- {% else %}
59
- require({{ plugin.name | tojson }}){{ "," if not loop.last }}
60
- {% endif %}
61
- {% else %}
62
- require({{ plugin | tojson }}){{ "," if not loop.last }}
63
- {% endif %}
64
- {% endfor %}
65
- ]
66
- };
@@ -1,6 +0,0 @@
1
- @import "tailwindcss/base";
2
-
3
- @import "@radix-ui/themes/styles.css";
4
-
5
- @tailwind components;
6
- @tailwind utilities;
reflex/constants/style.py DELETED
@@ -1,16 +0,0 @@
1
- """Style constants."""
2
-
3
- from types import SimpleNamespace
4
-
5
-
6
- class Tailwind(SimpleNamespace):
7
- """Tailwind constants."""
8
-
9
- # The Tailwindcss version
10
- VERSION = "tailwindcss@3.4.17"
11
- # The Tailwind config.
12
- CONFIG = "tailwind.config.js"
13
- # Default Tailwind content paths
14
- CONTENT = ["./pages/**/*.{js,ts,jsx,tsx}", "./utils/**/*.{js,ts,jsx,tsx}"]
15
- # Relative tailwind style path to root stylesheet in Dirs.STYLES.
16
- ROOT_STYLE_PATH = "./tailwind.css"