@xuda.io/runtime-bundle 1.0.351 → 1.0.353

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.
@@ -8619,62 +8619,6 @@ func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefr
8619
8619
  func.UI.worker = {};
8620
8620
  func.UI.worker.ID = null;
8621
8621
  func.UI.worker.init = async function (SESSION_ID) {
8622
- // var _session = SESSION_OBJ[SESSION_ID];
8623
-
8624
- // function getWorkerURL(url) {
8625
- // const content = `importScripts( "${url}" );`;
8626
- // return URL.createObjectURL(
8627
- // new Blob([content], { type: "text/javascript" })
8628
- // );
8629
- // }
8630
-
8631
- // let blob = getWorkerURL(
8632
- // func.common.get_url(
8633
- // SESSION_ID,
8634
- // "dist",
8635
- // func.utils.get_resource_filename(
8636
- // _session.engine_mode === "live_preview"
8637
- // ? ""
8638
- // : _session?.opt?.app_build_id,
8639
- // "runtime/js/xuda_UI_worker.js"
8640
- // )
8641
- // )
8642
- // );
8643
-
8644
- // func.UI.worker.ID = new Worker(blob, {
8645
- // name: "xuda UI worker ",
8646
- // });
8647
-
8648
- // func.UI.worker.ID.postMessage({ method: "init" });
8649
-
8650
- // func.UI.worker.ID.addEventListener(
8651
- // "message",
8652
- // function (e) {
8653
- // if (e.data.dsSessionP && !_session.DS_GLB[e.data.dsSessionP]) {
8654
- // func.UI.worker.delete_job(e.data.job_num);
8655
- // }
8656
-
8657
- // let queue_obj = e.data;
8658
-
8659
- // queue_obj.elementP = $(`[xu-ui-id=${queue_obj.xu_ui_id}]`);
8660
-
8661
- // if (queue_obj?.paramsP?.elem_val?.elm_xu_ui_id) {
8662
- // queue_obj.paramsP.elem_val.$elm = $(
8663
- // `[xu-ui-id=${queue_obj.paramsP.elem_val.elm_xu_ui_id}]`
8664
- // );
8665
- // }
8666
-
8667
- // func.UI.worker.execute(SESSION_ID, queue_obj);
8668
- // },
8669
- // false
8670
- // );
8671
-
8672
- // setInterval(async function () {
8673
- // func.UI.garbage_collector();
8674
- // }, 10000);
8675
-
8676
- // return;
8677
-
8678
8622
  $.fn.isInViewport = function () {
8679
8623
  var elementTop = $(this).offset().top;
8680
8624
  var elementBottom = elementTop + $(this).outerHeight();
@@ -8731,8 +8675,12 @@ func.UI.worker.init = async function (SESSION_ID) {
8731
8675
  this._interval = setInterval(job_iterator, 1);
8732
8676
 
8733
8677
  setInterval(async function () {
8734
- func.UI.garbage_collector();
8678
+ func.UI.ds_garbage_collector();
8735
8679
  }, 10000);
8680
+
8681
+ setInterval(async function () {
8682
+ func.UI.refs_garbage_collector();
8683
+ }, 1000);
8736
8684
  };
8737
8685
  func.UI.worker.add_to_queue = async function (SESSION_ID, source, functionP, paramsP, calling_job, elementP, dsSession, calling_trigger_prop) {
8738
8686
  // try {
@@ -9010,7 +8958,7 @@ func.UI.worker.find_job_index = function (SESSION_ID, jobNoP) {
9010
8958
  return ret;
9011
8959
  };
9012
8960
 
9013
- func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
8961
+ func.UI.ds_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
9014
8962
  // return;
9015
8963
  let _session = SESSION_OBJ[SESSION_ID];
9016
8964
 
@@ -9018,11 +8966,11 @@ func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0],
9018
8966
  if (_data_system?.SYS_GLOBAL_BOL_AJAX_BUSY) return;
9019
8967
  if (!_data_system?.SYS_GLOBAL_BOL_IDLE) return;
9020
8968
 
9021
- for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
9022
- if (!val?.$el?.length) {
9023
- delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
9024
- }
9025
- }
8969
+ // for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
8970
+ // if (!$(`[xu-ui-id='${val?.$el.attr('xu-ui-id')}'`)?.length) {
8971
+ // delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
8972
+ // }
8973
+ // }
9026
8974
 
9027
8975
  let abort;
9028
8976
 
@@ -9069,6 +9017,16 @@ func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0],
9069
9017
  for (const val of ds_pending_to_delete) {
9070
9018
  func.datasource.del(SESSION_ID, val);
9071
9019
  }
9020
+ };
9021
+ func.UI.refs_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
9022
+ let _session = SESSION_OBJ[SESSION_ID];
9023
+ const _data_system = _session?.DS_GLB?.[0]?.data_system;
9024
+
9025
+ for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
9026
+ if (!$(`[xu-ui-id='${val?.$el.attr('xu-ui-id')}'`)?.length) {
9027
+ delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
9028
+ }
9029
+ }
9072
9030
  };
9073
9031
  func.events = {};
9074
9032
  func.events.validate = async function (SESSION_ID, triggerP, dsSessionP, eventIdP, sourceP, argumentsP, return_validation_onlyP) {
@@ -8620,62 +8620,6 @@ func.UI.utils.get_panels_from_dom = function (SESSION_ID, ignore_disableAutoRefr
8620
8620
  func.UI.worker = {};
8621
8621
  func.UI.worker.ID = null;
8622
8622
  func.UI.worker.init = async function (SESSION_ID) {
8623
- // var _session = SESSION_OBJ[SESSION_ID];
8624
-
8625
- // function getWorkerURL(url) {
8626
- // const content = `importScripts( "${url}" );`;
8627
- // return URL.createObjectURL(
8628
- // new Blob([content], { type: "text/javascript" })
8629
- // );
8630
- // }
8631
-
8632
- // let blob = getWorkerURL(
8633
- // func.common.get_url(
8634
- // SESSION_ID,
8635
- // "dist",
8636
- // func.utils.get_resource_filename(
8637
- // _session.engine_mode === "live_preview"
8638
- // ? ""
8639
- // : _session?.opt?.app_build_id,
8640
- // "runtime/js/xuda_UI_worker.js"
8641
- // )
8642
- // )
8643
- // );
8644
-
8645
- // func.UI.worker.ID = new Worker(blob, {
8646
- // name: "xuda UI worker ",
8647
- // });
8648
-
8649
- // func.UI.worker.ID.postMessage({ method: "init" });
8650
-
8651
- // func.UI.worker.ID.addEventListener(
8652
- // "message",
8653
- // function (e) {
8654
- // if (e.data.dsSessionP && !_session.DS_GLB[e.data.dsSessionP]) {
8655
- // func.UI.worker.delete_job(e.data.job_num);
8656
- // }
8657
-
8658
- // let queue_obj = e.data;
8659
-
8660
- // queue_obj.elementP = $(`[xu-ui-id=${queue_obj.xu_ui_id}]`);
8661
-
8662
- // if (queue_obj?.paramsP?.elem_val?.elm_xu_ui_id) {
8663
- // queue_obj.paramsP.elem_val.$elm = $(
8664
- // `[xu-ui-id=${queue_obj.paramsP.elem_val.elm_xu_ui_id}]`
8665
- // );
8666
- // }
8667
-
8668
- // func.UI.worker.execute(SESSION_ID, queue_obj);
8669
- // },
8670
- // false
8671
- // );
8672
-
8673
- // setInterval(async function () {
8674
- // func.UI.garbage_collector();
8675
- // }, 10000);
8676
-
8677
- // return;
8678
-
8679
8623
  $.fn.isInViewport = function () {
8680
8624
  var elementTop = $(this).offset().top;
8681
8625
  var elementBottom = elementTop + $(this).outerHeight();
@@ -8732,8 +8676,12 @@ func.UI.worker.init = async function (SESSION_ID) {
8732
8676
  this._interval = setInterval(job_iterator, 1);
8733
8677
 
8734
8678
  setInterval(async function () {
8735
- func.UI.garbage_collector();
8679
+ func.UI.ds_garbage_collector();
8736
8680
  }, 10000);
8681
+
8682
+ setInterval(async function () {
8683
+ func.UI.refs_garbage_collector();
8684
+ }, 1000);
8737
8685
  };
8738
8686
  func.UI.worker.add_to_queue = async function (SESSION_ID, source, functionP, paramsP, calling_job, elementP, dsSession, calling_trigger_prop) {
8739
8687
  // try {
@@ -9011,7 +8959,7 @@ func.UI.worker.find_job_index = function (SESSION_ID, jobNoP) {
9011
8959
  return ret;
9012
8960
  };
9013
8961
 
9014
- func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
8962
+ func.UI.ds_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
9015
8963
  // return;
9016
8964
  let _session = SESSION_OBJ[SESSION_ID];
9017
8965
 
@@ -9019,11 +8967,11 @@ func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0],
9019
8967
  if (_data_system?.SYS_GLOBAL_BOL_AJAX_BUSY) return;
9020
8968
  if (!_data_system?.SYS_GLOBAL_BOL_IDLE) return;
9021
8969
 
9022
- for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
9023
- if (!val?.$el?.length) {
9024
- delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
9025
- }
9026
- }
8970
+ // for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
8971
+ // if (!$(`[xu-ui-id='${val?.$el.attr('xu-ui-id')}'`)?.length) {
8972
+ // delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
8973
+ // }
8974
+ // }
9027
8975
 
9028
8976
  let abort;
9029
8977
 
@@ -9070,6 +9018,16 @@ func.UI.garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0],
9070
9018
  for (const val of ds_pending_to_delete) {
9071
9019
  func.datasource.del(SESSION_ID, val);
9072
9020
  }
9021
+ };
9022
+ func.UI.refs_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
9023
+ let _session = SESSION_OBJ[SESSION_ID];
9024
+ const _data_system = _session?.DS_GLB?.[0]?.data_system;
9025
+
9026
+ for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
9027
+ if (!$(`[xu-ui-id='${val?.$el.attr('xu-ui-id')}'`)?.length) {
9028
+ delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
9029
+ }
9030
+ }
9073
9031
  };
9074
9032
  func.UI.screen = {};
9075
9033
  func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP) {