@jsenv/navi 0.23.7 → 0.23.9

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.
@@ -7026,11 +7026,29 @@ const PSEUDO_CLASSES = {
7026
7026
  el.removeEventListener("lostpointercapture", onRelease);
7027
7027
  el.removeEventListener("pointercancel", onRelease);
7028
7028
  el.removeEventListener("pointerup", onRelease);
7029
+ el.removeEventListener("contextmenu", onContextMenu);
7029
7030
  callback();
7030
7031
  };
7032
+ const onContextMenu = (e) => {
7033
+ // On touch devices, a long-press triggers the context menu.
7034
+ // If the context menu is not prevented, it means it will open and the
7035
+ // pointer events (pointerup, lostpointercapture) won't fire normally,
7036
+ // leaving the element stuck in pressed state. We clear it manually.
7037
+ // e.button === -1 means the event was synthesized from a long-press (not a real mouse click).
7038
+ if (e.button === -1 && !e.defaultPrevented) {
7039
+ pressedElements.delete(el);
7040
+ el.releasePointerCapture(e.pointerId);
7041
+ el.removeEventListener("lostpointercapture", onRelease);
7042
+ el.removeEventListener("pointercancel", onRelease);
7043
+ el.removeEventListener("pointerup", onRelease);
7044
+ el.removeEventListener("contextmenu", onContextMenu);
7045
+ callback();
7046
+ }
7047
+ };
7031
7048
  el.addEventListener("lostpointercapture", onRelease);
7032
7049
  el.addEventListener("pointercancel", onRelease);
7033
7050
  el.addEventListener("pointerup", onRelease);
7051
+ el.addEventListener("contextmenu", onContextMenu);
7034
7052
  callback();
7035
7053
  };
7036
7054
  el.addEventListener("pointerdown", onPointerDown);
@@ -21521,10 +21539,10 @@ const css$r = /* css */`
21521
21539
  }
21522
21540
 
21523
21541
  a.navi_button {
21524
- color: inherit;
21525
- text-decoration: none;
21526
21542
  display: inline-block;
21543
+ color: inherit;
21527
21544
  text-align: center;
21545
+ text-decoration: none;
21528
21546
  }
21529
21547
 
21530
21548
  .navi_button {
@@ -21855,14 +21873,20 @@ const ButtonBasic = props => {
21855
21873
  rel: innerRel,
21856
21874
  ref: ref,
21857
21875
  onContextMenu: e => {
21858
- if (e.pointerType === "touch") {
21859
- // Suppress the native context menu triggered by long-press on touch devices.
21860
- // Buttons have no meaningful context menu (no text to copy/paste/search),
21861
- // and the long-press visual state would get stuck if we let the menu open.
21862
- // Note: e.button === -1 is equivalent — it means no physical button triggered
21863
- // the event, i.e. it was synthesized from a long-press gesture (right-click gives e.button === 2).
21864
- e.preventDefault();
21876
+ if (as === "a") {
21877
+ // For link we keep context menu to allow "open in new tab" and other browser features
21878
+ return;
21865
21879
  }
21880
+ if (e.pointerType !== "touch") {
21881
+ // right click is allowed
21882
+ return;
21883
+ }
21884
+ // Suppress the native context menu triggered by long-press on touch devices.
21885
+ // Buttons have no meaningful context menu (no text to copy/paste/search),
21886
+ // and the long-press visual state would get stuck if we let the menu open.
21887
+ // Note: e.button === -1 is equivalent — it means no physical button triggered
21888
+ // the event, i.e. it was synthesized from a long-press gesture (right-click gives e.button === 2).
21889
+ e.preventDefault();
21866
21890
  },
21867
21891
  "data-icon": icon ? "" : undefined,
21868
21892
  "data-reveal-on-interaction": revealOnInteraction ? "" : undefined,
@@ -22418,10 +22442,10 @@ const css$q = /* css */`
22418
22442
 
22419
22443
  position: relative;
22420
22444
  aspect-ratio: inherit;
22421
- padding-top: calc(var(--x-link-padding-top) + var(--link-loading-outline-size));
22422
- padding-right: calc(var(--x-link-padding-right) + var(--link-loading-outline-size));
22423
- padding-bottom: calc(var(--x-link-padding-bottom) + var(--link-loading-outline-size));
22424
- padding-left: calc(var(--x-link-padding-left) + var(--link-loading-outline-size));
22445
+ padding-top: max(var(--x-link-padding-top), var(--link-loading-outline-size));
22446
+ padding-right: max(var(--x-link-padding-right), var(--link-loading-outline-size));
22447
+ padding-bottom: max(var(--x-link-padding-bottom), var(--link-loading-outline-size));
22448
+ padding-left: max(var(--x-link-padding-left), var(--link-loading-outline-size));
22425
22449
  color: var(--x-link-color);
22426
22450
  text-decoration: var(--x-link-text-decoration);
22427
22451
  background: var(--x-link-background);
@@ -32661,5 +32685,5 @@ const UserSvg = () => jsx("svg", {
32661
32685
  })
32662
32686
  });
32663
32687
 
32664
- export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, Loading, MessageBox, Meter, Nav, Paragraph, Quantity, QuantityIntl, Radio, RadioList, Route, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, SidePanel, StarSvg, SummaryMarker, Svg, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, actionRunEffect, addCustomMessage, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDarkBackgroundAttribute, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
32688
+ export { ActionRenderer, ActiveKeyboardShortcuts, Address, Badge, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, CloseSvg, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundary, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, Group, Head, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, LinkCurrentSvg, Loading, MessageBox, Meter, Nav, Paragraph, 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, arraySignalMembership, compareTwoJsValues, createAction, createAvailableConstraint, createIntl, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, filterTableSelection, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, route, routeAction, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, syncOwnedResourceToSignals, syncResourceToSignals, updateActions, useActionStatus, useArraySignalMembership, useAsyncData, useCalloutClose, useCancelPrevious, useCellGridFromRows, useConstraintValidityState, useDarkBackgroundAttribute, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useOrderedColumns, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSidePanelClose, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
32665
32689
  //# sourceMappingURL=jsenv_navi.js.map