instaui 0.1.8__py3-none-any.whl → 0.1.10__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 (46) hide show
  1. instaui/_helper/observable_helper.py +11 -1
  2. instaui/arco/components/select.py +4 -1
  3. instaui/arco/static/instaui-arco.css +1 -1
  4. instaui/arco/static/instaui-arco.js +55771 -55771
  5. instaui/components/echarts/echarts.js +7 -5
  6. instaui/components/echarts/echarts.py +1 -1
  7. instaui/components/element.py +12 -22
  8. instaui/components/grid.py +63 -11
  9. instaui/components/html/paragraph.py +10 -0
  10. instaui/components/html/select.py +0 -5
  11. instaui/components/html/table.py +1 -1
  12. instaui/components/label.py +5 -0
  13. instaui/components/row.py +0 -3
  14. instaui/components/shiki_code/static/shiki-style.css +179 -179
  15. instaui/event/js_event.py +24 -0
  16. instaui/event/vue_event.py +66 -0
  17. instaui/event/web_event.py +36 -25
  18. instaui/experimental/__init__.py +1 -2
  19. instaui/handlers/_utils.py +27 -5
  20. instaui/shadcn_classless/static/shadcn-classless.css +403 -403
  21. instaui/spa_router/_file_base_utils.py +20 -16
  22. instaui/static/insta-ui.css +1 -1
  23. instaui/static/insta-ui.esm-browser.prod.js +3683 -3663
  24. instaui/static/insta-ui.js.map +1 -1
  25. instaui/systems/func_system.py +15 -0
  26. instaui/template/webview_template.py +0 -2
  27. instaui/ui/__init__.py +5 -1
  28. instaui/ui/__init__.pyi +5 -1
  29. instaui/ui_functions/ui_page.py +3 -3
  30. instaui/vars/js_computed.py +25 -1
  31. instaui/vars/state.py +15 -0
  32. instaui/vars/web_computed.py +42 -0
  33. instaui/watch/js_watch.py +37 -1
  34. instaui/watch/web_watch.py +53 -0
  35. instaui/webview/__init__.py +1 -0
  36. instaui/webview/index.py +0 -1
  37. instaui-0.1.10.dist-info/METADATA +153 -0
  38. {instaui-0.1.8.dist-info → instaui-0.1.10.dist-info}/RECORD +70 -73
  39. {instaui-0.1.8.dist-info → instaui-0.1.10.dist-info}/WHEEL +1 -1
  40. instaui/experimental/link_sql/__init__.py +0 -3
  41. instaui/experimental/link_sql/_base.py +0 -23
  42. instaui/experimental/link_sql/_duckdb.py +0 -221
  43. instaui/experimental/link_sql/_types.py +0 -15
  44. instaui/experimental/link_sql/data_source.js +0 -50
  45. instaui-0.1.8.dist-info/METADATA +0 -160
  46. {instaui-0.1.8.dist-info → instaui-0.1.10.dist-info/licenses}/LICENSE +0 -0
@@ -1,160 +0,0 @@
1
- Metadata-Version: 2.3
2
- Name: instaui
3
- Version: 0.1.8
4
- Summary: insta-ui is a Python-based UI library for rapidly building user interfaces.
5
- License: MIT
6
- Author: CrystalWindSnake
7
- Author-email: 568166495@qq.com
8
- Requires-Python: >=3.8,<3.13
9
- Classifier: License :: OSI Approved :: MIT License
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3.8
12
- Classifier: Programming Language :: Python :: 3.9
13
- Classifier: Programming Language :: Python :: 3.10
14
- Classifier: Programming Language :: Python :: 3.11
15
- Classifier: Programming Language :: Python :: 3.12
16
- Provides-Extra: all
17
- Provides-Extra: web
18
- Provides-Extra: webview
19
- Requires-Dist: fastapi[standard] ; extra == "all"
20
- Requires-Dist: fastapi[standard] ; extra == "web"
21
- Requires-Dist: jinja2 (>=3.1.4,<4.0.0)
22
- Requires-Dist: orjson (>=3.10.15,<4.0.0)
23
- Requires-Dist: pydantic (>=2.10.6,<3.0.0)
24
- Requires-Dist: pydantic (>=2.10.6,<3.0.0) ; extra == "web"
25
- Requires-Dist: pydantic (>=2.10.6,<3.0.0) ; extra == "webview"
26
- Requires-Dist: pywebview ; extra == "all"
27
- Requires-Dist: pywebview ; extra == "webview"
28
- Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
29
- Requires-Dist: uvicorn ; extra == "all"
30
- Requires-Dist: uvicorn ; extra == "web"
31
- Description-Content-Type: text/markdown
32
-
33
- # insta-ui
34
-
35
- <div align="center">
36
-
37
- English| [简体中文](./README.md)
38
-
39
- </div>
40
-
41
-
42
- ## 📖 Introduction
43
- insta-ui is a Python-based UI library for rapidly building user interfaces.
44
-
45
-
46
- ## ⚙️ Features
47
-
48
- Three modes are provided:
49
-
50
- - Zero mode: Generates pure HTML files, requiring no dependencies. Simply open in a browser to run.
51
- - Web mode: Generates web applications.
52
- - Web view mode: Generates web view applications that can be packaged into local applications (without needing to start a web server).
53
-
54
-
55
- ## 📦 Installation
56
-
57
- For zero mode:
58
-
59
- ```
60
- pip install instaui -U
61
- ```
62
-
63
- For web mode:
64
-
65
- ```
66
- pip install instaui[web] -U
67
- ```
68
-
69
- For web view mode:
70
- ```
71
- pip install instaui[webview] -U
72
- ```
73
-
74
-
75
-
76
- ## 🖥️ Quick Start
77
-
78
- Here's a Counter example where clicking the button will display the current count value on the button text.
79
-
80
- zore mode:
81
-
82
- ```python
83
- from instaui import ui, html, zero
84
-
85
- with zero():
86
- count = ui.ref(0)
87
- text = ui.str_format("Count: {}", count)
88
-
89
- html.button(text).on_click(
90
- "()=> count.value++", bindings={"count": count}
91
- )
92
-
93
- ui.to_html("./test.html")
94
-
95
- ```
96
-
97
- Running the above code will generate a test.html file, which you can open in a browser to see the effect.
98
-
99
-
100
-
101
- Web mode:
102
-
103
- ```python
104
- from instaui import ui, html
105
-
106
- @ui.page("/")
107
- def counter():
108
- count = ui.ref(0)
109
- text = ui.str_format("Count: {}", count)
110
-
111
- html.button(text).on_click("()=> count.value++", bindings={"count": count})
112
-
113
-
114
- ui.server().run()
115
- ```
116
-
117
- In web mode, we can define interaction functions for complex computations.
118
-
119
- ```python
120
- from instaui import ui, html
121
-
122
- @ui.page("/")
123
- def counter():
124
- count = ui.ref(0)
125
- # text = ui.str_format("Count: {}", count)
126
-
127
- @ui.computed(inputs=[count])
128
- def text(count: int):
129
- # Any Python operation
130
- return f"Current Count: {count}"
131
-
132
-
133
- html.button(text).on_click("()=> count.value++", bindings={"count": count})
134
-
135
-
136
- ui.server().run()
137
- ```
138
-
139
- - The computation of `text` will generate network requests.
140
- - Button clicks, due to using JS binding, do not require network requests.
141
-
142
- You can choose to handle any computation with either Python or JavaScript. Below is an example of handling the button click event using Python.
143
-
144
- ```python
145
- @ui.page("/")
146
- def counter():
147
- count = ui.ref(0)
148
-
149
- @ui.computed(inputs=[count])
150
- def text(count: int):
151
- return f"Current Count: {count}"
152
-
153
- @ui.event(inputs=[count], outputs=[count])
154
- def add_count(count: int):
155
- return count + 1
156
-
157
- html.button(text).on_click(add_count)
158
-
159
- ```
160
-