@xuda.io/runtime-bundle 1.0.865 → 1.0.867

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.
@@ -24718,7 +24718,13 @@ var SCREEN_BLOCKER_OBJ = {};
24718
24718
  var IS_PROGRESS_SCREEN_OPEN = null;
24719
24719
  // var UI_ENGINE_OBJ = null;
24720
24720
 
24721
- var UI_WORKER_OBJ = { jobs: [], num: 9000, cache: {}, viewport_height_set_ids: [], pending_for_viewport_render: {} };
24721
+ var UI_WORKER_OBJ = {
24722
+ jobs: [],
24723
+ num: 9000,
24724
+ cache: {},
24725
+ viewport_height_set_ids: [],
24726
+ // pending_for_viewport_render: {}
24727
+ };
24722
24728
 
24723
24729
  glb.html5_events_handler = [
24724
24730
  'onabort',
@@ -27860,7 +27866,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
27860
27866
  }
27861
27867
 
27862
27868
  if ($div.hasClass('viewport_height')) {
27863
- $div.addClass('viewport_height');
27869
+ $div.data().xuData.viewport_height = $div.height();
27864
27870
  $div.css('height', 'unset');
27865
27871
  }
27866
27872
  }
@@ -27870,7 +27876,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
27870
27876
  set_viewport_height: async function () {
27871
27877
  const { $elm, height } = queue_obj?.paramsP || {};
27872
27878
 
27873
- $elm.children().css('height', height);
27879
+ // $elm.children().css('height', height);
27874
27880
 
27875
27881
  $.each($elm.children(), function (key, elm) {
27876
27882
  if (!$(elm).height() && !$(elm).children()) {
@@ -31192,16 +31198,16 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
31192
31198
 
31193
31199
  let ret_screen_loading = await func.UI.screen.screen_loading_done(SESSION_ID, params, ret_render_$container, jobNoP);
31194
31200
 
31195
- for (const [container_xu_ui_id, val] of Object.entries(UI_WORKER_OBJ.pending_for_viewport_render)) {
31196
- const height = val.base_$div.height();
31197
- if (height) {
31198
- const total_height = height * val.data.length || 1;
31199
- if (total_height > val.$container.height()) {
31200
- val.$container.css('height', height * val.data.length);
31201
- }
31202
- }
31203
- debugger;
31204
- }
31201
+ // for (const [container_xu_ui_id, val] of Object.entries(UI_WORKER_OBJ.pending_for_viewport_render)) {
31202
+ // const height = val.base_$div.height();
31203
+ // if (height) {
31204
+ // const total_height = height * val.data.length || 1;
31205
+ // if (total_height > val.$container.height()) {
31206
+ // val.$container.css('height', height * val.data.length);
31207
+ // }
31208
+ // }
31209
+ // debugger;
31210
+ // }
31205
31211
 
31206
31212
  return ret_screen_loading;
31207
31213
  }
@@ -34442,26 +34448,26 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34442
34448
  // check if iterator made to prevent children render
34443
34449
 
34444
34450
  if (nodeP?.attributes?.['xu-viewport'] == 'true') {
34445
- const xu_viewport = async function () {
34446
- const data = { $div: $div.clone(true), nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP, $container };
34447
- const container_id = $container.attr('xu-ui-id');
34448
- if (!UI_WORKER_OBJ.pending_for_viewport_render[container_id]) {
34449
- UI_WORKER_OBJ.pending_for_viewport_render[container_id] = { base_$div: $div, data: [], $container };
34450
- await iterate_child($div, nodeP, parent_infoP, $root_container);
34451
- } else {
34452
- $div.remove();
34453
- }
34454
- UI_WORKER_OBJ.pending_for_viewport_render[container_id].data.push(data);
34455
-
34456
- // if (!$div.children().length) {
34457
- // // render the first element to determine height
34458
- // await iterate_child($div, nodeP, parent_infoP, $root_container);
34459
- // // hover_in($div);
34460
- // // func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', data, null, null, paramsP.dsSessionP);
34461
- // } else {
34462
- // }
34463
- };
34464
- const xu_viewport_old = function () {
34451
+ // const xu_viewport = async function () {
34452
+ // const data = { $div: $div.clone(true), nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP, $container };
34453
+ // const container_id = $container.attr('xu-ui-id');
34454
+ // if (!UI_WORKER_OBJ.pending_for_viewport_render[container_id]) {
34455
+ // UI_WORKER_OBJ.pending_for_viewport_render[container_id] = { base_$div: $div, data: [], $container };
34456
+ // await iterate_child($div, nodeP, parent_infoP, $root_container);
34457
+ // } else {
34458
+ // $div.remove();
34459
+ // }
34460
+ // UI_WORKER_OBJ.pending_for_viewport_render[container_id].data.push(data);
34461
+
34462
+ // // if (!$div.children().length) {
34463
+ // // // render the first element to determine height
34464
+ // // await iterate_child($div, nodeP, parent_infoP, $root_container);
34465
+ // // // hover_in($div);
34466
+ // // // func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', data, null, null, paramsP.dsSessionP);
34467
+ // // } else {
34468
+ // // }
34469
+ // };
34470
+ const xu_viewport = function () {
34465
34471
  const observer_inViewport = new IntersectionObserver(
34466
34472
  function (entries) {
34467
34473
  entries.forEach((entry) => {
@@ -34523,6 +34529,10 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34523
34529
  if ($div.children().length) {
34524
34530
  UI_WORKER_OBJ.cache[$div.attr('xu-ui-id')] = $div.children().clone(true);
34525
34531
  $div.empty();
34532
+ const height = $div.data().xuData.viewport_height;
34533
+ if (typeof height !== 'undefined') {
34534
+ $div.css('height', height);
34535
+ }
34526
34536
  }
34527
34537
  // $div.addClass('skeleton');
34528
34538
  observer_inViewport.observe($div[0]);
@@ -34530,7 +34540,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34530
34540
  $div.addClass('skeleton');
34531
34541
  observer_inViewport.observe($div[0]);
34532
34542
  };
34533
- await xu_viewport_old();
34543
+ xu_viewport();
34534
34544
  } else {
34535
34545
  await iterate_child($div, nodeP, parent_infoP, $root_container);
34536
34546
  }