@yuneta/gobj-ui 7.26.6 → 7.26.8

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.
Files changed (48) hide show
  1. package/README.md +74 -25
  2. package/dist/gobj-ui.cjs.js +967 -377
  3. package/dist/gobj-ui.es.js +967 -377
  4. package/index.js +5 -1
  5. package/package.json +2 -2
  6. package/src/c_g6_nodes_tree.js +69 -24
  7. package/src/c_yui_form.js +331 -140
  8. package/src/c_yui_gclass.js +26 -21
  9. package/src/c_yui_gobj_tree_js.js +16 -5
  10. package/src/c_yui_json.js +7 -6
  11. package/src/c_yui_json_graph.js +42 -14
  12. package/src/c_yui_json_pad.js +2 -1
  13. package/src/c_yui_map.js +139 -75
  14. package/src/c_yui_nav.js +60 -20
  15. package/src/c_yui_pager.js +14 -9
  16. package/src/c_yui_period.js +16 -6
  17. package/src/c_yui_schema_editor.js +3 -2
  18. package/src/c_yui_shell.js +96 -31
  19. package/src/c_yui_treedb_topic_with_form.js +50 -56
  20. package/src/c_yui_treedb_topics.js +8 -7
  21. package/src/c_yui_uplot.js +1 -1
  22. package/src/c_yui_window.js +123 -36
  23. package/src/c_yui_window_manager.js +8 -3
  24. package/src/c_yui_wizard.js +23 -8
  25. package/src/delete_impact.js +5 -3
  26. package/src/form_json_field.js +123 -0
  27. package/src/form_json_field.test.js +49 -0
  28. package/src/form_json_field.wiring.test.js +137 -0
  29. package/src/form_table_rearm.wiring.test.js +158 -0
  30. package/src/g6_event_kw.js +36 -0
  31. package/src/nav_cards_helpers.js +2 -1
  32. package/src/nav_cards_helpers.test.js +7 -3
  33. package/src/schema_to_c.js +27 -1
  34. package/src/schema_to_c.test.js +15 -1
  35. package/src/shell_modals.js +5 -3
  36. package/src/shell_route_map.js +18 -13
  37. package/src/treedb_topics_transport.wiring.test.js +35 -1
  38. package/src/vite_plugin_yuneta_html.test.js +79 -0
  39. package/src/window_show.wiring.test.js +83 -0
  40. package/src/window_veto_back.wiring.test.js +136 -0
  41. package/src/wizard_chrome.wiring.test.js +87 -0
  42. package/src/yui_dev.js +23 -14
  43. package/src/yui_frontend_view.js +4 -4
  44. package/src/yui_gclass_view.js +3 -3
  45. package/src/yui_table_filter_clear.js +44 -44
  46. package/src/yui_text.js +31 -0
  47. package/src/yui_text.test.js +39 -0
  48. package/vite-plugin-yuneta-html.js +36 -9
package/index.js CHANGED
@@ -5,7 +5,11 @@
5
5
  *
6
6
  * Barrel re-exports for the v2 source, which lives in src/.
7
7
  * This is the canonical line, embedded as the yunetas submodule
8
- * kernel/js/gobj-ui and consumed by wattyzer via a file: dep.
8
+ * kernel/js/gobj-ui and published to npm; every app takes it
9
+ * from the registry. The barrel is a SUBSET: most apps import
10
+ * by specifier (`@yuneta/gobj-ui/src/<module>.js`), which is
11
+ * how C_YUI_NODE, yui_shell_of() and the rest of the deep
12
+ * surface are reached.
9
13
  *
10
14
  * Copyright (c) 2024-2026, ArtGins.
11
15
  * All Rights Reserved.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.26.6",
3
+ "version": "7.26.8",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -20,7 +20,7 @@
20
20
  "src/",
21
21
  "vite-plugin-yuneta-html.js"
22
22
  ],
23
- "description": "Yuneta UI Library — the active line: declarative shell (C_YUI_SHELL+NAV+PAGER+WIZARD) + windows, TreeDB views, forms, charts and maps. Consumed by wattyzer and the yunetas JS yunos (gui_agent, gui_treedb). The frozen legacy GClass GUI stack (C_YUI_MAIN/TABS/ROUTING) lives on the v1 branch, npm dist-tag 'legacy' (consumed by estadodelaire and hidraulia).",
23
+ "description": "Yuneta UI Library — the active line: declarative shell (C_YUI_SHELL+NAV+PAGER+WIZARD) + windows, TreeDB views, forms, charts and maps. Consumed from the npm registry by the Yuneta SPAs (gui_agent, gui_treedb, wattyzer, yunovatios). The frozen legacy GClass GUI stack (C_YUI_MAIN/TABS/ROUTING) lives on the v1 branch, npm dist-tag 'legacy' (consumed by estadodelaire and hidraulia).",
24
24
  "scripts": {
25
25
  "build": "vite build",
26
26
  "test": "vitest run",
@@ -176,6 +176,7 @@ import {
176
176
  import {yui_theme_now, yui_watch_theme} from "./yui_theme.js";
177
177
  import {yui_shell_of} from "./c_yui_shell.js";
178
178
  import {yui_shell_show_error} from "./shell_modals.js";
179
+ import {g6_event_kw} from "./g6_event_kw.js";
179
180
 
180
181
  /***************************************************************
181
182
  * YuiToolbar — G6 Toolbar subclass that adds per-item className
@@ -473,6 +474,7 @@ SDATA_END()
473
474
  ];
474
475
 
475
476
  let PRIVATE_DATA = {
477
+ _drag_unwire: null, // removes the document listeners of a drag in flight
476
478
  /*---------------- camera anchor ----------------*/
477
479
  anchor_id: "", // the node the camera keeps in the middle
478
480
  anchor_state: "off", // "off" | "arming" | "on"
@@ -717,6 +719,11 @@ function mt_destroy(gobj)
717
719
 
718
720
  uninstall_fold_listener(gobj);
719
721
 
722
+ if(priv._drag_unwire) {
723
+ priv._drag_unwire(); // a resize or a link drag still in flight
724
+ priv._drag_unwire = null;
725
+ }
726
+
720
727
  if(priv._on_pointerdown_focus) {
721
728
  priv.$container.removeEventListener(
722
729
  "pointerdown", priv._on_pointerdown_focus, true
@@ -1059,30 +1066,6 @@ function build_graph(gobj)
1059
1066
  });
1060
1067
  }
1061
1068
 
1062
- /************************************************************
1063
- * A G6 event, as PLAIN JSON.
1064
- *
1065
- * A kw is dumped by the `machine` trace (`trace_json(kw)`), and a
1066
- * G6 / @antv/g event is circular: serializing one THROWS, so the
1067
- * first thing a kw carrying `evt` breaks is the trace the FSM
1068
- * exists to feed. It also drags a live graph element into a
1069
- * message that may be read after that element is gone.
1070
- *
1071
- * What the actions read of it is an id and three scalars. The
1072
- * event itself never leaves the callback that received it.
1073
- ************************************************************/
1074
- function g6_event_kw(evt)
1075
- {
1076
- let target = (evt && evt.target)? evt.target : null;
1077
- let client = (evt && evt.client)? evt.client : null;
1078
-
1079
- return {
1080
- id: (target && target.id)? String(target.id) : "",
1081
- shift: !!(evt && evt.shiftKey),
1082
- client_x: (client && typeof client.x === "number")? client.x : 0,
1083
- client_y: (client && typeof client.y === "number")? client.y : 0
1084
- };
1085
- }
1086
1069
 
1087
1070
  /************************************************************
1088
1071
  * Configure G6 event handlers
@@ -5579,6 +5562,7 @@ function start_node_resize(gobj, e, mx, my)
5579
5562
  function onPointerUp(ev) {
5580
5563
  document.removeEventListener('pointermove', onPointerMove);
5581
5564
  document.removeEventListener('pointerup', onPointerUp);
5565
+ document.removeEventListener('pointercancel', onPointerCancel);
5582
5566
 
5583
5567
  // Calculate final size in world coordinates from the viewport rect deltas
5584
5568
  const dLeft = (currentRect.left - origVpRect.left) / zoom;
@@ -5631,8 +5615,26 @@ function start_node_resize(gobj, e, mx, my)
5631
5615
  });
5632
5616
  }
5633
5617
 
5618
+ /* A cancelled pointer (the browser took the touch) is no drop: the
5619
+ * listeners go, and what was there stays. Without it they stayed
5620
+ * on `document` until some later pointerup, which then dropped. */
5621
+ function onPointerCancel(ev) {
5622
+ document.removeEventListener('pointermove', onPointerMove);
5623
+ document.removeEventListener('pointerup', onPointerUp);
5624
+ document.removeEventListener('pointercancel', onPointerCancel);
5625
+ update_resize_handles_position(gobj);
5626
+ }
5627
+
5634
5628
  document.addEventListener('pointermove', onPointerMove);
5635
5629
  document.addEventListener('pointerup', onPointerUp);
5630
+ document.addEventListener('pointercancel', onPointerCancel);
5631
+ /* A view destroyed in the middle of the drag takes them off too
5632
+ * (mt_destroy): they are closures over this gobj, on `document`. */
5633
+ gobj.priv._drag_unwire = function() {
5634
+ document.removeEventListener('pointermove', onPointerMove);
5635
+ document.removeEventListener('pointerup', onPointerUp);
5636
+ document.removeEventListener('pointercancel', onPointerCancel);
5637
+ };
5636
5638
  }
5637
5639
 
5638
5640
  /************************************************************
@@ -6477,6 +6479,7 @@ function start_link_drag(gobj, e)
6477
6479
  function onPointerUp(ev) {
6478
6480
  document.removeEventListener('pointermove', onPointerMove);
6479
6481
  document.removeEventListener('pointerup', onPointerUp);
6482
+ document.removeEventListener('pointercancel', onPointerCancel);
6480
6483
  priv.$container.style.cursor = '';
6481
6484
 
6482
6485
  // Remove drag line
@@ -6503,8 +6506,31 @@ function start_link_drag(gobj, e)
6503
6506
  }
6504
6507
  }
6505
6508
 
6509
+ /* A cancelled pointer (the browser took the touch) is no drop: the
6510
+ * listeners go, and what was there stays. Without it they stayed
6511
+ * on `document` until some later pointerup, which then dropped. */
6512
+ function onPointerCancel(ev) {
6513
+ document.removeEventListener('pointermove', onPointerMove);
6514
+ document.removeEventListener('pointerup', onPointerUp);
6515
+ document.removeEventListener('pointercancel', onPointerCancel);
6516
+ priv.$container.style.cursor = '';
6517
+ if(priv._link_drag_svg) {
6518
+ priv._link_drag_svg.remove();
6519
+ priv._link_drag_svg = null;
6520
+ }
6521
+ exit_linking_mode(gobj);
6522
+ }
6523
+
6506
6524
  document.addEventListener('pointermove', onPointerMove);
6507
6525
  document.addEventListener('pointerup', onPointerUp);
6526
+ document.addEventListener('pointercancel', onPointerCancel);
6527
+ /* A view destroyed in the middle of the drag takes them off too
6528
+ * (mt_destroy): they are closures over this gobj, on `document`. */
6529
+ gobj.priv._drag_unwire = function() {
6530
+ document.removeEventListener('pointermove', onPointerMove);
6531
+ document.removeEventListener('pointerup', onPointerUp);
6532
+ document.removeEventListener('pointercancel', onPointerCancel);
6533
+ };
6508
6534
  }
6509
6535
 
6510
6536
  /************************************************************
@@ -6744,6 +6770,7 @@ function start_port_resize(gobj, e)
6744
6770
  function onPointerUp(ev) {
6745
6771
  document.removeEventListener('pointermove', onPointerMove);
6746
6772
  document.removeEventListener('pointerup', onPointerUp);
6773
+ document.removeEventListener('pointercancel', onPointerCancel);
6747
6774
 
6748
6775
  // Calculate new radius in world coordinates
6749
6776
  const dx = ev.clientX - clientCx;
@@ -6769,8 +6796,26 @@ function start_port_resize(gobj, e)
6769
6796
  });
6770
6797
  }
6771
6798
 
6799
+ /* A cancelled pointer (the browser took the touch) is no drop: the
6800
+ * listeners go, and what was there stays. Without it they stayed
6801
+ * on `document` until some later pointerup, which then dropped. */
6802
+ function onPointerCancel(ev) {
6803
+ document.removeEventListener('pointermove', onPointerMove);
6804
+ document.removeEventListener('pointerup', onPointerUp);
6805
+ document.removeEventListener('pointercancel', onPointerCancel);
6806
+ update_port_resize_handles_position(gobj);
6807
+ }
6808
+
6772
6809
  document.addEventListener('pointermove', onPointerMove);
6773
6810
  document.addEventListener('pointerup', onPointerUp);
6811
+ document.addEventListener('pointercancel', onPointerCancel);
6812
+ /* A view destroyed in the middle of the drag takes them off too
6813
+ * (mt_destroy): they are closures over this gobj, on `document`. */
6814
+ gobj.priv._drag_unwire = function() {
6815
+ document.removeEventListener('pointermove', onPointerMove);
6816
+ document.removeEventListener('pointerup', onPointerUp);
6817
+ document.removeEventListener('pointercancel', onPointerCancel);
6818
+ };
6774
6819
  }
6775
6820
 
6776
6821
  /************************************************************