@plasmicapp/react-web 0.2.182 → 0.2.184

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/all.d.ts CHANGED
@@ -11678,6 +11678,7 @@ declare function generateStateOnChangeProp($state: $State, path: ObjectPath): (v
11678
11678
  declare function generateStateOnChangePropForCodeComponents($state: $State, stateName: string, plasmicStatePath: ObjectPath, componentHelpers: ComponentHelpers<any>): (val: any) => void;
11679
11679
  declare function generateStateValueProp($state: $State, path: ObjectPath): any;
11680
11680
  declare function isPlasmicStateProxy(obj: any): boolean;
11681
+ declare function is$StateProxy(obj: any): number | boolean | undefined;
11681
11682
  declare function getStateCellsInPlasmicProxy(obj: any): {
11682
11683
  realPath: ObjectPath;
11683
11684
  path: string;
@@ -13299,4 +13300,4 @@ interface TriggeredOverlayContextValue {
13299
13300
  }
13300
13301
  declare const TriggeredOverlayContext: React$1.Context<TriggeredOverlayContextValue | undefined>;
13301
13302
 
13302
- export { $State, $StateSpec, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicDataSourceContextProvider, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicPageGuard, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, dlv as get, getCurrentInitialValue, getDataProps, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, hasVariant, initializeCodeComponentStates, initializePlasmicStates, isPlasmicStateProxy, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, resetToInitialValue, set, setPlumeStrictMode, useButton, useCheckbox, useCurrentUser, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
13303
+ export { $State, $StateSpec, BaseButtonProps, BaseMenuButtonProps, BaseMenuGroupProps, BaseMenuItemProps, BaseMenuProps, BaseSelectOptionGroupProps, BaseSelectOptionProps, BaseSelectProps, BaseTextInputProps, BaseTriggeredOverlayProps, ButtonRef, CheckboxProps, CheckboxRef, CheckboxRefValue, DropdownMenu, Flex, HTMLElementRefOf, HtmlAnchorOnlyProps, HtmlButtonOnlyProps, MenuButtonRef, MenuButtonRefValue, MenuRef, MenuRefValue, MultiChoiceArg, PlasmicDataSourceContextProvider, PlasmicHead, PlasmicIcon, PlasmicImg, PlasmicLink, PlasmicPageGuard, PlasmicRootProvider, PlasmicSlot, SelectContext, SelectOptionRef, SelectRef, SelectRefValue, SingleBooleanChoiceArg, SingleChoiceArg, Stack, StrictProps, SwitchProps, SwitchRef, SwitchRefValue, TextInputRef, TextInputRefValue, Trans, TriggeredOverlayConfig, TriggeredOverlayContext, TriggeredOverlayRef, classNames, createPlasmicElementProxy, createUseScreenVariants, deriveRenderOpts, ensureGlobalVariants, genTranslatableString, generateStateOnChangeProp, generateStateOnChangePropForCodeComponents, generateStateValueProp, dlv as get, getCurrentInitialValue, getDataProps, getStateCellsInPlasmicProxy, getStateSpecInPlasmicProxy, hasVariant, initializeCodeComponentStates, initializePlasmicStates, is$StateProxy, isPlasmicStateProxy, makeFragment, mergeVariantsWithStates, omit, pick, plasmicHeadMeta, renderPlasmicSlot, resetToInitialValue, set, setPlumeStrictMode, useButton, useCheckbox, useCurrentUser, useDollarState, useIsSSR, useMenu, useMenuButton, useMenuGroup, useMenuItem, useSelect, useSelectOption, useSelectOptionGroup, useSwitch, useTextInput, useTrigger, useTriggeredOverlay, wrapWithClassName };
@@ -13,9 +13,9 @@ var ReactDOM = require('react-dom');
13
13
  var ReactDOM__default = _interopDefault(ReactDOM);
14
14
  var ssr = require('@react-aria/ssr');
15
15
  var focus = require('@react-aria/focus');
16
+ var valtio = require('valtio');
16
17
  var clone = _interopDefault(require('clone'));
17
18
  var deepEqual = _interopDefault(require('fast-deep-equal'));
18
- var valtio = require('valtio');
19
19
  var checkbox = require('@react-aria/checkbox');
20
20
  var visuallyHidden = require('@react-aria/visually-hidden');
21
21
  var toggle = require('@react-stately/toggle');
@@ -2554,6 +2554,7 @@ function canProxy(value) {
2554
2554
  return typeof value === "object" && value != null;
2555
2555
  }
2556
2556
  var proxyObjToStateCell = /*#__PURE__*/new WeakMap();
2557
+ var valtioSubscriptions = /*#__PURE__*/new WeakMap();
2557
2558
  function ensureStateCell(target, property, path, node) {
2558
2559
  if (!proxyObjToStateCell.has(target)) {
2559
2560
  proxyObjToStateCell.set(target, {});
@@ -2587,6 +2588,30 @@ function tryGetStateCellFrom$StateRoot($state, path) {
2587
2588
  function getStateCellFrom$StateRoot($state, path) {
2588
2589
  return ensure(tryGetStateCellFrom$StateRoot($state, path));
2589
2590
  }
2591
+ function unsubscribeToValtio($$state, statePath) {
2592
+ var oldValue = _get($$state.stateValues, statePath);
2593
+ if (valtio.getVersion(oldValue)) {
2594
+ var _valtioSubscriptions$;
2595
+ (_valtioSubscriptions$ = valtioSubscriptions.get(oldValue)) == null ? void 0 : _valtioSubscriptions$.forEach(function (f) {
2596
+ return f();
2597
+ });
2598
+ valtioSubscriptions["delete"](oldValue);
2599
+ }
2600
+ }
2601
+ function subscribeToValtio($$state, statePath, node) {
2602
+ var spec = node.getSpec();
2603
+ var maybeValtioProxy = spec.valueProp ? $$state.env.$props[spec.valueProp] : _get($$state.stateValues, statePath);
2604
+ if (valtio.getVersion(maybeValtioProxy) && spec.onChangeProp) {
2605
+ var unsub = valtio.subscribe(maybeValtioProxy, function () {
2606
+ var _$$state$env$$props$s, _$$state$env$$props;
2607
+ (_$$state$env$$props$s = (_$$state$env$$props = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s.call(_$$state$env$$props, spec.valueProp ? $$state.env.$props[spec.valueProp] : _get($$state.stateValues, statePath));
2608
+ });
2609
+ if (!valtioSubscriptions.has(maybeValtioProxy)) {
2610
+ valtioSubscriptions.set(maybeValtioProxy, []);
2611
+ }
2612
+ ensure(valtioSubscriptions.get(maybeValtioProxy)).push(unsub);
2613
+ }
2614
+ }
2590
2615
  function initializeStateValue($$state, initialStateCell, proxyRoot) {
2591
2616
  var _initialStateCell$ove2;
2592
2617
  var initialStateName = initialStateCell.node.getSpec().path;
@@ -2647,8 +2672,8 @@ function initializeStateValue($$state, initialStateCell, proxyRoot) {
2647
2672
  set(proxyRoot, initialStateCell.path, value);
2648
2673
  //immediately fire onChange
2649
2674
  if (initialSpec.onChangeProp) {
2650
- var _$$state$env$$props$i, _$$state$env$$props;
2651
- (_$$state$env$$props$i = (_$$state$env$$props = $$state.env.$props)[initialSpec.onChangeProp]) == null ? void 0 : _$$state$env$$props$i.call(_$$state$env$$props, initialValue);
2675
+ var _$$state$env$$props$i, _$$state$env$$props2;
2676
+ (_$$state$env$$props$i = (_$$state$env$$props2 = $$state.env.$props)[initialSpec.onChangeProp]) == null ? void 0 : _$$state$env$$props$i.call(_$$state$env$$props2, initialValue);
2652
2677
  }
2653
2678
  $$state.stateInitializationEnv.visited["delete"](initialStateName);
2654
2679
  $$state.stateInitializationEnv.stack.pop();
@@ -2656,23 +2681,23 @@ function initializeStateValue($$state, initialStateCell, proxyRoot) {
2656
2681
  }
2657
2682
  function create$StateProxy($$state, leafHandlers) {
2658
2683
  var proxyRoot;
2659
- var rec = function rec(currPath, currNode, isOutside, initialObject) {
2684
+ var rec = function rec(currPath, currNode) {
2660
2685
  var getNextPath = function getNextPath(property) {
2661
2686
  return [].concat(currPath, [isNum(property) ? +property : property]);
2662
2687
  };
2663
2688
  var spec = currNode.getSpec();
2664
2689
  var handlers = {
2665
2690
  deleteProperty: function deleteProperty(target, property) {
2666
- if (!isOutside && !currNode.isLeaf() && !currNode.hasArrayTransition() && !isNum(property)) {
2691
+ if (!currNode.isLeaf() && !currNode.hasArrayTransition() && !isNum(property)) {
2667
2692
  throw new InvalidOperation("Can't delete a property in the middle of the state spec");
2668
2693
  }
2669
2694
  delete _get($$state.stateValues, currPath)[property];
2670
2695
  if (spec.onChangeProp) {
2671
- var _$$state$env$$props$s, _$$state$env$$props2;
2696
+ var _$$state$env$$props$s2, _$$state$env$$props3;
2672
2697
  //we are always in a leaf, since we only have two cases:
2673
2698
  // 1 - delete properties outside the state tree
2674
2699
  // 2 - delete indices in repeated implicit states, but these can't be exposed, so they don't have onChangeProp
2675
- (_$$state$env$$props$s = (_$$state$env$$props2 = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s.call(_$$state$env$$props2, _get(proxyRoot, currPath.slice(spec.pathObj.length)));
2700
+ (_$$state$env$$props$s2 = (_$$state$env$$props3 = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s2.call(_$$state$env$$props3, _get(proxyRoot, currPath.slice(spec.pathObj.length)));
2676
2701
  }
2677
2702
  return Reflect.deleteProperty(target, property);
2678
2703
  },
@@ -2680,27 +2705,23 @@ function create$StateProxy($$state, leafHandlers) {
2680
2705
  if (property === PLASMIC_STATE_PROXY_SYMBOL) {
2681
2706
  return {
2682
2707
  node: currNode,
2683
- path: currPath,
2684
- isOutside: isOutside
2708
+ path: currPath
2685
2709
  };
2686
2710
  }
2687
2711
  var nextPath = getNextPath(property);
2688
- if (isOutside || currNode.isLeaf()) {
2689
- return Reflect.get(target, property, receiver);
2690
- }
2691
2712
  var nextNode = currNode.makeTransition(property);
2692
2713
  if (nextNode != null && nextNode.isLeaf()) {
2693
2714
  var _leafHandlers$get, _leafHandlers;
2694
2715
  return (_leafHandlers$get = (_leafHandlers = leafHandlers(ensureStateCell(receiver, property, nextPath, nextNode))).get) == null ? void 0 : _leafHandlers$get.call(_leafHandlers, target, property, receiver);
2695
2716
  } else if (nextNode && !(property in target)) {
2696
- target[property] = rec(nextPath, nextNode, false, undefined);
2717
+ target[property] = rec(nextPath, nextNode);
2697
2718
  }
2698
2719
  return Reflect.get(target, property, receiver);
2699
2720
  },
2700
2721
  set: function set$1(target, property, value, receiver) {
2701
- var _nextNode, _nextNode2;
2702
2722
  var nextPath = getNextPath(property);
2703
2723
  var nextNode = currNode.makeTransition(property);
2724
+ var nextSpec = nextNode == null ? void 0 : nextNode.getSpec();
2704
2725
  if (property === "registerInitFunc" && currPath.length === 0) {
2705
2726
  return Reflect.set(target, property, value, receiver);
2706
2727
  }
@@ -2709,62 +2730,42 @@ function create$StateProxy($$state, leafHandlers) {
2709
2730
  //array can set his own properties such as length, map, ...
2710
2731
  return Reflect.set(target, property, value, receiver);
2711
2732
  }
2712
- if ((_nextNode = nextNode) != null && _nextNode.isLeaf()) {
2733
+ if (nextNode != null && nextNode.isLeaf()) {
2713
2734
  var _leafHandlers$set, _leafHandlers2;
2714
2735
  (_leafHandlers$set = (_leafHandlers2 = leafHandlers(ensureStateCell(receiver, property, nextPath, nextNode))).set) == null ? void 0 : _leafHandlers$set.call(_leafHandlers2, target, property, value, receiver);
2736
+ Reflect.set(target, property, value, receiver);
2737
+ if (nextSpec != null && nextSpec.onChangeProp) {
2738
+ var _$$state$env$$props$n, _$$state$env$$props4;
2739
+ (_$$state$env$$props$n = (_$$state$env$$props4 = $$state.env.$props)[nextSpec.onChangeProp]) == null ? void 0 : _$$state$env$$props$n.call(_$$state$env$$props4, value);
2740
+ }
2715
2741
  }
2716
- if (!isOutside && !currNode.isLeaf() && !nextNode) {
2742
+ if (!nextNode) {
2717
2743
  // can't set an unknown field in $state
2718
2744
  return false;
2719
2745
  }
2720
- // we keep pointing to the leaf
2721
- if (!nextNode) {
2722
- assert(isOutside || currNode.isLeaf, "unexpected update in nextNode");
2723
- nextNode = currNode;
2724
- }
2725
- if (canProxy(value)) {
2726
- target[property] = rec(nextPath, nextNode, isOutside || currNode.isLeaf(), value);
2727
- } else if (!isOutside && !currNode.isLeaf() && !((_nextNode2 = nextNode) != null && _nextNode2.isLeaf())) {
2728
- throw new InvalidOperation("inserting a primitive value into a non-leaf");
2729
- } else {
2730
- Reflect.set(target, property, value, receiver);
2731
- }
2732
- if (currNode.isLeaf()) {
2733
- if (spec.onChangeProp) {
2734
- var _$$state$env$$props$s2, _$$state$env$$props3;
2735
- (_$$state$env$$props$s2 = (_$$state$env$$props3 = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s2.call(_$$state$env$$props3, target);
2736
- }
2737
- } else {
2738
- nextNode.getAllSpecs().forEach(function (spec) {
2739
- if (spec.onChangeProp) {
2740
- var _$$state$env$$props$s3, _$$state$env$$props4;
2741
- (_$$state$env$$props$s3 = (_$$state$env$$props4 = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s3.call(_$$state$env$$props4, value);
2742
- }
2746
+ if (canProxy(value) && !nextNode.isLeaf()) {
2747
+ target[property] = rec(nextPath, nextNode);
2748
+ Reflect.ownKeys(value).forEach(function (key) {
2749
+ target[property][key] = value[key];
2743
2750
  });
2751
+ } else if (!nextNode.isLeaf()) {
2752
+ throw new InvalidOperation("inserting a primitive value into a non-leaf");
2744
2753
  }
2745
- var newValue = (isOutside || currNode.isLeaf()) && currNode.getSpec().isImmutable ? mkUntrackedValue(value) : value;
2754
+ var newValue = nextNode.isLeaf() && nextSpec != null && nextSpec.isImmutable ? mkUntrackedValue(value) : value;
2755
+ unsubscribeToValtio($$state, nextPath);
2746
2756
  set($$state.stateValues, nextPath, newValue);
2757
+ subscribeToValtio($$state, nextPath, nextNode);
2747
2758
  return true;
2748
2759
  }
2749
2760
  };
2750
- var baseObject = !isOutside && !currNode.isLeaf() ? currNode.hasArrayTransition() ? [] : {} : Array.isArray(initialObject) ? [] : Object.create(Object.getPrototypeOf(initialObject != null ? initialObject : {}));
2761
+ var baseObject = currNode.hasArrayTransition() ? [] : {};
2751
2762
  var proxyObj = new Proxy(baseObject, handlers);
2752
2763
  if (currPath.length === 0) {
2753
2764
  proxyRoot = proxyObj;
2754
2765
  }
2755
- if (initialObject) {
2756
- Reflect.ownKeys(initialObject).forEach(function (key) {
2757
- var desc = Object.getOwnPropertyDescriptor(initialObject, key);
2758
- if (desc.get || desc.set) {
2759
- Object.defineProperty(baseObject, key, desc);
2760
- } else {
2761
- proxyObj[key] = initialObject[key];
2762
- }
2763
- });
2764
- }
2765
2766
  return proxyObj;
2766
2767
  };
2767
- return rec([], $$state.rootSpecTree, false, undefined);
2768
+ return rec([], $$state.rootSpecTree);
2768
2769
  }
2769
2770
  var mkUntrackedValue = function mkUntrackedValue(o) {
2770
2771
  return o != null && typeof o === "object" ? valtio.ref(o) : o;
@@ -2850,12 +2851,14 @@ function useDollarState(specs) {
2850
2851
  set($state, stateCell.path, spec.initVal);
2851
2852
  }
2852
2853
  return {
2853
- get: function get(target, property, receiver) {
2854
+ get: function get() {
2854
2855
  var spec = stateCell.node.getSpec();
2855
2856
  if (spec.valueProp) {
2856
- return $$state.env.$props[spec.valueProp];
2857
+ var valueProp = $$state.env.$props[spec.valueProp];
2858
+ subscribeToValtio($$state, stateCell.path, stateCell.node);
2859
+ return valueProp;
2857
2860
  } else {
2858
- return Reflect.get(target, property, receiver);
2861
+ return _get($$state.stateValues, stateCell.path);
2859
2862
  }
2860
2863
  }
2861
2864
  };
@@ -2892,11 +2895,13 @@ function useDollarState(specs) {
2892
2895
  var old$state = $state;
2893
2896
  $state = ref.current = create$State();
2894
2897
  $$state.specTreeLeaves = newLeaves;
2895
- getStateCells(newLeaves, $$state.rootSpecTree).forEach(function (_ref2) {
2898
+ getStateCells(old$state, $$state.rootSpecTree).forEach(function (_ref2) {
2896
2899
  var path = _ref2.path;
2897
2900
  var oldStateCell = tryGetStateCellFrom$StateRoot(old$state, path);
2898
2901
  if (oldStateCell) {
2899
2902
  set($state, path, _get(old$state, path));
2903
+ var newStateCell = getStateCellFrom$StateRoot($state, path);
2904
+ newStateCell.initialValue = oldStateCell.initialValue;
2900
2905
  }
2901
2906
  });
2902
2907
  }
@@ -2911,7 +2916,7 @@ function useDollarState(specs) {
2911
2916
  var newSpec = specs.find(function (sp) {
2912
2917
  return sp.path === spec.path;
2913
2918
  });
2914
- if (!newSpec || stateCell.initFuncHash === (newSpec == null ? void 0 : newSpec.initFuncHash)) {
2919
+ if (!newSpec || stateCell.initFuncHash === (newSpec == null ? void 0 : newSpec.initFuncHash) || stateCell.initialValue !== UNINITIALIZED) {
2915
2920
  return;
2916
2921
  }
2917
2922
  stateCell.initFunc = newSpec.initFunc;
@@ -2940,8 +2945,8 @@ function useDollarState(specs) {
2940
2945
  var newInit = initializeStateValue($$state, stateCell, $state);
2941
2946
  var spec = stateCell.node.getSpec();
2942
2947
  if (spec.onChangeProp) {
2943
- var _$$state$env$$props$s4, _$$state$env$$props5;
2944
- (_$$state$env$$props$s4 = (_$$state$env$$props5 = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s4.call(_$$state$env$$props5, newInit);
2948
+ var _$$state$env$$props$s3, _$$state$env$$props5;
2949
+ (_$$state$env$$props$s3 = (_$$state$env$$props5 = $$state.env.$props)[spec.onChangeProp]) == null ? void 0 : _$$state$env$$props$s3.call(_$$state$env$$props5, newInit);
2945
2950
  }
2946
2951
  };
2947
2952
  useIsomorphicLayoutEffect$1(function () {
@@ -3036,30 +3041,33 @@ var useIsomorphicLayoutEffect$1 = typeof window !== "undefined" ? React.useLayou
3036
3041
  function isPlasmicStateProxy(obj) {
3037
3042
  return obj != null && typeof obj === "object" && !!obj[PLASMIC_STATE_PROXY_SYMBOL];
3038
3043
  }
3044
+ function is$StateProxy(obj) {
3045
+ return obj != null && typeof obj === "object" && (!!obj[PLASMIC_STATE_PROXY_SYMBOL] || valtio.getVersion(obj));
3046
+ }
3039
3047
  function getStateCells($state, root) {
3040
- var _proxyObjToStateCell$;
3041
3048
  if ($state == null || typeof $state !== "object") {
3042
3049
  return [];
3043
3050
  }
3044
- var stateCells = Object.values((_proxyObjToStateCell$ = proxyObjToStateCell.get($state)) != null ? _proxyObjToStateCell$ : {});
3045
- if (root.isLeaf()) {
3046
- return stateCells;
3047
- }
3048
3051
  if (root.hasArrayTransition()) {
3049
- return [].concat(stateCells, Object.keys($state).flatMap(function (key) {
3052
+ return Object.keys($state).flatMap(function (key) {
3050
3053
  return getStateCells($state[key], ensure(root.makeTransition(ARRAY_SYMBOL)));
3051
- }));
3054
+ });
3052
3055
  } else {
3053
- var childrenStateCells = [];
3056
+ var _proxyObjToStateCell$;
3057
+ var stateCell = (_proxyObjToStateCell$ = proxyObjToStateCell.get($state)) != null ? _proxyObjToStateCell$ : {};
3058
+ var stateCells = [];
3054
3059
  for (var _iterator3 = _createForOfIteratorHelperLoose(root.edges().entries()), _step3; !(_step3 = _iterator3()).done;) {
3055
3060
  var _step3$value = _step3.value,
3056
3061
  key = _step3$value[0],
3057
3062
  child = _step3$value[1];
3058
3063
  if (typeof key === "string" && key in $state) {
3059
- childrenStateCells.push.apply(childrenStateCells, getStateCells($state[key], child));
3064
+ stateCells.push.apply(stateCells, getStateCells($state[key], child));
3065
+ if (key in stateCell) {
3066
+ stateCells.push(stateCell[key]);
3067
+ }
3060
3068
  }
3061
3069
  }
3062
- return [].concat(stateCells, childrenStateCells);
3070
+ return stateCells;
3063
3071
  }
3064
3072
  }
3065
3073
  function getStateCellsInPlasmicProxy(obj) {
@@ -3085,11 +3093,9 @@ function getStateSpecInPlasmicProxy(obj, path) {
3085
3093
  if (!isPlasmicStateProxy(obj)) {
3086
3094
  return undefined;
3087
3095
  }
3088
- var _obj$PLASMIC_STATE_PR2 = obj[PLASMIC_STATE_PROXY_SYMBOL],
3089
- node = _obj$PLASMIC_STATE_PR2.node,
3090
- isOutside = _obj$PLASMIC_STATE_PR2.isOutside;
3096
+ var node = obj[PLASMIC_STATE_PROXY_SYMBOL].node;
3091
3097
  var nextNode = node.makeTransition(path[path.length - 1]);
3092
- if (isOutside || node.isLeaf() || !nextNode) {
3098
+ if (node.isLeaf() || !nextNode) {
3093
3099
  return undefined;
3094
3100
  }
3095
3101
  return {
@@ -3132,18 +3138,6 @@ function arrayEq(xs, ys) {
3132
3138
  function isNum$1(value) {
3133
3139
  return typeof value === "symbol" ? false : !isNaN(+value);
3134
3140
  }
3135
- function assert(cond, msg) {
3136
- if (msg === void 0) {
3137
- msg = "Assertion failed";
3138
- }
3139
- if (!cond) {
3140
- // We always generate an non empty message so that it doesn't get swallowed
3141
- // by the async library.
3142
- msg = (typeof msg === "string" ? msg : msg()) || "Assertion failed";
3143
- debugger;
3144
- throw new Error(msg);
3145
- }
3146
- }
3147
3141
  /**
3148
3142
  * Forked from https://github.com/lukeed/dset
3149
3143
  * Changes: fixed setting a deep value to a proxy object
@@ -4706,6 +4700,7 @@ exports.getStateSpecInPlasmicProxy = getStateSpecInPlasmicProxy;
4706
4700
  exports.hasVariant = hasVariant;
4707
4701
  exports.initializeCodeComponentStates = initializeCodeComponentStates;
4708
4702
  exports.initializePlasmicStates = initializePlasmicStates;
4703
+ exports.is$StateProxy = is$StateProxy;
4709
4704
  exports.isPlasmicStateProxy = isPlasmicStateProxy;
4710
4705
  exports.makeFragment = makeFragment;
4711
4706
  exports.mergeVariantsWithStates = mergeVariantsWithStates;