@yuneta/gobj-ui 7.27.24 → 7.27.25
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/dist/gobj-ui.cjs.js
CHANGED
|
@@ -24410,6 +24410,7 @@ function restore_view_state(gobj) {
|
|
|
24410
24410
|
(0, _yuneta_gobj_js.log_warning)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)}: the saved view shows none of the ${Object.keys(priv.node_by_id || {}).length} gobjs, framed again`);
|
|
24411
24411
|
zoom = null;
|
|
24412
24412
|
position = null;
|
|
24413
|
+
priv.view_refused = true;
|
|
24413
24414
|
}
|
|
24414
24415
|
let done = false;
|
|
24415
24416
|
priv.restoring = true;
|
|
@@ -24532,7 +24533,8 @@ var PRIVATE_DATA$9 = {
|
|
|
24532
24533
|
last_zoom: 1,
|
|
24533
24534
|
remote_root: null,
|
|
24534
24535
|
trace_info: {},
|
|
24535
|
-
trace_pending: false
|
|
24536
|
+
trace_pending: false,
|
|
24537
|
+
view_refused: false
|
|
24536
24538
|
};
|
|
24537
24539
|
var __gclass__$9 = null;
|
|
24538
24540
|
var __layout_registered__ = false;
|
|
@@ -25630,6 +25632,10 @@ function load_tree(gobj) {
|
|
|
25630
25632
|
if (!(priv.anchor_id ? await yui_graph_center_on(graph, priv.anchor_id) : false)) await yui_graph_center_on(graph, root_id);
|
|
25631
25633
|
priv.last_zoom = 1;
|
|
25632
25634
|
yui_graph_update_zoom((0, _yuneta_gobj_js.gobj_read_attr)(gobj, "$container"), priv.graph);
|
|
25635
|
+
if (priv.view_refused) {
|
|
25636
|
+
priv.view_refused = false;
|
|
25637
|
+
save_view_state(gobj);
|
|
25638
|
+
}
|
|
25633
25639
|
});
|
|
25634
25640
|
});
|
|
25635
25641
|
}
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -24405,6 +24405,7 @@ function restore_view_state(gobj) {
|
|
|
24405
24405
|
log_warning(`${gobj_short_name(gobj)}: the saved view shows none of the ${Object.keys(priv.node_by_id || {}).length} gobjs, framed again`);
|
|
24406
24406
|
zoom = null;
|
|
24407
24407
|
position = null;
|
|
24408
|
+
priv.view_refused = true;
|
|
24408
24409
|
}
|
|
24409
24410
|
let done = false;
|
|
24410
24411
|
priv.restoring = true;
|
|
@@ -24527,7 +24528,8 @@ var PRIVATE_DATA$9 = {
|
|
|
24527
24528
|
last_zoom: 1,
|
|
24528
24529
|
remote_root: null,
|
|
24529
24530
|
trace_info: {},
|
|
24530
|
-
trace_pending: false
|
|
24531
|
+
trace_pending: false,
|
|
24532
|
+
view_refused: false
|
|
24531
24533
|
};
|
|
24532
24534
|
var __gclass__$9 = null;
|
|
24533
24535
|
var __layout_registered__ = false;
|
|
@@ -25625,6 +25627,10 @@ function load_tree(gobj) {
|
|
|
25625
25627
|
if (!(priv.anchor_id ? await yui_graph_center_on(graph, priv.anchor_id) : false)) await yui_graph_center_on(graph, root_id);
|
|
25626
25628
|
priv.last_zoom = 1;
|
|
25627
25629
|
yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
|
|
25630
|
+
if (priv.view_refused) {
|
|
25631
|
+
priv.view_refused = false;
|
|
25632
|
+
save_view_state(gobj);
|
|
25633
|
+
}
|
|
25628
25634
|
});
|
|
25629
25635
|
});
|
|
25630
25636
|
}
|
package/package.json
CHANGED
|
@@ -261,6 +261,7 @@ function restore_view_state(gobj)
|
|
|
261
261
|
`${Object.keys(priv.node_by_id || {}).length} gobjs, framed again`);
|
|
262
262
|
zoom = null;
|
|
263
263
|
position = null;
|
|
264
|
+
priv.view_refused = true; /* the framing saves its camera over it */
|
|
264
265
|
}
|
|
265
266
|
|
|
266
267
|
let done = false;
|
|
@@ -446,6 +447,7 @@ let PRIVATE_DATA = {
|
|
|
446
447
|
remote_root: null, // the descriptor of the backend tree, as last loaded
|
|
447
448
|
trace_info: {}, // gclass -> {gclass_levels, global_levels, gclass_on, global_on, error}
|
|
448
449
|
trace_pending: false, // a trace was set: the block is locked until the host answers
|
|
450
|
+
view_refused: false, // the saved camera showed no card: the opening's framing replaces it
|
|
449
451
|
};
|
|
450
452
|
|
|
451
453
|
let __gclass__ = null;
|
|
@@ -1894,6 +1896,12 @@ function load_tree(gobj)
|
|
|
1894
1896
|
}
|
|
1895
1897
|
priv.last_zoom = 1;
|
|
1896
1898
|
yui_graph_update_zoom(gobj_read_attr(gobj, "$container"), priv.graph);
|
|
1899
|
+
/* A refused camera is replaced now, not at the reader's
|
|
1900
|
+
* next move: left saved, every opening refused it again. */
|
|
1901
|
+
if(priv.view_refused) {
|
|
1902
|
+
priv.view_refused = false;
|
|
1903
|
+
save_view_state(gobj);
|
|
1904
|
+
}
|
|
1897
1905
|
});
|
|
1898
1906
|
});
|
|
1899
1907
|
}
|
|
@@ -215,10 +215,16 @@ describe("C_YUI_GOBJ_TREE_JS does not restore a camera that shows nothing", () =
|
|
|
215
215
|
JSON.stringify({layout: "", collapsed: {}, anchor: "", zoom: 0.18, position: [-20000, -20000]}));
|
|
216
216
|
camera.size = [800, 600];
|
|
217
217
|
camera.viewport = [-5000, -5000];
|
|
218
|
+
/* what G6 answers once the opening has framed the tree */
|
|
219
|
+
camera.zoom = 1;
|
|
220
|
+
camera.position = [5, 6];
|
|
218
221
|
await mount(name);
|
|
219
222
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
220
223
|
/* judged before it is applied: only the opening's own framing */
|
|
221
224
|
expect(camera.zoomed).toEqual([1]);
|
|
225
|
+
/* and the refused camera is replaced by the framing's, so the
|
|
226
|
+
* next opening does not refuse it again */
|
|
227
|
+
expect(saved(name)).toMatchObject({zoom: 1, position: [5, 6]});
|
|
222
228
|
expect(logged.filter((l) => l.level === "warning").map((l) => l.msg).join(" "))
|
|
223
229
|
.toMatch(/the saved view shows none of the/);
|
|
224
230
|
expect(errors()).toEqual([]);
|