@jsenv/navi 0.29.94 → 0.29.95

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.
@@ -24761,6 +24761,30 @@ const useUIGroupStateController = (
24761
24761
  }
24762
24762
  };
24763
24763
 
24764
+ // What putting a value on a child comes down to, whichever way the group
24765
+ // worked out that value (one child at a time, or all of them at once).
24766
+ const placeOneChild = (childUIStateController, childNewState, e) => {
24767
+ if (
24768
+ childUIStateController.hasStateProp &&
24769
+ !childUIStateController.props.signal
24770
+ ) {
24771
+ // A child bound to a signal is placed like any other: bound is not
24772
+ // frozen, and the placement writes the signal, so both ends keep
24773
+ // saying the same thing. Only a child controlled by a `value` /
24774
+ // `checked` prop cannot be moved — its owner decides. Worth saying
24775
+ // out loud only when the two disagree: a child already showing what
24776
+ // the group would put there has lost nothing, and both being fed from
24777
+ // the same value is a legitimate way to write a group.
24778
+ if (
24779
+ !compareTwoJsValues(childNewState, childUIStateController.uiState)
24780
+ ) {
24781
+ warnChildAnswersForItself(s.controller);
24782
+ }
24783
+ return;
24784
+ }
24785
+ childUIStateController.setUIState(childNewState, e);
24786
+ };
24787
+
24764
24788
  const applyState = (newUIState, e, { internalBehavior = false } = {}) => {
24765
24789
  const { controller } = s;
24766
24790
  const currentUIState = controller.uiState;
@@ -24806,9 +24830,6 @@ const useUIGroupStateController = (
24806
24830
  ref,
24807
24831
  getPropFromState: (uiState) => uiState,
24808
24832
  distributeChildUIState: resolvedDistributeChildUIState,
24809
- // Where the group puts a value on ONE child: the only place that knows
24810
- // what each child gets, and the only one that sees a child it cannot
24811
- // place — see warnChildAnswersForItself.
24812
24833
  // One pass over every child, which is what a plural distribute needs:
24813
24834
  // it is asked once, sees the whole group, and answers for all of them.
24814
24835
  placeChildrenUIState: (groupUIState, e, { except } = {}) => {
@@ -24842,18 +24863,16 @@ const useUIGroupStateController = (
24842
24863
  // nothing about.
24843
24864
  continue;
24844
24865
  }
24845
- if (
24846
- childUIStateController.hasStateProp &&
24847
- !childUIStateController.props.signal
24848
- ) {
24849
- continue;
24850
- }
24851
- childUIStateController.setUIState(
24866
+ placeOneChild(
24867
+ childUIStateController,
24852
24868
  stateByChild.get(childUIStateController),
24853
24869
  e,
24854
24870
  );
24855
24871
  }
24856
24872
  },
24873
+ // Where the group puts a value on ONE child: the only place that knows
24874
+ // what each child gets, and the only one that sees a child it cannot
24875
+ // place — see warnChildAnswersForItself.
24857
24876
  placeChildUIState: (childUIStateController, groupUIState, e) => {
24858
24877
  if (!shouldPropagateStateToChild(childUIStateController)) {
24859
24878
  return;
@@ -24865,23 +24884,7 @@ const useUIGroupStateController = (
24865
24884
  if (childNewState === CANNOT_DERIVE) {
24866
24885
  return;
24867
24886
  }
24868
- if (
24869
- childUIStateController.hasStateProp &&
24870
- !childUIStateController.props.signal
24871
- ) {
24872
- // A child bound to a signal is placed like any other: bound is not
24873
- // frozen, and the placement writes the signal, so both ends keep
24874
- // saying the same thing. Only a child controlled by a `value` /
24875
- // `checked` prop cannot be moved — its owner decides. Worth saying
24876
- // out loud only when the two disagree: a child already showing what
24877
- // the group would put there has lost nothing, and both being fed
24878
- // from the same value is a legitimate way to write a group.
24879
- if (
24880
- !compareTwoJsValues(childNewState, childUIStateController.uiState)
24881
- ) ;
24882
- return;
24883
- }
24884
- childUIStateController.setUIState(childNewState, e);
24887
+ placeOneChild(childUIStateController, childNewState, e);
24885
24888
  },
24886
24889
  setUIState: (newUIState, e) => {
24887
24890
  if (
@@ -25596,6 +25599,11 @@ const dispatchSyntheticInput = (el, inputEvent, causeEvent) => {
25596
25599
  chainEvent(inputEvent, causeEvent);
25597
25600
  el.dispatchEvent(inputEvent);
25598
25601
  };
25602
+ const warnChildAnswersForItself = (groupController, child) => {
25603
+ {
25604
+ return;
25605
+ }
25606
+ };
25599
25607
 
25600
25608
  /**
25601
25609
  * What a control is worth when it holds nothing — nothing, in the shape of the