@yuneta/gobj-ui 7.23.34 β†’ 7.23.35

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.
@@ -64311,8 +64311,9 @@ function dev_view() {
64311
64311
  }
64312
64312
  var HIDE_PERIODIC_DEFAULT = 1;
64313
64313
  var SIMPLE_MACH_DEFAULT = 1;
64314
+ var SIMPLE_MACH_KEY = "dev_mach_simple";
64314
64315
  function dev_simple_mach() {
64315
- return dev_num("dev_automata_simple", SIMPLE_MACH_DEFAULT) ? 1 : 0;
64316
+ return dev_num(SIMPLE_MACH_KEY, SIMPLE_MACH_DEFAULT) ? 1 : 0;
64316
64317
  }
64317
64318
  function dev_hide_periodic() {
64318
64319
  return dev_num("dev_hide_periodic", HIDE_PERIODIC_DEFAULT) ? true : false;
@@ -65337,7 +65338,7 @@ function build_control_bar() {
65337
65338
  { click: (ev) => {
65338
65339
  ev.stopPropagation();
65339
65340
  let v = dev_simple_mach() ? 0 : 1;
65340
- (0, _yuneta_gobj_js.kw_set_local_storage_value)("dev_automata_simple", v);
65341
+ (0, _yuneta_gobj_js.kw_set_local_storage_value)(SIMPLE_MACH_KEY, v);
65341
65342
  (0, _yuneta_gobj_js.gobj_set_trace_machine_format)(v);
65342
65343
  refresh_dev_chrome();
65343
65344
  } }
@@ -64306,8 +64306,9 @@ function dev_view() {
64306
64306
  }
64307
64307
  var HIDE_PERIODIC_DEFAULT = 1;
64308
64308
  var SIMPLE_MACH_DEFAULT = 1;
64309
+ var SIMPLE_MACH_KEY = "dev_mach_simple";
64309
64310
  function dev_simple_mach() {
64310
- return dev_num("dev_automata_simple", SIMPLE_MACH_DEFAULT) ? 1 : 0;
64311
+ return dev_num(SIMPLE_MACH_KEY, SIMPLE_MACH_DEFAULT) ? 1 : 0;
64311
64312
  }
64312
64313
  function dev_hide_periodic() {
64313
64314
  return dev_num("dev_hide_periodic", HIDE_PERIODIC_DEFAULT) ? true : false;
@@ -65332,7 +65333,7 @@ function build_control_bar() {
65332
65333
  { click: (ev) => {
65333
65334
  ev.stopPropagation();
65334
65335
  let v = dev_simple_mach() ? 0 : 1;
65335
- kw_set_local_storage_value("dev_automata_simple", v);
65336
+ kw_set_local_storage_value(SIMPLE_MACH_KEY, v);
65336
65337
  gobj_set_trace_machine_format(v);
65337
65338
  refresh_dev_chrome();
65338
65339
  } }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "7.23.34",
3
+ "version": "7.23.35",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -20,6 +20,31 @@ const STATE_CHANGE =
20
20
  const NOT_DEFINED =
21
21
  "πŸ“› mach(C_X^x), st: ST_IDLE, ev: EV_TIMEOUT, πŸ“›πŸ“›ERROR Event NOT DEFINED in stateπŸ“›πŸ“›, from(C_TIMER^t)";
22
22
 
23
+ /* The other four shapes the SIMPLER format emits (gobj-js 7.13.7 gave them
24
+ * their format-1 branch; before that they leaked `mach(…)` into it). */
25
+ const SIMPLE_PUBLISH = "πŸ”πŸ” EV_STATE_CHANGED C_PROT_MQTT^input-2 ST_WAIT_FRAME_HEADER";
26
+ const SIMPLE_FORWARD = "πŸ”πŸ”„ EV_TX_READY (EV_TX_READY) C_PROT_TCP4H^output-0";
27
+ const SIMPLE_INJECT = "πŸ”œ EV_ON_MESSAGE C_GATE^gate ST_IDLE";
28
+ const SIMPLE_NESTED = " πŸ”„ EV_ON_MESSAGE C_IOGATE^output-iogate-0 ST_IDLE from C_CHANNEL^output-0";
29
+
30
+ describe("the simpler format's other shapes", () => {
31
+ it("reads the event out of a publish, a forward and an injection", () => {
32
+ expect(machine_event_of(SIMPLE_PUBLISH)).toBe("EV_STATE_CHANGED");
33
+ expect(machine_event_of(SIMPLE_FORWARD)).toBe("EV_TX_READY");
34
+ expect(machine_event_of(SIMPLE_INJECT)).toBe("EV_ON_MESSAGE");
35
+ });
36
+
37
+ it("the leading INDENTATION does not hide the event", () => {
38
+ expect(machine_event_of(SIMPLE_NESTED)).toBe("EV_ON_MESSAGE");
39
+ expect(log_is_periodic("debug", SIMPLE_NESTED)).toBe(false);
40
+ });
41
+
42
+ it("a periodic one is still recognised in every shape", () => {
43
+ expect(log_is_periodic("debug", "πŸ”πŸ” EV_TIMEOUT C_TIMER^t ST_IDLE")).toBe(true);
44
+ expect(log_is_periodic("debug", " πŸ”œ EV_TIMEOUT_PERIODIC C_YUNO^y ST_IDLE")).toBe(true);
45
+ });
46
+ });
47
+
23
48
  describe("machine_event_of", () => {
24
49
  it("reads the event out of the verbose format, both lines of it", () => {
25
50
  expect(machine_event_of(VERBOSE_IN)).toBe("EV_TIMEOUT");
package/src/yui_dev.js CHANGED
@@ -199,9 +199,19 @@ const HIDE_PERIODIC_DEFAULT = 1;
199
199
  * is born showing the wrong state and its first click does nothing. */
200
200
  const SIMPLE_MACH_DEFAULT = 1;
201
201
 
202
+ /* A NEW key, deliberately.
203
+ *
204
+ * The default moved from 0 to 1 in 7.23.34, and a stored preference beats a
205
+ * default: every browser that had ever clicked the old `Simple mach` chip
206
+ * carried an explicit 0 and went on reading the legacy shape, so the change
207
+ * reached nobody who had used the window before. A default that cannot reach
208
+ * an existing browser is not a default. The old key is left where it is and
209
+ * simply stops being read. */
210
+ const SIMPLE_MACH_KEY = "dev_mach_simple";
211
+
202
212
  function dev_simple_mach()
203
213
  {
204
- return dev_num("dev_automata_simple", SIMPLE_MACH_DEFAULT) ? 1 : 0;
214
+ return dev_num(SIMPLE_MACH_KEY, SIMPLE_MACH_DEFAULT) ? 1 : 0;
205
215
  }
206
216
 
207
217
  function dev_hide_periodic()
@@ -1468,7 +1478,7 @@ function build_control_bar()
1468
1478
  click: (ev) => {
1469
1479
  ev.stopPropagation();
1470
1480
  let v = dev_simple_mach() ? 0 : 1;
1471
- kw_set_local_storage_value('dev_automata_simple', v);
1481
+ kw_set_local_storage_value(SIMPLE_MACH_KEY, v);
1472
1482
  gobj_set_trace_machine_format(v);
1473
1483
  refresh_dev_chrome();
1474
1484
  }