@jsenv/navi 0.12.11 → 0.12.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.
@@ -1,5 +1,5 @@
1
1
  import { installImportMetaCss } from "./jsenv_navi_side_effects.js";
2
- import { createIterableWeakSet, createPubSub, createValueEffect, createStyleController, getVisuallyVisibleInfo, getFirstVisuallyVisibleAncestor, allowWheelThrough, resolveCSSColor, visibleRectEffect, pickPositionRelativeTo, getBorderSizes, getPaddingSizes, activeElementSignal, canInterceptKeys, createGroupTransitionController, getElementSignature, getBorderRadius, getBackground, preventIntermediateScrollbar, createOpacityTransition, stringifyStyle, mergeOneStyle, mergeTwoStyles, normalizeStyles, resolveCSSSize, findBefore, findAfter, initFocusGroup, elementIsFocusable, pickLightOrDark, resolveColorLuminance, dragAfterThreshold, getScrollContainer, stickyAsRelativeCoords, createDragToMoveGestureController, getDropTargetInfo, setStyles, useActiveElement } from "@jsenv/dom";
2
+ import { createIterableWeakSet, createPubSub, createValueEffect, createStyleController, getVisuallyVisibleInfo, getFirstVisuallyVisibleAncestor, allowWheelThrough, resolveCSSColor, visibleRectEffect, pickPositionRelativeTo, getBorderSizes, getPaddingSizes, activeElementSignal, canInterceptKeys, createGroupTransitionController, getElementSignature, getBorderRadius, preventIntermediateScrollbar, createOpacityTransition, mergeOneStyle, stringifyStyle, mergeTwoStyles, normalizeStyles, resolveCSSSize, findBefore, findAfter, initFocusGroup, elementIsFocusable, pickLightOrDark, resolveColorLuminance, dragAfterThreshold, getScrollContainer, stickyAsRelativeCoords, createDragToMoveGestureController, getDropTargetInfo, setStyles, useActiveElement } from "@jsenv/dom";
3
3
  import { prefixFirstAndIndentRemainingLines } from "@jsenv/humanize";
4
4
  import { effect, signal, computed, batch, useSignal } from "@preact/signals";
5
5
  import { useEffect, useRef, useCallback, useContext, useState, useLayoutEffect, useMemo, useErrorBoundary, useImperativeHandle, useId } from "preact/hooks";
@@ -8950,13 +8950,19 @@ const createUITransitionController = (
8950
8950
  if (isEmpty) {
8951
8951
  debugSize(`measureSlot(".${slot.className}") -> it is empty`);
8952
8952
  } else if (singleElementNode) {
8953
- const rect = singleElementNode.getBoundingClientRect();
8953
+ const visualSelector = singleElementNode.getAttribute(
8954
+ "data-visual-selector",
8955
+ );
8956
+ const visualElement = visualSelector
8957
+ ? singleElementNode.querySelector(visualSelector) || singleElementNode
8958
+ : singleElementNode;
8959
+ const rect = visualElement.getBoundingClientRect();
8954
8960
  width = rect.width;
8955
8961
  height = rect.height;
8956
8962
  debugSize(`measureSlot(".${slot.className}") -> [${width}x${height}]`);
8957
- borderRadius = getBorderRadius(singleElementNode);
8958
- border = getComputedStyle(singleElementNode).border;
8959
- background = getBackground(singleElementNode);
8963
+ borderRadius = getBorderRadius(visualElement);
8964
+ border = getComputedStyle(visualElement).border;
8965
+ background = getComputedStyle(visualElement).background;
8960
8966
  } else {
8961
8967
  // text, multiple elements
8962
8968
  const rect = slot.getBoundingClientRect();
@@ -9194,7 +9200,7 @@ const createUITransitionController = (
9194
9200
  const fadeInTargetSlot = () => {
9195
9201
  targetSlotBackground.style.setProperty(
9196
9202
  "--target-slot-background",
9197
- stringifyStyle(targetSlotConfiguration.background, "background"),
9203
+ targetSlotConfiguration.background,
9198
9204
  );
9199
9205
  targetSlotBackground.style.setProperty(
9200
9206
  "--target-slot-width",
@@ -9339,6 +9345,9 @@ const createUITransitionController = (
9339
9345
  };
9340
9346
 
9341
9347
  const targetSlotEffect = (reasons) => {
9348
+ if (root.hasAttribute("data-disabled")) {
9349
+ return;
9350
+ }
9342
9351
  const fromConfiguration = targetSlotConfiguration;
9343
9352
  const toConfiguration = detectConfiguration(targetSlot);
9344
9353
  if (hasDebugLogs) {
@@ -9604,13 +9613,11 @@ const UITransition = ({
9604
9613
  uiTransition.cleanup();
9605
9614
  };
9606
9615
  }, [disabled, alignX, alignY]);
9607
- if (disabled) {
9608
- return children;
9609
- }
9610
9616
  return jsxs("div", {
9611
9617
  ref: ref,
9612
9618
  ...props,
9613
9619
  className: "ui_transition",
9620
+ "data-disabled": disabled ? "" : undefined,
9614
9621
  "data-transition-type": type,
9615
9622
  "data-transition-duration": duration,
9616
9623
  "data-debug-detection": debugDetection ? "" : undefined,
@@ -9626,10 +9633,12 @@ const UITransition = ({
9626
9633
  children: children
9627
9634
  })
9628
9635
  }), jsx("div", {
9629
- className: "ui_transition_outgoing_slot"
9636
+ className: "ui_transition_outgoing_slot",
9637
+ inert: true
9630
9638
  })]
9631
9639
  }), jsxs("div", {
9632
9640
  className: "ui_transition_previous_group",
9641
+ inert: true,
9633
9642
  children: [jsx("div", {
9634
9643
  className: "ui_transition_previous_target_slot"
9635
9644
  }), jsx("div", {
@@ -11531,6 +11540,7 @@ const Box = props => {
11531
11540
  "data-layout-inline": inline ? "" : undefined,
11532
11541
  "data-layout-row": row ? "" : undefined,
11533
11542
  "data-layout-column": column ? "" : undefined,
11543
+ "data-visual-selector": visualSelector,
11534
11544
  ...selfForwardedProps,
11535
11545
  children: jsx(BoxLayoutContext.Provider, {
11536
11546
  value: layout,