@yuneta/gobj-ui 7.23.173 → 7.23.174

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.
@@ -76347,11 +76347,15 @@ function build_filter_ctx() {
76347
76347
  out: dev_num("dev_filter_out", 1),
76348
76348
  inc: dev_num("dev_filter_in", 1),
76349
76349
  err: dev_num("dev_filter_err", 1),
76350
- search: SEARCH_TEXT
76350
+ search: SEARCH_TEXT,
76351
+ view: dev_view()
76351
76352
  };
76352
76353
  }
76353
76354
  function entry_hidden(e, ctx) {
76354
- if (e.kind === "log") return !!(ctx.search && e.hay.indexOf(ctx.search) < 0);
76355
+ if (e.kind === "log") {
76356
+ if (e.level === "json" && (ctx.view === "name" || ctx.view === "compact")) return true;
76357
+ return !!(ctx.search && e.hay.indexOf(ctx.search) < 0);
76358
+ }
76355
76359
  if (e.dir === 1 && !ctx.out) return true;
76356
76360
  if (e.dir === 2 && !ctx.inc) return true;
76357
76361
  if (e.dir === 3 && !ctx.err) return true;
@@ -76928,6 +76932,17 @@ function append_and_follow(logger, node) {
76928
76932
  if (at_bottom) logger.scrollTop = logger.scrollHeight;
76929
76933
  }
76930
76934
  /************************************************************
76935
+ * Keep one entry in the bounded buffer, dropping the oldest
76936
+ * (and its row, if painted).
76937
+ ************************************************************/
76938
+ function push_entry(entry) {
76939
+ TRAFFIC_LOG.push(entry);
76940
+ if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
76941
+ let old = TRAFFIC_LOG.shift();
76942
+ if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
76943
+ }
76944
+ }
76945
+ /************************************************************
76931
76946
  * Append one inter-event message. Kept in a bounded buffer so
76932
76947
  * view/filter switches repaint from memory. Shared by the legacy
76933
76948
  * C_YUI_WINDOW (setup_dev) and the modal (build_dev_panel).
@@ -76945,9 +76960,6 @@ function info_traffic(title, msg, direction, size) {
76945
76960
  }
76946
76961
  let route = dev_route();
76947
76962
  if (route !== "window") console_traffic(title, jn, direction, size);
76948
- let logger = document.getElementById("developer-traffic-logger");
76949
- if (!logger || route === "console") return;
76950
- ensure_dev_style();
76951
76963
  let event = jn && jn.event ? String(jn.event) : "(no event)";
76952
76964
  let kw = jn && jn.kw && typeof jn.kw === "object" ? jn.kw : null;
76953
76965
  let command = kw && typeof kw.command === "string" ? kw.command : "";
@@ -76969,11 +76981,10 @@ function info_traffic(title, msg, direction, size) {
76969
76981
  hay,
76970
76982
  $node: null
76971
76983
  };
76972
- TRAFFIC_LOG.push(entry);
76973
- if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
76974
- let old = TRAFFIC_LOG.shift();
76975
- if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
76976
- }
76984
+ push_entry(entry);
76985
+ let logger = document.getElementById("developer-traffic-logger");
76986
+ if (!logger || route === "console") return;
76987
+ ensure_dev_style();
76977
76988
  if (!entry_hidden(entry, build_filter_ctx())) {
76978
76989
  let node = render_entry(entry);
76979
76990
  entry.$node = node;
@@ -76994,15 +77005,8 @@ function info_log(level, msg, hora) {
76994
77005
  if (__in_info_log__) return;
76995
77006
  if (level === "error") LOG_ERR_COUNT++;
76996
77007
  else if (level === "warning") LOG_WARN_COUNT++;
76997
- if (dev_route() === "console") {
76998
- update_stats();
76999
- return;
77000
- }
77001
- let logger = document.getElementById("developer-traffic-logger");
77002
- if (!logger) return;
77003
77008
  __in_info_log__ = true;
77004
77009
  try {
77005
- ensure_dev_style();
77006
77010
  let lvl = level || "debug";
77007
77011
  let text;
77008
77012
  if (lvl === "json") {
@@ -77023,11 +77027,13 @@ function info_log(level, msg, hora) {
77023
77027
  hay: (lvl + " " + text).toLowerCase(),
77024
77028
  $node: null
77025
77029
  };
77026
- TRAFFIC_LOG.push(entry);
77027
- if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
77028
- let old = TRAFFIC_LOG.shift();
77029
- if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
77030
+ push_entry(entry);
77031
+ let logger = document.getElementById("developer-traffic-logger");
77032
+ if (!logger || dev_route() === "console") {
77033
+ update_stats();
77034
+ return;
77030
77035
  }
77036
+ ensure_dev_style();
77031
77037
  if (!entry_hidden(entry, build_filter_ctx())) {
77032
77038
  let node = render_entry(entry);
77033
77039
  entry.$node = node;
@@ -77365,7 +77371,11 @@ function build_control_bar() {
77365
77371
  type: "search",
77366
77372
  "data-role": "search",
77367
77373
  placeholder: (0, i18next.t)("filter events / payload"),
77368
- "data-i18n-placeholder": "filter events / payload"
77374
+ "data-i18n-placeholder": "filter events / payload",
77375
+ title: (0, i18next.t)("filter events / payload"),
77376
+ "data-i18n-title": "filter events / payload",
77377
+ "aria-label": (0, i18next.t)("filter events / payload"),
77378
+ "data-i18n-aria-label": "filter events / payload"
77369
77379
  },
77370
77380
  "",
77371
77381
  { input: (ev) => {
@@ -77373,6 +77383,29 @@ function build_control_bar() {
77373
77383
  rerender_all();
77374
77384
  } }
77375
77385
  ];
77386
+ let search_clear = [
77387
+ "button",
77388
+ {
77389
+ class: "YDEV_CHIP YDEV_SEARCH_CLEAR",
77390
+ type: "button",
77391
+ title: (0, i18next.t)("clear the filter"),
77392
+ "data-i18n-title": "clear the filter",
77393
+ "aria-label": (0, i18next.t)("clear the filter"),
77394
+ "data-i18n-aria-label": "clear the filter"
77395
+ },
77396
+ "✕",
77397
+ { click: (ev) => {
77398
+ ev.stopPropagation();
77399
+ let $bar = ev.currentTarget.closest(".YDEV_BAR");
77400
+ let $input = $bar ? $bar.querySelector(".YDEV_SEARCH") : null;
77401
+ if ($input) {
77402
+ $input.value = "";
77403
+ $input.focus();
77404
+ }
77405
+ SEARCH_TEXT = "";
77406
+ rerender_all();
77407
+ } }
77408
+ ];
77376
77409
  let copy = [
77377
77410
  "button",
77378
77411
  {
@@ -77440,7 +77473,7 @@ function build_control_bar() {
77440
77473
  sep(),
77441
77474
  grp("show", dir_chips),
77442
77475
  sep(),
77443
- grp("find", [search]),
77476
+ grp("find", [search, search_clear]),
77444
77477
  sep(),
77445
77478
  grp("log", [copy, clear])
77446
77479
  ]
@@ -76342,11 +76342,15 @@ function build_filter_ctx() {
76342
76342
  out: dev_num("dev_filter_out", 1),
76343
76343
  inc: dev_num("dev_filter_in", 1),
76344
76344
  err: dev_num("dev_filter_err", 1),
76345
- search: SEARCH_TEXT
76345
+ search: SEARCH_TEXT,
76346
+ view: dev_view()
76346
76347
  };
76347
76348
  }
76348
76349
  function entry_hidden(e, ctx) {
76349
- if (e.kind === "log") return !!(ctx.search && e.hay.indexOf(ctx.search) < 0);
76350
+ if (e.kind === "log") {
76351
+ if (e.level === "json" && (ctx.view === "name" || ctx.view === "compact")) return true;
76352
+ return !!(ctx.search && e.hay.indexOf(ctx.search) < 0);
76353
+ }
76350
76354
  if (e.dir === 1 && !ctx.out) return true;
76351
76355
  if (e.dir === 2 && !ctx.inc) return true;
76352
76356
  if (e.dir === 3 && !ctx.err) return true;
@@ -76923,6 +76927,17 @@ function append_and_follow(logger, node) {
76923
76927
  if (at_bottom) logger.scrollTop = logger.scrollHeight;
76924
76928
  }
76925
76929
  /************************************************************
76930
+ * Keep one entry in the bounded buffer, dropping the oldest
76931
+ * (and its row, if painted).
76932
+ ************************************************************/
76933
+ function push_entry(entry) {
76934
+ TRAFFIC_LOG.push(entry);
76935
+ if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
76936
+ let old = TRAFFIC_LOG.shift();
76937
+ if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
76938
+ }
76939
+ }
76940
+ /************************************************************
76926
76941
  * Append one inter-event message. Kept in a bounded buffer so
76927
76942
  * view/filter switches repaint from memory. Shared by the legacy
76928
76943
  * C_YUI_WINDOW (setup_dev) and the modal (build_dev_panel).
@@ -76940,9 +76955,6 @@ function info_traffic(title, msg, direction, size) {
76940
76955
  }
76941
76956
  let route = dev_route();
76942
76957
  if (route !== "window") console_traffic(title, jn, direction, size);
76943
- let logger = document.getElementById("developer-traffic-logger");
76944
- if (!logger || route === "console") return;
76945
- ensure_dev_style();
76946
76958
  let event = jn && jn.event ? String(jn.event) : "(no event)";
76947
76959
  let kw = jn && jn.kw && typeof jn.kw === "object" ? jn.kw : null;
76948
76960
  let command = kw && typeof kw.command === "string" ? kw.command : "";
@@ -76964,11 +76976,10 @@ function info_traffic(title, msg, direction, size) {
76964
76976
  hay,
76965
76977
  $node: null
76966
76978
  };
76967
- TRAFFIC_LOG.push(entry);
76968
- if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
76969
- let old = TRAFFIC_LOG.shift();
76970
- if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
76971
- }
76979
+ push_entry(entry);
76980
+ let logger = document.getElementById("developer-traffic-logger");
76981
+ if (!logger || route === "console") return;
76982
+ ensure_dev_style();
76972
76983
  if (!entry_hidden(entry, build_filter_ctx())) {
76973
76984
  let node = render_entry(entry);
76974
76985
  entry.$node = node;
@@ -76989,15 +77000,8 @@ function info_log(level, msg, hora) {
76989
77000
  if (__in_info_log__) return;
76990
77001
  if (level === "error") LOG_ERR_COUNT++;
76991
77002
  else if (level === "warning") LOG_WARN_COUNT++;
76992
- if (dev_route() === "console") {
76993
- update_stats();
76994
- return;
76995
- }
76996
- let logger = document.getElementById("developer-traffic-logger");
76997
- if (!logger) return;
76998
77003
  __in_info_log__ = true;
76999
77004
  try {
77000
- ensure_dev_style();
77001
77005
  let lvl = level || "debug";
77002
77006
  let text;
77003
77007
  if (lvl === "json") {
@@ -77018,11 +77022,13 @@ function info_log(level, msg, hora) {
77018
77022
  hay: (lvl + " " + text).toLowerCase(),
77019
77023
  $node: null
77020
77024
  };
77021
- TRAFFIC_LOG.push(entry);
77022
- if (TRAFFIC_LOG.length > TRAFFIC_MAX) {
77023
- let old = TRAFFIC_LOG.shift();
77024
- if (old.$node && old.$node.parentNode) old.$node.parentNode.removeChild(old.$node);
77025
+ push_entry(entry);
77026
+ let logger = document.getElementById("developer-traffic-logger");
77027
+ if (!logger || dev_route() === "console") {
77028
+ update_stats();
77029
+ return;
77025
77030
  }
77031
+ ensure_dev_style();
77026
77032
  if (!entry_hidden(entry, build_filter_ctx())) {
77027
77033
  let node = render_entry(entry);
77028
77034
  entry.$node = node;
@@ -77360,7 +77366,11 @@ function build_control_bar() {
77360
77366
  type: "search",
77361
77367
  "data-role": "search",
77362
77368
  placeholder: t("filter events / payload"),
77363
- "data-i18n-placeholder": "filter events / payload"
77369
+ "data-i18n-placeholder": "filter events / payload",
77370
+ title: t("filter events / payload"),
77371
+ "data-i18n-title": "filter events / payload",
77372
+ "aria-label": t("filter events / payload"),
77373
+ "data-i18n-aria-label": "filter events / payload"
77364
77374
  },
77365
77375
  "",
77366
77376
  { input: (ev) => {
@@ -77368,6 +77378,29 @@ function build_control_bar() {
77368
77378
  rerender_all();
77369
77379
  } }
77370
77380
  ];
77381
+ let search_clear = [
77382
+ "button",
77383
+ {
77384
+ class: "YDEV_CHIP YDEV_SEARCH_CLEAR",
77385
+ type: "button",
77386
+ title: t("clear the filter"),
77387
+ "data-i18n-title": "clear the filter",
77388
+ "aria-label": t("clear the filter"),
77389
+ "data-i18n-aria-label": "clear the filter"
77390
+ },
77391
+ "✕",
77392
+ { click: (ev) => {
77393
+ ev.stopPropagation();
77394
+ let $bar = ev.currentTarget.closest(".YDEV_BAR");
77395
+ let $input = $bar ? $bar.querySelector(".YDEV_SEARCH") : null;
77396
+ if ($input) {
77397
+ $input.value = "";
77398
+ $input.focus();
77399
+ }
77400
+ SEARCH_TEXT = "";
77401
+ rerender_all();
77402
+ } }
77403
+ ];
77371
77404
  let copy = [
77372
77405
  "button",
77373
77406
  {
@@ -77435,7 +77468,7 @@ function build_control_bar() {
77435
77468
  sep(),
77436
77469
  grp("show", dir_chips),
77437
77470
  sep(),
77438
- grp("find", [search]),
77471
+ grp("find", [search, search_clear]),
77439
77472
  sep(),
77440
77473
  grp("log", [copy, clear])
77441
77474
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.173",
3
+ "version": "7.23.174",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
package/src/yui_dev.js CHANGED
@@ -82,7 +82,8 @@ const TRAFFIC_TS_FIELDS = {
82
82
  * clear captured traffic, compact, console, copied, copy,
83
83
  * copy visible traffic to clipboard, creation, data, detailed,
84
84
  * dev window and browser console, dev window only, developer,
85
- * errors, expand, expanded, filter events / payload, find, i18n,
85
+ * clear the filter, errors, expand, expanded, filter events / payload,
86
+ * find, i18n,
86
87
  * i18next debug output, incoming, log, machine trace shape,
87
88
  * metadata, name only, outgoing, output, periodic, schema, show,
88
89
  * show this section in the expanded view, simple mach,
@@ -319,12 +320,19 @@ function build_filter_ctx()
319
320
  inc: dev_num("dev_filter_in", 1),
320
321
  err: dev_num("dev_filter_err", 1),
321
322
  search: SEARCH_TEXT,
323
+ view: dev_view(),
322
324
  };
323
325
  }
324
326
 
325
327
  function entry_hidden(e, ctx)
326
328
  {
327
329
  if(e.kind === "log") {
330
+ /* A `json` line is a PAYLOAD (the kw the trace dumps with ev_kw or a
331
+ * publication): the Compact and Name only views promise one line
332
+ * per message, so they leave it out. Its level says what it is. */
333
+ if(e.level === "json" && (ctx.view === "name" || ctx.view === "compact")) {
334
+ return true;
335
+ }
328
336
  /* Mirrored console logs respect the search box only — not the
329
337
  * in/out/err traffic filters, which are about DIRECTION and a
330
338
  * log has none. What is traced at all is the runtime's trace
@@ -930,6 +938,21 @@ function append_and_follow(logger, node)
930
938
  }
931
939
  }
932
940
 
941
+ /************************************************************
942
+ * Keep one entry in the bounded buffer, dropping the oldest
943
+ * (and its row, if painted).
944
+ ************************************************************/
945
+ function push_entry(entry)
946
+ {
947
+ TRAFFIC_LOG.push(entry);
948
+ if(TRAFFIC_LOG.length > TRAFFIC_MAX) {
949
+ let old = TRAFFIC_LOG.shift();
950
+ if(old.$node && old.$node.parentNode) {
951
+ old.$node.parentNode.removeChild(old.$node);
952
+ }
953
+ }
954
+ }
955
+
933
956
  /************************************************************
934
957
  * Append one inter-event message. Kept in a bounded buffer so
935
958
  * view/filter switches repaint from memory. Shared by the legacy
@@ -958,16 +981,6 @@ function info_traffic(title, msg, direction, size)
958
981
  console_traffic(title, jn, direction, size);
959
982
  }
960
983
 
961
- /* Window side: skip when routed to the console only, or when the window
962
- * is not mounted (closed). No fallback console dump — console_traffic
963
- * above already covered every route that wants console output. */
964
- let logger = document.getElementById('developer-traffic-logger');
965
- if(!logger || route === "console") {
966
- return;
967
- }
968
-
969
- ensure_dev_style();
970
-
971
984
  let event = (jn && jn.event) ? String(jn.event) : "(no event)";
972
985
  let kw = (jn && jn.kw && typeof jn.kw === "object") ? jn.kw : null;
973
986
  let command = (kw && typeof kw.command === "string") ? kw.command : "";
@@ -985,14 +998,16 @@ function info_traffic(title, msg, direction, size)
985
998
  kw: kw, jn: jn, hay: hay, $node: null,
986
999
  };
987
1000
 
988
- TRAFFIC_LOG.push(entry);
1001
+ push_entry(entry);
989
1002
 
990
- if(TRAFFIC_LOG.length > TRAFFIC_MAX) {
991
- let old = TRAFFIC_LOG.shift();
992
- if(old.$node && old.$node.parentNode) {
993
- old.$node.parentNode.removeChild(old.$node);
994
- }
1003
+ /* Window side: the entry is buffered above whatever happens, so the
1004
+ * window shows what arrived before it was opened. Painted only when the
1005
+ * window is mounted and not routed to the console only. */
1006
+ let logger = document.getElementById('developer-traffic-logger');
1007
+ if(!logger || route === "console") {
1008
+ return;
995
1009
  }
1010
+ ensure_dev_style();
996
1011
 
997
1012
  if(!entry_hidden(entry, build_filter_ctx())) {
998
1013
  let node = render_entry(entry);
@@ -1033,20 +1048,8 @@ function info_log(level, msg, hora)
1033
1048
  } else if(level === "warning") {
1034
1049
  LOG_WARN_COUNT++;
1035
1050
  }
1036
- /* Routed to the console only: the line already reached the browser
1037
- * console (gobj-js gate left on), so don't mirror it into the window —
1038
- * but keep the status-line tally live if the window is open. */
1039
- if(dev_route() === "console") {
1040
- update_stats();
1041
- return;
1042
- }
1043
- let logger = document.getElementById('developer-traffic-logger');
1044
- if(!logger) {
1045
- return;
1046
- }
1047
1051
  __in_info_log__ = true;
1048
1052
  try {
1049
- ensure_dev_style();
1050
1053
  let lvl = level || "debug";
1051
1054
  let text;
1052
1055
  if(lvl === "json") {
@@ -1066,13 +1069,16 @@ function info_log(level, msg, hora)
1066
1069
  dir: 0, size: 0, ts: traffic_now(),
1067
1070
  hay: (lvl + " " + text).toLowerCase(), $node: null,
1068
1071
  };
1069
- TRAFFIC_LOG.push(entry);
1070
- if(TRAFFIC_LOG.length > TRAFFIC_MAX) {
1071
- let old = TRAFFIC_LOG.shift();
1072
- if(old.$node && old.$node.parentNode) {
1073
- old.$node.parentNode.removeChild(old.$node);
1074
- }
1072
+ /* Buffered always: the window shows what the app logged before it
1073
+ * was opened. Painted only when mounted and not routed to the
1074
+ * console only (the line already reached the console). */
1075
+ push_entry(entry);
1076
+ let logger = document.getElementById('developer-traffic-logger');
1077
+ if(!logger || dev_route() === "console") {
1078
+ update_stats();
1079
+ return;
1075
1080
  }
1081
+ ensure_dev_style();
1076
1082
  if(!entry_hidden(entry, build_filter_ctx())) {
1077
1083
  let node = render_entry(entry);
1078
1084
  entry.$node = node;
@@ -1428,6 +1434,8 @@ function build_control_bar()
1428
1434
  class: 'YDEV_SEARCH', type: 'search', 'data-role': 'search',
1429
1435
  placeholder: t('filter events / payload'),
1430
1436
  'data-i18n-placeholder': 'filter events / payload',
1437
+ title: t('filter events / payload'), 'data-i18n-title': 'filter events / payload',
1438
+ 'aria-label': t('filter events / payload'), 'data-i18n-aria-label': 'filter events / payload',
1431
1439
  }, '', {
1432
1440
  input: (ev) => {
1433
1441
  SEARCH_TEXT = String(ev.target.value || '').toLowerCase().trim();
@@ -1435,6 +1443,26 @@ function build_control_bar()
1435
1443
  }
1436
1444
  }];
1437
1445
 
1446
+ /* Its own button: a `type=search` input shows a clear cross in some
1447
+ * browsers only (not in Firefox). */
1448
+ let search_clear = ['button', {
1449
+ class: 'YDEV_CHIP YDEV_SEARCH_CLEAR', type: 'button',
1450
+ title: t('clear the filter'), 'data-i18n-title': 'clear the filter',
1451
+ 'aria-label': t('clear the filter'), 'data-i18n-aria-label': 'clear the filter',
1452
+ }, '✕', {
1453
+ click: (ev) => {
1454
+ ev.stopPropagation();
1455
+ let $bar = ev.currentTarget.closest('.YDEV_BAR');
1456
+ let $input = $bar ? $bar.querySelector('.YDEV_SEARCH') : null;
1457
+ if($input) {
1458
+ $input.value = '';
1459
+ $input.focus();
1460
+ }
1461
+ SEARCH_TEXT = '';
1462
+ rerender_all();
1463
+ }
1464
+ }];
1465
+
1438
1466
  let copy = ['button', {class: 'YDEV_CHIP', type: 'button',
1439
1467
  title: t('copy visible traffic to clipboard'),
1440
1468
  'data-i18n-title': 'copy visible traffic to clipboard',
@@ -1469,7 +1497,7 @@ function build_control_bar()
1469
1497
  grp('output', [output_seg]), sep(),
1470
1498
  grp('view', [view_seg]), expand_grp, sep(),
1471
1499
  grp('show', dir_chips), sep(),
1472
- grp('find', [search]), sep(),
1500
+ grp('find', [search, search_clear]), sep(),
1473
1501
  grp('log', [copy, clear]),
1474
1502
  ]]);
1475
1503
  }