pulse-framework 0.1.46__py3-none-any.whl → 0.1.48__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.
Files changed (73) hide show
  1. pulse/__init__.py +9 -23
  2. pulse/app.py +6 -25
  3. pulse/cli/processes.py +1 -0
  4. pulse/codegen/codegen.py +43 -88
  5. pulse/codegen/js.py +35 -5
  6. pulse/codegen/templates/route.py +341 -254
  7. pulse/form.py +1 -1
  8. pulse/helpers.py +51 -27
  9. pulse/hooks/core.py +2 -2
  10. pulse/hooks/effects.py +1 -1
  11. pulse/hooks/init.py +2 -1
  12. pulse/hooks/setup.py +1 -1
  13. pulse/hooks/stable.py +2 -2
  14. pulse/hooks/states.py +2 -2
  15. pulse/html/props.py +3 -2
  16. pulse/html/tags.py +135 -0
  17. pulse/html/tags.pyi +4 -0
  18. pulse/js/__init__.py +110 -0
  19. pulse/js/__init__.pyi +95 -0
  20. pulse/js/_types.py +297 -0
  21. pulse/js/array.py +253 -0
  22. pulse/js/console.py +47 -0
  23. pulse/js/date.py +113 -0
  24. pulse/js/document.py +138 -0
  25. pulse/js/error.py +139 -0
  26. pulse/js/json.py +62 -0
  27. pulse/js/map.py +84 -0
  28. pulse/js/math.py +66 -0
  29. pulse/js/navigator.py +76 -0
  30. pulse/js/number.py +54 -0
  31. pulse/js/object.py +173 -0
  32. pulse/js/promise.py +150 -0
  33. pulse/js/regexp.py +54 -0
  34. pulse/js/set.py +109 -0
  35. pulse/js/string.py +35 -0
  36. pulse/js/weakmap.py +50 -0
  37. pulse/js/weakset.py +45 -0
  38. pulse/js/window.py +199 -0
  39. pulse/messages.py +22 -3
  40. pulse/proxy.py +21 -8
  41. pulse/react_component.py +167 -14
  42. pulse/reactive_extensions.py +5 -5
  43. pulse/render_session.py +144 -34
  44. pulse/renderer.py +80 -115
  45. pulse/routing.py +1 -18
  46. pulse/transpiler/__init__.py +131 -0
  47. pulse/transpiler/builtins.py +731 -0
  48. pulse/transpiler/constants.py +110 -0
  49. pulse/transpiler/context.py +26 -0
  50. pulse/transpiler/errors.py +2 -0
  51. pulse/transpiler/function.py +250 -0
  52. pulse/transpiler/ids.py +16 -0
  53. pulse/transpiler/imports.py +409 -0
  54. pulse/transpiler/js_module.py +274 -0
  55. pulse/transpiler/modules/__init__.py +30 -0
  56. pulse/transpiler/modules/asyncio.py +38 -0
  57. pulse/transpiler/modules/json.py +20 -0
  58. pulse/transpiler/modules/math.py +320 -0
  59. pulse/transpiler/modules/re.py +466 -0
  60. pulse/transpiler/modules/tags.py +268 -0
  61. pulse/transpiler/modules/typing.py +59 -0
  62. pulse/transpiler/nodes.py +1216 -0
  63. pulse/transpiler/py_module.py +119 -0
  64. pulse/transpiler/transpiler.py +938 -0
  65. pulse/transpiler/utils.py +4 -0
  66. pulse/vdom.py +112 -6
  67. {pulse_framework-0.1.46.dist-info → pulse_framework-0.1.48.dist-info}/METADATA +1 -1
  68. pulse_framework-0.1.48.dist-info/RECORD +119 -0
  69. pulse/codegen/imports.py +0 -204
  70. pulse/css.py +0 -155
  71. pulse_framework-0.1.46.dist-info/RECORD +0 -80
  72. {pulse_framework-0.1.46.dist-info → pulse_framework-0.1.48.dist-info}/WHEEL +0 -0
  73. {pulse_framework-0.1.46.dist-info → pulse_framework-0.1.48.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,131 @@
1
+ """Python -> JavaScript transpiler system.
2
+
3
+ This module provides the full transpilation API for converting Python functions
4
+ to JavaScript. For basic usage, use the exports from the main `pulse` module:
5
+
6
+ from pulse import javascript, Import, CssImport, import_js
7
+
8
+ For advanced use cases (custom transpilers, AST manipulation, module registration),
9
+ import from this module:
10
+
11
+ from pulse.transpiler import JSExpr, JsTranspiler, register_module, ...
12
+ """
13
+
14
+ # Core types
15
+ # Builtins system
16
+ from pulse.transpiler.builtins import ALL_METHODS as ALL_METHODS
17
+ from pulse.transpiler.builtins import BUILTINS as BUILTINS
18
+ from pulse.transpiler.builtins import DICT_METHODS as DICT_METHODS
19
+ from pulse.transpiler.builtins import LIST_METHODS as LIST_METHODS
20
+ from pulse.transpiler.builtins import METHOD_CLASSES as METHOD_CLASSES
21
+ from pulse.transpiler.builtins import SET_METHODS as SET_METHODS
22
+ from pulse.transpiler.builtins import STR_METHODS as STR_METHODS
23
+ from pulse.transpiler.builtins import BuiltinMethods as BuiltinMethods
24
+ from pulse.transpiler.builtins import DictMethods as DictMethods
25
+ from pulse.transpiler.builtins import ListMethods as ListMethods
26
+ from pulse.transpiler.builtins import SetMethods as SetMethods
27
+ from pulse.transpiler.builtins import StringMethods as StringMethods
28
+ from pulse.transpiler.builtins import emit_method as emit_method
29
+
30
+ # Constants system
31
+ from pulse.transpiler.constants import CONSTANTS_CACHE as CONSTANTS_CACHE
32
+ from pulse.transpiler.constants import JsConstant as JsConstant
33
+ from pulse.transpiler.constants import JsPrimitive as JsPrimitive
34
+ from pulse.transpiler.constants import JsValue as JsValue
35
+ from pulse.transpiler.constants import JsVar as JsVar
36
+ from pulse.transpiler.constants import const_to_js as const_to_js
37
+ from pulse.transpiler.constants import jsify as jsify
38
+
39
+ # Context
40
+ from pulse.transpiler.context import interpreted_mode as interpreted_mode
41
+ from pulse.transpiler.context import is_interpreted_mode as is_interpreted_mode
42
+ from pulse.transpiler.errors import JSCompilationError as JSCompilationError
43
+
44
+ # Function system
45
+ from pulse.transpiler.function import FUNCTION_CACHE as FUNCTION_CACHE
46
+ from pulse.transpiler.function import JsFunction as JsFunction
47
+ from pulse.transpiler.function import javascript as javascript
48
+
49
+ # Utilities
50
+ from pulse.transpiler.ids import generate_id as generate_id
51
+ from pulse.transpiler.ids import reset_id_counter as reset_id_counter
52
+ from pulse.transpiler.imports import CssImport as CssImport
53
+ from pulse.transpiler.imports import Import as Import
54
+
55
+ # Import system
56
+ from pulse.transpiler.imports import clear_import_registry as clear_import_registry
57
+ from pulse.transpiler.imports import import_js as import_js
58
+ from pulse.transpiler.imports import registered_imports as registered_imports
59
+
60
+ # Module registration - JS modules
61
+ from pulse.transpiler.js_module import JS_MODULES as JS_MODULES
62
+ from pulse.transpiler.js_module import JsModule as JsModule
63
+ from pulse.transpiler.js_module import register_js_module as register_js_module
64
+
65
+ # JS AST Utilities
66
+ from pulse.transpiler.nodes import ALLOWED_BINOPS as ALLOWED_BINOPS
67
+ from pulse.transpiler.nodes import ALLOWED_CMPOPS as ALLOWED_CMPOPS
68
+ from pulse.transpiler.nodes import ALLOWED_UNOPS as ALLOWED_UNOPS
69
+ from pulse.transpiler.nodes import JSEXPR_REGISTRY as JSEXPR_REGISTRY
70
+
71
+ # JS AST Nodes - Expressions
72
+ from pulse.transpiler.nodes import JSArray as JSArray
73
+ from pulse.transpiler.nodes import JSArrowFunction as JSArrowFunction
74
+
75
+ # JS AST Nodes - Statements
76
+ from pulse.transpiler.nodes import JSAssign as JSAssign
77
+ from pulse.transpiler.nodes import JSAugAssign as JSAugAssign
78
+ from pulse.transpiler.nodes import JSBinary as JSBinary
79
+ from pulse.transpiler.nodes import JSBlock as JSBlock
80
+ from pulse.transpiler.nodes import JSBoolean as JSBoolean
81
+ from pulse.transpiler.nodes import JSBreak as JSBreak
82
+ from pulse.transpiler.nodes import JSCall as JSCall
83
+ from pulse.transpiler.nodes import JSComma as JSComma
84
+ from pulse.transpiler.nodes import JSComputedProp as JSComputedProp
85
+ from pulse.transpiler.nodes import JSConstAssign as JSConstAssign
86
+ from pulse.transpiler.nodes import JSContinue as JSContinue
87
+ from pulse.transpiler.nodes import JSExpr as JSExpr
88
+ from pulse.transpiler.nodes import JSForOf as JSForOf
89
+ from pulse.transpiler.nodes import JSFunctionDef as JSFunctionDef
90
+ from pulse.transpiler.nodes import JSIdentifier as JSIdentifier
91
+ from pulse.transpiler.nodes import JSIf as JSIf
92
+
93
+ # JS AST Nodes - JSX
94
+ from pulse.transpiler.nodes import JSImport as JSImport
95
+ from pulse.transpiler.nodes import JSLogicalChain as JSLogicalChain
96
+ from pulse.transpiler.nodes import JSMember as JSMember
97
+ from pulse.transpiler.nodes import JSMemberCall as JSMemberCall
98
+ from pulse.transpiler.nodes import JSMultiStmt as JSMultiStmt
99
+ from pulse.transpiler.nodes import JSNew as JSNew
100
+ from pulse.transpiler.nodes import JSNode as JSNode
101
+ from pulse.transpiler.nodes import JSNull as JSNull
102
+ from pulse.transpiler.nodes import JSNumber as JSNumber
103
+ from pulse.transpiler.nodes import JSObjectExpr as JSObjectExpr
104
+ from pulse.transpiler.nodes import JSProp as JSProp
105
+ from pulse.transpiler.nodes import JSRaw as JSRaw
106
+ from pulse.transpiler.nodes import JSReturn as JSReturn
107
+ from pulse.transpiler.nodes import JSSingleStmt as JSSingleStmt
108
+ from pulse.transpiler.nodes import JSSpread as JSSpread
109
+ from pulse.transpiler.nodes import JSStmt as JSStmt
110
+ from pulse.transpiler.nodes import JSString as JSString
111
+ from pulse.transpiler.nodes import JSSubscript as JSSubscript
112
+ from pulse.transpiler.nodes import JSTemplate as JSTemplate
113
+ from pulse.transpiler.nodes import JSTertiary as JSTertiary
114
+ from pulse.transpiler.nodes import JSTransformer as JSTransformer
115
+ from pulse.transpiler.nodes import JSUnary as JSUnary
116
+ from pulse.transpiler.nodes import JSUndefined as JSUndefined
117
+ from pulse.transpiler.nodes import JSWhile as JSWhile
118
+ from pulse.transpiler.nodes import JSXElement as JSXElement
119
+ from pulse.transpiler.nodes import JSXFragment as JSXFragment
120
+ from pulse.transpiler.nodes import JSXProp as JSXProp
121
+ from pulse.transpiler.nodes import JSXSpreadProp as JSXSpreadProp
122
+ from pulse.transpiler.nodes import is_primary as is_primary
123
+
124
+ # Module registration - Python modules
125
+ from pulse.transpiler.py_module import PY_MODULES as PY_MODULES
126
+ from pulse.transpiler.py_module import PyModule as PyModule
127
+ from pulse.transpiler.py_module import PyModuleExpr as PyModuleExpr
128
+ from pulse.transpiler.py_module import register_module as register_module
129
+
130
+ # Transpiler
131
+ from pulse.transpiler.transpiler import JsTranspiler as JsTranspiler