@plasmicapp/react-web 0.2.154 → 0.2.156

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.
@@ -2350,6 +2350,15 @@ var StateSpecNode = /*#__PURE__*/function () {
2350
2350
  path: path
2351
2351
  };
2352
2352
  };
2353
+ _proto.deleteStateCell = function deleteStateCell(prefixPath) {
2354
+ var _this = this;
2355
+ [].concat(Object.keys(this._state)).forEach(function (key) {
2356
+ var path = JSON.parse(key);
2357
+ if (shallowEqual(prefixPath, path.slice(0, prefixPath.length))) {
2358
+ delete _this._state[key];
2359
+ }
2360
+ });
2361
+ };
2353
2362
  _proto.setInitialValue = function setInitialValue(path, value) {
2354
2363
  var key = JSON.stringify(path);
2355
2364
  this._state[key].initialValue = value;
@@ -2610,6 +2619,7 @@ function initializeStateValue($$state, initialSpecNode, initialStatePath, proxyR
2610
2619
  if (spec.valueProp) {
2611
2620
  return $$state.props[spec.valueProp];
2612
2621
  } else if (!node.hasState(path) && spec.initFunc) {
2622
+ node.createStateCell(path);
2613
2623
  return initializeStateValue($$state, node, path, proxyRoot);
2614
2624
  }
2615
2625
  return _get(proxyRoot, path);
@@ -2659,6 +2669,13 @@ function create$StateProxy($$state, leafHandlers) {
2659
2669
  // 2 - delete indices in repeated implicit states, but these can't be exposed, so they don't have onChangeProp
2660
2670
  (_$$state$props$spec$o = (_$$state$props2 = $$state.props)[spec.onChangeProp]) == null ? void 0 : _$$state$props$spec$o.call(_$$state$props2, _get(proxyRoot, currPath.slice(spec.pathObj.length)));
2661
2671
  }
2672
+ var nextPath = getNextPath(property);
2673
+ var nextNode = currNode.makeTransition(property);
2674
+ if (nextNode) {
2675
+ getStateCells(nextNode).forEach(function (node) {
2676
+ node.deleteStateCell(nextPath);
2677
+ });
2678
+ }
2662
2679
  return Reflect.deleteProperty(target, property);
2663
2680
  },
2664
2681
  get: function get(target, property, receiver) {