vim-web 0.3.44-dev.77 → 0.3.44-dev.79

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.
@@ -78,7 +78,7 @@ export declare class StateSynchronizer {
78
78
  */
79
79
  replaceState(fromState: NodeState | NodeState[], toState: NodeState): void;
80
80
  /**
81
- * Reapplies all current state settings, useful after changes to the node structure.
81
+ * Reapplies all current state settings, useful after a reconnection.
82
82
  * This will remove redundant overrides and ensure consistency.
83
83
  */
84
84
  reapplyStates(): void;
@@ -60226,7 +60226,7 @@ void main() {
60226
60226
  this.scheduleUpdate();
60227
60227
  }
60228
60228
  /**
60229
- * Reapplies all current state settings, useful after changes to the node structure.
60229
+ * Reapplies all current state settings, useful after a reconnection.
60230
60230
  * This will remove redundant overrides and ensure consistency.
60231
60231
  */
60232
60232
  reapplyStates() {
@@ -60479,16 +60479,29 @@ void main() {
60479
60479
  * @param toState - The new state to apply
60480
60480
  */
60481
60481
  replace(fromState, toState) {
60482
+ this.purge();
60482
60483
  if (matchesState(this._default, fromState)) {
60483
60484
  this._default = toState;
60484
60485
  this._updatedDefault = true;
60486
+ this.reapply();
60487
+ return;
60485
60488
  }
60486
60489
  for (const [nodeId, state] of this._state.entries()) {
60487
60490
  if (matchesState(state, fromState)) {
60488
60491
  this._state.set(nodeId, toState);
60492
+ this._updates.add(nodeId);
60489
60493
  }
60490
60494
  }
60491
- this.reapply();
60495
+ }
60496
+ // Clean up redundant overrides
60497
+ purge() {
60498
+ const toRemove = [];
60499
+ for (const [nodeId, state] of this._state.entries()) {
60500
+ if (state === this._default) {
60501
+ toRemove.push(nodeId);
60502
+ }
60503
+ }
60504
+ toRemove.forEach((nodeId) => this._state.delete(nodeId));
60492
60505
  }
60493
60506
  }
60494
60507
  function matchesState(nodeState, state) {
@@ -75706,9 +75719,9 @@ Averrage Date/Second ${avgDataRatePS} kb
75706
75719
  case "number":
75707
75720
  return /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { state: props.field.state, disabled: ((_b2 = (_a3 = props.field).enabled) == null ? void 0 : _b2.call(_a3)) === false });
75708
75721
  case "text":
75709
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { state: props.field.state, disabled: !((_d = (_c = props.field).enabled) == null ? void 0 : _d.call(_c)) === false });
75722
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { state: props.field.state, disabled: ((_d = (_c = props.field).enabled) == null ? void 0 : _d.call(_c)) === false });
75710
75723
  case "bool":
75711
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { state: props.field.state, disabled: !((_f = (_e = props.field).enabled) == null ? void 0 : _f.call(_e)) === false });
75724
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { state: props.field.state, disabled: ((_f = (_e = props.field).enabled) == null ? void 0 : _f.call(_e)) === false });
75712
75725
  default:
75713
75726
  return null;
75714
75727
  }
@@ -75987,7 +76000,7 @@ Averrage Date/Second ${avgDataRatePS} kb
75987
76000
  entries: [
75988
76001
  { type: "bool", id: "showGhost", label: "Show Ghost", state: props.state.showGhost },
75989
76002
  // { type: "bool", id: "showRooms", label: "Show Rooms", state: props.state.showRooms },
75990
- { type: "number", id: "ghostOpacity", label: "Ghost Opacity", state: props.state.ghostOpacity, enabled: () => false }
76003
+ { type: "number", id: "ghostOpacity", label: "Ghost Opacity", state: props.state.ghostOpacity, enabled: () => props.state.showGhost.get() }
75991
76004
  ]
75992
76005
  }
75993
76006
  );