@xuda.io/runtime-bundle 1.0.1326 → 1.0.1328
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 +23 -0
- package/js/xuda-runtime-bundle.min.js +3 -3
- package/js/xuda-runtime-slim.js +23 -0
- package/js/xuda-runtime-slim.min.es.js +23 -0
- package/js/xuda-runtime-slim.min.js +3 -3
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +14 -0
- package/js/xuda-worker-bundle.js +14 -0
- package/js/xuda-worker-bundle.min.js +1 -1
- package/js/xuda_common-bundle.js +14 -0
- package/js/xuda_common-bundle.min.js +1 -1
- package/package.json +1 -1
package/js/xuda-runtime-slim.js
CHANGED
|
@@ -2500,6 +2500,20 @@ func.api.call_javascript = async function (prog_id, params, evaluate) {
|
|
|
2500
2500
|
return await api_utils.call_javascript(prog_id, params, evaluate);
|
|
2501
2501
|
};
|
|
2502
2502
|
|
|
2503
|
+
func.api.watch = async function (path, cb) {
|
|
2504
|
+
if (!path) return 'path is mandatory';
|
|
2505
|
+
if (!cb) return 'cb (callback function) is mandatory';
|
|
2506
|
+
const SESSION_ID = Object.keys(SESSION_OBJ)[0];
|
|
2507
|
+
let _session = SESSION_OBJ[SESSION_ID];
|
|
2508
|
+
if (!_session.watchers) {
|
|
2509
|
+
_session.watchers = {};
|
|
2510
|
+
}
|
|
2511
|
+
|
|
2512
|
+
_session.watchers[path] = cb;
|
|
2513
|
+
|
|
2514
|
+
return 'ok';
|
|
2515
|
+
};
|
|
2516
|
+
|
|
2503
2517
|
// func.api.call_javascript = async function (prog_id, params, evaluate) {
|
|
2504
2518
|
// const SESSION_ID = Object.keys(SESSION_OBJ)[0];
|
|
2505
2519
|
// const api_utils = await func.common.get_module(SESSION_ID, 'xuda-api-library.mjs', {
|
|
@@ -18216,6 +18230,8 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
18216
18230
|
// data: { ds_data: _session.DS_GLB[0], session_id: SESSION_ID },
|
|
18217
18231
|
// });
|
|
18218
18232
|
// }
|
|
18233
|
+
|
|
18234
|
+
func.index.set_ds_0_proxy(SESSION_ID);
|
|
18219
18235
|
return ret;
|
|
18220
18236
|
// });
|
|
18221
18237
|
};
|
|
@@ -20102,6 +20118,13 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
20102
20118
|
try {
|
|
20103
20119
|
if (_.isEqual(newValue, oldValue)) return;
|
|
20104
20120
|
|
|
20121
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
20122
|
+
|
|
20123
|
+
if (_session?.watchers?.[path]) {
|
|
20124
|
+
const fx = _session?.watchers?.[path];
|
|
20125
|
+
fx(change);
|
|
20126
|
+
}
|
|
20127
|
+
|
|
20105
20128
|
if (!change.path.includes('data_system.SYS_GLOBAL_OBJ_REFS')) return;
|
|
20106
20129
|
const ref_id = change.path.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
|
|
20107
20130
|
if (!ref_id) return;
|
|
@@ -2501,6 +2501,20 @@ func.api.call_javascript = async function (prog_id, params, evaluate) {
|
|
|
2501
2501
|
return await api_utils.call_javascript(prog_id, params, evaluate);
|
|
2502
2502
|
};
|
|
2503
2503
|
|
|
2504
|
+
func.api.watch = async function (path, cb) {
|
|
2505
|
+
if (!path) return 'path is mandatory';
|
|
2506
|
+
if (!cb) return 'cb (callback function) is mandatory';
|
|
2507
|
+
const SESSION_ID = Object.keys(SESSION_OBJ)[0];
|
|
2508
|
+
let _session = SESSION_OBJ[SESSION_ID];
|
|
2509
|
+
if (!_session.watchers) {
|
|
2510
|
+
_session.watchers = {};
|
|
2511
|
+
}
|
|
2512
|
+
|
|
2513
|
+
_session.watchers[path] = cb;
|
|
2514
|
+
|
|
2515
|
+
return 'ok';
|
|
2516
|
+
};
|
|
2517
|
+
|
|
2504
2518
|
// func.api.call_javascript = async function (prog_id, params, evaluate) {
|
|
2505
2519
|
// const SESSION_ID = Object.keys(SESSION_OBJ)[0];
|
|
2506
2520
|
// const api_utils = await func.common.get_module(SESSION_ID, 'xuda-api-library.mjs', {
|
|
@@ -18217,6 +18231,8 @@ func.UI.main.embed_loader = async function (SESSION_ID) {
|
|
|
18217
18231
|
// data: { ds_data: _session.DS_GLB[0], session_id: SESSION_ID },
|
|
18218
18232
|
// });
|
|
18219
18233
|
// }
|
|
18234
|
+
|
|
18235
|
+
func.index.set_ds_0_proxy(SESSION_ID);
|
|
18220
18236
|
return ret;
|
|
18221
18237
|
// });
|
|
18222
18238
|
};
|
|
@@ -20103,6 +20119,13 @@ func.index.set_ds_0_proxy = function (SESSION_ID) {
|
|
|
20103
20119
|
try {
|
|
20104
20120
|
if (_.isEqual(newValue, oldValue)) return;
|
|
20105
20121
|
|
|
20122
|
+
const _session = SESSION_OBJ[SESSION_ID];
|
|
20123
|
+
|
|
20124
|
+
if (_session?.watchers?.[path]) {
|
|
20125
|
+
const fx = _session?.watchers?.[path];
|
|
20126
|
+
fx(change);
|
|
20127
|
+
}
|
|
20128
|
+
|
|
20106
20129
|
if (!change.path.includes('data_system.SYS_GLOBAL_OBJ_REFS')) return;
|
|
20107
20130
|
const ref_id = change.path.split('SYS_GLOBAL_OBJ_REFS.')[1].split('.')[0];
|
|
20108
20131
|
if (!ref_id) return;
|