instaui 0.1.18__py2.py3-none-any.whl → 0.2.0__py2.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.
- instaui/components/component.py +4 -7
- instaui/components/element.py +0 -16
- instaui/components/html/button.py +2 -2
- instaui/components/html/input.py +2 -2
- instaui/components/html/select.py +3 -2
- instaui/components/html/textarea.py +2 -2
- instaui/components/match.py +4 -6
- instaui/components/mixins.py +12 -0
- instaui/components/vfor.py +2 -4
- instaui/components/vif.py +2 -4
- instaui/event/js_event.py +0 -2
- instaui/event/vue_event.py +0 -3
- instaui/event/web_event.py +25 -5
- instaui/fastapi_server/middlewares.py +12 -0
- instaui/fastapi_server/server.py +5 -1
- instaui/js/fn.py +5 -1
- instaui/pre_setup.py +45 -0
- instaui/runtime/_app.py +7 -3
- instaui/runtime/scope.py +74 -33
- instaui/spa_router/_route_model.py +5 -6
- instaui/static/insta-ui.esm-browser.prod.js +1523 -1504
- instaui/static/insta-ui.js.map +1 -1
- instaui/static/templates/web.html +5 -3
- instaui/static/templates/webview.html +4 -2
- instaui/static/templates/zero.html +4 -2
- instaui/template/web_template.py +1 -0
- instaui/template/webview_template.py +1 -0
- instaui/template/zero_template.py +1 -0
- instaui/ui/__init__.py +2 -0
- instaui/ui/__init__.pyi +2 -0
- instaui/ui_functions/server.py +10 -1
- instaui/vars/data.py +5 -7
- instaui/vars/js_computed.py +6 -22
- instaui/vars/mixin_types/element_binding.py +1 -13
- instaui/vars/ref.py +5 -7
- instaui/vars/vue_computed.py +6 -21
- instaui/vars/web_computed.py +6 -23
- instaui/watch/js_watch.py +0 -2
- instaui/watch/web_watch.py +11 -2
- instaui/webview/resource.py +2 -0
- instaui/zero/func.py +2 -0
- {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/METADATA +4 -3
- {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/RECORD +45 -44
- instaui/webview/func.py +0 -114
- {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/WHEEL +0 -0
- {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -5,7 +5,6 @@ from pydantic import BaseModel, Field, ConfigDict, field_serializer, model_seria
|
|
5
5
|
from instaui.components.html.div import Div
|
6
6
|
from instaui.runtime._app import get_app_slot, new_scope
|
7
7
|
from instaui.components.component import Component
|
8
|
-
from instaui.runtime.scope import Scope
|
9
8
|
from instaui.common.jsonable import dumps2dict
|
10
9
|
|
11
10
|
from . import _types
|
@@ -15,7 +14,7 @@ class RouteItem(BaseModel):
|
|
15
14
|
model_config = ConfigDict(arbitrary_types_allowed=True)
|
16
15
|
|
17
16
|
component_fn: typing.Optional[typing.Callable] = Field(exclude=True)
|
18
|
-
|
17
|
+
scopeId: typing.Optional[str] = None
|
19
18
|
vue_route_item: VueRouteItem = Field(serialization_alias="vueItem")
|
20
19
|
meta: typing.Optional[typing.Dict] = None
|
21
20
|
|
@@ -30,20 +29,20 @@ class RouteItem(BaseModel):
|
|
30
29
|
}
|
31
30
|
|
32
31
|
if self.vue_route_item.path is None:
|
33
|
-
self.vue_route_item.path = f"/{'' if self.component_fn.__name__=='index' else self.component_fn.__name__}"
|
32
|
+
self.vue_route_item.path = f"/{'' if self.component_fn.__name__ == 'index' else self.component_fn.__name__}"
|
34
33
|
|
35
34
|
app = get_app_slot()
|
36
|
-
with new_scope(
|
35
|
+
with new_scope() as scope:
|
37
36
|
with Div() as div:
|
38
37
|
self.component_fn()
|
39
38
|
|
40
39
|
app.items.pop()
|
41
40
|
|
42
|
-
self.
|
41
|
+
self.scopeId = scope.id
|
43
42
|
self.vue_route_item.component = div._slot_manager.default._children
|
44
43
|
|
45
44
|
return {
|
46
|
-
"
|
45
|
+
"scopeId": scope.id,
|
47
46
|
"vueItem": self.vue_route_item,
|
48
47
|
}
|
49
48
|
|