pulse-framework 0.1.62__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/__init__.py +1493 -0
- pulse/_examples.py +29 -0
- pulse/app.py +1086 -0
- pulse/channel.py +607 -0
- pulse/cli/__init__.py +0 -0
- pulse/cli/cmd.py +575 -0
- pulse/cli/dependencies.py +181 -0
- pulse/cli/folder_lock.py +134 -0
- pulse/cli/helpers.py +271 -0
- pulse/cli/logging.py +102 -0
- pulse/cli/models.py +35 -0
- pulse/cli/packages.py +262 -0
- pulse/cli/processes.py +292 -0
- pulse/cli/secrets.py +39 -0
- pulse/cli/uvicorn_log_config.py +87 -0
- pulse/code_analysis.py +38 -0
- pulse/codegen/__init__.py +0 -0
- pulse/codegen/codegen.py +359 -0
- pulse/codegen/templates/__init__.py +0 -0
- pulse/codegen/templates/layout.py +106 -0
- pulse/codegen/templates/route.py +345 -0
- pulse/codegen/templates/routes_ts.py +42 -0
- pulse/codegen/utils.py +20 -0
- pulse/component.py +237 -0
- pulse/components/__init__.py +0 -0
- pulse/components/for_.py +83 -0
- pulse/components/if_.py +86 -0
- pulse/components/react_router.py +94 -0
- pulse/context.py +108 -0
- pulse/cookies.py +322 -0
- pulse/decorators.py +344 -0
- pulse/dom/__init__.py +0 -0
- pulse/dom/elements.py +1024 -0
- pulse/dom/events.py +445 -0
- pulse/dom/props.py +1250 -0
- pulse/dom/svg.py +0 -0
- pulse/dom/tags.py +328 -0
- pulse/dom/tags.pyi +480 -0
- pulse/env.py +178 -0
- pulse/form.py +538 -0
- pulse/helpers.py +541 -0
- pulse/hooks/__init__.py +0 -0
- pulse/hooks/core.py +452 -0
- pulse/hooks/effects.py +88 -0
- pulse/hooks/init.py +668 -0
- pulse/hooks/runtime.py +464 -0
- pulse/hooks/setup.py +254 -0
- pulse/hooks/stable.py +138 -0
- pulse/hooks/state.py +192 -0
- pulse/js/__init__.py +125 -0
- pulse/js/__init__.pyi +115 -0
- pulse/js/_types.py +299 -0
- pulse/js/array.py +339 -0
- pulse/js/console.py +50 -0
- pulse/js/date.py +119 -0
- pulse/js/document.py +145 -0
- pulse/js/error.py +140 -0
- pulse/js/json.py +66 -0
- pulse/js/map.py +97 -0
- pulse/js/math.py +69 -0
- pulse/js/navigator.py +79 -0
- pulse/js/number.py +57 -0
- pulse/js/obj.py +81 -0
- pulse/js/object.py +172 -0
- pulse/js/promise.py +172 -0
- pulse/js/pulse.py +115 -0
- pulse/js/react.py +495 -0
- pulse/js/regexp.py +57 -0
- pulse/js/set.py +124 -0
- pulse/js/string.py +38 -0
- pulse/js/weakmap.py +53 -0
- pulse/js/weakset.py +48 -0
- pulse/js/window.py +205 -0
- pulse/messages.py +202 -0
- pulse/middleware.py +471 -0
- pulse/plugin.py +96 -0
- pulse/proxy.py +242 -0
- pulse/py.typed +0 -0
- pulse/queries/__init__.py +0 -0
- pulse/queries/client.py +609 -0
- pulse/queries/common.py +101 -0
- pulse/queries/effect.py +55 -0
- pulse/queries/infinite_query.py +1418 -0
- pulse/queries/mutation.py +295 -0
- pulse/queries/protocol.py +136 -0
- pulse/queries/query.py +1314 -0
- pulse/queries/store.py +120 -0
- pulse/react_component.py +88 -0
- pulse/reactive.py +1208 -0
- pulse/reactive_extensions.py +1172 -0
- pulse/render_session.py +768 -0
- pulse/renderer.py +584 -0
- pulse/request.py +205 -0
- pulse/routing.py +598 -0
- pulse/serializer.py +279 -0
- pulse/state.py +556 -0
- pulse/test_helpers.py +15 -0
- pulse/transpiler/__init__.py +111 -0
- pulse/transpiler/assets.py +81 -0
- pulse/transpiler/builtins.py +1029 -0
- pulse/transpiler/dynamic_import.py +130 -0
- pulse/transpiler/emit_context.py +49 -0
- pulse/transpiler/errors.py +96 -0
- pulse/transpiler/function.py +611 -0
- pulse/transpiler/id.py +18 -0
- pulse/transpiler/imports.py +341 -0
- pulse/transpiler/js_module.py +336 -0
- pulse/transpiler/modules/__init__.py +33 -0
- pulse/transpiler/modules/asyncio.py +57 -0
- pulse/transpiler/modules/json.py +24 -0
- pulse/transpiler/modules/math.py +265 -0
- pulse/transpiler/modules/pulse/__init__.py +5 -0
- pulse/transpiler/modules/pulse/tags.py +250 -0
- pulse/transpiler/modules/typing.py +63 -0
- pulse/transpiler/nodes.py +1987 -0
- pulse/transpiler/py_module.py +135 -0
- pulse/transpiler/transpiler.py +1100 -0
- pulse/transpiler/vdom.py +256 -0
- pulse/types/__init__.py +0 -0
- pulse/types/event_handler.py +50 -0
- pulse/user_session.py +386 -0
- pulse/version.py +69 -0
- pulse_framework-0.1.62.dist-info/METADATA +198 -0
- pulse_framework-0.1.62.dist-info/RECORD +126 -0
- pulse_framework-0.1.62.dist-info/WHEEL +4 -0
- pulse_framework-0.1.62.dist-info/entry_points.txt +3 -0
pulse/dom/tags.pyi
ADDED
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
from typing import Any, Protocol, Unpack
|
|
2
|
+
|
|
3
|
+
from pulse.dom.elements import GenericHTMLElement
|
|
4
|
+
from pulse.dom.props import (
|
|
5
|
+
HTMLAnchorProps,
|
|
6
|
+
HTMLAreaProps,
|
|
7
|
+
HTMLAudioProps,
|
|
8
|
+
HTMLBaseProps,
|
|
9
|
+
HTMLBlockquoteProps,
|
|
10
|
+
HTMLButtonProps,
|
|
11
|
+
HTMLCanvasProps,
|
|
12
|
+
HTMLColgroupProps,
|
|
13
|
+
HTMLColProps,
|
|
14
|
+
HTMLDataProps,
|
|
15
|
+
HTMLDelProps,
|
|
16
|
+
HTMLDetailsProps,
|
|
17
|
+
HTMLDialogProps,
|
|
18
|
+
HTMLEmbedProps,
|
|
19
|
+
HTMLFieldsetProps,
|
|
20
|
+
HTMLFormProps,
|
|
21
|
+
HTMLHtmlProps,
|
|
22
|
+
HTMLIframeProps,
|
|
23
|
+
HTMLImgProps,
|
|
24
|
+
HTMLInputProps,
|
|
25
|
+
HTMLInsProps,
|
|
26
|
+
HTMLLabelProps,
|
|
27
|
+
HTMLLinkProps,
|
|
28
|
+
HTMLLiProps,
|
|
29
|
+
HTMLMapProps,
|
|
30
|
+
HTMLMenuProps,
|
|
31
|
+
HTMLMetaProps,
|
|
32
|
+
HTMLMeterProps,
|
|
33
|
+
HTMLObjectProps,
|
|
34
|
+
HTMLOlProps,
|
|
35
|
+
HTMLOptgroupProps,
|
|
36
|
+
HTMLOptionProps,
|
|
37
|
+
HTMLOutputProps,
|
|
38
|
+
HTMLParamProps,
|
|
39
|
+
HTMLProgressProps,
|
|
40
|
+
HTMLProps,
|
|
41
|
+
HTMLQuoteProps,
|
|
42
|
+
HTMLScriptProps,
|
|
43
|
+
HTMLSelectProps,
|
|
44
|
+
HTMLSourceProps,
|
|
45
|
+
HTMLStyleProps,
|
|
46
|
+
HTMLSVGProps,
|
|
47
|
+
HTMLTableProps,
|
|
48
|
+
HTMLTdProps,
|
|
49
|
+
HTMLTextareaProps,
|
|
50
|
+
HTMLThProps,
|
|
51
|
+
HTMLTimeProps,
|
|
52
|
+
HTMLTrackProps,
|
|
53
|
+
HTMLVideoProps,
|
|
54
|
+
)
|
|
55
|
+
from pulse.transpiler.nodes import Element, Node
|
|
56
|
+
|
|
57
|
+
class Tag(Protocol):
|
|
58
|
+
def __call__(self, *children: Node, **props: Any) -> Element: ...
|
|
59
|
+
|
|
60
|
+
def define_tag(
|
|
61
|
+
name: str,
|
|
62
|
+
default_props: dict[str, Any] | None = None,
|
|
63
|
+
) -> Tag: ...
|
|
64
|
+
def define_self_closing_tag(
|
|
65
|
+
name: str,
|
|
66
|
+
default_props: dict[str, Any] | None = None,
|
|
67
|
+
) -> Tag: ...
|
|
68
|
+
|
|
69
|
+
# --- Self-closing tags ----
|
|
70
|
+
def area(*, key: str | None = None, **props: Unpack[HTMLAreaProps]) -> Element: ...
|
|
71
|
+
def base(*, key: str | None = None, **props: Unpack[HTMLBaseProps]) -> Element: ...
|
|
72
|
+
def br(*, key: str | None = None, **props: Unpack[HTMLProps]) -> Element: ...
|
|
73
|
+
def col(*, key: str | None = None, **props: Unpack[HTMLColProps]) -> Element: ...
|
|
74
|
+
def embed(*, key: str | None = None, **props: Unpack[HTMLEmbedProps]) -> Element: ...
|
|
75
|
+
def hr(*, key: str | None = None, **props: Unpack[HTMLProps]) -> Element: ...
|
|
76
|
+
def img(*, key: str | None = None, **props: Unpack[HTMLImgProps]) -> Element: ...
|
|
77
|
+
def input(*, key: str | None = None, **props: Unpack[HTMLInputProps]) -> Element: ...
|
|
78
|
+
def link(*, key: str | None = None, **props: Unpack[HTMLLinkProps]) -> Element: ...
|
|
79
|
+
def meta(*, key: str | None = None, **props: Unpack[HTMLMetaProps]) -> Element: ...
|
|
80
|
+
def param(*, key: str | None = None, **props: Unpack[HTMLParamProps]) -> Element: ...
|
|
81
|
+
def source(*, key: str | None = None, **props: Unpack[HTMLSourceProps]) -> Element: ...
|
|
82
|
+
def track(*, key: str | None = None, **props: Unpack[HTMLTrackProps]) -> Element: ...
|
|
83
|
+
def wbr(*, key: str | None = None, **props: Unpack[HTMLProps]) -> Element: ...
|
|
84
|
+
|
|
85
|
+
# --- Regular tags ---
|
|
86
|
+
|
|
87
|
+
def a(
|
|
88
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLAnchorProps]
|
|
89
|
+
) -> Element: ...
|
|
90
|
+
def abbr(
|
|
91
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
92
|
+
) -> Element: ...
|
|
93
|
+
def address(
|
|
94
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
95
|
+
) -> Element: ...
|
|
96
|
+
def article(
|
|
97
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
98
|
+
) -> Element: ...
|
|
99
|
+
def aside(
|
|
100
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
101
|
+
) -> Element: ...
|
|
102
|
+
def audio(
|
|
103
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLAudioProps]
|
|
104
|
+
) -> Element: ...
|
|
105
|
+
def b(
|
|
106
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
107
|
+
) -> Element: ...
|
|
108
|
+
def bdi(
|
|
109
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
110
|
+
) -> Element: ...
|
|
111
|
+
def bdo(
|
|
112
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
113
|
+
) -> Element: ...
|
|
114
|
+
def blockquote(
|
|
115
|
+
*children: Node,
|
|
116
|
+
key: str | None = None,
|
|
117
|
+
**props: Unpack[HTMLBlockquoteProps],
|
|
118
|
+
) -> Element: ...
|
|
119
|
+
def body(
|
|
120
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
121
|
+
) -> Element: ...
|
|
122
|
+
def button(
|
|
123
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLButtonProps]
|
|
124
|
+
) -> Element: ...
|
|
125
|
+
def canvas(
|
|
126
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLCanvasProps]
|
|
127
|
+
) -> Element: ...
|
|
128
|
+
def caption(
|
|
129
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
130
|
+
) -> Element: ...
|
|
131
|
+
def cite(
|
|
132
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
133
|
+
) -> Element: ...
|
|
134
|
+
def code(
|
|
135
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
136
|
+
) -> Element: ...
|
|
137
|
+
def colgroup(
|
|
138
|
+
*children: Node,
|
|
139
|
+
key: str | None = None,
|
|
140
|
+
**props: Unpack[HTMLColgroupProps],
|
|
141
|
+
) -> Element: ...
|
|
142
|
+
def data(
|
|
143
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLDataProps]
|
|
144
|
+
) -> Element: ...
|
|
145
|
+
def datalist(
|
|
146
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
147
|
+
) -> Element: ...
|
|
148
|
+
def dd(
|
|
149
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
150
|
+
) -> Element: ...
|
|
151
|
+
def del_(
|
|
152
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLDelProps]
|
|
153
|
+
) -> Element: ...
|
|
154
|
+
def details(
|
|
155
|
+
*children: Node,
|
|
156
|
+
key: str | None = None,
|
|
157
|
+
**props: Unpack[HTMLDetailsProps],
|
|
158
|
+
) -> Element: ...
|
|
159
|
+
def dfn(
|
|
160
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
161
|
+
) -> Element: ...
|
|
162
|
+
def dialog(
|
|
163
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLDialogProps]
|
|
164
|
+
) -> Element: ...
|
|
165
|
+
def div(
|
|
166
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
167
|
+
) -> Element: ...
|
|
168
|
+
def dl(
|
|
169
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
170
|
+
) -> Element: ...
|
|
171
|
+
def dt(
|
|
172
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
173
|
+
) -> Element: ...
|
|
174
|
+
def em(
|
|
175
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
176
|
+
) -> Element: ...
|
|
177
|
+
def fieldset(
|
|
178
|
+
*children: Node,
|
|
179
|
+
key: str | None = None,
|
|
180
|
+
**props: Unpack[HTMLFieldsetProps],
|
|
181
|
+
) -> Element: ...
|
|
182
|
+
def figcaption(
|
|
183
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
184
|
+
) -> Element: ...
|
|
185
|
+
def figure(
|
|
186
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
187
|
+
) -> Element: ...
|
|
188
|
+
def footer(
|
|
189
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
190
|
+
) -> Element: ...
|
|
191
|
+
def form(
|
|
192
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLFormProps]
|
|
193
|
+
) -> Element: ...
|
|
194
|
+
def h1(
|
|
195
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
196
|
+
) -> Element: ...
|
|
197
|
+
def h2(
|
|
198
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
199
|
+
) -> Element: ...
|
|
200
|
+
def h3(
|
|
201
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
202
|
+
) -> Element: ...
|
|
203
|
+
def h4(
|
|
204
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
205
|
+
) -> Element: ...
|
|
206
|
+
def h5(
|
|
207
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
208
|
+
) -> Element: ...
|
|
209
|
+
def h6(
|
|
210
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
211
|
+
) -> Element: ...
|
|
212
|
+
def head(
|
|
213
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
214
|
+
) -> Element: ...
|
|
215
|
+
def header(
|
|
216
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
217
|
+
) -> Element: ...
|
|
218
|
+
def hgroup(
|
|
219
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
220
|
+
) -> Element: ...
|
|
221
|
+
def html(
|
|
222
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLHtmlProps]
|
|
223
|
+
) -> Element: ...
|
|
224
|
+
def i(
|
|
225
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
226
|
+
) -> Element: ...
|
|
227
|
+
def iframe(
|
|
228
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLIframeProps]
|
|
229
|
+
) -> Element: ...
|
|
230
|
+
def ins(
|
|
231
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLInsProps]
|
|
232
|
+
) -> Element: ...
|
|
233
|
+
def kbd(
|
|
234
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
235
|
+
) -> Element: ...
|
|
236
|
+
def label(
|
|
237
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLLabelProps]
|
|
238
|
+
) -> Element: ...
|
|
239
|
+
def legend(
|
|
240
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
241
|
+
) -> Element: ...
|
|
242
|
+
def li(
|
|
243
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLLiProps]
|
|
244
|
+
) -> Element: ...
|
|
245
|
+
def main(
|
|
246
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
247
|
+
) -> Element: ...
|
|
248
|
+
def map_(
|
|
249
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLMapProps]
|
|
250
|
+
) -> Element: ...
|
|
251
|
+
def mark(
|
|
252
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
253
|
+
) -> Element: ...
|
|
254
|
+
def menu(
|
|
255
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLMenuProps]
|
|
256
|
+
) -> Element: ...
|
|
257
|
+
def meter(
|
|
258
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLMeterProps]
|
|
259
|
+
) -> Element: ...
|
|
260
|
+
def nav(
|
|
261
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
262
|
+
) -> Element: ...
|
|
263
|
+
def noscript(
|
|
264
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
265
|
+
) -> Element: ...
|
|
266
|
+
def object_(
|
|
267
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLObjectProps]
|
|
268
|
+
) -> Element: ...
|
|
269
|
+
def ol(
|
|
270
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLOlProps]
|
|
271
|
+
) -> Element: ...
|
|
272
|
+
def optgroup(
|
|
273
|
+
*children: Node,
|
|
274
|
+
key: str | None = None,
|
|
275
|
+
**props: Unpack[HTMLOptgroupProps],
|
|
276
|
+
) -> Element: ...
|
|
277
|
+
def option(
|
|
278
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLOptionProps]
|
|
279
|
+
) -> Element: ...
|
|
280
|
+
def output(
|
|
281
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLOutputProps]
|
|
282
|
+
) -> Element: ...
|
|
283
|
+
def p(
|
|
284
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
285
|
+
) -> Element: ...
|
|
286
|
+
def picture(
|
|
287
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
288
|
+
) -> Element: ...
|
|
289
|
+
def pre(
|
|
290
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
291
|
+
) -> Element: ...
|
|
292
|
+
def progress(
|
|
293
|
+
*children: Node,
|
|
294
|
+
key: str | None = None,
|
|
295
|
+
**props: Unpack[HTMLProgressProps],
|
|
296
|
+
) -> Element: ...
|
|
297
|
+
def q(
|
|
298
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLQuoteProps]
|
|
299
|
+
) -> Element: ...
|
|
300
|
+
def rp(
|
|
301
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
302
|
+
) -> Element: ...
|
|
303
|
+
def rt(
|
|
304
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
305
|
+
) -> Element: ...
|
|
306
|
+
def ruby(
|
|
307
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
308
|
+
) -> Element: ...
|
|
309
|
+
def s(
|
|
310
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
311
|
+
) -> Element: ...
|
|
312
|
+
def samp(
|
|
313
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
314
|
+
) -> Element: ...
|
|
315
|
+
def script(
|
|
316
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLScriptProps]
|
|
317
|
+
) -> Element: ...
|
|
318
|
+
def section(
|
|
319
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
320
|
+
) -> Element: ...
|
|
321
|
+
def select(
|
|
322
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLSelectProps]
|
|
323
|
+
) -> Element: ...
|
|
324
|
+
def small(
|
|
325
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
326
|
+
) -> Element: ...
|
|
327
|
+
def span(
|
|
328
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
329
|
+
) -> Element: ...
|
|
330
|
+
def strong(
|
|
331
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
332
|
+
) -> Element: ...
|
|
333
|
+
def style(
|
|
334
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLStyleProps]
|
|
335
|
+
) -> Element: ...
|
|
336
|
+
def sub(
|
|
337
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
338
|
+
) -> Element: ...
|
|
339
|
+
def summary(
|
|
340
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
341
|
+
) -> Element: ...
|
|
342
|
+
def sup(
|
|
343
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
344
|
+
) -> Element: ...
|
|
345
|
+
def table(
|
|
346
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLTableProps]
|
|
347
|
+
) -> Element: ...
|
|
348
|
+
def tbody(
|
|
349
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
350
|
+
) -> Element: ...
|
|
351
|
+
def td(
|
|
352
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLTdProps]
|
|
353
|
+
) -> Element: ...
|
|
354
|
+
def template(
|
|
355
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
356
|
+
) -> Element: ...
|
|
357
|
+
def textarea(
|
|
358
|
+
*children: Node,
|
|
359
|
+
key: str | None = None,
|
|
360
|
+
**props: Unpack[HTMLTextareaProps],
|
|
361
|
+
) -> Element: ...
|
|
362
|
+
def tfoot(
|
|
363
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
364
|
+
) -> Element: ...
|
|
365
|
+
def th(
|
|
366
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLThProps]
|
|
367
|
+
) -> Element: ...
|
|
368
|
+
def thead(
|
|
369
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
370
|
+
) -> Element: ...
|
|
371
|
+
def time(
|
|
372
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLTimeProps]
|
|
373
|
+
) -> Element: ...
|
|
374
|
+
def title(
|
|
375
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
376
|
+
) -> Element: ...
|
|
377
|
+
def tr(
|
|
378
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
379
|
+
) -> Element: ...
|
|
380
|
+
def u(
|
|
381
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
382
|
+
) -> Element: ...
|
|
383
|
+
def ul(
|
|
384
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
385
|
+
) -> Element: ...
|
|
386
|
+
def var(
|
|
387
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLProps]
|
|
388
|
+
) -> Element: ...
|
|
389
|
+
def video(
|
|
390
|
+
*children: Node, key: str | None = None, **props: Unpack[HTMLVideoProps]
|
|
391
|
+
) -> Element: ...
|
|
392
|
+
|
|
393
|
+
# -- React Fragment ---
|
|
394
|
+
def fragment(*children: Node, key: str | None = None) -> Element: ...
|
|
395
|
+
|
|
396
|
+
# -- SVG --
|
|
397
|
+
def svg(
|
|
398
|
+
*children: Node,
|
|
399
|
+
key: str | None = None,
|
|
400
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
401
|
+
) -> Element: ...
|
|
402
|
+
def circle(
|
|
403
|
+
*children: Node,
|
|
404
|
+
key: str | None = None,
|
|
405
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
406
|
+
) -> Element: ...
|
|
407
|
+
def ellipse(
|
|
408
|
+
*children: Node,
|
|
409
|
+
key: str | None = None,
|
|
410
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
411
|
+
) -> Element: ...
|
|
412
|
+
def g(
|
|
413
|
+
*children: Node,
|
|
414
|
+
key: str | None = None,
|
|
415
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
416
|
+
) -> Element: ...
|
|
417
|
+
def line(
|
|
418
|
+
*children: Node,
|
|
419
|
+
key: str | None = None,
|
|
420
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
421
|
+
) -> Element: ...
|
|
422
|
+
def path(
|
|
423
|
+
*children: Node,
|
|
424
|
+
key: str | None = None,
|
|
425
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
426
|
+
) -> Element: ...
|
|
427
|
+
def polygon(
|
|
428
|
+
*children: Node,
|
|
429
|
+
key: str | None = None,
|
|
430
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
431
|
+
) -> Element: ...
|
|
432
|
+
def polyline(
|
|
433
|
+
*children: Node,
|
|
434
|
+
key: str | None = None,
|
|
435
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
436
|
+
) -> Element: ...
|
|
437
|
+
def rect(
|
|
438
|
+
*children: Node,
|
|
439
|
+
key: str | None = None,
|
|
440
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
441
|
+
) -> Element: ...
|
|
442
|
+
def text(
|
|
443
|
+
*children: Node,
|
|
444
|
+
key: str | None = None,
|
|
445
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
446
|
+
) -> Element: ...
|
|
447
|
+
def tspan(
|
|
448
|
+
*children: Node,
|
|
449
|
+
key: str | None = None,
|
|
450
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
451
|
+
) -> Element: ...
|
|
452
|
+
def defs(
|
|
453
|
+
*children: Node,
|
|
454
|
+
key: str | None = None,
|
|
455
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
456
|
+
) -> Element: ...
|
|
457
|
+
def clipPath(
|
|
458
|
+
*children: Node,
|
|
459
|
+
key: str | None = None,
|
|
460
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
461
|
+
) -> Element: ...
|
|
462
|
+
def mask(
|
|
463
|
+
*children: Node,
|
|
464
|
+
key: str | None = None,
|
|
465
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
466
|
+
) -> Element: ...
|
|
467
|
+
def pattern(
|
|
468
|
+
*children: Node,
|
|
469
|
+
key: str | None = None,
|
|
470
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
471
|
+
) -> Element: ...
|
|
472
|
+
def use(
|
|
473
|
+
*children: Node,
|
|
474
|
+
key: str | None = None,
|
|
475
|
+
**props: Unpack[HTMLSVGProps[GenericHTMLElement]],
|
|
476
|
+
) -> Element: ...
|
|
477
|
+
|
|
478
|
+
# Lists exported for JS transpiler
|
|
479
|
+
TAGS: list[tuple[str, dict[str, Any] | None]]
|
|
480
|
+
SELF_CLOSING_TAGS: list[tuple[str, dict[str, Any] | None]]
|
pulse/env.py
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Centralized environment variable definitions and typed accessors for Pulse.
|
|
3
|
+
|
|
4
|
+
Preferred usage:
|
|
5
|
+
|
|
6
|
+
from pulse.env import env
|
|
7
|
+
env.pulse_env = "prod"
|
|
8
|
+
if env.running_cli:
|
|
9
|
+
...
|
|
10
|
+
|
|
11
|
+
You can still import constants for passing into subprocess env dicts.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from __future__ import annotations
|
|
15
|
+
|
|
16
|
+
import os
|
|
17
|
+
from typing import Literal
|
|
18
|
+
|
|
19
|
+
# Types
|
|
20
|
+
PulseEnv = Literal["dev", "ci", "prod"]
|
|
21
|
+
"""Environment type for the Pulse application.
|
|
22
|
+
|
|
23
|
+
Values:
|
|
24
|
+
"dev": Development environment with hot reload and debugging.
|
|
25
|
+
"ci": Continuous integration environment for testing.
|
|
26
|
+
"prod": Production environment with optimizations enabled.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
# Keys
|
|
30
|
+
ENV_PULSE_ENV = "PULSE_ENV"
|
|
31
|
+
ENV_PULSE_APP_FILE = "PULSE_APP_FILE"
|
|
32
|
+
ENV_PULSE_APP_DIR = "PULSE_APP_DIR"
|
|
33
|
+
ENV_PULSE_HOST = "PULSE_HOST"
|
|
34
|
+
ENV_PULSE_PORT = "PULSE_PORT"
|
|
35
|
+
ENV_PULSE_REACT_SERVER_ADDRESS = "PULSE_REACT_SERVER_ADDRESS"
|
|
36
|
+
ENV_PULSE_SECRET = "PULSE_SECRET"
|
|
37
|
+
ENV_PULSE_DISABLE_CODEGEN = "PULSE_DISABLE_CODEGEN"
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class EnvVars:
|
|
41
|
+
"""Singleton accessor for Pulse environment variables.
|
|
42
|
+
|
|
43
|
+
Provides typed getters and setters for all Pulse-related environment
|
|
44
|
+
variables. Access via the `env` singleton instance.
|
|
45
|
+
|
|
46
|
+
Example:
|
|
47
|
+
```python
|
|
48
|
+
from pulse.env import env
|
|
49
|
+
|
|
50
|
+
env.pulse_env = "prod"
|
|
51
|
+
if env.pulse_env == "dev":
|
|
52
|
+
print(f"Running on {env.pulse_host}:{env.pulse_port}")
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Attributes:
|
|
56
|
+
pulse_env: Current environment ("dev", "ci", "prod").
|
|
57
|
+
pulse_host: Server hostname. Defaults to "localhost".
|
|
58
|
+
pulse_port: Server port number. Defaults to 8000.
|
|
59
|
+
pulse_secret: Secret key for JWT session signing.
|
|
60
|
+
codegen_disabled: If True, skip code generation.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
def _get(self, key: str) -> str | None:
|
|
64
|
+
return os.environ.get(key)
|
|
65
|
+
|
|
66
|
+
def _set(self, key: str, value: str | None) -> None:
|
|
67
|
+
if value is None:
|
|
68
|
+
os.environ.pop(key, None)
|
|
69
|
+
else:
|
|
70
|
+
os.environ[key] = value
|
|
71
|
+
|
|
72
|
+
@property
|
|
73
|
+
def pulse_env(self) -> PulseEnv:
|
|
74
|
+
value = (self._get(ENV_PULSE_ENV) or "dev").lower()
|
|
75
|
+
if value not in ("dev", "ci", "prod"):
|
|
76
|
+
value = "dev"
|
|
77
|
+
return value
|
|
78
|
+
|
|
79
|
+
@pulse_env.setter
|
|
80
|
+
def pulse_env(self, value: PulseEnv) -> None:
|
|
81
|
+
self._set(ENV_PULSE_ENV, value)
|
|
82
|
+
|
|
83
|
+
# App file/dir
|
|
84
|
+
@property
|
|
85
|
+
def pulse_app_file(self) -> str | None:
|
|
86
|
+
return self._get(ENV_PULSE_APP_FILE)
|
|
87
|
+
|
|
88
|
+
@pulse_app_file.setter
|
|
89
|
+
def pulse_app_file(self, value: str | None) -> None:
|
|
90
|
+
self._set(ENV_PULSE_APP_FILE, value)
|
|
91
|
+
|
|
92
|
+
@property
|
|
93
|
+
def pulse_app_dir(self) -> str | None:
|
|
94
|
+
return self._get(ENV_PULSE_APP_DIR)
|
|
95
|
+
|
|
96
|
+
@pulse_app_dir.setter
|
|
97
|
+
def pulse_app_dir(self, value: str | None) -> None:
|
|
98
|
+
self._set(ENV_PULSE_APP_DIR, value)
|
|
99
|
+
|
|
100
|
+
# Host/port
|
|
101
|
+
@property
|
|
102
|
+
def pulse_host(self) -> str:
|
|
103
|
+
return self._get(ENV_PULSE_HOST) or "localhost"
|
|
104
|
+
|
|
105
|
+
@pulse_host.setter
|
|
106
|
+
def pulse_host(self, value: str) -> None:
|
|
107
|
+
self._set(ENV_PULSE_HOST, value)
|
|
108
|
+
|
|
109
|
+
@property
|
|
110
|
+
def pulse_port(self) -> int:
|
|
111
|
+
try:
|
|
112
|
+
return int(self._get(ENV_PULSE_PORT) or 8000)
|
|
113
|
+
except Exception:
|
|
114
|
+
return 8000
|
|
115
|
+
|
|
116
|
+
@pulse_port.setter
|
|
117
|
+
def pulse_port(self, value: int) -> None:
|
|
118
|
+
self._set(ENV_PULSE_PORT, str(value))
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def react_server_address(self) -> str | None:
|
|
122
|
+
return self._get(ENV_PULSE_REACT_SERVER_ADDRESS)
|
|
123
|
+
|
|
124
|
+
@react_server_address.setter
|
|
125
|
+
def react_server_address(self, value: str | None) -> None:
|
|
126
|
+
self._set(ENV_PULSE_REACT_SERVER_ADDRESS, value)
|
|
127
|
+
|
|
128
|
+
# Secrets
|
|
129
|
+
@property
|
|
130
|
+
def pulse_secret(self) -> str | None:
|
|
131
|
+
return self._get(ENV_PULSE_SECRET)
|
|
132
|
+
|
|
133
|
+
@pulse_secret.setter
|
|
134
|
+
def pulse_secret(self, value: str | None) -> None:
|
|
135
|
+
self._set(ENV_PULSE_SECRET, value)
|
|
136
|
+
|
|
137
|
+
# Flags
|
|
138
|
+
@property
|
|
139
|
+
def codegen_disabled(self) -> bool:
|
|
140
|
+
return self._get(ENV_PULSE_DISABLE_CODEGEN) == "1"
|
|
141
|
+
|
|
142
|
+
@codegen_disabled.setter
|
|
143
|
+
def codegen_disabled(self, value: bool) -> None:
|
|
144
|
+
self._set(ENV_PULSE_DISABLE_CODEGEN, "1" if value else None)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# Singleton
|
|
148
|
+
env = EnvVars()
|
|
149
|
+
"""Singleton instance for accessing Pulse environment variables.
|
|
150
|
+
|
|
151
|
+
Example:
|
|
152
|
+
```python
|
|
153
|
+
from pulse.env import env
|
|
154
|
+
|
|
155
|
+
env.pulse_env = "prod"
|
|
156
|
+
print(env.pulse_host) # "localhost"
|
|
157
|
+
print(env.pulse_port) # 8000
|
|
158
|
+
```
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
def mode() -> PulseEnv:
|
|
163
|
+
"""Returns the current pulse_env value.
|
|
164
|
+
|
|
165
|
+
Shorthand for `env.pulse_env`.
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
The current environment: "dev", "ci", or "prod".
|
|
169
|
+
|
|
170
|
+
Example:
|
|
171
|
+
```python
|
|
172
|
+
from pulse.env import mode
|
|
173
|
+
|
|
174
|
+
if mode() == "dev":
|
|
175
|
+
enable_debug_toolbar()
|
|
176
|
+
```
|
|
177
|
+
"""
|
|
178
|
+
return env.pulse_env
|