instaui 0.1.1__py3-none-any.whl → 0.1.2__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 (34) hide show
  1. instaui/components/component.py +1 -1
  2. instaui/components/element.py +37 -17
  3. instaui/components/html/checkbox.py +0 -7
  4. instaui/components/vfor.py +1 -1
  5. instaui/dependencies/component_dependency.py +16 -0
  6. instaui/dependencies/plugin_dependency.py +28 -0
  7. instaui/fastapi_server/debug_mode_router.py +0 -1
  8. instaui/fastapi_server/dependency_router.py +21 -0
  9. instaui/fastapi_server/resource.py +35 -0
  10. instaui/fastapi_server/server.py +124 -100
  11. instaui/html_tools.py +12 -106
  12. instaui/page_info.py +1 -11
  13. instaui/runtime/_app.py +9 -20
  14. instaui/runtime/resource.py +11 -46
  15. instaui/static/insta-ui.esm-browser.prod.js +3663 -3663
  16. instaui/static/insta-ui.iife.js +29 -29
  17. instaui/static/templates/web.html +32 -76
  18. instaui/static/templates/zero.html +48 -32
  19. instaui/systems/file_system.py +0 -9
  20. instaui/template/web_template.py +40 -46
  21. instaui/template/zero_template.py +100 -15
  22. instaui/ui/__init__.py +2 -5
  23. instaui/ui_functions/ui_page.py +3 -18
  24. instaui/vars/path_var.py +2 -1
  25. instaui/zero/func.py +111 -0
  26. instaui/zero/scope.py +12 -1
  27. {instaui-0.1.1.dist-info → instaui-0.1.2.dist-info}/METADATA +1 -1
  28. {instaui-0.1.1.dist-info → instaui-0.1.2.dist-info}/RECORD +30 -29
  29. instaui/dependencies/__init__.py +0 -15
  30. instaui/dependencies/component_registrar.py +0 -82
  31. instaui/dependencies/installer.py +0 -5
  32. instaui/fastapi_server/config_router.py +0 -60
  33. {instaui-0.1.1.dist-info → instaui-0.1.2.dist-info}/LICENSE +0 -0
  34. {instaui-0.1.1.dist-info → instaui-0.1.2.dist-info}/WHEEL +0 -0
@@ -4,15 +4,15 @@ instaui/boot_info.py,sha256=2uIkRaNhuUCG6Jbyl2Gb0_1IbVxtfJ8s2j6X1XXdSk0,905
4
4
  instaui/common/jsonable.py,sha256=efzn_IvfrsaNKjc3B3UzshoMvsqSsB-jnD2Aia8YMYM,902
5
5
  instaui/components/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  instaui/components/column.py,sha256=IjSfrtH8Ez-DMOZWUULUpmA5s8CWl1DY1o4q0ztJCg8,608
7
- instaui/components/component.py,sha256=aTrBm7XHUk1835Vqjx284iGUcOfG12umd8Z1TkYTRGw,1271
7
+ instaui/components/component.py,sha256=cfKWlhxATdvERSzsVzvLtm61f72_gblhLJXIrXLGQrk,1284
8
8
  instaui/components/content.py,sha256=et3n8O-36vKRhfNl0y-5lA9pSSEM323Pc0fBMa00pkU,1088
9
9
  instaui/components/directive.py,sha256=bHSOWXNhzWRVNqLXwhc_hY3R3g-JAQ5DWIqpZkI6_wI,1411
10
- instaui/components/element.py,sha256=J6ZLNmle3B0Ys8Fa0-DRCltLCrpi8EXH8Qlvp2w38FQ,14743
10
+ instaui/components/element.py,sha256=eC7SZSM4kSdqadDc5SQsAcLq5HCdHa_KD27Qd9CZZis,15269
11
11
  instaui/components/grid.py,sha256=VPqiEMbLkRukeMkHjE2fTnZdKJrbcuBLrU05TpocfL8,2403
12
12
  instaui/components/html/__init__.py,sha256=seR029kPHbfCFNYawXryoJr-KXn-_B9OB2qdUwz02RM,786
13
13
  instaui/components/html/_mixins.py,sha256=5dcSM9h1PswIKL6_eiqUxqW4H2OCuyNeCuRZq3gDGOc,876
14
14
  instaui/components/html/button.py,sha256=lB5SYC2Q8b3dOHLBclJW8yaWBuhoe0qNhpKeEifRDJc,820
15
- instaui/components/html/checkbox.py,sha256=1qy7vgeiELztIDSw9KA57iAIIxhKSFKsHp9TH1GkGlU,1283
15
+ instaui/components/html/checkbox.py,sha256=29BTpovcJvrN2uQY280dn8KTyspwBBvLeKSxUv3CxjU,1066
16
16
  instaui/components/html/date.py,sha256=MOodsG83JDtb_8l26QWRb7taiPHUAJI6wjt_AjSAJT0,833
17
17
  instaui/components/html/div.py,sha256=fF9rBlOBIl-tDvml1DtJK9lFfFY0SBcP5bn36pluis4,167
18
18
  instaui/components/html/form.py,sha256=C-QVtwX18zH8ZuVK93weGwlRWfSyTGWY_CYIdGcaslU,169
@@ -31,12 +31,11 @@ instaui/components/row.py,sha256=dvLbVmXFgigBZo1OKK6fFyJdrYHPms5-EZ11PVPD23I,388
31
31
  instaui/components/slot.py,sha256=RT0eU7wH7ffFDkl5ucfrNXB1nbsKDq688Hp920TZaoo,2287
32
32
  instaui/components/transition_group.py,sha256=H9zx9NTlCoQnBArWfmxmh7CMKb5hZn8vKrFe4OFxPrE,201
33
33
  instaui/components/value_element.py,sha256=Y10W4Hus-k-Og2ft2noBdVqF_Hq3x54vFdVvi1Tlf_I,1236
34
- instaui/components/vfor.py,sha256=hPkTk8sBVXRodmIu-9aXugrxK-AlexkiG3mP1KmYbXQ,4015
34
+ instaui/components/vfor.py,sha256=6zj2-27hMNQtr5PPcCRriKxVX1YRluTWuCbwPGzoBA0,4030
35
35
  instaui/components/vif.py,sha256=2E62-8J9NIlZDhvgIOuDwz0tLLb6VoJ1ji1K4okrapw,1165
36
36
  instaui/consts.py,sha256=2T-M4z3dT_sAsr7W1FAGWjS2bCm0VEfqMWveAJglpv8,805
37
- instaui/dependencies/__init__.py,sha256=wSIpU-bI1JogS80XSI38VrPFt4rwItujgGw41lQ3JO8,349
38
- instaui/dependencies/component_registrar.py,sha256=YH9E9BbRPT39EcgDpRblwaTl2Fmp8SPpOdPglkvzDRA,2306
39
- instaui/dependencies/installer.py,sha256=xP-AiNdvJHqupeqIwsWu2rrOGT-wvWPcRyj1w7Hs0-s,91
37
+ instaui/dependencies/component_dependency.py,sha256=U4CUV4dY54iW16cHsoAymC8N2H-VRzApiavpBR5heMY,486
38
+ instaui/dependencies/plugin_dependency.py,sha256=6u562ihKbiL3DE4hBrGjauS2nzYEC2glOVN0fwEVNVc,806
40
39
  instaui/event/event_mixin.py,sha256=cN0Wh95e1wX183mGnGFm8BK_aEHWJ8WNx3Upy75mU_4,286
41
40
  instaui/event/js_event.py,sha256=vA8fBuD7jeMU7HMsXC1b6OM3wO4phQDu149P1ZxtwhQ,1738
42
41
  instaui/event/web_event.py,sha256=1_TBXYuyhZnxhV6U0D10JtUXzYBQoEDqPR9ZYTx8_Is,3208
@@ -44,31 +43,32 @@ instaui/experimental/__init__.py,sha256=mla0-czeN-1mBNReWSEnMLwBvERMVceQfHGAdCdl
44
43
  instaui/experimental/debug.py,sha256=UGUWgNZ3ShanpuxfuPdx52TgQrkO9hByABYMnPZEIiE,1325
45
44
  instaui/fastapi_server/_utils.py,sha256=MCqbebS4UkBOV8fp3Oy415Tvxnqi2mnMl5Eqe6yJogg,1177
46
45
  instaui/fastapi_server/_uvicorn.py,sha256=n-es5ajWepXb6xF9EP0ft2lrEbsyLGWMUE7uVqpkUAs,1174
47
- instaui/fastapi_server/config_router.py,sha256=VVlF8Vb_mgQE0E81c3ICOz7kUgc4KkRGUAVgTKFsVTk,1568
48
- instaui/fastapi_server/debug_mode_router.py,sha256=2UbfImld1ZPRRt5_17l4ZYRWKVAlNetRkKkAyu79LuU,1586
46
+ instaui/fastapi_server/debug_mode_router.py,sha256=n5i9SP300Wvji_ziuzOOVqvrl9bswj6BQ1Ka0RiVpVg,1543
47
+ instaui/fastapi_server/dependency_router.py,sha256=8OczS9OK73dbFCLUgHmm9FTtLmOQ1qLtdperPS3q4YQ,515
49
48
  instaui/fastapi_server/event_router.py,sha256=_b0UNaPiwGwk7ElcF7XQnZfraPyWG2Miv9-wg-RI-PU,1648
50
49
  instaui/fastapi_server/middlewares.py,sha256=XyXjdGjH5hJ47ZK8EBeOln4Db1rfRijZpEGl3xmYQqU,643
51
50
  instaui/fastapi_server/request_context.py,sha256=EV5ZG4zgI_NPlTxinqO4AIREj6rbb1-HcjKCMa2Unfs,521
52
- instaui/fastapi_server/server.py,sha256=bNQyIkP31ivYeuVBxiGQDyzS_CctW2BPUObpNDzz80w,8266
51
+ instaui/fastapi_server/resource.py,sha256=HBAjYHOr1ik564IqHB0AHEPwO8SLizLLMsXqkJsDLwE,1023
52
+ instaui/fastapi_server/server.py,sha256=Uzr44b-kPsSS_O4CptZIIaCViZD97GCYPsDsKQtIFFo,8688
53
53
  instaui/fastapi_server/watch_router.py,sha256=KC8AbGNpH2x11PHQMPgc9N5WOlqW05i6r0PTU5A35rI,1599
54
54
  instaui/handlers/_utils.py,sha256=EB5mTb6flhMeuwm2Byb5jp18WqMngOuv3jC_PmycrA0,2076
55
55
  instaui/handlers/computed_handler.py,sha256=vlX29BJlJ8BNVR5HJRRl_nTOyf5cFdg7YhzSnXqKtJc,1067
56
56
  instaui/handlers/config_handler.py,sha256=I2Paut7lZJ-u0LXNmSgtie67APyZfEOEv8JMducYEL8,303
57
57
  instaui/handlers/event_handler.py,sha256=HVeKks1Widy7OemMNxURk5L8x6-CbI3pV05ATl7OGaI,1633
58
58
  instaui/handlers/watch_handler.py,sha256=LZTo6AiklHs7BqOHwCPpDKSigqOmK9kusTkbogB2-_Q,1468
59
- instaui/html_tools.py,sha256=0X9XE1ifTxhyjzvAjyHjd5WEujaD1yEXo2j7O83K5_o,4073
59
+ instaui/html_tools.py,sha256=FirtDZodg_YQCl3P9QwqilVttcnjSbdkT-qQk875MUQ,1142
60
60
  instaui/inject.py,sha256=yaEgsySd-5EYDjb-Wn5i2-K1tsUBdZyi_ViUplgnjrQ,731
61
61
  instaui/js/__init__.py,sha256=oIYLPskHpQf8a4SWHLX4DyKjrlDrqWaqbNksIQsLBoA,69
62
62
  instaui/js/js_output.py,sha256=a4tZ99P19oen4510qI9LWX6pX0-lH5y37v8va6UY62Y,382
63
63
  instaui/js/lambda_func.py,sha256=ulCJ1lzF4h3jGihVTwltS3xEDPbTegjzIN8Al7U4Ank,1004
64
64
  instaui/launch_collector.py,sha256=_YmF3hsNWe-ZxMp_amqUBHkhB6fOuTPfX16BVwn25xg,1731
65
- instaui/page_info.py,sha256=3PLnTv-ItZlDrNRbhrTIVgm3aUTh50T6Qimddkvxx0Q,623
65
+ instaui/page_info.py,sha256=aJtfLp2h05tCuLzxk2pZ6a9ztyxSdI-g3NBRxbqpS6E,269
66
66
  instaui/runtime/__init__.py,sha256=4aYTDsKaloRMQns8ttdfSx5xLmcN0Ot6tMqELbjIDZg,667
67
- instaui/runtime/_app.py,sha256=WJpMhff3pLMdkItDS11g2EpTotZgpJdzarsC198tso0,6284
67
+ instaui/runtime/_app.py,sha256=ZnZvITMel77elQjnccbcVT7y2Pinwqy8FvhHwEwv-_A,5899
68
68
  instaui/runtime/_inner_helper.py,sha256=Aw7S_KtCuOlpd8NP2RuQvNTL1GJtpxQGLsKdc3VXQFY,326
69
69
  instaui/runtime/context.py,sha256=MXwyKnX1X13peHOUbYzwAMflaA1WoQrNkGbi5C_0ErU,1086
70
70
  instaui/runtime/dataclass.py,sha256=dr3hN4YjFXPzckRX9HR87t1-gPjT9RNq9YV-0uJnjHo,587
71
- instaui/runtime/resource.py,sha256=nD98oKqPHDzYcAutGmtAHVNvPRl1OGkpX1D_ZGqbwMs,3104
71
+ instaui/runtime/resource.py,sha256=X20TEO-mvkWwsELycSXZ1t8BDXJjIp0kf5mfycYjcUY,1735
72
72
  instaui/runtime/scope.py,sha256=CG8o3TmisLCSp6zHhj0vI4bJgEzDitUXw5ox9BNb3z4,3779
73
73
  instaui/runtime/ui_state_scope.py,sha256=g48VpQj0BboooUrPr5VIWvcQoJe0bIQARMwRyVEE0I8,314
74
74
  instaui/settings/__init__.py,sha256=nK_xDrlq7CPjm9x3EKsKUW5qWBg_1d-xbqAp_i5G8cc,70
@@ -86,32 +86,32 @@ instaui/spa_router/_router_param_var.py,sha256=KCy54xBZxGMqLO3Zlbzr6XV8ts-M6jCOK
86
86
  instaui/spa_router/_types.py,sha256=KuGuv5C6qivwllfdmV5qrvM0S_GWJ6u8OOTkCNmJImU,81
87
87
  instaui/spa_router/templates/page_routes,sha256=8VjM_8f6pjFb01QbU9z5HNqpcNRdCiX3X0OqNHLq8fo,1355
88
88
  instaui/static/insta-ui.css,sha256=B0xrNK9qVoRwRXhnTT8OascdHFeUk7vtfr7VhoA23_Y,297
89
- instaui/static/insta-ui.esm-browser.prod.js,sha256=gz3EFnwRRXx3F1t4Fp4fikkr0kjAWZ1xICdBuOnslGw,104366
90
- instaui/static/insta-ui.iife.js,sha256=JhloLLlMG3D7s6LTpcV9K7f42khfd8ZjzUl1uMR2DEY,71856
89
+ instaui/static/insta-ui.esm-browser.prod.js,sha256=d-XH08dCFhTbJ97IxCFnfA8JRToJwYvdM3Z812JrnJw,108029
90
+ instaui/static/insta-ui.iife.js,sha256=ZahZqkh_wOrxNGaAXk3MZHrE3sKvOzs1dyYq1987NPE,71885
91
91
  instaui/static/insta-ui.iife.js.map,sha256=kn3azChvTCovyT0u4xg02i4DXoy97FTMsMEWMb8nPLc,646544
92
92
  instaui/static/insta-ui.js.map,sha256=hEYm8Kj9veIDKyAqmvQOYIMG_uPuO0lwBpIMxy49XlQ,656435
93
93
  instaui/static/tailwindcss.min.js,sha256=rR1MZFeOQv5aofD10TzUia9_YGdMGdtIPSSVT0WKR_Y,366328
94
94
  instaui/static/templates/debug/sse.html,sha256=-E2JvLkXGOJ1kG7YxeeE2sH825ZGhwDyqmEfJfKm1zk,3386
95
- instaui/static/templates/web.html,sha256=oj5N_2_BDlgCqI_cJPCM8misxQSVXeheFuTJywi4zt4,2872
96
- instaui/static/templates/zero.html,sha256=kOu99ogWFxKL-y-3WZnGxJh4ZF8HF3IPTZirX22QQWs,1270
95
+ instaui/static/templates/web.html,sha256=pCHoQIPUO03GX_aZ5zNjRYQC9b0GPFtoYE9P8eo5pHc,1789
96
+ instaui/static/templates/zero.html,sha256=_PHhx6uYD__tlt_bXG4j1WoZGnMBXIs2w2sU6-1zvH4,1684
97
97
  instaui/static/vue.esm-browser.prod.js,sha256=vwQkXANuVYQuEFc0VgiokJdhNyMmvxMKyb1FmrYrNb4,162662
98
98
  instaui/static/vue.global.prod.js,sha256=xFm6fMjbZcmCWJ-l1kx_9HiHfo5bD9dWgyB87GpOieg,157924
99
99
  instaui/static/vue.runtime.esm-browser.prod.js,sha256=74FfP_s9pycfQXWAiGWx6SbjV_oJvMwZLFBkEXeW1Ek,102024
100
- instaui/systems/file_system.py,sha256=aLFjE-6o3AVIHtwDJzrMapvkf-TIvix73npMBVWzuNY,487
100
+ instaui/systems/file_system.py,sha256=8xt8IcuYfj5hcofDm306lQdL7hSH9Zzxxe9PMqNSgAs,211
101
101
  instaui/systems/func_system.py,sha256=iEnskq2vE4TUekJhMLc9hvv-iiougkxi1qXbvSEGovs,2806
102
102
  instaui/systems/js_system.py,sha256=t_r7SFPmfvTiIrxzuf1YgHyi_Oi_81W0UH_kkC5MwmM,685
103
103
  instaui/systems/pydantic_system.py,sha256=qibHh4QqjLNPBzyrCkJVJwCk1dC_H8gEDYYf8Sb-5ps,691
104
104
  instaui/systems/string_system.py,sha256=NzB7rgy7BZAYXAYDEWJQSvuYNui2TbLbrc9itVZGLmE,247
105
105
  instaui/template/__init__.py,sha256=fuua3uCOCmhWb7Q6Sc6pUxfwlxYJTXkdWB1V2fubyyc,141
106
106
  instaui/template/env.py,sha256=ZqVsqpfSY1mupbgpBSkvOJytNui8xfNR5kNNC9rv4Ps,150
107
- instaui/template/web_template.py,sha256=K6_dcpLmer78tetZb780MzMe2QHAV-Bn7WgI4L2zDKI,2009
108
- instaui/template/zero_template.py,sha256=XdUK7V9OPJj5rV7kTjHBbbzQM5O6VPVhiKFaczqtq20,742
109
- instaui/ui/__init__.py,sha256=xmddwePuEo6cavfovjEyp2r03DUvBD6Ah7o4nmnl7nk,3577
107
+ instaui/template/web_template.py,sha256=MJ_ChBHYg2oCsmuVXu97-XiJ94EQcDHq66q3we2MhHs,1584
108
+ instaui/template/zero_template.py,sha256=jCfvc92KWkl0xpwlx9b8T38HABsT4jZ00RjHqLpz_vM,3654
109
+ instaui/ui/__init__.py,sha256=V-CEErQoS8M4BVirO9tlMGqSGwvEZLyR-nw_zvm8zCM,3507
110
110
  instaui/ui/events.py,sha256=4OZ-qFU2S4WG0WSq0Hjh9T_GOPWyPqPSr9PZ8sjVU-M,808
111
111
  instaui/ui_functions/input_slient_data.py,sha256=0A5DegIt_MqdZgbj1RiVFNmB_RUqgov9FYtkw6VX0DE,511
112
112
  instaui/ui_functions/server.py,sha256=75Th_PhcbHcA9vAqrymGoZm2xNcOHMe0UZpypgbTRy8,287
113
113
  instaui/ui_functions/str_format.py,sha256=ECWttA4LlNHlvdT_73wGF_I68soWNEXTP_Hosmxt-m4,1139
114
- instaui/ui_functions/ui_page.py,sha256=-7wk1Z_7V0HTvuf6TYm_Hmbbg-zM4RZlCNKWzgz4la8,1033
114
+ instaui/ui_functions/ui_page.py,sha256=QbXIKajnDxeutf06wXn7wZ8FgELS-eXedn5HwtuDoT8,357
115
115
  instaui/ui_functions/ui_types.py,sha256=J5tqFFkoZJMuoLeTqU52KNgw3kdB_IfcrhaBmyI6NAA,505
116
116
  instaui/ui_functions/url_location.py,sha256=zyTAJpA-3GBBe7WAiP2IDKQxeQhu0LNgBOxwEzcDaDk,823
117
117
  instaui/vars/__init__.py,sha256=yR-gU9FPEYUjWD7CS3RKT0JeAEuF2EPG99AwXFiLhAg,250
@@ -129,7 +129,7 @@ instaui/vars/mixin_types/pathable.py,sha256=40H5f1gCDtKs4Qor0C-moB821T7Df8DOgUcn
129
129
  instaui/vars/mixin_types/py_binding.py,sha256=VIVSrHrjcltsP5ADKHtMSZBpi2qKyameXqoEevdfqk8,237
130
130
  instaui/vars/mixin_types/str_format_binding.py,sha256=i2jXm1RKddPnGrCxEyz0tkDrBU2FfjR0EviQ0RKZsbY,257
131
131
  instaui/vars/mixin_types/var_type.py,sha256=FQj1TEkjT7HopDPztt0-J6eQVGHjem3KBFsjZwvcvYg,57
132
- instaui/vars/path_var.py,sha256=UdyLMDdpUlPJBmoAEVG3IxaoKCRKqRdIUQHnFGMwH3I,2790
132
+ instaui/vars/path_var.py,sha256=DOgYHoajWKcMHMKYMSBiEOA99mmHIaMH-HRDvAKTZyE,2820
133
133
  instaui/vars/ref.py,sha256=WPLZiWK0SRSTo87IVhvndMCR-G3_QO9OfoP2C3VwSYs,2522
134
134
  instaui/vars/slot_prop.py,sha256=qBVQ0Ze0T8-Wsy__8qEuqVESIrLX69Bmy21Kuxrg_GQ,1198
135
135
  instaui/vars/state.py,sha256=N6yLcVkiyCpK5oR8C2KbggFmLwpgBgzylp11JgFiab8,2630
@@ -145,8 +145,9 @@ instaui/watch/js_watch.py,sha256=k9lgtyUGZ8a549QITcNie2kGbT0BJuYqfouoOex0Dqs,218
145
145
  instaui/watch/vue_watch.py,sha256=n6yVt2ruKCjx-ZnIb29ytN9ugDas1JpUBOJeQ_FSYAA,1571
146
146
  instaui/watch/web_watch.py,sha256=Gl0AZ9ji_A7tAoqsvyHmBOAYaX1CHxowVONlZKy8nd8,3763
147
147
  instaui/zero/__init__.py,sha256=N0LuRUAcaurxHSspcEDuwZg62W2S3qL4VtrMKxOivBE,49
148
- instaui/zero/scope.py,sha256=i4RqD1doMvyrAwQY3NpdPbMaIGbZE2crV3VZyj1k0VA,204
149
- instaui-0.1.1.dist-info/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
150
- instaui-0.1.1.dist-info/METADATA,sha256=6M12PNmMvDs2Gv4vzBoluCXls_EejCvohpPfkYbx8Pw,3474
151
- instaui-0.1.1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
152
- instaui-0.1.1.dist-info/RECORD,,
148
+ instaui/zero/func.py,sha256=qu-_fOALj5StNemY-_43kJ8AikaAUGTS_HtO7mFWHlY,3391
149
+ instaui/zero/scope.py,sha256=p15fZRmvvNi6prIdY2j7iUYGHxcPpK3df0A3P70-Dy4,464
150
+ instaui-0.1.2.dist-info/LICENSE,sha256=_JjnAWrikJ6qkwT7PazeFNRlcIu8q_RH3mYcHTxEF5c,1094
151
+ instaui-0.1.2.dist-info/METADATA,sha256=NJEkxo3sPwurZp_F91Zx3e2evrfTnHpEQyeA8fO4cZg,3474
152
+ instaui-0.1.2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
153
+ instaui-0.1.2.dist-info/RECORD,,
@@ -1,15 +0,0 @@
1
- from .component_registrar import (
2
- ComponentRegistrationInfo,
3
- register_component,
4
- PluginRegistrationInfo,
5
- register_plugin,
6
- )
7
- from .installer import install_component
8
-
9
- __all__ = [
10
- "ComponentRegistrationInfo",
11
- "register_component",
12
- "PluginRegistrationInfo",
13
- "register_plugin",
14
- "install_component",
15
- ]
@@ -1,82 +0,0 @@
1
- import inspect
2
- from pathlib import Path
3
- from typing import List, Optional, Type, Union
4
- from instaui.systems.file_system import generate_hash_name_from_path
5
- from dataclasses import dataclass, field
6
- from instaui.runtime import get_app_slot
7
- from instaui.runtime._app import App
8
-
9
-
10
- class ComponentRegistrar:
11
- def __init__(self, js_file: Path):
12
- self.js_file = js_file
13
- self.key = f"{generate_hash_name_from_path(js_file.parent)}/{js_file.name}"
14
- self.name = js_file.stem
15
-
16
- def __hash__(self) -> int:
17
- return hash(self.js_file)
18
-
19
- def __eq__(self, other: object) -> bool:
20
- if not isinstance(other, ComponentRegistrar):
21
- return False
22
- return self.js_file == other.js_file
23
-
24
- @classmethod
25
- def create(cls, js_file: Union[str, Path], target_class: Type):
26
- js_file = Path(js_file)
27
- base = Path(inspect.getfile(target_class)).parent
28
- if not js_file.is_absolute():
29
- js_file = base / js_file
30
- return cls(js_file)
31
-
32
-
33
- @dataclass(frozen=True)
34
- class ComponentRegistrationInfo:
35
- name: str
36
- esm: Optional[Path] = None
37
- iife: Optional[Path] = None
38
- css: List[Path] = field(default_factory=list, compare=False)
39
-
40
-
41
- @dataclass(frozen=True)
42
- class PluginRegistrationInfo:
43
- name: str
44
- esm: Optional[Path] = None
45
- iife: Optional[Path] = None
46
- css: List[Path] = field(default_factory=list, compare=False)
47
-
48
-
49
- def register_plugin(
50
- name: str,
51
- esm: Optional[Path] = None,
52
- iife: Optional[Path] = None,
53
- css: Optional[Union[Path, List[Path]]] = None,
54
- shared: bool = False,
55
- ):
56
- css = [css] if isinstance(css, Path) else css
57
-
58
- cr = PluginRegistrationInfo(name, esm, iife, css or [])
59
-
60
- if shared:
61
- App.default_plugins(cr)
62
-
63
- get_app_slot().register_plugin(cr)
64
- return cr
65
-
66
-
67
- def register_component(
68
- name: str,
69
- esm: Optional[Path] = None,
70
- iife: Optional[Path] = None,
71
- css: Optional[Union[Path, List[Path]]] = None,
72
- shared: bool = False,
73
- ):
74
- css = [css] if isinstance(css, Path) else css
75
-
76
- cr = ComponentRegistrationInfo(f"instaui-{name}", esm, iife, css or [])
77
-
78
- if shared:
79
- App.default_js_components(cr)
80
-
81
- get_app_slot().register_component(cr)
82
- return cr
@@ -1,5 +0,0 @@
1
- from typing import Callable
2
-
3
-
4
- def install_component(install: Callable):
5
- install()
@@ -1,60 +0,0 @@
1
- from typing import Dict
2
- from fastapi import FastAPI
3
- from contextlib import contextmanager
4
- from instaui.html_tools import to_config_data
5
- from instaui.handlers import config_handler
6
- from instaui.launch_collector import get_launch_collector
7
- from . import _utils
8
-
9
-
10
- def create_router(app: FastAPI):
11
- _async_config_handler(app)
12
- _sync_config_handler(app)
13
-
14
-
15
- def _async_config_handler(app: FastAPI):
16
- @app.post(config_handler.ASYNC_URL)
17
- async def _(data: Dict):
18
- key = data.get("key", None)
19
- handler = config_handler.get_handler(key)
20
- if handler is None:
21
- return {"error": "event handler not found"}
22
-
23
- _utils.update_app_page_info(data)
24
-
25
- with _execute_request_lifespans():
26
- await handler()
27
-
28
- return to_config_data()
29
-
30
-
31
- def _sync_config_handler(app: FastAPI):
32
- @app.post(config_handler.SYNC_URL)
33
- def _(data: Dict):
34
- key = data.get("key", None)
35
-
36
- handler = config_handler.get_handler(key)
37
- if handler is None:
38
- return {"error": "event handler not found"}
39
-
40
- _utils.update_app_page_info(data)
41
-
42
- with _execute_request_lifespans():
43
- handler()
44
-
45
- return to_config_data()
46
-
47
-
48
- @contextmanager
49
- def _execute_request_lifespans():
50
- events = [iter(event()) for event in get_launch_collector().page_request_lifespans]
51
- for event in events:
52
- next(event)
53
-
54
- yield
55
-
56
- for event in events:
57
- try:
58
- next(event)
59
- except StopIteration:
60
- pass