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.
package/dist/vim-web.js CHANGED
@@ -60210,7 +60210,7 @@ class StateSynchronizer {
60210
60210
  this.scheduleUpdate();
60211
60211
  }
60212
60212
  /**
60213
- * Reapplies all current state settings, useful after changes to the node structure.
60213
+ * Reapplies all current state settings, useful after a reconnection.
60214
60214
  * This will remove redundant overrides and ensure consistency.
60215
60215
  */
60216
60216
  reapplyStates() {
@@ -60463,16 +60463,29 @@ class StateTracker {
60463
60463
  * @param toState - The new state to apply
60464
60464
  */
60465
60465
  replace(fromState, toState) {
60466
+ this.purge();
60466
60467
  if (matchesState(this._default, fromState)) {
60467
60468
  this._default = toState;
60468
60469
  this._updatedDefault = true;
60470
+ this.reapply();
60471
+ return;
60469
60472
  }
60470
60473
  for (const [nodeId, state] of this._state.entries()) {
60471
60474
  if (matchesState(state, fromState)) {
60472
60475
  this._state.set(nodeId, toState);
60476
+ this._updates.add(nodeId);
60473
60477
  }
60474
60478
  }
60475
- this.reapply();
60479
+ }
60480
+ // Clean up redundant overrides
60481
+ purge() {
60482
+ const toRemove = [];
60483
+ for (const [nodeId, state] of this._state.entries()) {
60484
+ if (state === this._default) {
60485
+ toRemove.push(nodeId);
60486
+ }
60487
+ }
60488
+ toRemove.forEach((nodeId) => this._state.delete(nodeId));
60476
60489
  }
60477
60490
  }
60478
60491
  function matchesState(nodeState, state) {
@@ -75690,9 +75703,9 @@ function GenericField(props) {
75690
75703
  case "number":
75691
75704
  return /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { state: props.field.state, disabled: ((_b2 = (_a3 = props.field).enabled) == null ? void 0 : _b2.call(_a3)) === false });
75692
75705
  case "text":
75693
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { state: props.field.state, disabled: !((_d = (_c = props.field).enabled) == null ? void 0 : _d.call(_c)) === false });
75706
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericTextField, { state: props.field.state, disabled: ((_d = (_c = props.field).enabled) == null ? void 0 : _d.call(_c)) === false });
75694
75707
  case "bool":
75695
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { state: props.field.state, disabled: !((_f = (_e = props.field).enabled) == null ? void 0 : _f.call(_e)) === false });
75708
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericBoolField, { state: props.field.state, disabled: ((_f = (_e = props.field).enabled) == null ? void 0 : _f.call(_e)) === false });
75696
75709
  default:
75697
75710
  return null;
75698
75711
  }
@@ -75971,7 +75984,7 @@ const IsolationPanel = forwardRef(
75971
75984
  entries: [
75972
75985
  { type: "bool", id: "showGhost", label: "Show Ghost", state: props.state.showGhost },
75973
75986
  // { type: "bool", id: "showRooms", label: "Show Rooms", state: props.state.showRooms },
75974
- { type: "number", id: "ghostOpacity", label: "Ghost Opacity", state: props.state.ghostOpacity, enabled: () => false }
75987
+ { type: "number", id: "ghostOpacity", label: "Ghost Opacity", state: props.state.ghostOpacity, enabled: () => props.state.showGhost.get() }
75975
75988
  ]
75976
75989
  }
75977
75990
  );