@xuda.io/runtime-bundle 1.0.1128 → 1.0.1129

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.
@@ -24631,11 +24631,32 @@ func.common.get_data_from_websocket = async function (SESSION_ID, serviceP, data
24631
24631
  });
24632
24632
  };
24633
24633
 
24634
- func.common.sha256 = async function (str) {
24635
- const enc = new TextEncoder();
24636
- const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
24637
- const bytes = new Uint8Array(buf);
24638
- return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
24634
+ func.common.sha256 = async function (inputString) {
24635
+ // const enc = new TextEncoder();
24636
+ // const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
24637
+ // const bytes = new Uint8Array(buf);
24638
+ // return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
24639
+
24640
+ // 1. Create a hash buffer from the input string using SHA-256.
24641
+ // This part remains the same as it provides a strong, unique cryptographic starting point.
24642
+ const buffer = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(inputString));
24643
+
24644
+ // 2. Interpret the first 8 bytes (64 bits) of the hash as one big number.
24645
+ const view = new DataView(buffer);
24646
+ const bigInt = view.getBigUint64(0, false); // `false` for big-endian
24647
+
24648
+ // 3. Convert the BigInt to a Base36 string.
24649
+ // The .toString(36) method handles the conversion to an alphanumeric representation (0-9, a-z).
24650
+ const base36Hash = bigInt.toString(36);
24651
+
24652
+ // 4. Take the first 10 characters. If it's shorter, it will just return the whole string.
24653
+ // For a 64-bit integer, the Base36 representation will be about 13 characters long,
24654
+ // so slicing is a reliable way to get a fixed length.
24655
+ const shortHash = base36Hash.slice(0, 10);
24656
+
24657
+ // 5. Pad the start in the unlikely case the hash is shorter than 10 characters.
24658
+ // This ensures the output is always exactly 10 characters long.
24659
+ return shortHash.padStart(10, '0');
24639
24660
  };
24640
24661
 
24641
24662
  glb.new_xu_render = false;
@@ -26952,7 +26973,7 @@ func.UI.utils.get_element_info = function (SESSION_ID, dsSessionP, ui_idP, $cont
26952
26973
  // }
26953
26974
  // } else {
26954
26975
  // ret.nodeId = $elm.data().xuData.nodeId;
26955
- ret.nodeId = $elm.data().xuData.xu_id;
26976
+ ret.nodeId = $elm.attr('xu-ui-id'); //$elm.data().xuData.xu_id;
26956
26977
  // }
26957
26978
  }
26958
26979
  ret.$elm = $elm;
@@ -27816,7 +27837,8 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
27816
27837
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
27817
27838
  };
27818
27839
 
27819
- var $elm = func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', queue_obj.paramsP.elem_key);
27840
+ // var $elm = func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', queue_obj.paramsP.elem_key);
27841
+ var $elm = $(`[xu-ui-id="${queue_obj.paramsP.elem_key}"]`);
27820
27842
 
27821
27843
  if (glb.new_xu_render) {
27822
27844
  $elm = $(`[xu-ui-id="${queue_obj.paramsP.elem_key}"]`);
@@ -31269,7 +31291,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
31269
31291
  }
31270
31292
  }
31271
31293
  });
31272
-
31294
+ debugger;
31273
31295
  const selector_id = glb.new_xu_render ? $(this).data()?.xuData?.ui_id : $(this).data()?.xuData?.xu_id;
31274
31296
 
31275
31297
  if (attr.length) {