@primer/react 0.0.0-20260715132544 → 0.0.0-20260715134933
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.
- package/CHANGELOG.md +5 -5
- package/dist/ActionList/Group.js +1 -1
- package/dist/ActionList/Item.js +1 -1
- package/dist/ActionList/List.js +1 -1
- package/dist/ActionMenu/ActionMenu.js +1 -1
- package/dist/AnchoredOverlay/AnchoredOverlay.js +1 -2
- package/dist/Autocomplete/AutocompleteMenu.js +2 -3
- package/dist/Breadcrumbs/Breadcrumbs.js +1 -4
- package/dist/Dialog/Dialog.js +1 -1
- package/dist/FilteredActionList/useAnnouncements.js +14 -20
- package/dist/NavList/NavList.js +1 -1
- package/dist/PageHeader/PageHeader.js +1 -1
- package/dist/PageLayout/DragHandle.d.ts +45 -0
- package/dist/PageLayout/DragHandle.js +224 -0
- package/dist/PageLayout/PageLayout.js +54 -248
- package/dist/PageLayout/index.d.ts +3 -1
- package/dist/PageLayout/usePaneWidth.d.ts +63 -1
- package/dist/PageLayout/usePaneWidth.js +51 -36
- package/dist/SelectPanel/SelectPanel.js +6 -13
- package/dist/TextInputWithTokens/TextInputWithTokens.js +1 -1
- package/dist/TooltipV2/Tooltip.js +1 -2
- package/dist/TreeView/TreeView.js +3 -6
- package/dist/experimental/SelectPanel2/SelectPanel.js +2 -2
- package/dist/experimental/UnderlinePanels/UnderlinePanels.js +1 -1
- package/dist/experimental/index.js +1 -1
- package/dist/hooks/useDialog.js +1 -2
- package/dist/hooks/useScrollFlash.js +1 -2
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -5
- package/dist/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.js +1 -1
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css +2 -0
- package/dist/internal/components/UnderlineTabbedInterface-25587345.css.map +1 -0
- package/dist/internal/components/UnderlineTabbedInterface.module.css.js +1 -1
- package/dist/utils/warning.js +2 -3
- package/package.json +2 -2
- package/dist/internal/components/UnderlineTabbedInterface-9aca4eac.css +0 -2
- package/dist/internal/components/UnderlineTabbedInterface-9aca4eac.css.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
# @primer/react
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-20260715134933
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#8160](https://github.com/primer/react/pull/8160) [`74c731b`](https://github.com/primer/react/commit/74c731b16478bd328eb44ca87d4eb66d43f56fd8) Thanks [@TylerJDev](https://github.com/TylerJDev)! - PageLayout: Export the resize primitives `usePaneWidth` and `DragHandle` (with `defaultPaneWidth` and related types) so pane-resize behavior can be reused outside of `PageLayout`.
|
|
4
8
|
|
|
5
9
|
### Patch Changes
|
|
6
10
|
|
|
@@ -10,10 +14,6 @@
|
|
|
10
14
|
|
|
11
15
|
- [#8116](https://github.com/primer/react/pull/8116) [`cade4af`](https://github.com/primer/react/commit/cade4af9a70f3fd2622031af585dc07dccd79e11) Thanks [@mattcosta7](https://github.com/mattcosta7)! - `useAnchoredPosition`: improve performance by caching the scrollable-ancestor walk per anchor, reducing repositioning work for overlays, menus, and tooltips.
|
|
12
16
|
|
|
13
|
-
- [#8025](https://github.com/primer/react/pull/8025) [`5abc62f`](https://github.com/primer/react/commit/5abc62f90cac33cd67396d78f01bf91b703db45c) Thanks [@mattcosta7](https://github.com/mattcosta7)! - SelectPanel: Reset the single-select modal's intermediate selection during render instead of in an effect, avoiding an extra re-render when the panel opens or the selection changes.
|
|
14
|
-
|
|
15
|
-
- [#8164](https://github.com/primer/react/pull/8164) [`f86e5a6`](https://github.com/primer/react/commit/f86e5a6420e857e7476c3954d419f4e228bdcf1a) Thanks [@jonrohan](https://github.com/jonrohan)! - Fix `UnderlineNav` tab list not filling the full width of the underline nav in Safari
|
|
16
|
-
|
|
17
17
|
## 38.32.0
|
|
18
18
|
|
|
19
19
|
### Minor Changes
|
package/dist/ActionList/Group.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
2
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
3
2
|
import { invariant } from "../utils/invariant.js";
|
|
3
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
4
4
|
import { ListContext } from "./shared.js";
|
|
5
5
|
import ActionList_module_css_default from "./ActionList.module.css.js";
|
|
6
6
|
import { useFeatureFlag } from "../FeatureFlags/useFeatureFlag.js";
|
package/dist/ActionList/Item.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
2
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
3
2
|
import { ConditionalWrapper } from "../internal/components/ConditionalWrapper.js";
|
|
4
3
|
import { invariant } from "../utils/invariant.js";
|
|
5
4
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
6
5
|
import VisuallyHidden from "../_VisuallyHidden.js";
|
|
7
6
|
import { TooltipContext } from "../TooltipV2/TooltipContext.js";
|
|
8
7
|
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
8
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
9
9
|
import { ActionListContainerContext } from "./ActionListContainerContext.js";
|
|
10
10
|
import { ItemContext, ListContext } from "./shared.js";
|
|
11
11
|
import ActionList_module_css_default from "./ActionList.module.css.js";
|
package/dist/ActionList/List.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
2
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
3
3
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
4
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
5
4
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
5
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
6
6
|
import { FocusKeys, useFocusZone } from "../hooks/useFocusZone.js";
|
|
7
7
|
import { ActionListContainerContext } from "./ActionListContainerContext.js";
|
|
8
8
|
import { ListContext } from "./shared.js";
|
|
@@ -2,10 +2,10 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
|
2
2
|
import { useProvidedStateOrCreate } from "../hooks/useProvidedStateOrCreate.js";
|
|
3
3
|
import { useMenuKeyboardNavigation } from "../hooks/useMenuKeyboardNavigation.js";
|
|
4
4
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
5
|
-
import { isSlot } from "../utils/is-slot.js";
|
|
6
5
|
import { Tooltip } from "../TooltipV2/Tooltip.js";
|
|
7
6
|
import { ButtonComponent } from "../Button/Button.js";
|
|
8
7
|
import { useResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
8
|
+
import { isSlot } from "../utils/is-slot.js";
|
|
9
9
|
import { DialogContext } from "../Dialog/DialogContext.js";
|
|
10
10
|
import { ActionListContainerContext } from "../ActionList/ActionListContainerContext.js";
|
|
11
11
|
import { Divider } from "../ActionList/Divider.js";
|
|
@@ -122,8 +122,7 @@ const AnchoredOverlay = ({ renderAnchor, anchorRef: externalAnchorRef, anchorId:
|
|
|
122
122
|
else currentOverlay.style.removeProperty("position-try-fallbacks");
|
|
123
123
|
pendingPositionFrame = requestAnimationFrame(() => {
|
|
124
124
|
pendingPositionFrame = null;
|
|
125
|
-
const
|
|
126
|
-
const result = getDefaultPosition(anchorElement, currentOverlay, fallbackWidth);
|
|
125
|
+
const result = getDefaultPosition(anchorElement, currentOverlay, width ? parseInt(widthMap[width]) : parseInt(widthMap.small));
|
|
127
126
|
currentOverlay.setAttribute("data-align", result.horizontal);
|
|
128
127
|
if (result.suggestedSide) currentOverlay.setAttribute("data-side", result.suggestedSide);
|
|
129
128
|
const offset = result.horizontal === "left" ? result.leftOffset : result.rightOffset;
|
|
@@ -193,11 +193,10 @@ function AutocompleteMenu(props) {
|
|
|
193
193
|
t12 = (current, _previous, directlyActivated) => {
|
|
194
194
|
activeDescendantRef.current = current || null;
|
|
195
195
|
if (current) {
|
|
196
|
-
|
|
196
|
+
setHighlightedItem(allItemsToRenderRef.current.find((item_1) => {
|
|
197
197
|
var _current$closest;
|
|
198
198
|
return item_1.id === ((_current$closest = current.closest("li")) === null || _current$closest === void 0 ? void 0 : _current$closest.getAttribute("data-id"));
|
|
199
|
-
});
|
|
200
|
-
setHighlightedItem(selectedItem);
|
|
199
|
+
}));
|
|
201
200
|
setIsMenuDirectlyActivated(directlyActivated);
|
|
202
201
|
}
|
|
203
202
|
if (current && customScrollContainerRef && customScrollContainerRef.current && directlyActivated) scrollIntoView(current, customScrollContainerRef.current, menuScrollMargins);
|
|
@@ -250,10 +250,7 @@ function Breadcrumbs(t0) {
|
|
|
250
250
|
const measuredContainerWidth = containerElement.offsetWidth;
|
|
251
251
|
setContainerWidth((prev_0) => prev_0 === measuredContainerWidth ? prev_0 : measuredContainerWidth);
|
|
252
252
|
const listElement = containerElement.querySelector("ol");
|
|
253
|
-
if (listElement && listElement.children.length > 0 && listElement.children.length === childArray.length)
|
|
254
|
-
const widths = Array.from(listElement.children).map(_temp3);
|
|
255
|
-
setChildArrayWidths(widths);
|
|
256
|
-
}
|
|
253
|
+
if (listElement && listElement.children.length > 0 && listElement.children.length === childArray.length) setChildArrayWidths(Array.from(listElement.children).map(_temp3));
|
|
257
254
|
};
|
|
258
255
|
$[3] = childArray.length;
|
|
259
256
|
$[4] = overflow;
|
package/dist/Dialog/Dialog.js
CHANGED
|
@@ -3,9 +3,9 @@ import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
|
3
3
|
import { useOnEscapePress } from "../hooks/useOnEscapePress.js";
|
|
4
4
|
import { useResizeObserver } from "../hooks/useResizeObserver.js";
|
|
5
5
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
6
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
7
6
|
import { IconButton } from "../Button/IconButton.js";
|
|
8
7
|
import { ButtonComponent } from "../Button/Button.js";
|
|
8
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
9
9
|
import { useFocusTrap } from "../hooks/useFocusTrap.js";
|
|
10
10
|
import { useFocusZone } from "../hooks/useFocusZone.js";
|
|
11
11
|
import Portal_default from "../Portal/index.js";
|
|
@@ -31,23 +31,20 @@ const useAnnouncements = (items, listContainerRef, inputRef, enabled = true, loa
|
|
|
31
31
|
}, [enabled]);
|
|
32
32
|
useEffect(function announceInitialFocus() {
|
|
33
33
|
const focusHandler = () => {
|
|
34
|
-
if (usingRovingTabindex) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
});
|
|
40
|
-
} else window.requestAnimationFrame(() => {
|
|
34
|
+
if (usingRovingTabindex) announce$1(`${items.length} item${items.length > 1 ? "s" : ""} available, ${selectedItems} selected.`, {
|
|
35
|
+
delayMs,
|
|
36
|
+
from: liveRegion ? liveRegion : void 0
|
|
37
|
+
});
|
|
38
|
+
else window.requestAnimationFrame(() => {
|
|
41
39
|
const activeItem = getItemWithActiveDescendant(listContainerRef, items);
|
|
42
40
|
if (!activeItem) return;
|
|
43
41
|
const { index, text, selected } = activeItem;
|
|
44
|
-
|
|
42
|
+
announce$1([
|
|
45
43
|
`Focus on filter text box and list of items`,
|
|
46
44
|
`Focused item: ${text}`,
|
|
47
45
|
`${selected ? "selected" : "not selected"}`,
|
|
48
46
|
`${index + 1} of ${items.length}`
|
|
49
|
-
].join(", ")
|
|
50
|
-
announce$1(announcementText, {
|
|
47
|
+
].join(", "), {
|
|
51
48
|
delayMs,
|
|
52
49
|
from: liveRegion ? liveRegion : void 0
|
|
53
50
|
});
|
|
@@ -73,23 +70,20 @@ const useAnnouncements = (items, listContainerRef, inputRef, enabled = true, loa
|
|
|
73
70
|
announce$1(`${message === null || message === void 0 ? void 0 : message.title}. ${message === null || message === void 0 ? void 0 : message.description}`, { delayMs });
|
|
74
71
|
return;
|
|
75
72
|
}
|
|
76
|
-
if (usingRovingTabindex) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
82
|
-
} else window.requestAnimationFrame(() => {
|
|
73
|
+
if (usingRovingTabindex) announce$1(`${items.length} item${items.length > 1 ? "s" : ""} available, ${selectedItems} selected.`, {
|
|
74
|
+
delayMs,
|
|
75
|
+
from: liveRegion ? liveRegion : void 0
|
|
76
|
+
});
|
|
77
|
+
else window.requestAnimationFrame(() => {
|
|
83
78
|
const activeItem = getItemWithActiveDescendant(listContainerRef, items);
|
|
84
79
|
if (!activeItem) return;
|
|
85
80
|
const { index, text, selected } = activeItem;
|
|
86
|
-
|
|
81
|
+
announce$1([
|
|
87
82
|
`List updated`,
|
|
88
83
|
`Focused item: ${text}`,
|
|
89
84
|
`${selected ? "selected" : "not selected"}`,
|
|
90
85
|
`${index + 1} of ${items.length}`
|
|
91
|
-
].join(", ")
|
|
92
|
-
announce$1(announcementText, {
|
|
86
|
+
].join(", "), {
|
|
93
87
|
delayMs,
|
|
94
88
|
from: liveRegion ? liveRegion : void 0
|
|
95
89
|
});
|
package/dist/NavList/NavList.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import useIsomorphicLayoutEffect from "../utils/useIsomorphicLayoutEffect.js";
|
|
2
2
|
import { useId as useId$1 } from "../hooks/useId.js";
|
|
3
|
-
import { useSlots } from "../hooks/useSlots.js";
|
|
4
3
|
import { fixedForwardRef } from "../utils/modern-polymorphic.js";
|
|
5
4
|
import _VisuallyHidden_module_css_default from "../_VisuallyHidden.module.css.js";
|
|
5
|
+
import { useSlots } from "../hooks/useSlots.js";
|
|
6
6
|
import { ActionListContainerContext } from "../ActionList/ActionListContainerContext.js";
|
|
7
7
|
import Heading$1 from "../Heading/Heading.js";
|
|
8
8
|
import ActionList_module_css_default from "../ActionList/ActionList.module.css.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useProvidedRefOrCreate } from "../hooks/useProvidedRefOrCreate.js";
|
|
2
2
|
import { warning } from "../utils/warning.js";
|
|
3
|
-
import { isSlot } from "../utils/is-slot.js";
|
|
4
3
|
import { isResponsiveValue } from "../hooks/useResponsiveValue.js";
|
|
4
|
+
import { isSlot } from "../utils/is-slot.js";
|
|
5
5
|
import { getResponsiveAttributes } from "../internal/utils/getResponsiveAttributes.js";
|
|
6
6
|
import Heading from "../Heading/Heading.js";
|
|
7
7
|
import Link from "../Link/Link.js";
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
//#region src/PageLayout/DragHandle.d.ts
|
|
4
|
+
type DragHandleProps = {
|
|
5
|
+
/** Ref for imperative ARIA updates during drag */handleRef: React.RefObject<HTMLDivElement>; /** Called once when drag starts with initial cursor X position */
|
|
6
|
+
onDragStart: (clientX: number) => void; /** Called on each drag tick with cursor position (pointer) or delta (keyboard) */
|
|
7
|
+
onDrag: (value: number, isKeyboard: boolean) => void; /** Called when drag operation completes */
|
|
8
|
+
onDragEnd: () => void; /** Reset width on double-click */
|
|
9
|
+
onDoubleClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
10
|
+
/**
|
|
11
|
+
* Accessible name for the slider. Defaults to `'Draggable pane splitter'`.
|
|
12
|
+
* Provide a context-specific or localized label for standalone usage.
|
|
13
|
+
* Ignored when `aria-labelledby` is provided.
|
|
14
|
+
*/
|
|
15
|
+
'aria-label'?: string; /** Id of an element that labels the slider. Takes precedence over `aria-label`. */
|
|
16
|
+
'aria-labelledby'?: string; /** ARIA slider min value */
|
|
17
|
+
'aria-valuemin'?: number; /** ARIA slider max value */
|
|
18
|
+
'aria-valuemax'?: number; /** ARIA slider current value */
|
|
19
|
+
'aria-valuenow'?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Ref to the element that receives drag-time styling/containment optimizations
|
|
22
|
+
* (e.g. the resizable pane). When omitted, those side effects are skipped.
|
|
23
|
+
*/
|
|
24
|
+
dragTargetRef?: React.RefObject<HTMLElement | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Ref to a content wrapper element that receives drag-time containment.
|
|
27
|
+
* Only needed for layouts (like PageLayout) that optimize sibling content during drag.
|
|
28
|
+
*/
|
|
29
|
+
contentWrapperRef?: React.RefObject<HTMLElement | null>;
|
|
30
|
+
/**
|
|
31
|
+
* Formats the `aria-valuetext` announced for the current width.
|
|
32
|
+
* @default valueNow => `Pane width ${valueNow} pixels`
|
|
33
|
+
*/
|
|
34
|
+
formatValueText?: (valueNow: number) => string; /** Value for the `data-component` attribute. */
|
|
35
|
+
'data-component'?: string;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* DragHandle - handles all pointer and keyboard interactions for resizing.
|
|
39
|
+
* ARIA values are set in JSX for SSR accessibility, then updated via DOM
|
|
40
|
+
* manipulation during drag for performance. The consumer owns writing the width
|
|
41
|
+
* (via the `onDrag` callback); this component only reports interactions.
|
|
42
|
+
*/
|
|
43
|
+
declare const DragHandle: React.NamedExoticComponent<DragHandleProps>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { DragHandle, DragHandleProps };
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import PageLayout_module_css_default from "./PageLayout.module.css.js";
|
|
2
|
+
import { defaultFormatValueText } from "./usePaneWidth.js";
|
|
3
|
+
import { removeDraggingStyles, setDraggingStyles } from "./paneUtils.js";
|
|
4
|
+
import { c } from "react-compiler-runtime";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import React, { memo } from "react";
|
|
7
|
+
//#region src/PageLayout/DragHandle.tsx
|
|
8
|
+
const isArrowKey = (key) => key === "ArrowLeft" || key === "ArrowRight" || key === "ArrowUp" || key === "ArrowDown";
|
|
9
|
+
const isShrinkKey = (key) => key === "ArrowLeft" || key === "ArrowDown";
|
|
10
|
+
/**
|
|
11
|
+
* DragHandle - handles all pointer and keyboard interactions for resizing.
|
|
12
|
+
* ARIA values are set in JSX for SSR accessibility, then updated via DOM
|
|
13
|
+
* manipulation during drag for performance. The consumer owns writing the width
|
|
14
|
+
* (via the `onDrag` callback); this component only reports interactions.
|
|
15
|
+
*/
|
|
16
|
+
const DragHandle = /*#__PURE__*/ memo(function DragHandle(t0) {
|
|
17
|
+
const $ = c(41);
|
|
18
|
+
const { handleRef, onDragStart, onDrag, onDragEnd, onDoubleClick, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-valuemin": ariaValueMin, "aria-valuemax": ariaValueMax, "aria-valuenow": ariaValueNow, dragTargetRef, contentWrapperRef, formatValueText: t1, "data-component": t2 } = t0;
|
|
19
|
+
const formatValueText = t1 === void 0 ? defaultFormatValueText : t1;
|
|
20
|
+
const dataComponent = t2 === void 0 ? "PageLayout.DragHandle" : t2;
|
|
21
|
+
const stableOnDragStart = React.useRef(onDragStart);
|
|
22
|
+
const stableOnDrag = React.useRef(onDrag);
|
|
23
|
+
const stableOnDragEnd = React.useRef(onDragEnd);
|
|
24
|
+
let t3;
|
|
25
|
+
if ($[0] !== onDrag || $[1] !== onDragEnd || $[2] !== onDragStart) {
|
|
26
|
+
t3 = () => {
|
|
27
|
+
stableOnDragStart.current = onDragStart;
|
|
28
|
+
stableOnDrag.current = onDrag;
|
|
29
|
+
stableOnDragEnd.current = onDragEnd;
|
|
30
|
+
};
|
|
31
|
+
$[0] = onDrag;
|
|
32
|
+
$[1] = onDragEnd;
|
|
33
|
+
$[2] = onDragStart;
|
|
34
|
+
$[3] = t3;
|
|
35
|
+
} else t3 = $[3];
|
|
36
|
+
React.useEffect(t3);
|
|
37
|
+
const isDraggingRef = React.useRef(false);
|
|
38
|
+
let t4;
|
|
39
|
+
if ($[4] !== contentWrapperRef || $[5] !== dragTargetRef || $[6] !== handleRef) {
|
|
40
|
+
t4 = () => {
|
|
41
|
+
var _dragTargetRef$curren, _contentWrapperRef$cu;
|
|
42
|
+
if (isDraggingRef.current) return;
|
|
43
|
+
setDraggingStyles({
|
|
44
|
+
handle: handleRef.current,
|
|
45
|
+
pane: (_dragTargetRef$curren = dragTargetRef === null || dragTargetRef === void 0 ? void 0 : dragTargetRef.current) !== null && _dragTargetRef$curren !== void 0 ? _dragTargetRef$curren : null,
|
|
46
|
+
contentWrapper: (_contentWrapperRef$cu = contentWrapperRef === null || contentWrapperRef === void 0 ? void 0 : contentWrapperRef.current) !== null && _contentWrapperRef$cu !== void 0 ? _contentWrapperRef$cu : null
|
|
47
|
+
});
|
|
48
|
+
isDraggingRef.current = true;
|
|
49
|
+
};
|
|
50
|
+
$[4] = contentWrapperRef;
|
|
51
|
+
$[5] = dragTargetRef;
|
|
52
|
+
$[6] = handleRef;
|
|
53
|
+
$[7] = t4;
|
|
54
|
+
} else t4 = $[7];
|
|
55
|
+
const startDragging = t4;
|
|
56
|
+
let t5;
|
|
57
|
+
if ($[8] !== contentWrapperRef || $[9] !== dragTargetRef || $[10] !== handleRef) {
|
|
58
|
+
t5 = () => {
|
|
59
|
+
var _dragTargetRef$curren2, _contentWrapperRef$cu2;
|
|
60
|
+
if (!isDraggingRef.current) return;
|
|
61
|
+
removeDraggingStyles({
|
|
62
|
+
handle: handleRef.current,
|
|
63
|
+
pane: (_dragTargetRef$curren2 = dragTargetRef === null || dragTargetRef === void 0 ? void 0 : dragTargetRef.current) !== null && _dragTargetRef$curren2 !== void 0 ? _dragTargetRef$curren2 : null,
|
|
64
|
+
contentWrapper: (_contentWrapperRef$cu2 = contentWrapperRef === null || contentWrapperRef === void 0 ? void 0 : contentWrapperRef.current) !== null && _contentWrapperRef$cu2 !== void 0 ? _contentWrapperRef$cu2 : null
|
|
65
|
+
});
|
|
66
|
+
isDraggingRef.current = false;
|
|
67
|
+
};
|
|
68
|
+
$[8] = contentWrapperRef;
|
|
69
|
+
$[9] = dragTargetRef;
|
|
70
|
+
$[10] = handleRef;
|
|
71
|
+
$[11] = t5;
|
|
72
|
+
} else t5 = $[11];
|
|
73
|
+
const endDragging = t5;
|
|
74
|
+
let t6;
|
|
75
|
+
if ($[12] !== startDragging) {
|
|
76
|
+
t6 = (event) => {
|
|
77
|
+
if (event.button !== 0) return;
|
|
78
|
+
event.preventDefault();
|
|
79
|
+
const target = event.currentTarget;
|
|
80
|
+
try {
|
|
81
|
+
target.setPointerCapture(event.pointerId);
|
|
82
|
+
} catch {}
|
|
83
|
+
stableOnDragStart.current(event.clientX);
|
|
84
|
+
startDragging();
|
|
85
|
+
};
|
|
86
|
+
$[12] = startDragging;
|
|
87
|
+
$[13] = t6;
|
|
88
|
+
} else t6 = $[13];
|
|
89
|
+
const handlePointerDown = t6;
|
|
90
|
+
const rafIdRef = React.useRef(null);
|
|
91
|
+
const pendingClientXRef = React.useRef(null);
|
|
92
|
+
let t7;
|
|
93
|
+
if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
94
|
+
t7 = (event_0) => {
|
|
95
|
+
if (!isDraggingRef.current) return;
|
|
96
|
+
event_0.preventDefault();
|
|
97
|
+
pendingClientXRef.current = event_0.clientX;
|
|
98
|
+
if (rafIdRef.current === null) rafIdRef.current = requestAnimationFrame(() => {
|
|
99
|
+
rafIdRef.current = null;
|
|
100
|
+
if (pendingClientXRef.current !== null) {
|
|
101
|
+
stableOnDrag.current(pendingClientXRef.current, false);
|
|
102
|
+
pendingClientXRef.current = null;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
$[14] = t7;
|
|
107
|
+
} else t7 = $[14];
|
|
108
|
+
const handlePointerMove = t7;
|
|
109
|
+
let t8;
|
|
110
|
+
if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
|
|
111
|
+
t8 = (event_1) => {
|
|
112
|
+
if (!isDraggingRef.current) return;
|
|
113
|
+
event_1.preventDefault();
|
|
114
|
+
};
|
|
115
|
+
$[15] = t8;
|
|
116
|
+
} else t8 = $[15];
|
|
117
|
+
const handlePointerUp = t8;
|
|
118
|
+
let t9;
|
|
119
|
+
if ($[16] !== endDragging) {
|
|
120
|
+
t9 = () => {
|
|
121
|
+
if (!isDraggingRef.current) return;
|
|
122
|
+
if (rafIdRef.current !== null) {
|
|
123
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
124
|
+
rafIdRef.current = null;
|
|
125
|
+
pendingClientXRef.current = null;
|
|
126
|
+
}
|
|
127
|
+
endDragging();
|
|
128
|
+
stableOnDragEnd.current();
|
|
129
|
+
};
|
|
130
|
+
$[16] = endDragging;
|
|
131
|
+
$[17] = t9;
|
|
132
|
+
} else t9 = $[17];
|
|
133
|
+
const handleLostPointerCapture = t9;
|
|
134
|
+
let t10;
|
|
135
|
+
if ($[18] !== startDragging) {
|
|
136
|
+
t10 = (event_2) => {
|
|
137
|
+
if (!isArrowKey(event_2.key)) return;
|
|
138
|
+
event_2.preventDefault();
|
|
139
|
+
const delta = isShrinkKey(event_2.key) ? -3 : 3;
|
|
140
|
+
if (!isDraggingRef.current) startDragging();
|
|
141
|
+
stableOnDrag.current(delta, true);
|
|
142
|
+
};
|
|
143
|
+
$[18] = startDragging;
|
|
144
|
+
$[19] = t10;
|
|
145
|
+
} else t10 = $[19];
|
|
146
|
+
const handleKeyDown = t10;
|
|
147
|
+
let t11;
|
|
148
|
+
if ($[20] !== endDragging) {
|
|
149
|
+
t11 = (event_3) => {
|
|
150
|
+
if (!isArrowKey(event_3.key)) return;
|
|
151
|
+
event_3.preventDefault();
|
|
152
|
+
endDragging();
|
|
153
|
+
stableOnDragEnd.current();
|
|
154
|
+
};
|
|
155
|
+
$[20] = endDragging;
|
|
156
|
+
$[21] = t11;
|
|
157
|
+
} else t11 = $[21];
|
|
158
|
+
const handleKeyUp = t11;
|
|
159
|
+
let t12;
|
|
160
|
+
let t13;
|
|
161
|
+
if ($[22] === Symbol.for("react.memo_cache_sentinel")) {
|
|
162
|
+
t12 = () => () => {
|
|
163
|
+
if (rafIdRef.current !== null) {
|
|
164
|
+
cancelAnimationFrame(rafIdRef.current);
|
|
165
|
+
rafIdRef.current = null;
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
t13 = [];
|
|
169
|
+
$[22] = t12;
|
|
170
|
+
$[23] = t13;
|
|
171
|
+
} else {
|
|
172
|
+
t12 = $[22];
|
|
173
|
+
t13 = $[23];
|
|
174
|
+
}
|
|
175
|
+
React.useEffect(t12, t13);
|
|
176
|
+
const t14 = ariaLabelledBy ? void 0 : ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : "Draggable pane splitter";
|
|
177
|
+
let t15;
|
|
178
|
+
if ($[24] !== ariaValueNow || $[25] !== formatValueText) {
|
|
179
|
+
t15 = ariaValueNow !== void 0 ? formatValueText(ariaValueNow) : void 0;
|
|
180
|
+
$[24] = ariaValueNow;
|
|
181
|
+
$[25] = formatValueText;
|
|
182
|
+
$[26] = t15;
|
|
183
|
+
} else t15 = $[26];
|
|
184
|
+
let t16;
|
|
185
|
+
if ($[27] !== ariaLabelledBy || $[28] !== ariaValueMax || $[29] !== ariaValueMin || $[30] !== ariaValueNow || $[31] !== dataComponent || $[32] !== handleKeyDown || $[33] !== handleKeyUp || $[34] !== handleLostPointerCapture || $[35] !== handlePointerDown || $[36] !== handleRef || $[37] !== onDoubleClick || $[38] !== t14 || $[39] !== t15) {
|
|
186
|
+
t16 = /*#__PURE__*/ jsx("div", {
|
|
187
|
+
ref: handleRef,
|
|
188
|
+
className: PageLayout_module_css_default.DraggableHandle,
|
|
189
|
+
"data-component": dataComponent,
|
|
190
|
+
role: "slider",
|
|
191
|
+
"aria-label": t14,
|
|
192
|
+
"aria-labelledby": ariaLabelledBy,
|
|
193
|
+
"aria-valuemin": ariaValueMin,
|
|
194
|
+
"aria-valuemax": ariaValueMax,
|
|
195
|
+
"aria-valuenow": ariaValueNow,
|
|
196
|
+
"aria-valuetext": t15,
|
|
197
|
+
tabIndex: 0,
|
|
198
|
+
onPointerDown: handlePointerDown,
|
|
199
|
+
onPointerMove: handlePointerMove,
|
|
200
|
+
onPointerUp: handlePointerUp,
|
|
201
|
+
onLostPointerCapture: handleLostPointerCapture,
|
|
202
|
+
onKeyDown: handleKeyDown,
|
|
203
|
+
onKeyUp: handleKeyUp,
|
|
204
|
+
onDoubleClick
|
|
205
|
+
});
|
|
206
|
+
$[27] = ariaLabelledBy;
|
|
207
|
+
$[28] = ariaValueMax;
|
|
208
|
+
$[29] = ariaValueMin;
|
|
209
|
+
$[30] = ariaValueNow;
|
|
210
|
+
$[31] = dataComponent;
|
|
211
|
+
$[32] = handleKeyDown;
|
|
212
|
+
$[33] = handleKeyUp;
|
|
213
|
+
$[34] = handleLostPointerCapture;
|
|
214
|
+
$[35] = handlePointerDown;
|
|
215
|
+
$[36] = handleRef;
|
|
216
|
+
$[37] = onDoubleClick;
|
|
217
|
+
$[38] = t14;
|
|
218
|
+
$[39] = t15;
|
|
219
|
+
$[40] = t16;
|
|
220
|
+
} else t16 = $[40];
|
|
221
|
+
return t16;
|
|
222
|
+
});
|
|
223
|
+
//#endregion
|
|
224
|
+
export { DragHandle };
|