@yuneta/gobj-ui 7.23.171 → 7.23.172

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.
@@ -32,7 +32,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
32
32
  }) : target, mod));
33
33
  //#endregion
34
34
  let _yuneta_gobj_js = require("@yuneta/gobj-js");
35
- _yuneta_gobj_js = __toESM(_yuneta_gobj_js, 1);
36
35
  let i18next = require("i18next");
37
36
  i18next = __toESM(i18next, 1);
38
37
  let tom_select = require("tom-select");
@@ -76157,86 +76156,6 @@ function register_c_yui_period() {
76157
76156
  return create_gclass(GCLASS_NAME);
76158
76157
  }
76159
76158
  //#endregion
76160
- //#region src/dev_machine_trace.js
76161
- /***********************************************************************
76162
- * dev_machine_trace.js
76163
- *
76164
- * Reading a MACHINE trace line back.
76165
- *
76166
- * The developer window mirrors the runtime's log, and the
76167
- * `machine` trace is most of what lands there once it is on.
76168
- * Those lines arrive as text, so to the window they were just
76169
- * "a debug log" -- which is why its `Periodic` filter could
76170
- * not touch them: the filter works on a signature, and every
76171
- * mirrored log carried the same one (`log:debug`).
76172
- *
76173
- * This gives a machine line back its EVENT, which is the only
76174
- * thing that says whether it is noise. Both formats gobj-js
76175
- * emits (`gobj_set_trace_machine_format`):
76176
- *
76177
- * 0 verbose "🔄 mach(C_TIMER^t), st: ST_IDLE, ev: EV_TIMEOUT, ac: …"
76178
- * "<- mach(C_TIMER^t), st: ST_IDLE, ev: EV_TIMEOUT, ret: 0"
76179
- * 1 compact "🔄 EV_TIMEOUT C_TIMER^t ST_IDLE from C_TIMER^t"
76180
- *
76181
- * Copyright (c) 2026, ArtGins.
76182
- * All Rights Reserved.
76183
- ***********************************************************************/
76184
- var MACHINE_MARK_RE = /\bmach\(/;
76185
- var EVENT_FIELD_RE = /\bev:\s*([A-Za-z0-9_]+)/;
76186
- var EVENT_HEAD_RE = /^\s*\S{0,4}\s*(EV_[A-Za-z0-9_]+)(?=\s|$)/;
76187
- var PERIODIC_EVENT_RE = /PERIODIC|TIMEOUT|HEARTBEAT|PING|POLL/i;
76188
- /************************************************************
76189
- * The event of a machine trace line, or "" when the line is
76190
- * not one.
76191
- *
76192
- * "" is also the answer for a machine line that carries no
76193
- * event -- a state change ("new st(…), prev st(…)") -- and
76194
- * that is right: what it reports is not repetitive.
76195
- ************************************************************/
76196
- function machine_event_of(text) {
76197
- if (typeof text !== "string" || text.length === 0) return "";
76198
- if (MACHINE_MARK_RE.test(text)) {
76199
- let m = EVENT_FIELD_RE.exec(text);
76200
- return m ? m[1] : "";
76201
- }
76202
- let m = EVENT_HEAD_RE.exec(text);
76203
- return m ? m[1] : "";
76204
- }
76205
- /************************************************************
76206
- * Is this event one of the ones that arrive by themselves,
76207
- * for ever, and say nothing about what the app is doing?
76208
- ************************************************************/
76209
- function is_periodic_event(event_name) {
76210
- if (!event_name) return false;
76211
- return PERIODIC_EVENT_RE.test(event_name);
76212
- }
76213
- /************************************************************
76214
- * The signature of a mirrored log line: what the window
76215
- * counts it under and what its filters match on.
76216
- *
76217
- * A machine line is signed by its EVENT, so a hundred
76218
- * EV_TIMEOUTs are one recurring thing rather than a hundred
76219
- * anonymous debug lines. Everything else is signed by its
76220
- * level, as before.
76221
- ************************************************************/
76222
- function log_signature(level, text) {
76223
- let event = machine_event_of(text);
76224
- if (event) return "mach:" + event;
76225
- return "log:" + (level || "debug");
76226
- }
76227
- /************************************************************
76228
- * May the periodic filter hide this log line?
76229
- *
76230
- * Only a machine transition, and only below warning level.
76231
- * An ERROR that names EV_TIMEOUT -- "Event NOT DEFINED in
76232
- * state", which is exactly the loud one the framework wants
76233
- * seen -- must never disappear because of the word in it.
76234
- ************************************************************/
76235
- function log_is_periodic(level, text) {
76236
- if (level === "error" || level === "warning") return false;
76237
- return is_periodic_event(machine_event_of(text));
76238
- }
76239
- //#endregion
76240
76159
  //#region src/yui_dev.js
76241
76160
  /***********************************************************************
76242
76161
  * ui_dev.js
@@ -76254,10 +76173,7 @@ function log_is_periodic(level, text) {
76254
76173
  * losing history. Reopening the window repaints the buffer.
76255
76174
  ***********************************************************************/
76256
76175
  var TRAFFIC_MAX = 600;
76257
- var PERIODIC_THRESHOLD = 5;
76258
- var PERIODIC_RE = /PERIODIC|TIMEOUT|HEARTBEAT|PING/i;
76259
76176
  var TRAFFIC_LOG = [];
76260
- var TRAFFIC_COUNTS = /* @__PURE__ */ new Map();
76261
76177
  var SEARCH_TEXT = "";
76262
76178
  var LOG_ERR_COUNT = 0;
76263
76179
  var LOG_WARN_COUNT = 0;
@@ -76274,39 +76190,53 @@ var TRAFFIC_TS_FIELDS = {
76274
76190
  };
76275
76191
  var TRACE_DEFS = [
76276
76192
  [
76277
- "trace_automata",
76278
76193
  "automata",
76279
- trace_automata
76194
+ "automata",
76195
+ "trace every event of every automaton",
76196
+ automata_state,
76197
+ toggle_automata
76280
76198
  ],
76281
76199
  [
76282
- "trace_creation",
76283
76200
  "creation",
76284
- trace_creation
76201
+ "creation",
76202
+ "trace the creation and destruction of gobjs",
76203
+ () => global_bit(_yuneta_gobj_js.trace_level_t.TRACE_CREATE_DELETE),
76204
+ () => toggle_global("create_delete")
76285
76205
  ],
76286
76206
  [
76287
- "trace_start_stop",
76207
+ "start_stop",
76288
76208
  "start / stop",
76289
- trace_start_stop
76209
+ "trace the start and stop of gobjs",
76210
+ () => global_bit(_yuneta_gobj_js.trace_level_t.TRACE_START_STOP),
76211
+ () => toggle_global("start_stop")
76290
76212
  ],
76291
76213
  [
76292
- "trace_subscriptions",
76293
76214
  "subscriptions",
76294
- trace_subscriptions
76215
+ "subscriptions",
76216
+ "trace subscriptions and publications",
76217
+ () => global_bit(_yuneta_gobj_js.trace_level_t.TRACE_SUBSCRIPTIONS),
76218
+ () => toggle_global("subscriptions")
76295
76219
  ],
76296
76220
  [
76297
- "trace_i18n",
76298
76221
  "i18n",
76299
- trace_i18n
76222
+ "i18n",
76223
+ "i18next debug output",
76224
+ i18n_state,
76225
+ toggle_i18n
76300
76226
  ],
76301
76227
  [
76302
- "trace_traffic",
76303
76228
  "traffic",
76304
- trace_traffic
76229
+ "traffic",
76230
+ "trace the messages to and from the backend",
76231
+ traffic_state,
76232
+ toggle_traffic
76305
76233
  ],
76306
76234
  [
76307
- "no_poll",
76308
- "no poll",
76309
- set_no_poll
76235
+ "periodic",
76236
+ "periodic",
76237
+ "trace the periodic timer event",
76238
+ periodic_state,
76239
+ toggle_periodic
76310
76240
  ]
76311
76241
  ];
76312
76242
  /******************************
@@ -76373,45 +76303,24 @@ function dev_view() {
76373
76303
  let v = (0, _yuneta_gobj_js.kw_get_local_storage_value)("dev_view_mode", "detailed", false);
76374
76304
  return v === "compact" || v === "name" || v === "full" ? v : "detailed";
76375
76305
  }
76376
- var HIDE_PERIODIC_DEFAULT = 1;
76377
76306
  var SIMPLE_MACH_DEFAULT = 1;
76378
76307
  var SIMPLE_MACH_KEY = "dev_mach_simple";
76379
76308
  function dev_simple_mach() {
76380
76309
  return dev_num(SIMPLE_MACH_KEY, SIMPLE_MACH_DEFAULT) ? 1 : 0;
76381
76310
  }
76382
- function dev_hide_periodic() {
76383
- return dev_num("dev_hide_periodic", HIDE_PERIODIC_DEFAULT) ? true : false;
76384
- }
76385
76311
  function dev_route() {
76386
76312
  let v = (0, _yuneta_gobj_js.kw_get_local_storage_value)("dev_output_route", "both", false);
76387
76313
  return v === "window" || v === "console" ? v : "both";
76388
76314
  }
76389
76315
  function apply_console_route() {
76390
76316
  (0, _yuneta_gobj_js.set_console_log_enabled)(dev_route() !== "window");
76391
- if (typeof _yuneta_gobj_js.set_console_log_filter === "function") _yuneta_gobj_js.set_console_log_filter((level, msg) => {
76392
- if (!dev_hide_periodic()) return true;
76393
- return !log_is_periodic(level, (0, _yuneta_gobj_js.is_string)(msg) ? msg : String(msg));
76394
- });
76395
- else if (!__console_filter_warned__) {
76396
- __console_filter_warned__ = true;
76397
- console.warn("yui_dev: gobj-js has no set_console_log_filter (needs >= 7.13.6): the Periodic filter applies to this window only, not to the console");
76398
- }
76399
76317
  }
76400
- var __console_filter_warned__ = false;
76401
76318
  function console_traffic(title, jn, direction, size) {
76402
76319
  let event = jn && jn.event ? String(jn.event) : "(no event)";
76403
76320
  let kw = jn && jn.kw && typeof jn.kw === "object" ? jn.kw : jn;
76404
76321
  let color = direction === 2 ? "#16a34a" : direction === 3 ? "#dc2626" : "#2563eb";
76405
76322
  window.console.log("%c" + dir_arrow(direction) + " " + (title ? "[" + title + "] " : "") + event + (size ? " (" + size + "b)" : ""), "color:" + color, kw);
76406
76323
  }
76407
- function dev_muted() {
76408
- let a = (0, _yuneta_gobj_js.kw_get_local_storage_value)("dev_muted_events", [], false);
76409
- if (!Array.isArray(a)) a = [];
76410
- return new Set(a);
76411
- }
76412
- function dev_set_muted(set) {
76413
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("dev_muted_events", Array.from(set));
76414
- }
76415
76324
  function set_view(v) {
76416
76325
  (0, _yuneta_gobj_js.kw_set_local_storage_value)("dev_view_mode", v);
76417
76326
  rerender_all();
@@ -76427,54 +76336,25 @@ function set_output_route(v) {
76427
76336
  function toggle_pref(key, def) {
76428
76337
  let v = dev_num(key, def) ? 0 : 1;
76429
76338
  (0, _yuneta_gobj_js.kw_set_local_storage_value)(key, v);
76430
- apply_console_route();
76431
- rerender_all();
76432
- refresh_dev_chrome();
76433
- }
76434
- function mute_signature(sig) {
76435
- let set = dev_muted();
76436
- set.add(sig);
76437
- dev_set_muted(set);
76438
- rerender_all();
76439
- refresh_dev_chrome();
76440
- }
76441
- function unmute_signature(sig) {
76442
- let set = dev_muted();
76443
- set.delete(sig);
76444
- dev_set_muted(set);
76445
76339
  rerender_all();
76446
76340
  refresh_dev_chrome();
76447
76341
  }
76448
76342
  /******************************
76449
76343
  * Filtering
76450
76344
  ******************************/
76451
- function traffic_signature(event, command) {
76452
- return command ? event + " · " + command : event;
76453
- }
76454
- function traffic_is_periodic(sig) {
76455
- if (PERIODIC_RE.test(sig)) return true;
76456
- return (TRAFFIC_COUNTS.get(sig) || 0) >= PERIODIC_THRESHOLD;
76457
- }
76458
76345
  function build_filter_ctx() {
76459
76346
  return {
76460
76347
  out: dev_num("dev_filter_out", 1),
76461
76348
  inc: dev_num("dev_filter_in", 1),
76462
76349
  err: dev_num("dev_filter_err", 1),
76463
- muted: dev_muted(),
76464
- hide_periodic: dev_hide_periodic(),
76465
76350
  search: SEARCH_TEXT
76466
76351
  };
76467
76352
  }
76468
76353
  function entry_hidden(e, ctx) {
76469
- if (e.kind === "log") {
76470
- if (ctx.hide_periodic && e.periodic) return true;
76471
- return !!(ctx.search && e.hay.indexOf(ctx.search) < 0);
76472
- }
76354
+ if (e.kind === "log") return !!(ctx.search && e.hay.indexOf(ctx.search) < 0);
76473
76355
  if (e.dir === 1 && !ctx.out) return true;
76474
76356
  if (e.dir === 2 && !ctx.inc) return true;
76475
76357
  if (e.dir === 3 && !ctx.err) return true;
76476
- if (ctx.muted.has(e.sig)) return true;
76477
- if (ctx.hide_periodic && traffic_is_periodic(e.sig)) return true;
76478
76358
  if (ctx.search && e.hay.indexOf(ctx.search) < 0) return true;
76479
76359
  return false;
76480
76360
  }
@@ -76498,11 +76378,6 @@ function ensure_dev_style() {
76498
76378
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
76499
76379
  }
76500
76380
  .YDEV_LOG { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px 10px; }
76501
- .YDEV_MUTED {
76502
- display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
76503
- padding: 4px 10px; border-bottom: 1px solid rgba(0,0,0,0.08); font-size: 12px;
76504
- }
76505
- .YDEV_MUTED:empty { display: none; }
76506
76381
  .YDEV_STATS {
76507
76382
  flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 14px;
76508
76383
  padding: 6px 10px; border-top: 1px solid rgba(0,0,0,0.1);
@@ -76534,7 +76409,6 @@ function ensure_dev_style() {
76534
76409
  .YDEV_CHIP.s-in.is-active { background: rgba(5,150,105,0.16); border-color: #059669; color: #059669; }
76535
76410
  .YDEV_CHIP.s-err.is-active { background: rgba(220,38,38,0.16); border-color: #dc2626; color: #dc2626; }
76536
76411
  .YDEV_CHIP[data-dir]:not(.is-active) { opacity: 0.4; text-decoration: line-through; }
76537
- .YDEV_CHIP[data-toggle="periodic"].is-active { background: rgba(217,119,6,0.16); border-color: #d97706; color: #b45309; font-weight: 600; }
76538
76412
  .YDEV_SEG { display: inline-flex; border: 1px solid rgba(0,0,0,0.18); border-radius: 7px; overflow: hidden; }
76539
76413
  .YDEV_SEG_BTN {
76540
76414
  font: inherit; font-size: 12px; padding: 4px 10px; border: 0;
@@ -76548,12 +76422,6 @@ function ensure_dev_style() {
76548
76422
  border: 1px solid rgba(0,0,0,0.18); border-radius: 7px;
76549
76423
  background: transparent; color: inherit;
76550
76424
  }
76551
- .YDEV_MUTED_CHIP {
76552
- font: inherit; font-family: "DejaVu Sans Mono", monospace; font-size: 12px;
76553
- display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px;
76554
- border: 1px solid rgba(217,119,6,0.5); border-radius: 999px;
76555
- background: rgba(217,119,6,0.12); color: #b45309; cursor: pointer;
76556
- }
76557
76425
  .YDEV_STAT.s-out { color: #2563eb; } .YDEV_STAT.s-in { color: #059669; } .YDEV_STAT.s-err { color: #dc2626; }
76558
76426
  .YDEV_STAT.s-warn { color: #d97706; }
76559
76427
  .YDEV_STAT.is-strong { font-weight: 700; }
@@ -76581,10 +76449,7 @@ function ensure_dev_style() {
76581
76449
  .dir-err .TRAFFIC_ARROW, .dir-err .TRAFFIC_EVENT { color: #dc2626; }
76582
76450
  .TRAFFIC_SUMMARY { opacity: 0.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
76583
76451
  .TRAFFIC_META { margin-left: auto; opacity: 0.6; font-size: 11px; white-space: nowrap; }
76584
- .TRAFFIC_MUTE { border: 0; background: transparent; color: inherit; cursor: pointer; opacity: 0; font-size: 12px; padding: 0 2px; flex: 0 0 auto; }
76585
- .TRAFFIC_ENTRY:hover .TRAFFIC_MUTE, .TRAFFIC_LINE:hover .TRAFFIC_MUTE, .TRAFFIC_NAME:hover .TRAFFIC_MUTE { opacity: 0.5; }
76586
- .TRAFFIC_MUTE:hover { opacity: 1 !important; color: #d97706; }
76587
- .TRAFFIC_KW { margin: 2px 0 0 16px; }
76452
+ .TRAFFIC_ENTRY:hover .TRAFFIC_KW { margin: 2px 0 0 16px; }
76588
76453
  .TRAFFIC_FULL { margin: 4px 0 0 16px; padding: 6px 8px; font-family: monospace; font-size: 11px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; background: rgba(0,0,0,0.04); border-radius: 4px; overflow-x: auto; }
76589
76454
  .TRAFFIC_ROW { display: flex; gap: 6px; align-items: baseline; }
76590
76455
  .TRAFFIC_BULLET { opacity: 0.45; flex: 0 0 auto; }
@@ -76628,9 +76493,7 @@ details.TRAFFIC_NEST > summary::-webkit-details-marker { display: none; }
76628
76493
  :root[data-theme="dark"] .TRAFFIC_VAL.t-bool, :root[data-theme="dark"] .TRAFFIC_VAL.t-null { color: #c084fc; }
76629
76494
  :root[data-theme="dark"] .YDEV_CHIP.is-active { background: rgba(96,165,250,0.2); border-color: #60a5fa; color: #93c5fd; }
76630
76495
  :root[data-theme="dark"] .YDEV_SEG_BTN.is-active { background: #2563eb; color: #fff; }
76631
- :root[data-theme="dark"] .YDEV_CHIP[data-toggle="periodic"].is-active { background: rgba(217,119,6,0.24); border-color: #f59e0b; color: #fbbf24; }
76632
- :root[data-theme="dark"] .YDEV_MUTED_CHIP { border-color: rgba(245,158,11,0.5); background: rgba(245,158,11,0.16); color: #fbbf24; }
76633
- `;
76496
+ :root[data-theme="dark"] `;
76634
76497
  let $style = document.createElement("style");
76635
76498
  $style.id = "yui-dev-style";
76636
76499
  $style.textContent = css;
@@ -76773,23 +76636,6 @@ function traffic_bullets(obj) {
76773
76636
  /******************************
76774
76637
  * Entry rendering (per view)
76775
76638
  ******************************/
76776
- function mute_button(sig) {
76777
- return [
76778
- "button",
76779
- {
76780
- class: "TRAFFIC_MUTE",
76781
- type: "button",
76782
- title: (0, i18next.t)("mute this message"),
76783
- "data-i18n-title": "mute this message"
76784
- },
76785
- "⊘",
76786
- { click: (ev) => {
76787
- ev.stopPropagation();
76788
- ev.preventDefault();
76789
- mute_signature(sig);
76790
- } }
76791
- ];
76792
- }
76793
76639
  function event_spans(e) {
76794
76640
  let spans = [[
76795
76641
  "span",
@@ -76827,7 +76673,6 @@ function compact_summary(kw) {
76827
76673
  }
76828
76674
  function render_detailed(e) {
76829
76675
  let head = event_spans(e);
76830
- head.push(mute_button(e.sig));
76831
76676
  head.push([
76832
76677
  "span",
76833
76678
  { class: "TRAFFIC_META" },
@@ -76886,7 +76731,6 @@ function full_sections(payload) {
76886
76731
  }
76887
76732
  function render_full(e) {
76888
76733
  let head = event_spans(e);
76889
- head.push(mute_button(e.sig));
76890
76734
  head.push([
76891
76735
  "span",
76892
76736
  { class: "TRAFFIC_META" },
@@ -76924,7 +76768,6 @@ function render_compact(e) {
76924
76768
  { class: "TRAFFIC_SUMMARY" },
76925
76769
  compact_summary(e.kw)
76926
76770
  ]);
76927
- kids.push(mute_button(e.sig));
76928
76771
  kids.push([
76929
76772
  "span",
76930
76773
  { class: "TRAFFIC_META" },
@@ -76941,7 +76784,6 @@ function render_compact(e) {
76941
76784
  }
76942
76785
  function render_name(e) {
76943
76786
  let kids = event_spans(e);
76944
- kids.push(mute_button(e.sig));
76945
76787
  kids.push([
76946
76788
  "span",
76947
76789
  { class: "TRAFFIC_META" },
@@ -76998,7 +76840,6 @@ function render_entry(e) {
76998
76840
  ******************************/
76999
76841
  function clear_traffic() {
77000
76842
  TRAFFIC_LOG.length = 0;
77001
- TRAFFIC_COUNTS.clear();
77002
76843
  LOG_ERR_COUNT = 0;
77003
76844
  LOG_WARN_COUNT = 0;
77004
76845
  let logger = document.getElementById("developer-traffic-logger");
@@ -77110,7 +76951,6 @@ function info_traffic(title, msg, direction, size) {
77110
76951
  let event = jn && jn.event ? String(jn.event) : "(no event)";
77111
76952
  let kw = jn && jn.kw && typeof jn.kw === "object" ? jn.kw : null;
77112
76953
  let command = kw && typeof kw.command === "string" ? kw.command : "";
77113
- let sig = traffic_signature(event, command);
77114
76954
  let hay = "";
77115
76955
  try {
77116
76956
  hay = (event + " " + command + " " + (kw ? JSON.stringify(kw) : "")).toLowerCase();
@@ -77121,7 +76961,6 @@ function info_traffic(title, msg, direction, size) {
77121
76961
  title: title || "",
77122
76962
  event,
77123
76963
  command,
77124
- sig,
77125
76964
  dir: direction,
77126
76965
  size,
77127
76966
  ts: traffic_now(),
@@ -77131,17 +76970,11 @@ function info_traffic(title, msg, direction, size) {
77131
76970
  $node: null
77132
76971
  };
77133
76972
  TRAFFIC_LOG.push(entry);
77134
- TRAFFIC_COUNTS.set(sig, (TRAFFIC_COUNTS.get(sig) || 0) + 1);
77135
- let crossed = dev_hide_periodic() && TRAFFIC_COUNTS.get(sig) === PERIODIC_THRESHOLD;
77136
76973
  if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
77137
76974
  let old = TRAFFIC_LOG.shift();
77138
- let c = (TRAFFIC_COUNTS.get(old.sig) || 0) - 1;
77139
- if (c <= 0) TRAFFIC_COUNTS.delete(old.sig);
77140
- else TRAFFIC_COUNTS.set(old.sig, c);
77141
76975
  if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
77142
76976
  }
77143
- if (crossed) rerender_all();
77144
- else if (!entry_hidden(entry, build_filter_ctx())) {
76977
+ if (!entry_hidden(entry, build_filter_ctx())) {
77145
76978
  let node = render_entry(entry);
77146
76979
  entry.$node = node;
77147
76980
  let ph = logger.querySelector(".YDEV_EMPTY");
@@ -77187,19 +77020,12 @@ function info_log(level, msg, hora) {
77187
77020
  dir: 0,
77188
77021
  size: 0,
77189
77022
  ts: traffic_now(),
77190
- sig: log_signature(lvl, text),
77191
- periodic: log_is_periodic(lvl, text),
77192
77023
  hay: (lvl + " " + text).toLowerCase(),
77193
77024
  $node: null
77194
77025
  };
77195
77026
  TRAFFIC_LOG.push(entry);
77196
77027
  if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
77197
77028
  let old = TRAFFIC_LOG.shift();
77198
- if (old.kind !== "log") {
77199
- let c = (TRAFFIC_COUNTS.get(old.sig) || 0) - 1;
77200
- if (c <= 0) TRAFFIC_COUNTS.delete(old.sig);
77201
- else TRAFFIC_COUNTS.set(old.sig, c);
77202
- }
77203
77029
  if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
77204
77030
  }
77205
77031
  if (!entry_hidden(entry, build_filter_ctx())) {
@@ -77217,72 +77043,97 @@ function info_log(level, msg, hora) {
77217
77043
  /******************************
77218
77044
  * Trace toggles
77219
77045
  ******************************/
77220
- function trace_traffic() {
77221
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_traffic"));
77222
- if (v) {
77223
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_inter_event", false);
77224
- v = 0;
77225
- } else {
77226
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_inter_event", true);
77227
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_ievent_callback", info_traffic);
77228
- v = 1;
77229
- }
77230
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("trace_traffic", v);
77046
+ function yuno_trace_command(command, kw) {
77047
+ let r = (0, _yuneta_gobj_js.gobj_command)((0, _yuneta_gobj_js.gobj_yuno)(), command, kw, (0, _yuneta_gobj_js.gobj_yuno)());
77048
+ if (!r || r.result < 0) (0, _yuneta_gobj_js.log_error)(`yui_dev: ${command} ${JSON.stringify(kw)}: ${r ? r.comment : "no answer"}`);
77231
77049
  refresh_dev_chrome();
77232
77050
  }
77233
- function trace_automata() {
77234
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_automata"));
77235
- if (v === 0) v = 1;
77236
- else if (v === 1) v = 2;
77237
- else v = 0;
77238
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "tracing", v);
77239
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("trace_automata", v);
77240
- refresh_dev_chrome();
77051
+ function global_bit(bit) {
77052
+ return (0, _yuneta_gobj_js.gobj_global_trace_level)() & bit ? 1 : 0;
77241
77053
  }
77242
- function trace_creation() {
77243
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_creation"));
77244
- v = v === 0 ? 1 : 0;
77245
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_creation", v);
77246
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("trace_creation", v);
77247
- refresh_dev_chrome();
77054
+ var GLOBAL_TRACE_BITS = {
77055
+ "machine": _yuneta_gobj_js.trace_level_t.TRACE_MACHINE,
77056
+ "ev_kw": _yuneta_gobj_js.trace_level_t.TRACE_EV_KW,
77057
+ "create_delete": _yuneta_gobj_js.trace_level_t.TRACE_CREATE_DELETE,
77058
+ "start_stop": _yuneta_gobj_js.trace_level_t.TRACE_START_STOP,
77059
+ "subscriptions": _yuneta_gobj_js.trace_level_t.TRACE_SUBSCRIPTIONS
77060
+ };
77061
+ function toggle_global(level) {
77062
+ yuno_trace_command("set-global-trace", {
77063
+ level,
77064
+ set: global_bit(GLOBAL_TRACE_BITS[level]) ? 0 : 1
77065
+ });
77248
77066
  }
77249
- function trace_start_stop() {
77250
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_start_stop"));
77251
- v = v === 0 ? 1 : 0;
77252
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_start_stop", v);
77253
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("trace_start_stop", v);
77254
- refresh_dev_chrome();
77067
+ function automata_state() {
77068
+ if (!global_bit(_yuneta_gobj_js.trace_level_t.TRACE_MACHINE)) return 0;
77069
+ return global_bit(_yuneta_gobj_js.trace_level_t.TRACE_EV_KW) ? 2 : 1;
77255
77070
  }
77256
- function trace_subscriptions() {
77257
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_subscriptions"));
77258
- v = v === 0 ? 1 : 0;
77259
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_subscriptions", v);
77260
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("trace_subscriptions", v);
77261
- refresh_dev_chrome();
77071
+ function toggle_automata() {
77072
+ let v = automata_state();
77073
+ if (v === 0) yuno_trace_command("set-global-trace", {
77074
+ level: "machine",
77075
+ set: 1
77076
+ });
77077
+ else if (v === 1) yuno_trace_command("set-global-trace", {
77078
+ level: "ev_kw",
77079
+ set: 1
77080
+ });
77081
+ else {
77082
+ yuno_trace_command("set-global-trace", {
77083
+ level: "ev_kw",
77084
+ set: 0
77085
+ });
77086
+ yuno_trace_command("set-global-trace", {
77087
+ level: "machine",
77088
+ set: 0
77089
+ });
77090
+ }
77262
77091
  }
77263
- function trace_i18n() {
77264
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_i18n"));
77265
- v = v === 0 ? 1 : 0;
77092
+ function traffic_state() {
77093
+ return (0, _yuneta_gobj_js.gobj_get_gclass_trace_level2)("C_IEVENT_CLI").includes("ievents") ? 1 : 0;
77094
+ }
77095
+ function toggle_traffic() {
77096
+ yuno_trace_command("set-gclass-trace", {
77097
+ gclass_name: "C_IEVENT_CLI",
77098
+ level: "ievents",
77099
+ set: traffic_state() ? 0 : 1
77100
+ });
77101
+ }
77102
+ function periodic_state() {
77103
+ let on = (0, _yuneta_gobj_js.gobj_global_trace_level)() & _yuneta_gobj_js.trace_level_t.TRACE_TIMER_PERIODIC;
77104
+ let off = (0, _yuneta_gobj_js.gobj_global_trace_no_level)() & _yuneta_gobj_js.trace_level_t.TRACE_TIMER_PERIODIC;
77105
+ return on && !off ? 1 : 0;
77106
+ }
77107
+ function toggle_periodic() {
77108
+ let v = periodic_state() ? 0 : 1;
77109
+ yuno_trace_command("set-global-trace", {
77110
+ level: "timer_periodic",
77111
+ set: v
77112
+ });
77113
+ yuno_trace_command("set-global-no-trace", {
77114
+ level: "timer_periodic",
77115
+ set: v ? 0 : 1
77116
+ });
77117
+ }
77118
+ function i18n_state() {
77119
+ return Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_i18n", 0, false)) ? 1 : 0;
77120
+ }
77121
+ function toggle_i18n() {
77122
+ let v = i18n_state() ? 0 : 1;
77266
77123
  i18next.default.options.debug = v ? true : false;
77267
77124
  (0, _yuneta_gobj_js.kw_set_local_storage_value)("trace_i18n", v);
77268
77125
  refresh_dev_chrome();
77269
77126
  }
77270
- function set_no_poll() {
77271
- let v = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("no_poll"));
77272
- v = v ? 0 : 1;
77273
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "no_poll", v);
77274
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("no_poll", v);
77275
- refresh_dev_chrome();
77276
- }
77277
77127
  /******************************
77278
77128
  * Chrome (controls)
77279
77129
  ******************************/
77280
77130
  function refresh_dev_chrome() {
77281
77131
  document.querySelectorAll(".YDEV_CHIP[data-trace]").forEach(($b) => {
77282
77132
  let key = $b.getAttribute("data-trace");
77133
+ let def = TRACE_DEFS.find((d) => d[0] === key);
77283
77134
  let label = (0, i18next.t)($b.getAttribute("data-label") || "");
77284
- let v = dev_num(key, 0);
77285
- $b.textContent = key === "trace_automata" && v > 0 ? label + " " + v : label;
77135
+ let v = def ? def[3]() : 0;
77136
+ $b.textContent = key === "automata" && v > 0 ? label + " " + v : label;
77286
77137
  $b.classList.toggle("is-active", v > 0);
77287
77138
  });
77288
77139
  let view = dev_view();
@@ -77301,40 +77152,9 @@ function refresh_dev_chrome() {
77301
77152
  document.querySelectorAll(".YDEV_CHIP[data-dir]").forEach(($b) => {
77302
77153
  $b.classList.toggle("is-active", !!dev_num($b.getAttribute("data-dir"), 1));
77303
77154
  });
77304
- document.querySelectorAll(".YDEV_CHIP[data-toggle=\"periodic\"]").forEach(($b) => {
77305
- $b.classList.toggle("is-active", dev_hide_periodic());
77306
- });
77307
77155
  document.querySelectorAll(".YDEV_CHIP[data-toggle=\"automata-simple\"]").forEach(($b) => {
77308
77156
  $b.classList.toggle("is-active", !!dev_simple_mach());
77309
77157
  });
77310
- let $m = document.getElementById("ydev-muted");
77311
- if ($m) {
77312
- $m.replaceChildren();
77313
- let set = dev_muted();
77314
- if (set.size) {
77315
- let $lbl = document.createElement("span");
77316
- $lbl.className = "YDEV_LABEL";
77317
- $lbl.textContent = (0, i18next.t)("muted");
77318
- $lbl.setAttribute("data-i18n", "muted");
77319
- $m.appendChild($lbl);
77320
- set.forEach((sig) => {
77321
- $m.appendChild((0, _yuneta_gobj_js.createElement2)([
77322
- "button",
77323
- {
77324
- class: "YDEV_MUTED_CHIP",
77325
- type: "button",
77326
- title: (0, i18next.t)("unmute"),
77327
- "data-i18n-title": "unmute"
77328
- },
77329
- "⊘ " + sig + " ✕",
77330
- { click: (ev) => {
77331
- ev.stopPropagation();
77332
- unmute_signature(sig);
77333
- } }
77334
- ]));
77335
- });
77336
- }
77337
- }
77338
77158
  update_stats();
77339
77159
  }
77340
77160
  function traffic_to_text() {
@@ -77379,19 +77199,23 @@ function dev_fallback_copy(text) {
77379
77199
  document.body.removeChild(ta);
77380
77200
  }
77381
77201
  function build_control_bar() {
77382
- let trace_chips = TRACE_DEFS.map(([key, label_key, fn]) => [
77202
+ let trace_chips = TRACE_DEFS.map(([key, label_key, title_key, state, toggle]) => [
77383
77203
  "button",
77384
77204
  {
77385
77205
  class: "YDEV_CHIP",
77386
77206
  "data-trace": key,
77387
77207
  "data-label": label_key,
77388
77208
  "data-i18n": label_key,
77389
- type: "button"
77209
+ type: "button",
77210
+ title: (0, i18next.t)(title_key),
77211
+ "data-i18n-title": title_key,
77212
+ "aria-label": (0, i18next.t)(label_key),
77213
+ "data-i18n-aria-label": label_key
77390
77214
  },
77391
77215
  (0, i18next.t)(label_key),
77392
77216
  { click: (ev) => {
77393
77217
  ev.stopPropagation();
77394
- fn();
77218
+ toggle();
77395
77219
  } }
77396
77220
  ]);
77397
77221
  let simple_mach = [
@@ -77529,29 +77353,6 @@ function build_control_bar() {
77529
77353
  mk_dir("in", "⇠", "dev_filter_in", "incoming"),
77530
77354
  mk_dir("err", "⚠", "dev_filter_err", "errors")
77531
77355
  ];
77532
- let periodic_chip = [
77533
- "button",
77534
- {
77535
- class: "YDEV_CHIP",
77536
- "data-toggle": "periodic",
77537
- type: "button",
77538
- title: (0, i18next.t)("hide the timers and the recurring traffic"),
77539
- "data-i18n-title": "hide the timers and the recurring traffic"
77540
- },
77541
- [[
77542
- "span",
77543
- { class: "YDEV_GLYPH" },
77544
- "⊘"
77545
- ], [
77546
- "span",
77547
- { "data-i18n": "periodic" },
77548
- (0, i18next.t)("periodic")
77549
- ]],
77550
- { click: (ev) => {
77551
- ev.stopPropagation();
77552
- toggle_pref("dev_hide_periodic", HIDE_PERIODIC_DEFAULT);
77553
- } }
77554
- ];
77555
77356
  let search = [
77556
77357
  "input",
77557
77358
  {
@@ -77632,7 +77433,7 @@ function build_control_bar() {
77632
77433
  grp("view", [view_seg]),
77633
77434
  expand_grp,
77634
77435
  sep(),
77635
- grp("show", [...dir_chips, periodic_chip]),
77436
+ grp("show", dir_chips),
77636
77437
  sep(),
77637
77438
  grp("find", [search]),
77638
77439
  sep(),
@@ -77667,14 +77468,6 @@ function build_dev_body() {
77667
77468
  { class: "YDEV_BODY" },
77668
77469
  [
77669
77470
  build_control_bar(),
77670
- [
77671
- "div",
77672
- {
77673
- class: "YDEV_MUTED",
77674
- id: "ydev-muted"
77675
- },
77676
- []
77677
- ],
77678
77471
  [
77679
77472
  "div",
77680
77473
  {
@@ -77707,28 +77500,16 @@ function dev_window_was_open() {
77707
77500
  return Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("open_developer_window", 0, false)) ? true : false;
77708
77501
  }
77709
77502
  /************************************************************
77710
- * Apply ALL persisted developer-trace flags to the running
77711
- * yuno. Independent of the dev window — call it once at app
77712
- * startup so a refresh keeps logging whatever was enabled.
77503
+ * Wire the developer window's sinks and the browser-side prefs.
77504
+ * Call it once at app startup.
77505
+ *
77506
+ * The TRACE LEVELS are not here: the yuno restores the ones the user
77507
+ * persisted in its own mt_create (`trace_levels` / `no_trace_levels`),
77508
+ * as a C yuno does. What is left is where the output goes.
77713
77509
  ************************************************************/
77714
77510
  function apply_dev_traces() {
77715
- let traffic = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_traffic", 0, false));
77716
- let trace = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_automata", 0, false));
77717
- let creation = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_creation", 0, false));
77718
- let start_stop = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_start_stop", 0, false));
77719
- let subscriptions = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_subscriptions", 0, false));
77720
- let i18n = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("trace_i18n", 0, false));
77721
- let no_poll = Number((0, _yuneta_gobj_js.kw_get_local_storage_value)("no_poll", 0, false));
77722
- if (traffic) {
77723
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_inter_event", true);
77724
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_ievent_callback", info_traffic);
77725
- } else (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_inter_event", false);
77726
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "tracing", trace);
77727
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_creation", creation);
77728
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_start_stop", start_stop);
77729
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_subscriptions", subscriptions);
77730
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "no_poll", no_poll);
77731
- i18next.default.options.debug = i18n ? true : false;
77511
+ (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_ievent_callback", info_traffic);
77512
+ i18next.default.options.debug = i18n_state() ? true : false;
77732
77513
  (0, _yuneta_gobj_js.gobj_set_trace_machine_format)(dev_simple_mach());
77733
77514
  (0, _yuneta_gobj_js.set_log_callback)(info_log);
77734
77515
  apply_console_route();
@@ -77779,8 +77560,8 @@ function setup_dev(self, show) {
77779
77560
  *
77780
77561
  * Returns { $el, dispose }:
77781
77562
  * - $el: the panel element (control bar + log + stats).
77782
- * - dispose: stops the inter-event traffic trace; call it from
77783
- * the modal's on_close.
77563
+ * - dispose: call it from the modal's on_close (kept for the
77564
+ * contract; the traces outlive the panel).
77784
77565
  ************************************************************/
77785
77566
  function build_dev_panel() {
77786
77567
  ensure_dev_style();
@@ -77801,9 +77582,7 @@ function build_dev_panel() {
77801
77582
  refresh_dev_chrome();
77802
77583
  rerender_all();
77803
77584
  }, 0);
77804
- let dispose = function() {
77805
- (0, _yuneta_gobj_js.gobj_write_attr)((0, _yuneta_gobj_js.gobj_yuno)(), "trace_inter_event", false);
77806
- };
77585
+ let dispose = function() {};
77807
77586
  return {
77808
77587
  $el,
77809
77588
  dispose