@jsenv/navi 0.26.10 → 0.26.12

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.
@@ -6729,6 +6729,8 @@ const COPIED_ON_VISUAL_CHILD_PROP_SET = new Set([
6729
6729
  "align",
6730
6730
  "alignX",
6731
6731
  "alignY",
6732
+ "minWidth",
6733
+ "minHeight",
6732
6734
  ]);
6733
6735
  const HANDLED_BY_VISUAL_CHILD_PROP_SET = new Set([
6734
6736
  ...INNER_SPACING_PROP_NAME_SET,
@@ -14473,14 +14475,37 @@ const debug$1 = (...args) => {
14473
14475
  // - route → RouteLeafRoute (rendered by parent container when URL matches)
14474
14476
  // - fallback → RouteActive (rendered by parent container when no sibling matches)
14475
14477
  const Route = props => {
14476
- if (props.children) return jsx(RouteContainer, {
14477
- ...props
14478
- });
14478
+ if (props.children) {
14479
+ return jsx(RouteContainer, {
14480
+ ...props
14481
+ });
14482
+ }
14479
14483
  return jsx(RouteLeaf, {
14480
14484
  ...props
14481
14485
  });
14482
14486
  };
14483
-
14487
+ // RouteContainer: traverses children statically per render, finds the active branch,
14488
+ // and renders only that branch — or the fallback if nothing matches.
14489
+ // No effects, no signals, no contexts needed: reads route signals directly.
14490
+ const RouteContainer = ({
14491
+ id,
14492
+ element,
14493
+ elementProps,
14494
+ children
14495
+ }) => {
14496
+ const {
14497
+ activeBranch
14498
+ } = collectBranches(children);
14499
+ debug$1(`[container "${id}"] RENDER, active=${activeBranch ? activeBranch.type : "none"}`);
14500
+ const content = activeBranch ? activeBranch.node : null;
14501
+ if (!content) {
14502
+ return null;
14503
+ }
14504
+ if (element) {
14505
+ return h(element, elementProps, content);
14506
+ }
14507
+ return content;
14508
+ };
14484
14509
  // Walk JSX children vnodes (without rendering) to build a branch list and
14485
14510
  // find the active one in the same pass.
14486
14511
  // All children must be <Route> — throws in dev otherwise.
@@ -14550,52 +14575,34 @@ const collectBranches = children => {
14550
14575
  activeBranch
14551
14576
  };
14552
14577
  };
14553
- // RouteContainer: traverses children statically per render, finds the active branch,
14554
- // and renders only that branch — or the fallback if nothing matches.
14555
- // No effects, no signals, no contexts needed: reads route signals directly.
14556
- const RouteContainer = ({
14557
- id,
14558
- element,
14559
- elementProps,
14560
- children
14561
- }) => {
14562
- const {
14563
- activeBranch
14564
- } = collectBranches(children);
14565
- debug$1(`[container "${id}"] RENDER, active=${activeBranch ? activeBranch.type : "none"}`);
14566
- const content = activeBranch ? activeBranch.node : null;
14567
- if (!content) {
14568
- return null;
14578
+ const RouteLeaf = props => {
14579
+ if (props.route) {
14580
+ return jsx(RouteLeafRoute, {
14581
+ ...props
14582
+ });
14569
14583
  }
14570
- if (element) {
14571
- return h(element, elementProps, content);
14584
+ if (props.fallback) {
14585
+ return jsx(RouteLeafFallback, {
14586
+ ...props
14587
+ });
14572
14588
  }
14573
- return content;
14574
- };
14575
- const RouteLeaf = props => {
14576
- if (props.route) return jsx(RouteLeafRoute, {
14577
- ...props
14578
- });
14579
- if (props.fallback) return jsx(RouteLeafFallback, {
14580
- ...props
14581
- });
14582
14589
  // not supposed to happen?
14583
- return jsx(RouteActive, {
14590
+ return jsx(RouteUI, {
14584
14591
  ...props
14585
14592
  });
14586
14593
  };
14587
14594
  const RouteLeafRoute = props => {
14588
14595
  useUITransitionContentId(props.route?.urlPattern);
14589
- return jsx(RouteActive, {
14596
+ return jsx(RouteUI, {
14590
14597
  ...props
14591
14598
  });
14592
14599
  };
14593
14600
  const RouteLeafFallback = props => {
14594
- return jsx(RouteActive, {
14601
+ return jsx(RouteUI, {
14595
14602
  ...props
14596
14603
  });
14597
14604
  };
14598
- const RouteActive = ({
14605
+ const RouteUI = ({
14599
14606
  element,
14600
14607
  elementProps
14601
14608
  }) => {
@@ -14611,11 +14618,13 @@ const routeAction = (
14611
14618
  paramsEffect = () => true,
14612
14619
  options = {},
14613
14620
  ) => {
14614
- const routes = Array.isArray(routeOrRoutes) ? routeOrRoutes : [routeOrRoutes];
14621
+ const routeMatchingSignal = Array.isArray(routeOrRoutes)
14622
+ ? anyMatchingRouteSignal(routeOrRoutes)
14623
+ : routeOrRoutes.matchingSignal;
14615
14624
  const actionBoundToRoute = actionRunEffect(
14616
14625
  action,
14617
14626
  () => {
14618
- const matching = routes.some((route) => route.matchingSignal.value);
14627
+ const matching = routeMatchingSignal.value;
14619
14628
  const params = paramsEffect();
14620
14629
  if (!matching) {
14621
14630
  return null;
@@ -14628,6 +14637,31 @@ const routeAction = (
14628
14637
  return actionBoundToRoute;
14629
14638
  };
14630
14639
 
14640
+ // I delibrately prefer the term "any" and avoid "some" so dev are not tempted to think
14641
+ // "well I could just use array.some" and bypass this helper entirely, which would be incorrect:
14642
+ // This helper does return if some/any route is matching but ensure all route matching signals are read (subscribed to)
14643
+ // array.some would return as soon as it finds a match and would not subscribe to the rest of the signals.
14644
+ const anyMatchingRouteSignal = (routes) => {
14645
+ if (routes.length === 0) {
14646
+ return signal(false);
14647
+ }
14648
+ if (routes.length === 1) {
14649
+ const [route] = routes;
14650
+ return route.matchingSignal;
14651
+ }
14652
+ const anyMatchingSignal = computed(() => {
14653
+ let someMatching;
14654
+ for (const route of routes) {
14655
+ const matching = route.matchingSignal.value;
14656
+ if (matching) {
14657
+ someMatching = true;
14658
+ }
14659
+ }
14660
+ return someMatching;
14661
+ });
14662
+ return anyMatchingSignal;
14663
+ };
14664
+
14631
14665
  const FormContext = createContext();
14632
14666
 
14633
14667
  const FormActionContext = createContext();
@@ -26151,6 +26185,7 @@ installImportMetaCssBuild(import.meta);const css$n = /* css */`
26151
26185
  margin: 0;
26152
26186
  opacity: 0;
26153
26187
  --webkit-appearance: none;
26188
+ min-width: inherit;
26154
26189
  font-size: inherit;
26155
26190
  appearance: none;
26156
26191
 
@@ -37854,5 +37889,5 @@ const UserSvg = () => jsx("svg", {
37854
37889
  })
37855
37890
  });
37856
37891
 
37857
- export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, Dialog, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Interpolate, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, List, ListItem, ListItemFooter, ListItemGroup, ListItemHeader, Loading, MessageBox, Meter, Nav, NaviDebug, Paragraph, Popover, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, applySearch, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSearch, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, requestListClose, requestListOpen, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDependenciesDiff, useDisplayedLayoutEffect, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSearchText, useSelectRequestClose, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage, windowWidthSignal };
37892
+ export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, Dialog, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Interpolate, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, List, ListItem, ListItemFooter, ListItemGroup, ListItemHeader, Loading, MessageBox, Meter, Nav, NaviDebug, Paragraph, Popover, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, anyMatchingRouteSignal, applySearch, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSearch, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, requestListClose, requestListOpen, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDependenciesDiff, useDisplayedLayoutEffect, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSearchText, useSelectRequestClose, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage, windowWidthSignal };
37858
37893
  //# sourceMappingURL=jsenv_navi.js.map