@yuneta/gobj-ui 7.23.37 → 7.23.38

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/README.md CHANGED
@@ -1433,6 +1433,11 @@ description describes the CLASS and cannot carry it, so the host supplies it —
1433
1433
  the gobj tree passes `node_data.state` — and the machine lights that column.
1434
1434
  Omitted, nothing is lit.
1435
1435
 
1436
+ `close_gclass_view(handle)` is the host-driven teardown, and the ✕ runs it too:
1437
+ the window destroys itself, but the viewer hangs from the HOST, so nothing else
1438
+ would take it down — and a viewer left alive keeps its service name, which made
1439
+ the next click answer *"service ALREADY registered"* (fixed in 7.23.38).
1440
+
1436
1441
  `gclass_view_available()` registers `C_YUI_GCLASS` on demand and reports
1437
1442
  whether it is there, so no app has to mount a gclass for a control it never
1438
1443
  asked for. The gobj tree still asks before drawing its `gclass` button: a
@@ -16558,6 +16558,9 @@ function open_gclass_view(host, gclass_name, opts) {
16558
16558
  };
16559
16559
  let $box = (0, _yuneta_gobj_js.gobj_read_pointer_attr)(jv, "$container");
16560
16560
  let on_close = () => {
16561
+ handle.win = null;
16562
+ handle.modal = null;
16563
+ close_gclass_view(handle);
16561
16564
  if (typeof opts.on_close === "function") opts.on_close();
16562
16565
  };
16563
16566
  if (is_mobile$3()) {
@@ -16553,6 +16553,9 @@ function open_gclass_view(host, gclass_name, opts) {
16553
16553
  };
16554
16554
  let $box = gobj_read_pointer_attr(jv, "$container");
16555
16555
  let on_close = () => {
16556
+ handle.win = null;
16557
+ handle.modal = null;
16558
+ close_gclass_view(handle);
16556
16559
  if (typeof opts.on_close === "function") opts.on_close();
16557
16560
  };
16558
16561
  if (is_mobile$3()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.37",
3
+ "version": "7.23.38",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -158,7 +158,30 @@ function open_gclass_view(host, gclass_name, opts)
158
158
  let handle = {json_gobj: jv, win: null, modal: null};
159
159
  let $box = gobj_read_pointer_attr(jv, "$container");
160
160
 
161
+ /*
162
+ * The ✕ path, and the ONLY one that used to leave the viewer
163
+ * behind. `close_window()` calls this and THEN destroys the
164
+ * window -- but the viewer is not the window's child (it hangs
165
+ * from the host, so it can outlive a window that is only its
166
+ * frame), so nothing else took it down. Alive, it did two things:
167
+ *
168
+ * - it kept its service NAME, so the very next click on the
169
+ * `gclass` button answered "service ALREADY registered:
170
+ * C_YUI_GCLASS^gclass-view-<host>" and no second gclass could
171
+ * be opened for the rest of the session.
172
+ * - it was still RUNNING when the host's own window closed, and
173
+ * the framework logged "Destroying a RUNNING gobj" while
174
+ * taking it down with its parent.
175
+ *
176
+ * The window and the sheet are cleared FIRST: both are already
177
+ * tearing themselves down, and close_gclass_view() must not go
178
+ * back at them.
179
+ */
161
180
  let on_close = () => {
181
+ handle.win = null;
182
+ handle.modal = null;
183
+ close_gclass_view(handle);
184
+
162
185
  if(typeof opts.on_close === "function") {
163
186
  opts.on_close();
164
187
  }