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.
Files changed (46) hide show
  1. instaui/components/component.py +4 -7
  2. instaui/components/element.py +0 -16
  3. instaui/components/html/button.py +2 -2
  4. instaui/components/html/input.py +2 -2
  5. instaui/components/html/select.py +3 -2
  6. instaui/components/html/textarea.py +2 -2
  7. instaui/components/match.py +4 -6
  8. instaui/components/mixins.py +12 -0
  9. instaui/components/vfor.py +2 -4
  10. instaui/components/vif.py +2 -4
  11. instaui/event/js_event.py +0 -2
  12. instaui/event/vue_event.py +0 -3
  13. instaui/event/web_event.py +25 -5
  14. instaui/fastapi_server/middlewares.py +12 -0
  15. instaui/fastapi_server/server.py +5 -1
  16. instaui/js/fn.py +5 -1
  17. instaui/pre_setup.py +45 -0
  18. instaui/runtime/_app.py +7 -3
  19. instaui/runtime/scope.py +74 -33
  20. instaui/spa_router/_route_model.py +5 -6
  21. instaui/static/insta-ui.esm-browser.prod.js +1523 -1504
  22. instaui/static/insta-ui.js.map +1 -1
  23. instaui/static/templates/web.html +5 -3
  24. instaui/static/templates/webview.html +4 -2
  25. instaui/static/templates/zero.html +4 -2
  26. instaui/template/web_template.py +1 -0
  27. instaui/template/webview_template.py +1 -0
  28. instaui/template/zero_template.py +1 -0
  29. instaui/ui/__init__.py +2 -0
  30. instaui/ui/__init__.pyi +2 -0
  31. instaui/ui_functions/server.py +10 -1
  32. instaui/vars/data.py +5 -7
  33. instaui/vars/js_computed.py +6 -22
  34. instaui/vars/mixin_types/element_binding.py +1 -13
  35. instaui/vars/ref.py +5 -7
  36. instaui/vars/vue_computed.py +6 -21
  37. instaui/vars/web_computed.py +6 -23
  38. instaui/watch/js_watch.py +0 -2
  39. instaui/watch/web_watch.py +11 -2
  40. instaui/webview/resource.py +2 -0
  41. instaui/zero/func.py +2 -0
  42. {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/METADATA +4 -3
  43. {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/RECORD +45 -44
  44. instaui/webview/func.py +0 -114
  45. {instaui-0.1.18.dist-info → instaui-0.2.0.dist-info}/WHEEL +0 -0
  46. {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
- scope: typing.Optional[Scope] = None
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(append_to_app=False) as 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.scope = scope
41
+ self.scopeId = scope.id
43
42
  self.vue_route_item.component = div._slot_manager.default._children
44
43
 
45
44
  return {
46
- "scope": dumps2dict(scope),
45
+ "scopeId": scope.id,
47
46
  "vueItem": self.vue_route_item,
48
47
  }
49
48