@yuneta/gobj-ui 5.13.0 → 5.14.0

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.
@@ -15557,6 +15557,13 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
15557
15557
  break;
15558
15558
  case "create-node":
15559
15559
  case "update-node":
15560
+ (0, _yuneta_gobj_js.gobj_publish_event)(gobj, "EV_RECORD_WRITTEN", {
15561
+ treedb_name: (0, _yuneta_gobj_js.kw_get_str)(gobj, kw_command, "treedb_name", "", 0),
15562
+ topic_name: (0, _yuneta_gobj_js.kw_get_str)(gobj, kw_command, "topic_name", "", 0),
15563
+ record: (0, _yuneta_gobj_js.kw_get_dict)(gobj, kw_command, "record", {}, 0),
15564
+ created: command === "create-node"
15565
+ });
15566
+ break;
15560
15567
  case "delete-node": break;
15561
15568
  default: (0, _yuneta_gobj_js.log_error)(`${(0, _yuneta_gobj_js.gobj_short_name)(gobj)} Command unknown: ${command}`);
15562
15569
  }
@@ -15962,6 +15969,7 @@ function create_gclass$5(gclass_name) {
15962
15969
  ["EV_CREATE_RECORD", 0],
15963
15970
  ["EV_UPDATE_RECORD", 0],
15964
15971
  ["EV_DELETE_RECORD", 0],
15972
+ ["EV_RECORD_WRITTEN", _yuneta_gobj_js.event_flag_t.EVF_OUTPUT_EVENT | _yuneta_gobj_js.event_flag_t.EVF_NO_WARN_SUBS],
15965
15973
  ["EV_REFRESH_TOPIC", 0],
15966
15974
  ["EV_OPEN_JSON", 0],
15967
15975
  ["EV_EXPAND_PATH", 0],
@@ -15552,6 +15552,13 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
15552
15552
  break;
15553
15553
  case "create-node":
15554
15554
  case "update-node":
15555
+ gobj_publish_event(gobj, "EV_RECORD_WRITTEN", {
15556
+ treedb_name: kw_get_str(gobj, kw_command, "treedb_name", "", 0),
15557
+ topic_name: kw_get_str(gobj, kw_command, "topic_name", "", 0),
15558
+ record: kw_get_dict(gobj, kw_command, "record", {}, 0),
15559
+ created: command === "create-node"
15560
+ });
15561
+ break;
15555
15562
  case "delete-node": break;
15556
15563
  default: log_error(`${gobj_short_name(gobj)} Command unknown: ${command}`);
15557
15564
  }
@@ -15957,6 +15964,7 @@ function create_gclass$5(gclass_name) {
15957
15964
  ["EV_CREATE_RECORD", 0],
15958
15965
  ["EV_UPDATE_RECORD", 0],
15959
15966
  ["EV_DELETE_RECORD", 0],
15967
+ ["EV_RECORD_WRITTEN", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
15960
15968
  ["EV_REFRESH_TOPIC", 0],
15961
15969
  ["EV_OPEN_JSON", 0],
15962
15970
  ["EV_EXPAND_PATH", 0],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yuneta/gobj-ui",
3
- "version": "5.13.0",
3
+ "version": "5.14.0",
4
4
  "type": "module",
5
5
  "main": "dist/gobj-ui.cjs.js",
6
6
  "module": "dist/gobj-ui.es.js",
@@ -1717,6 +1717,24 @@ function ac_mt_command_answer(gobj, event, kw, src)
1717
1717
 
1718
1718
  case "create-node":
1719
1719
  case "update-node":
1720
+ /*
1721
+ * The view refreshes itself from the treedb's own
1722
+ * EV_TREEDB_NODE_* events, which arrive for EVERY writer. This
1723
+ * says something those cannot: THIS view has just written THIS
1724
+ * record, and it succeeded. A host whose save is not finished
1725
+ * with one record — a schema editor, where a column change also
1726
+ * has to raise the versions that publish it — needs exactly that,
1727
+ * and cannot use the node events without answering its own writes
1728
+ * in a loop.
1729
+ */
1730
+ gobj_publish_event(gobj, "EV_RECORD_WRITTEN", {
1731
+ treedb_name: kw_get_str(gobj, kw_command, "treedb_name", "", 0),
1732
+ topic_name: kw_get_str(gobj, kw_command, "topic_name", "", 0),
1733
+ record: kw_get_dict(gobj, kw_command, "record", {}, 0),
1734
+ created: (command === "create-node")
1735
+ });
1736
+ break;
1737
+
1720
1738
  case "delete-node":
1721
1739
  // Don't process by here, process on subscribed events.
1722
1740
  break;
@@ -2239,6 +2257,8 @@ function create_gclass(gclass_name)
2239
2257
  ["EV_CREATE_RECORD", 0],
2240
2258
  ["EV_UPDATE_RECORD", 0],
2241
2259
  ["EV_DELETE_RECORD", 0],
2260
+ ["EV_RECORD_WRITTEN", event_flag_t.EVF_OUTPUT_EVENT|
2261
+ event_flag_t.EVF_NO_WARN_SUBS],
2242
2262
  ["EV_REFRESH_TOPIC", 0],
2243
2263
  ["EV_OPEN_JSON", 0],
2244
2264
  ["EV_EXPAND_PATH", 0],