@jsenv/navi 0.16.55 → 0.16.57

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.
@@ -5,7 +5,7 @@ import { createIterableWeakSet, mergeOneStyle, stringifyStyle, createPubSub, mer
5
5
  import { prefixFirstAndIndentRemainingLines } from "@jsenv/humanize";
6
6
  import { effect, signal, computed, batch, useSignal } from "@preact/signals";
7
7
  import { createValidity } from "@jsenv/validity";
8
- import { createContext, render, isValidElement, toChildArray, createRef, cloneElement } from "preact";
8
+ import { createContext, toChildArray, render, isValidElement, createRef, cloneElement } from "preact";
9
9
  import { createPortal, forwardRef } from "preact/compat";
10
10
 
11
11
  const actionPrivatePropertiesWeakMap = new WeakMap();
@@ -6468,25 +6468,26 @@ const Box = props => {
6468
6468
  innerChildren = children;
6469
6469
  }
6470
6470
  if (separator) {
6471
- if (Array.isArray(innerChildren)) {
6472
- const childCount = innerChildren.length;
6473
- if (childCount > 1) {
6474
- const childrenWithSeparators = [];
6475
- let i = 0;
6476
- while (true) {
6477
- const child = innerChildren[i];
6478
- childrenWithSeparators.push(child);
6479
- i++;
6480
- if (i === childCount) {
6481
- break;
6482
- }
6483
- // Support function separators that receive separator index
6484
- const separatorElement = typeof separator === "function" ? separator(i - 1) // i-1 because i was incremented after pushing child
6485
- : separator;
6486
- childrenWithSeparators.push(separatorElement);
6471
+ // Flatten nested arrays (e.g., from .map()) to treat each element as individual child
6472
+ const flattenedChildren = toChildArray(innerChildren);
6473
+ if (flattenedChildren.length > 1) {
6474
+ const childrenWithSeparators = [];
6475
+ let i = 0;
6476
+ while (true) {
6477
+ const child = flattenedChildren[i];
6478
+ childrenWithSeparators.push(child);
6479
+ i++;
6480
+ if (i === flattenedChildren.length) {
6481
+ break;
6487
6482
  }
6488
- innerChildren = childrenWithSeparators;
6483
+ // Support function separators that receive separator index
6484
+ const separatorElement = typeof separator === "function" ? separator(i - 1) // i-1 because i was incremented after pushing child
6485
+ : separator;
6486
+ childrenWithSeparators.push(separatorElement);
6489
6487
  }
6488
+ innerChildren = childrenWithSeparators;
6489
+ } else {
6490
+ innerChildren = flattenedChildren;
6490
6491
  }
6491
6492
  }
6492
6493
  return jsx(TagName, {
@@ -17627,16 +17628,18 @@ const TextBasic = ({
17627
17628
  children,
17628
17629
  ...rest
17629
17630
  }) => {
17630
- const shouldPreserveSpacing = rest.as === "pre" || rest.box || rest.column || rest.row;
17631
- if (!shouldPreserveSpacing) {
17632
- children = applySpacingOnTextChildren(children, spacing);
17633
- }
17634
17631
  const boxProps = {
17635
17632
  "as": "span",
17636
17633
  "data-bold-transition": boldTransition ? "" : undefined,
17637
17634
  ...rest,
17638
17635
  "baseClassName": withPropsClassName("navi_text", rest.baseClassName)
17639
17636
  };
17637
+ const shouldPreserveSpacing = rest.as === "pre" || rest.box || rest.column || rest.row;
17638
+ if (shouldPreserveSpacing) {
17639
+ boxProps.spacing = spacing;
17640
+ } else {
17641
+ children = applySpacingOnTextChildren(children, spacing);
17642
+ }
17640
17643
  if (boldStable) {
17641
17644
  const {
17642
17645
  bold
@@ -28301,6 +28304,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
28301
28304
  height: var(--size);
28302
28305
  margin-top: var(--spacing-start, var(--spacing));
28303
28306
  margin-bottom: var(--spacing-end, var(--spacing));
28307
+ flex-shrink: 0;
28304
28308
  background: var(--color);
28305
28309
  border: none;
28306
28310