pulse-framework 0.1.48__py3-none-any.whl → 0.1.49__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.
pulse/proxy.py CHANGED
@@ -41,7 +41,7 @@ class ReactProxy:
41
41
  self.server_address = server_address
42
42
  self._client = None
43
43
 
44
- def _rewrite_url(self, url: str) -> str:
44
+ def rewrite_url(self, url: str) -> str:
45
45
  """Rewrite internal React server URLs to external server address."""
46
46
  if self.react_server_address in url:
47
47
  return url.replace(self.react_server_address, self.server_address)
@@ -207,7 +207,7 @@ class ReactProxy:
207
207
  response_headers: dict[str, str] = {}
208
208
  for k, v in r.headers.items():
209
209
  if k.lower() in ("location", "content-location"):
210
- v = self._rewrite_url(v)
210
+ v = self.rewrite_url(v)
211
211
  response_headers[k] = v
212
212
 
213
213
  return StreamingResponse(
@@ -293,6 +293,7 @@ class CssImport(Import):
293
293
  - Absolute path (e.g., "/path/to/styles.css")
294
294
  module: If True, import as a CSS module (default export for class access).
295
295
  If False, import for side effects only (global styles).
296
+ Automatically set to True if path ends with ".module.css".
296
297
  relative: If True, resolve path relative to the caller's file.
297
298
  before: List of import sources that should come after this import.
298
299
 
@@ -300,8 +301,8 @@ class CssImport(Import):
300
301
  # Side-effect CSS import (global styles)
301
302
  CssImport("@mantine/core/styles.css")
302
303
 
303
- # CSS module for class access
304
- styles = CssImport("./styles.module.css", module=True, relative=True)
304
+ # CSS module for class access (module=True auto-detected from .module.css)
305
+ styles = CssImport("./styles.module.css", relative=True)
305
306
  styles.container # Returns JSMember for 'container' class
306
307
 
307
308
  # Local CSS file (will be copied during codegen)
@@ -316,6 +317,10 @@ class CssImport(Import):
316
317
  relative: bool = False,
317
318
  before: Sequence[str] = (),
318
319
  ) -> None:
320
+ # Auto-detect CSS modules based on filename
321
+ if path.endswith(".module.css"):
322
+ module = True
323
+
319
324
  source_path: Path | None = None
320
325
  import_src = path
321
326
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pulse-framework
3
- Version: 0.1.48
3
+ Version: 0.1.49
4
4
  Summary: Pulse - Full-stack framework for building real-time React applications in Python
5
5
  Requires-Dist: websockets>=12.0
6
6
  Requires-Dist: fastapi>=0.104.0
@@ -68,7 +68,7 @@ pulse/js/window.py,sha256=ayx3lBl54hTVanlkiC2wCVGNh0IDJqzPO7OlO11YUtI,4081
68
68
  pulse/messages.py,sha256=PDsb07QDKvkMitAMgLmOk2c4JDb58Cq9WWCwbQ8unvg,3979
69
69
  pulse/middleware.py,sha256=9uyAhVUEGMSwqWC3WXqs7x5JMMNEcSTTu3g7DjsR8w8,9812
70
70
  pulse/plugin.py,sha256=RfGl6Vtr7VRHb8bp4Ob4dOX9dVzvc4Riu7HWnStMPpk,580
71
- pulse/proxy.py,sha256=wDKz8zJvLTpcowEoHclOppindK7Xp0Qquh58dVWKgdc,7255
71
+ pulse/proxy.py,sha256=jv2IdOEbF-qbtN5hmSqnyhZedOX1597XBye8cerWIyE,7253
72
72
  pulse/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
73
73
  pulse/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
74
74
  pulse/queries/client.py,sha256=GGckE0P3YCBO4Mj-08AO_I9eXVC4sIDSNw_xTLrBFuE,15224
@@ -95,7 +95,7 @@ pulse/transpiler/context.py,sha256=e-Nh0AKsq9_wVOI8gL_gn-UAP6HzcYN14zWLfNNzjWw,7
95
95
  pulse/transpiler/errors.py,sha256=JC6tTEmnHf6JdyW4GIvfXB0IBLe7p3FvCLh14PocH28,43
96
96
  pulse/transpiler/function.py,sha256=rP-MZl15_mwaGwPToPcFVYHXqyVdMn91cxtF7MKFPHA,7526
97
97
  pulse/transpiler/ids.py,sha256=d91B_LFaAALKXHjGPmL8tJmDqGDFz7-GquYmnV9IZ0o,327
98
- pulse/transpiler/imports.py,sha256=C4lSi5cRQcoo559_urDqbHAdeTiSeU3eEh89o2YDWhI,10848
98
+ pulse/transpiler/imports.py,sha256=zTBd4uyWlSE0dzS8muWwuhnmZKKZ3Ezjg4qa5MokIKo,11041
99
99
  pulse/transpiler/js_module.py,sha256=AjguCbKV_FnoanzojrW5-vlW-DQCTtyd-4FfBYQLxxQ,9603
100
100
  pulse/transpiler/modules/__init__.py,sha256=YPM2WhILHXQFDSxDcbs-hHdhFh6i3N5ZJLEVGDZeR3Y,1065
101
101
  pulse/transpiler/modules/asyncio.py,sha256=FetybIKGJhVJ3uEQJBw6Z2fsh6g7vA-9tqec4nn5FtI,1409
@@ -113,7 +113,7 @@ pulse/types/event_handler.py,sha256=psQCydj-WEtBcFU5JU4mDwvyzkW8V2O0g_VFRU2EOHI,
113
113
  pulse/user_session.py,sha256=FITxLSEl3JU-jod6UWuUYC6EpnPG2rbaLCnIOdkQPtg,7803
114
114
  pulse/vdom.py,sha256=yHMOYiXcaP3IVnYOAZrd_7cXWULKQ2fRQAiPDPSsOyU,18494
115
115
  pulse/version.py,sha256=711vaM1jVIQPgkisGgKZqwmw019qZIsc_QTae75K2pg,1895
116
- pulse_framework-0.1.48.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
117
- pulse_framework-0.1.48.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
118
- pulse_framework-0.1.48.dist-info/METADATA,sha256=NYRK6Ja0Dxl3wB3n24TdGbBO8FWGp1oOnGfeSKb6Hqo,580
119
- pulse_framework-0.1.48.dist-info/RECORD,,
116
+ pulse_framework-0.1.49.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
117
+ pulse_framework-0.1.49.dist-info/entry_points.txt,sha256=i7aohd3QaPu5IcuGKKvsQQEiMYMe5HcF56QEsaLVO64,46
118
+ pulse_framework-0.1.49.dist-info/METADATA,sha256=HKBRKLM8CJdL2a7oguyCDzayWPqIBQirMMN40jFrSTw,580
119
+ pulse_framework-0.1.49.dist-info/RECORD,,