reflex 0.7.2a1__py3-none-any.whl → 0.7.2a2__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.

Potentially problematic release.


This version of reflex might be problematic. Click here for more details.

@@ -179,7 +179,7 @@ export const applyEvent = async (event, socket) => {
179
179
  // Handle special events
180
180
  if (event.name == "_redirect") {
181
181
  if (event.payload.external) {
182
- window.open(event.payload.path, "_blank");
182
+ window.open(event.payload.path, "_blank", "noopener");
183
183
  } else if (event.payload.replace) {
184
184
  Router.replace(event.payload.path);
185
185
  } else {
@@ -227,8 +227,8 @@ export const applyEvent = async (event, socket) => {
227
227
  a.href = eval?.(
228
228
  event.payload.url.replace(
229
229
  "getBackendURL(env.UPLOAD)",
230
- `"${getBackendURL(env.UPLOAD)}"`,
231
- ),
230
+ `"${getBackendURL(env.UPLOAD)}"`
231
+ )
232
232
  );
233
233
  }
234
234
  a.download = event.payload.filename;
@@ -341,7 +341,7 @@ export const applyRestEvent = async (event, socket) => {
341
341
  event.payload.files,
342
342
  event.payload.upload_id,
343
343
  event.payload.on_upload_progress,
344
- socket,
344
+ socket
345
345
  );
346
346
  return false;
347
347
  }
@@ -408,7 +408,7 @@ export const connect = async (
408
408
  dispatch,
409
409
  transports,
410
410
  setConnectErrors,
411
- client_storage = {},
411
+ client_storage = {}
412
412
  ) => {
413
413
  // Get backend URL object from the endpoint.
414
414
  const endpoint = getBackendURL(EVENTURL);
@@ -499,7 +499,7 @@ export const uploadFiles = async (
499
499
  files,
500
500
  upload_id,
501
501
  on_upload_progress,
502
- socket,
502
+ socket
503
503
  ) => {
504
504
  // return if there's no file to upload
505
505
  if (files === undefined || files.length === 0) {
@@ -604,7 +604,7 @@ export const Event = (
604
604
  name,
605
605
  payload = {},
606
606
  event_actions = {},
607
- handler = null,
607
+ handler = null
608
608
  ) => {
609
609
  return { name, payload, handler, event_actions };
610
610
  };
@@ -631,7 +631,7 @@ export const hydrateClientStorage = (client_storage) => {
631
631
  for (const state_key in client_storage.local_storage) {
632
632
  const options = client_storage.local_storage[state_key];
633
633
  const local_storage_value = localStorage.getItem(
634
- options.name || state_key,
634
+ options.name || state_key
635
635
  );
636
636
  if (local_storage_value !== null) {
637
637
  client_storage_values[state_key] = local_storage_value;
@@ -642,7 +642,7 @@ export const hydrateClientStorage = (client_storage) => {
642
642
  for (const state_key in client_storage.session_storage) {
643
643
  const session_options = client_storage.session_storage[state_key];
644
644
  const session_storage_value = sessionStorage.getItem(
645
- session_options.name || state_key,
645
+ session_options.name || state_key
646
646
  );
647
647
  if (session_storage_value != null) {
648
648
  client_storage_values[state_key] = session_storage_value;
@@ -667,7 +667,7 @@ export const hydrateClientStorage = (client_storage) => {
667
667
  const applyClientStorageDelta = (client_storage, delta) => {
668
668
  // find the main state and check for is_hydrated
669
669
  const unqualified_states = Object.keys(delta).filter(
670
- (key) => key.split(".").length === 1,
670
+ (key) => key.split(".").length === 1
671
671
  );
672
672
  if (unqualified_states.length === 1) {
673
673
  const main_state = delta[unqualified_states[0]];
@@ -701,7 +701,7 @@ const applyClientStorageDelta = (client_storage, delta) => {
701
701
  const session_options = client_storage.session_storage[state_key];
702
702
  sessionStorage.setItem(
703
703
  session_options.name || state_key,
704
- delta[substate][key],
704
+ delta[substate][key]
705
705
  );
706
706
  }
707
707
  }
@@ -721,7 +721,7 @@ const applyClientStorageDelta = (client_storage, delta) => {
721
721
  export const useEventLoop = (
722
722
  dispatch,
723
723
  initial_events = () => [],
724
- client_storage = {},
724
+ client_storage = {}
725
725
  ) => {
726
726
  const socket = useRef(null);
727
727
  const router = useRouter();
@@ -735,7 +735,7 @@ export const useEventLoop = (
735
735
 
736
736
  event_actions = events.reduce(
737
737
  (acc, e) => ({ ...acc, ...e.event_actions }),
738
- event_actions ?? {},
738
+ event_actions ?? {}
739
739
  );
740
740
 
741
741
  const _e = args.filter((o) => o?.preventDefault !== undefined)[0];
@@ -763,7 +763,7 @@ export const useEventLoop = (
763
763
  debounce(
764
764
  combined_name,
765
765
  () => queueEvents(events, socket),
766
- event_actions.debounce,
766
+ event_actions.debounce
767
767
  );
768
768
  } else {
769
769
  queueEvents(events, socket);
@@ -782,7 +782,7 @@ export const useEventLoop = (
782
782
  query,
783
783
  asPath,
784
784
  }))(router),
785
- })),
785
+ }))
786
786
  );
787
787
  sentHydrate.current = true;
788
788
  }
@@ -828,7 +828,7 @@ export const useEventLoop = (
828
828
  dispatch,
829
829
  ["websocket"],
830
830
  setConnectErrors,
831
- client_storage,
831
+ client_storage
832
832
  );
833
833
  }
834
834
  }
@@ -876,7 +876,7 @@ export const useEventLoop = (
876
876
  vars[storage_to_state_map[e.key]] = e.newValue;
877
877
  const event = Event(
878
878
  `${state_name}.reflex___state____update_vars_internal_state.update_vars_internal`,
879
- { vars: vars },
879
+ { vars: vars }
880
880
  );
881
881
  addEvents([event], e);
882
882
  }
@@ -969,7 +969,7 @@ export const getRefValues = (refs) => {
969
969
  return refs.map((ref) =>
970
970
  ref.current
971
971
  ? ref.current.value || ref.current.getAttribute("aria-valuenow")
972
- : null,
972
+ : null
973
973
  );
974
974
  };
975
975
 
@@ -32,7 +32,7 @@ HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string(
32
32
  ev.preventDefault()
33
33
  const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}};
34
34
 
35
- ({{ on_submit_event_chain }}());
35
+ ({{ on_submit_event_chain }}(ev));
36
36
 
37
37
  if ({{ reset_on_submit }}) {
38
38
  $form.reset()
@@ -17,7 +17,7 @@ from .base import BaseHTML
17
17
 
18
18
  FORM_DATA = Var(_js_expr="form_data")
19
19
  HANDLE_SUBMIT_JS_JINJA2 = Environment().from_string(
20
- "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}};\n\n ({{ on_submit_event_chain }}());\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n "
20
+ "\n const handleSubmit_{{ handle_submit_unique_name }} = useCallback((ev) => {\n const $form = ev.target\n ev.preventDefault()\n const {{ form_data }} = {...Object.fromEntries(new FormData($form).entries()), ...{{ field_ref_mapping }}};\n\n ({{ on_submit_event_chain }}(ev));\n\n if ({{ reset_on_submit }}) {\n $form.reset()\n }\n })\n "
21
21
  )
22
22
  ButtonType = Literal["submit", "reset", "button"]
23
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: reflex
3
- Version: 0.7.2a1
3
+ Version: 0.7.2a2
4
4
  Summary: Web apps in pure Python.
5
5
  License: Apache-2.0
6
6
  Keywords: web,framework
@@ -35,7 +35,7 @@ reflex/.templates/web/utils/helpers/debounce.js,sha256=xGhtTRtS_xIcaeqnYVvYJNseL
35
35
  reflex/.templates/web/utils/helpers/paste.js,sha256=ef30HsR83jRzzvZnl8yV79yqFP8TC_u8SlN99cCS_OM,1799
36
36
  reflex/.templates/web/utils/helpers/range.js,sha256=FevdZzCVxjF57ullfjpcUpeOXRxh5v09YnBB0jPbrS4,1152
37
37
  reflex/.templates/web/utils/helpers/throttle.js,sha256=qxeyaEojaTeX36FPGftzVWrzDsRQU4iqg3U9RJz9Vj4,566
38
- reflex/.templates/web/utils/state.js,sha256=Xd6nlwJ0B8FXvWbEm0Csv-CpJo7NiFBUO03oByQgaak,29766
38
+ reflex/.templates/web/utils/state.js,sha256=Y2OYTzc1IJArMkudtTwXrG9i96jj_QXuo_stwAPfxFE,29761
39
39
  reflex/__init__.py,sha256=64HB9b6MKesl3Yv6aZMsozdMKKpgnxirKk-aeN45UYY,10341
40
40
  reflex/__init__.pyi,sha256=j4ZkO-mKKw5dFBhJVbaOg7AlncO-JCckV2cHENPiLG0,11303
41
41
  reflex/__main__.py,sha256=6cVrGEyT3j3tEvlEVUatpaYfbB5EF3UVY-6vc_Z7-hw,108
@@ -125,8 +125,8 @@ reflex/components/el/elements/__init__.py,sha256=Slx-rO0DOJeHTUbhocKyYm2wb570MJO
125
125
  reflex/components/el/elements/__init__.pyi,sha256=0D3Iw6gktb0vio95VVR69WNY7HXwULQdsy8YMIam9xk,9900
126
126
  reflex/components/el/elements/base.py,sha256=4jnwyCQUHvWcIfwiIWVCiIC_jbwZlkAiOgx73t7tdw8,3075
127
127
  reflex/components/el/elements/base.pyi,sha256=lCvreiB4vd87UWsmmZqEvUe4Bn7XoK7cqmyZbRKVpOU,9872
128
- reflex/components/el/elements/forms.py,sha256=KWBQZyOK3u9dZGxtKFDzSQB1wwgtCj_16z_jcqmEhNo,20140
129
- reflex/components/el/elements/forms.pyi,sha256=YH-WwnrNZeJ7W24xfcyYOPLGF07PGGqQcaYnSYbypGE,124661
128
+ reflex/components/el/elements/forms.py,sha256=Uv7Pr7iblKuFdJ0d21wA5sOi2Z1uFPY522oXfc4N6JQ,20142
129
+ reflex/components/el/elements/forms.pyi,sha256=NJYmmpd8WeU2S80DyHQWJyWhApeH7SgGAvGntDOoBec,124663
130
130
  reflex/components/el/elements/inline.py,sha256=GxOYtkNm1OfdMeqNvrFY_AUm-SVdc4Zg4JdSf3V3S6g,4064
131
131
  reflex/components/el/elements/inline.pyi,sha256=3THlwfna_Jf75fxgxvLuUgsAiNdNtDobf8v_jEz0RSw,228048
132
132
  reflex/components/el/elements/media.py,sha256=Ae7BxSc8XPpQtC2dATMbd1B2aCuuXyCTPk2ZDfuA6ms,12797
@@ -398,8 +398,8 @@ reflex/vars/function.py,sha256=2sVnhgetPSwtor8VFtAiYJdzZ9IRNzAKdsUJG6dXQcE,14461
398
398
  reflex/vars/number.py,sha256=RHY_KsUxliIgn7sptYPPyDubIfLkGYr0TZjX4PB_dgI,29334
399
399
  reflex/vars/object.py,sha256=cHVXN7I1MNw32KfpYKcmgStNSD4BnF3Y2CjkPABmjeo,16233
400
400
  reflex/vars/sequence.py,sha256=X4Gducv2u6fSEZm9uBlMr030bhDO0jUxnKkUXNg4Mwg,54878
401
- reflex-0.7.2a1.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
402
- reflex-0.7.2a1.dist-info/METADATA,sha256=2qIMYXarpwUY25SFLVcKQuctQA3O-T5-bQh8UNhq2u8,11875
403
- reflex-0.7.2a1.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
404
- reflex-0.7.2a1.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
405
- reflex-0.7.2a1.dist-info/RECORD,,
401
+ reflex-0.7.2a2.dist-info/LICENSE,sha256=dw3zLrp9f5ObD7kqS32vWfhcImfO52PMmRqvtxq_YEE,11358
402
+ reflex-0.7.2a2.dist-info/METADATA,sha256=c91IdRnfmecqq_4ZaI1uU5J7cM87O012JddW-HDHSQI,11875
403
+ reflex-0.7.2a2.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
404
+ reflex-0.7.2a2.dist-info/entry_points.txt,sha256=H1Z5Yat_xJfy0dRT1Frk2PkO_p41Xy7fCKlj4FcdL9o,44
405
+ reflex-0.7.2a2.dist-info/RECORD,,