@xuda.io/runtime-bundle 1.0.720 → 1.0.722

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.
@@ -36403,7 +36403,7 @@ func.events.execute = async function (
36403
36403
  var params_obj = {};
36404
36404
  if (_prog?.properties?.progParams) {
36405
36405
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
36406
- if (val.data.dir !== 'in') continue;
36406
+ if (!val.data.dir === 'in') continue;
36407
36407
  if (typeof args.parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
36408
36408
  if (args.parameters_obj_inP?.[val.data.parameter].fx) {
36409
36409
  let ret = await func.expression.get(SESSION_ID, args.parameters_obj_inP?.[val.data.parameter].fx, dsSession, 'parameters');
@@ -37745,7 +37745,7 @@ func.action.execute = async function (
37745
37745
  func.UI.main = {};
37746
37746
 
37747
37747
  func.UI.main.clear_SYNC_INTERVAL = function () {
37748
- $("body").unbind("mousemove keypress mousedown");
37748
+ $('body').unbind('mousemove keypress mousedown');
37749
37749
  };
37750
37750
  func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
37751
37751
  var _session = SESSION_OBJ[SESSION_ID];
@@ -37757,16 +37757,13 @@ func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
37757
37757
  var params_obj = {};
37758
37758
  if (_prog?.properties?.progParams) {
37759
37759
  for (const [key, val] of Object.entries(_prog.properties.progParams)) {
37760
- if (!val.data.dir === "in") continue;
37761
- if (typeof _session.url_params?.[val.data.parameter] !== "undefined") {
37762
- params_obj[val.data.parameter] =
37763
- _session.url_params?.[val.data.parameter];
37760
+ // if (val.data.dir !== 'in') continue;
37761
+ if (typeof _session.url_params?.[val.data.parameter] !== 'undefined') {
37762
+ params_obj[val.data.parameter] = _session.url_params?.[val.data.parameter];
37764
37763
 
37765
37764
  continue;
37766
37765
  }
37767
- console.warn(
37768
- `Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`
37769
- );
37766
+ console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
37770
37767
  }
37771
37768
  }
37772
37769
  return params_obj;
@@ -37774,50 +37771,33 @@ func.UI.main.embed_prog_execute = async function (SESSION_ID, prog) {
37774
37771
 
37775
37772
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog);
37776
37773
  if (screen_ret) {
37777
- let ret_init = await func.UI.screen.init(
37778
- SESSION_ID,
37779
- prog,
37780
- null,
37781
- null,
37782
- $("#embed_" + SESSION_ID),
37783
- null,
37784
- null,
37785
- null,
37786
- null,
37787
- get_params_obj(),
37788
- "call_embed"
37789
- );
37774
+ let ret_init = await func.UI.screen.init(SESSION_ID, prog, null, null, $('#embed_' + SESSION_ID), null, null, null, null, get_params_obj(), 'call_embed');
37790
37775
  document.title = screen_ret.properties.menuTitle;
37791
37776
 
37792
37777
  return;
37793
37778
  }
37794
37779
 
37795
- console.error("Program not exist", prog);
37796
- func.UI.utils.progressScreen.show(
37797
- SESSION_ID,
37798
- "Program not exist",
37799
- null,
37800
- true
37801
- );
37780
+ console.error('Program not exist', prog);
37781
+ func.UI.utils.progressScreen.show(SESSION_ID, 'Program not exist', null, true);
37802
37782
  // }
37803
37783
  };
37804
37784
 
37805
37785
  func.UI.main.embed_loader = async function (SESSION_ID) {
37806
37786
  var _session = SESSION_OBJ[SESSION_ID];
37807
- var hash = "";
37787
+ var hash = '';
37808
37788
  if (window.location.hash) hash = window.location.hash.substr(1);
37809
37789
  _session.SYS_GLOBAL_STR_BROWSER_HASH_ID = hash;
37810
37790
  _session.SYS_GLOBAL_STR_BROWSER_TITLE = document.title;
37811
37791
 
37812
37792
  const init_system_ds = async function () {
37813
- if (!["main"].includes(_session.opt.app_computing_mode)) {
37814
- await func.index.new_webworker(SESSION_ID, { menuName: "Main" });
37793
+ if (!['main'].includes(_session.opt.app_computing_mode)) {
37794
+ await func.index.new_webworker(SESSION_ID, { menuName: 'Main' });
37815
37795
  // await func.index.call_worker(SESSION_ID, {
37816
37796
  // service: "create_webworker_globals",
37817
37797
  // data: { ds_data: _session.DS_GLB[0], session_id: SESSION_ID },
37818
37798
  // });
37819
37799
  }
37820
- const ret = await func.datasource.create(SESSION_ID, "system");
37800
+ const ret = await func.datasource.create(SESSION_ID, 'system');
37821
37801
 
37822
37802
  /////////// moved to the datasource callback to allow sync on_load events to run at worker
37823
37803
 
@@ -37833,12 +37813,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
37833
37813
  };
37834
37814
  const set_SYS_GLOBAL_KEYS_STATE = async function (SESSION_ID, e, state) {
37835
37815
  if (!_session?.DS_GLB?.[0]) return;
37836
- if (
37837
- e.keyCode !== 16 &&
37838
- e.keyCode !== 17 &&
37839
- e.keyCode !== 18 &&
37840
- e.keyCode !== 91
37841
- ) {
37816
+ if (e.keyCode !== 16 && e.keyCode !== 17 && e.keyCode !== 18 && e.keyCode !== 91) {
37842
37817
  return;
37843
37818
  }
37844
37819
 
@@ -37859,7 +37834,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
37859
37834
 
37860
37835
  var datasource_changes = {
37861
37836
  [0]: {
37862
- ["data_system"]: data,
37837
+ ['data_system']: data,
37863
37838
  },
37864
37839
  };
37865
37840
  await func.datasource.update(SESSION_ID, datasource_changes);
@@ -37870,38 +37845,32 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
37870
37845
  _session.WORKER_OBJ.fx.init();
37871
37846
  };
37872
37847
  const create_embed_container = async function () {
37873
- $("<div>")
37874
- .attr("id", "embed_" + SESSION_ID)
37848
+ $('<div>')
37849
+ .attr('id', 'embed_' + SESSION_ID)
37875
37850
 
37876
- .addClass("xu_embed_div")
37851
+ .addClass('xu_embed_div')
37877
37852
  .data({ xuData: {} })
37878
37853
  .appendTo($(_session.root_element));
37879
37854
  };
37880
37855
  const execute_PENDING_OPEN_URL_EVENTS = async function () {
37881
- if (
37882
- typeof func.events.execute_PENDING_OPEN_URL_EVENTS !== "undefined" &&
37883
- glb.is_cordova
37884
- ) {
37856
+ if (typeof func.events.execute_PENDING_OPEN_URL_EVENTS !== 'undefined' && glb.is_cordova) {
37885
37857
  func.events.execute_PENDING_OPEN_URL_EVENTS();
37886
37858
  }
37887
37859
  };
37888
37860
 
37889
37861
  const remove_loader = async function () {
37890
- $(".loader").remove();
37891
- $(_session.root_element).removeClass("loader_background_color");
37862
+ $('.loader').remove();
37863
+ $(_session.root_element).removeClass('loader_background_color');
37892
37864
  };
37893
37865
  const perform_callback = async function () {
37894
37866
  if (_session.api_callback) {
37895
- _session.api_callback("xuda_ready", SESSION_ID, SESSION_OBJ);
37867
+ _session.api_callback('xuda_ready', SESSION_ID, SESSION_OBJ);
37896
37868
  }
37897
37869
  };
37898
37870
 
37899
37871
  const call_program = async function () {
37900
37872
  if (_session.route_id) {
37901
- const route_obj = await func.utils.DOCS_OBJ.get(
37902
- SESSION_ID,
37903
- _session.route_id
37904
- );
37873
+ const route_obj = await func.utils.DOCS_OBJ.get(SESSION_ID, _session.route_id);
37905
37874
 
37906
37875
  function flattenMenuItems(menu) {
37907
37876
  let flatMenu = {};
@@ -37944,50 +37913,25 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
37944
37913
  if (!_session.prog_id) return;
37945
37914
 
37946
37915
  await func.utils.TREE_OBJ.get(SESSION_ID, _session.prog_id);
37947
- let screen_ret = await func.utils.get_screen_obj(
37948
- SESSION_ID,
37949
- _session.prog_id
37950
- );
37916
+ let screen_ret = await func.utils.get_screen_obj(SESSION_ID, _session.prog_id);
37951
37917
  if (screen_ret) {
37952
37918
  func.UI.main.embed_prog_execute(SESSION_ID, _session.prog_id);
37953
37919
  } else {
37954
- console.error("Program not exist", _session.prog_id);
37955
- func.UI.utils.progressScreen.show(
37956
- SESSION_ID,
37957
- "Program not exist",
37958
- null,
37959
- true
37960
- );
37920
+ console.error('Program not exist', _session.prog_id);
37921
+ func.UI.utils.progressScreen.show(SESSION_ID, 'Program not exist', null, true);
37961
37922
  }
37962
37923
  };
37963
37924
 
37964
37925
  const register_run_background_plugins = async function () {
37965
- if (typeof glb.SLIM_BUNDLE !== "undefined" || glb.SLIM_BUNDLE) return;
37926
+ if (typeof glb.SLIM_BUNDLE !== 'undefined' || glb.SLIM_BUNDLE) return;
37966
37927
 
37967
- for await (const [plugin_name, val] of Object.entries(
37968
- APP_OBJ[_session.app_id].app_plugins_purchased
37969
- )) {
37970
- if (
37971
- val.installed &&
37972
- val.run_in_background &&
37973
- val.manifest?.["runtime.mjs"]?.exist
37974
- ) {
37928
+ for await (const [plugin_name, val] of Object.entries(APP_OBJ[_session.app_id].app_plugins_purchased)) {
37929
+ if (val.installed && val.run_in_background && val.manifest?.['runtime.mjs']?.exist) {
37975
37930
  try {
37976
- const plugin_runtime_src = await func.utils.get_plugin_npm_cdn(
37977
- SESSION_ID,
37978
- plugin_name,
37979
- `${val.manifest["runtime.mjs"].dist ? "dist/" : ""}runtime.mjs`
37980
- );
37931
+ const plugin_runtime_src = await func.utils.get_plugin_npm_cdn(SESSION_ID, plugin_name, `${val.manifest['runtime.mjs'].dist ? 'dist/' : ''}runtime.mjs`);
37981
37932
 
37982
- if (
37983
- val.manifest["runtime.mjs"].dist &&
37984
- val.manifest?.["runtime.mjs"]?.css
37985
- ) {
37986
- const plugin_runtime_css_url = await func.utils.get_plugin_npm_cdn(
37987
- SESSION_ID,
37988
- plugin_name,
37989
- "dist/runtime.css"
37990
- );
37933
+ if (val.manifest['runtime.mjs'].dist && val.manifest?.['runtime.mjs']?.css) {
37934
+ const plugin_runtime_css_url = await func.utils.get_plugin_npm_cdn(SESSION_ID, plugin_name, 'dist/runtime.css');
37991
37935
  func.utils.load_css_on_demand(plugin_runtime_css_url);
37992
37936
  }
37993
37937
 
@@ -37995,20 +37939,13 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
37995
37939
  eval(plugin_script);
37996
37940
 
37997
37941
  let plugin_setup_script_ret = null;
37998
- if (val.manifest?.["index.mjs"]?.exist) {
37999
- const plugin_setup_src = await func.utils.get_plugin_npm_cdn(
38000
- SESSION_ID,
38001
- plugin_name,
38002
- `${val.manifest["index.mjs"].dist ? "dist/" : ""}index.mjs`
38003
- );
37942
+ if (val.manifest?.['index.mjs']?.exist) {
37943
+ const plugin_setup_src = await func.utils.get_plugin_npm_cdn(SESSION_ID, plugin_name, `${val.manifest['index.mjs'].dist ? 'dist/' : ''}index.mjs`);
38004
37944
 
38005
37945
  let plugin_setup_script = await import(plugin_setup_src);
38006
37946
 
38007
37947
  if (plugin_setup_script) {
38008
- plugin_setup_script_ret = await func.utils.get_plugin_setup(
38009
- SESSION_ID,
38010
- plugin_name
38011
- );
37948
+ plugin_setup_script_ret = await func.utils.get_plugin_setup(SESSION_ID, plugin_name);
38012
37949
  if (plugin_setup_script_ret.code < 0) {
38013
37950
  throw plugin_setup_script_ret;
38014
37951
  }
@@ -38035,7 +37972,7 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
38035
37972
 
38036
37973
  var datasource_changes = {
38037
37974
  [0]: {
38038
- ["data_system"]: data,
37975
+ ['data_system']: data,
38039
37976
  },
38040
37977
  };
38041
37978
  await func.datasource.update(SESSION_ID, datasource_changes);
@@ -38045,20 +37982,20 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
38045
37982
 
38046
37983
  $(_session.root_element).show();
38047
37984
  func.UI.component.create_app_root_component(SESSION_ID);
38048
- await glb.lifecycle.execute(SESSION_ID, "beforeInit");
37985
+ await glb.lifecycle.execute(SESSION_ID, 'beforeInit');
38049
37986
  await start_workers();
38050
37987
  await init_system_ds();
38051
- await glb.lifecycle.execute(SESSION_ID, "initialized");
37988
+ await glb.lifecycle.execute(SESSION_ID, 'initialized');
38052
37989
  await create_embed_container();
38053
37990
  await execute_PENDING_OPEN_URL_EVENTS();
38054
37991
  await remove_loader();
38055
37992
  await func.UI.worker.init(SESSION_ID);
38056
- await glb.lifecycle.execute(SESSION_ID, "beforeMounted");
37993
+ await glb.lifecycle.execute(SESSION_ID, 'beforeMounted');
38057
37994
  await call_program();
38058
- await glb.lifecycle.execute(SESSION_ID, "mounted");
37995
+ await glb.lifecycle.execute(SESSION_ID, 'mounted');
38059
37996
  await perform_callback();
38060
- func.utils.debug.write(SESSION_ID, "Xuda.io started.");
38061
- await glb.lifecycle.execute(SESSION_ID, "systemReady");
37997
+ func.utils.debug.write(SESSION_ID, 'Xuda.io started.');
37998
+ await glb.lifecycle.execute(SESSION_ID, 'systemReady');
38062
37999
  /////////////////////////////
38063
38000
  $(document).keydown(function (e) {
38064
38001
  set_SYS_GLOBAL_KEYS_STATE(SESSION_ID, e, 1);
@@ -38068,23 +38005,14 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
38068
38005
  });
38069
38006
 
38070
38007
  await updateOnlineStatus();
38071
- window.addEventListener("online", updateOnlineStatus);
38072
- window.addEventListener("offline", updateOnlineStatus);
38008
+ window.addEventListener('online', updateOnlineStatus);
38009
+ window.addEventListener('offline', updateOnlineStatus);
38073
38010
 
38074
- console.log("xuda.io system ready.");
38075
- $("body")[0].dispatchEvent(glb.system_ready_event);
38011
+ console.log('xuda.io system ready.');
38012
+ $('body')[0].dispatchEvent(glb.system_ready_event);
38076
38013
  };
38077
38014
  func.UI.main.set_custom_css = function (SESSION_ID, callbackP) {
38078
- if (
38079
- SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system?.["SYS_GLOBAL_STR_SITE_CSS"]
38080
- )
38081
- $(
38082
- "<style type='text/css'> " +
38083
- SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system[
38084
- "SYS_GLOBAL_STR_SITE_CSS"
38085
- ] +
38086
- " </style>"
38087
- ).appendTo("head");
38015
+ if (SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system?.['SYS_GLOBAL_STR_SITE_CSS']) $("<style type='text/css'> " + SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system['SYS_GLOBAL_STR_SITE_CSS'] + ' </style>').appendTo('head');
38088
38016
  callbackP();
38089
38017
  };
38090
38018
  func.index = {};