@xuda.io/runtime-bundle 1.0.1008 → 1.0.1009
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.
- package/js/xuda-runtime-bundle.js +30 -29
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +30 -29
- package/js/xuda-runtime-slim.min.es.js +30 -29
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +7 -0
- package/js/xuda-worker-bundle.js +7 -0
- package/js/xuda-worker-bundle.min.js +1 -1
- package/js/xuda_common-bundle.js +7 -0
- package/js/xuda_common-bundle.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -2670,6 +2670,13 @@ func.common.get_data_from_websocket = async function (SESSION_ID, serviceP, data
|
|
|
2670
2670
|
dbs_calls();
|
|
2671
2671
|
});
|
|
2672
2672
|
};
|
|
2673
|
+
|
|
2674
|
+
func.common.sha256 = async function (str) {
|
|
2675
|
+
const enc = new TextEncoder();
|
|
2676
|
+
const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
|
|
2677
|
+
const bytes = new Uint8Array(buf);
|
|
2678
|
+
return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
2679
|
+
};
|
|
2673
2680
|
glb.DEBUG_INFO_OBJ = {};
|
|
2674
2681
|
// var CONNECTION_ATTEMPTS = 0;
|
|
2675
2682
|
glb.APP_INFO = {};
|
|
@@ -12085,7 +12092,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
12085
12092
|
// };
|
|
12086
12093
|
const program = val.value?.prog || val.value;
|
|
12087
12094
|
var $wrapper = $('<div>');
|
|
12088
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
12095
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
12089
12096
|
const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
|
|
12090
12097
|
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
|
|
12091
12098
|
ret = {
|
|
@@ -13563,7 +13570,7 @@ func.UI.screen.panel_post_render_handler = async function (
|
|
|
13563
13570
|
return jobNoP;
|
|
13564
13571
|
};
|
|
13565
13572
|
|
|
13566
|
-
func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
13573
|
+
func.UI.screen.create_container = async function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
13567
13574
|
const _paramsP = _.cloneDeep(paramsP);
|
|
13568
13575
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_paramsP.dsSessionP];
|
|
13569
13576
|
var $appendTo = $container;
|
|
@@ -13630,23 +13637,24 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
|
|
|
13630
13637
|
$div = $(`<${div} ${attr_str ? attr_str : ''}>`);
|
|
13631
13638
|
}
|
|
13632
13639
|
|
|
13633
|
-
// Returns a 32-bit unsigned integer hash of a string (FNV-1a)
|
|
13634
|
-
function hash32(str) {
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13639
|
-
|
|
13640
|
-
|
|
13641
|
-
|
|
13642
|
-
|
|
13643
|
-
}
|
|
13640
|
+
// // Returns a 32-bit unsigned integer hash of a string (FNV-1a)
|
|
13641
|
+
// function hash32(str) {
|
|
13642
|
+
// let h = 0x811c9dc5; // FNV offset basis
|
|
13643
|
+
// for (let i = 0; i < str.length; i++) {
|
|
13644
|
+
// h ^= str.charCodeAt(i);
|
|
13645
|
+
// // multiply by FNV prime (2^24 + 2^8 + 0x93) with 32-bit overflow
|
|
13646
|
+
// h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
|
|
13647
|
+
// }
|
|
13648
|
+
// // Convert to unsigned 32-bit
|
|
13649
|
+
// return h >>> 0;
|
|
13650
|
+
// }
|
|
13644
13651
|
|
|
13645
|
-
function hash32hex(str) {
|
|
13646
|
-
|
|
13647
|
-
}
|
|
13652
|
+
// function hash32hex(str) {
|
|
13653
|
+
// return (hash32(str) >>> 0).toString(16).padStart(8, '0');
|
|
13654
|
+
// }
|
|
13648
13655
|
|
|
13649
|
-
const new_ui_id = hash32hex(ui_id);
|
|
13656
|
+
// const new_ui_id = hash32hex(ui_id);
|
|
13657
|
+
const new_ui_id = await func.common.sha256(ui_id);
|
|
13650
13658
|
|
|
13651
13659
|
$div.attr('xu-ui-id', new_ui_id).data({
|
|
13652
13660
|
xuData: {
|
|
@@ -14339,7 +14347,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14339
14347
|
var exist_elm_obj = get_element_info();
|
|
14340
14348
|
var $div = exist_elm_obj.div;
|
|
14341
14349
|
if (!exist_elm_obj.div) {
|
|
14342
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
14350
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
14343
14351
|
|
|
14344
14352
|
//////////////////////////
|
|
14345
14353
|
|
|
@@ -14541,7 +14549,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14541
14549
|
|
|
14542
14550
|
if (!exist_elm_obj.div) {
|
|
14543
14551
|
var $wrapper = $('<div>');
|
|
14544
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
14552
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
14545
14553
|
|
|
14546
14554
|
if (!$div) return;
|
|
14547
14555
|
|
|
@@ -14681,7 +14689,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14681
14689
|
};
|
|
14682
14690
|
|
|
14683
14691
|
var $wrapper = $('<div>');
|
|
14684
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
14692
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
14685
14693
|
|
|
14686
14694
|
let ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div.clone(true), true, undefined, refreshed_ds);
|
|
14687
14695
|
if (ret.abort) {
|
|
@@ -14711,7 +14719,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
14711
14719
|
if (!element || element === 'script') return await done();
|
|
14712
14720
|
let str = '';
|
|
14713
14721
|
|
|
14714
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
14722
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
14715
14723
|
|
|
14716
14724
|
$div.hover(
|
|
14717
14725
|
function (e) {
|
|
@@ -14895,14 +14903,7 @@ const get_xu_render_cache_str = async function (SESSION_ID, dsSessionP) {
|
|
|
14895
14903
|
str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
|
|
14896
14904
|
}
|
|
14897
14905
|
|
|
14898
|
-
|
|
14899
|
-
const enc = new TextEncoder();
|
|
14900
|
-
const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
|
|
14901
|
-
const bytes = new Uint8Array(buf);
|
|
14902
|
-
return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
14903
|
-
}
|
|
14904
|
-
|
|
14905
|
-
return await sha256(str);
|
|
14906
|
+
return await func.common.sha256(str);
|
|
14906
14907
|
};
|
|
14907
14908
|
func.UI.component = {};
|
|
14908
14909
|
|
|
@@ -2671,6 +2671,13 @@ func.common.get_data_from_websocket = async function (SESSION_ID, serviceP, data
|
|
|
2671
2671
|
dbs_calls();
|
|
2672
2672
|
});
|
|
2673
2673
|
};
|
|
2674
|
+
|
|
2675
|
+
func.common.sha256 = async function (str) {
|
|
2676
|
+
const enc = new TextEncoder();
|
|
2677
|
+
const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
|
|
2678
|
+
const bytes = new Uint8Array(buf);
|
|
2679
|
+
return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
2680
|
+
};
|
|
2674
2681
|
glb.DEBUG_INFO_OBJ = {};
|
|
2675
2682
|
// var CONNECTION_ATTEMPTS = 0;
|
|
2676
2683
|
glb.APP_INFO = {};
|
|
@@ -9810,7 +9817,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
|
|
|
9810
9817
|
// };
|
|
9811
9818
|
const program = val.value?.prog || val.value;
|
|
9812
9819
|
var $wrapper = $('<div>');
|
|
9813
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
9820
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
|
|
9814
9821
|
const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
|
|
9815
9822
|
let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
|
|
9816
9823
|
ret = {
|
|
@@ -11288,7 +11295,7 @@ func.UI.screen.panel_post_render_handler = async function (
|
|
|
11288
11295
|
return jobNoP;
|
|
11289
11296
|
};
|
|
11290
11297
|
|
|
11291
|
-
func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
11298
|
+
func.UI.screen.create_container = async function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
|
|
11292
11299
|
const _paramsP = _.cloneDeep(paramsP);
|
|
11293
11300
|
var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_paramsP.dsSessionP];
|
|
11294
11301
|
var $appendTo = $container;
|
|
@@ -11355,23 +11362,24 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
|
|
|
11355
11362
|
$div = $(`<${div} ${attr_str ? attr_str : ''}>`);
|
|
11356
11363
|
}
|
|
11357
11364
|
|
|
11358
|
-
// Returns a 32-bit unsigned integer hash of a string (FNV-1a)
|
|
11359
|
-
function hash32(str) {
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11366
|
-
|
|
11367
|
-
|
|
11368
|
-
}
|
|
11365
|
+
// // Returns a 32-bit unsigned integer hash of a string (FNV-1a)
|
|
11366
|
+
// function hash32(str) {
|
|
11367
|
+
// let h = 0x811c9dc5; // FNV offset basis
|
|
11368
|
+
// for (let i = 0; i < str.length; i++) {
|
|
11369
|
+
// h ^= str.charCodeAt(i);
|
|
11370
|
+
// // multiply by FNV prime (2^24 + 2^8 + 0x93) with 32-bit overflow
|
|
11371
|
+
// h += (h << 1) + (h << 4) + (h << 7) + (h << 8) + (h << 24);
|
|
11372
|
+
// }
|
|
11373
|
+
// // Convert to unsigned 32-bit
|
|
11374
|
+
// return h >>> 0;
|
|
11375
|
+
// }
|
|
11369
11376
|
|
|
11370
|
-
function hash32hex(str) {
|
|
11371
|
-
|
|
11372
|
-
}
|
|
11377
|
+
// function hash32hex(str) {
|
|
11378
|
+
// return (hash32(str) >>> 0).toString(16).padStart(8, '0');
|
|
11379
|
+
// }
|
|
11373
11380
|
|
|
11374
|
-
const new_ui_id = hash32hex(ui_id);
|
|
11381
|
+
// const new_ui_id = hash32hex(ui_id);
|
|
11382
|
+
const new_ui_id = await func.common.sha256(ui_id);
|
|
11375
11383
|
|
|
11376
11384
|
$div.attr('xu-ui-id', new_ui_id).data({
|
|
11377
11385
|
xuData: {
|
|
@@ -12064,7 +12072,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12064
12072
|
var exist_elm_obj = get_element_info();
|
|
12065
12073
|
var $div = exist_elm_obj.div;
|
|
12066
12074
|
if (!exist_elm_obj.div) {
|
|
12067
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
12075
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
|
|
12068
12076
|
|
|
12069
12077
|
//////////////////////////
|
|
12070
12078
|
|
|
@@ -12266,7 +12274,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12266
12274
|
|
|
12267
12275
|
if (!exist_elm_obj.div) {
|
|
12268
12276
|
var $wrapper = $('<div>');
|
|
12269
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
12277
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
|
|
12270
12278
|
|
|
12271
12279
|
if (!$div) return;
|
|
12272
12280
|
|
|
@@ -12406,7 +12414,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12406
12414
|
};
|
|
12407
12415
|
|
|
12408
12416
|
var $wrapper = $('<div>');
|
|
12409
|
-
$div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
12417
|
+
$div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
|
|
12410
12418
|
|
|
12411
12419
|
let ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div.clone(true), true, undefined, refreshed_ds);
|
|
12412
12420
|
if (ret.abort) {
|
|
@@ -12436,7 +12444,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
|
|
|
12436
12444
|
if (!element || element === 'script') return await done();
|
|
12437
12445
|
let str = '';
|
|
12438
12446
|
|
|
12439
|
-
var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
12447
|
+
var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
|
|
12440
12448
|
|
|
12441
12449
|
$div.hover(
|
|
12442
12450
|
function (e) {
|
|
@@ -12620,14 +12628,7 @@ const get_xu_render_cache_str = async function (SESSION_ID, dsSessionP) {
|
|
|
12620
12628
|
str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
|
|
12621
12629
|
}
|
|
12622
12630
|
|
|
12623
|
-
|
|
12624
|
-
const enc = new TextEncoder();
|
|
12625
|
-
const buf = await crypto.subtle.digest('SHA-256', enc.encode(str));
|
|
12626
|
-
const bytes = new Uint8Array(buf);
|
|
12627
|
-
return [...bytes].map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
12628
|
-
}
|
|
12629
|
-
|
|
12630
|
-
return await sha256(str);
|
|
12631
|
+
return await func.common.sha256(str);
|
|
12631
12632
|
};
|
|
12632
12633
|
func.UI.component = {};
|
|
12633
12634
|
|