@payloadcms/ui 4.0.0-beta.4 → 4.0.0-beta.6
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/dist/css/utilities.css +1 -0
- package/dist/elements/AddNewRelation/index.d.ts.map +1 -1
- package/dist/elements/AddNewRelation/index.js +4 -0
- package/dist/elements/AddNewRelation/index.js.map +1 -1
- package/dist/elements/AppHeader/index.d.ts.map +1 -1
- package/dist/elements/AppHeader/index.js +2 -0
- package/dist/elements/AppHeader/index.js.map +1 -1
- package/dist/elements/Collapsible/index.css +1 -1
- package/dist/elements/ColumnSelection/Popup.css +2 -2
- package/dist/elements/DocumentDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/DocumentDrawer/DrawerContent.js +15 -9
- package/dist/elements/DocumentDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/index.js +10 -8
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -1
- package/dist/elements/FileDetails/DraggableFileDetails/index.d.ts.map +1 -1
- package/dist/elements/FileDetails/DraggableFileDetails/index.js +19 -12
- package/dist/elements/FileDetails/DraggableFileDetails/index.js.map +1 -1
- package/dist/elements/FileDetails/StaticFileDetails/index.d.ts.map +1 -1
- package/dist/elements/FileDetails/StaticFileDetails/index.js +63 -33
- package/dist/elements/FileDetails/StaticFileDetails/index.js.map +1 -1
- package/dist/elements/FileManager/index.d.ts.map +1 -1
- package/dist/elements/FileManager/index.js +18 -11
- package/dist/elements/FileManager/index.js.map +1 -1
- package/dist/elements/FilterTrigger/index.d.ts.map +1 -1
- package/dist/elements/FilterTrigger/index.js +80 -44
- package/dist/elements/FilterTrigger/index.js.map +1 -1
- package/dist/elements/ListControls/index.css +1 -0
- package/dist/elements/ListControls/index.d.ts.map +1 -1
- package/dist/elements/ListControls/index.js +7 -4
- package/dist/elements/ListControls/index.js.map +1 -1
- package/dist/elements/ListControls/types.d.ts +1 -0
- package/dist/elements/ListControls/types.d.ts.map +1 -1
- package/dist/elements/ListControls/types.js.map +1 -1
- package/dist/elements/ListDrawer/DrawerContent.d.ts.map +1 -1
- package/dist/elements/ListDrawer/DrawerContent.js +18 -12
- package/dist/elements/ListDrawer/DrawerContent.js.map +1 -1
- package/dist/elements/LivePreview/Toolbar/index.d.ts.map +1 -1
- package/dist/elements/LivePreview/Toolbar/index.js +13 -7
- package/dist/elements/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/elements/Nav/NavSidebarToggle/index.d.ts.map +1 -1
- package/dist/elements/Nav/NavSidebarToggle/index.js +26 -37
- package/dist/elements/Nav/NavSidebarToggle/index.js.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.client.d.ts.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.client.js +9 -2
- package/dist/elements/Nav/SidebarTabs/index.client.js.map +1 -1
- package/dist/elements/Nav/SidebarTabs/index.css +1 -1
- package/dist/elements/Nav/context.d.ts +1 -0
- package/dist/elements/Nav/context.d.ts.map +1 -1
- package/dist/elements/Nav/context.js +2 -0
- package/dist/elements/Nav/context.js.map +1 -1
- package/dist/elements/Nav/getNavPrefs.d.ts.map +1 -1
- package/dist/elements/Nav/getNavPrefs.js +7 -2
- package/dist/elements/Nav/getNavPrefs.js.map +1 -1
- package/dist/elements/Nav/index.css +11 -0
- package/dist/elements/Popup/PopupButtonList/index.css +1 -1
- package/dist/elements/Popup/SubmenuScope.d.ts +3 -5
- package/dist/elements/Popup/SubmenuScope.d.ts.map +1 -1
- package/dist/elements/Popup/SubmenuScope.js +10 -54
- package/dist/elements/Popup/SubmenuScope.js.map +1 -1
- package/dist/elements/Popup/index.css +15 -0
- package/dist/elements/Popup/index.d.ts.map +1 -1
- package/dist/elements/Popup/index.js +69 -30
- package/dist/elements/Popup/index.js.map +1 -1
- package/dist/elements/Popup/useSubmenuPointerIntent.d.ts +16 -4
- package/dist/elements/Popup/useSubmenuPointerIntent.d.ts.map +1 -1
- package/dist/elements/Popup/useSubmenuPointerIntent.js +68 -27
- package/dist/elements/Popup/useSubmenuPointerIntent.js.map +1 -1
- package/dist/elements/PreviewButton/index.d.ts.map +1 -1
- package/dist/elements/PreviewButton/index.js +4 -0
- package/dist/elements/PreviewButton/index.js.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.d.ts.map +1 -1
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.js +1 -0
- package/dist/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.js.map +1 -1
- package/dist/elements/ReactSelect/MultiValue/index.css +1 -1
- package/dist/elements/ReactSelect/index.css +4 -2
- package/dist/elements/ReactSelect/index.d.ts.map +1 -1
- package/dist/elements/ReactSelect/index.js +8 -3
- package/dist/elements/ReactSelect/index.js.map +1 -1
- package/dist/elements/SchedulePublishButton/index.d.ts.map +1 -1
- package/dist/elements/SchedulePublishButton/index.js +4 -0
- package/dist/elements/SchedulePublishButton/index.js.map +1 -1
- package/dist/elements/Search/SearchInput/index.css +32 -3
- package/dist/elements/SegmentedControl/index.css +1 -1
- package/dist/elements/SidebarToggle/index.css +1 -1
- package/dist/elements/SortColumn/index.css +49 -5
- package/dist/elements/SortRow/index.css +1 -3
- package/dist/elements/SortRow/index.d.ts.map +1 -1
- package/dist/elements/SortRow/index.js +16 -10
- package/dist/elements/SortRow/index.js.map +1 -1
- package/dist/elements/StepNav/index.d.ts.map +1 -1
- package/dist/elements/StepNav/index.js +4 -1
- package/dist/elements/StepNav/index.js.map +1 -1
- package/dist/elements/Tabs/index.css +1 -1
- package/dist/elements/TimezonePicker/index.css +6 -5
- package/dist/elements/TimezonePicker/index.d.ts.map +1 -1
- package/dist/elements/TimezonePicker/index.js +80 -43
- package/dist/elements/TimezonePicker/index.js.map +1 -1
- package/dist/elements/Upload/index.js +2 -0
- package/dist/elements/Upload/index.js.map +1 -1
- package/dist/elements/UploadDropzoneContent/index.d.ts.map +1 -1
- package/dist/elements/UploadDropzoneContent/index.js +1 -0
- package/dist/elements/UploadDropzoneContent/index.js.map +1 -1
- package/dist/elements/UserMenu/index.css +1 -1
- package/dist/exports/client/{DatePicker-AZBZPMY6.js → DatePicker-DJN2NVQC.js} +2 -2
- package/dist/exports/client/chunk-GQEFXRCN.js +29 -0
- package/dist/exports/client/{chunk-ZP2PB6M4.js.map → chunk-GQEFXRCN.js.map} +4 -4
- package/dist/exports/client/index.js +27 -27
- package/dist/exports/client/index.js.map +4 -4
- package/dist/fields/Blocks/SectionTitle/index.css +21 -2
- package/dist/fields/DateTime/index.js +1 -1
- package/dist/fields/DateTime/index.js.map +1 -1
- package/dist/fields/Upload/Input.d.ts.map +1 -1
- package/dist/fields/Upload/Input.js +1 -0
- package/dist/fields/Upload/Input.js.map +1 -1
- package/dist/fields/Upload/RelationshipContent/index.css +1 -1
- package/dist/forms/Form/index.d.ts.map +1 -1
- package/dist/forms/Form/index.js +9 -7
- package/dist/forms/Form/index.js.map +1 -1
- package/dist/hooks/usePointerSafeArea.d.ts +29 -0
- package/dist/hooks/usePointerSafeArea.d.ts.map +1 -0
- package/dist/hooks/usePointerSafeArea.js +232 -0
- package/dist/hooks/usePointerSafeArea.js.map +1 -0
- package/dist/providers/ListQuery/index.d.ts.map +1 -1
- package/dist/providers/ListQuery/index.js +17 -1
- package/dist/providers/ListQuery/index.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/views/List/index.client.d.ts.map +1 -1
- package/dist/views/List/index.client.js +15 -9
- package/dist/views/List/index.client.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +6 -9
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.d.ts +0 -1
- package/dist/views/Version/Default/types.d.ts.map +1 -1
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/Restore/index.css +0 -11
- package/dist/views/Version/Restore/index.d.ts +0 -1
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +87 -115
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +1 -2
- package/dist/views/Version/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/exports/client/chunk-ZP2PB6M4.js +0 -29
- /package/dist/exports/client/{DatePicker-AZBZPMY6.js.map → DatePicker-DJN2NVQC.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["PopupList","React","createContext","use","useCallback","useEffect","useId","useLayoutEffect","useRef","useState","useEffectEvent","useModalFocus","ThemeProvider","PopupTrigger","createSubmenuScope","useSubmenuPointerIntent","baseClass","PopupContext","TABBABLE_SELECTOR","map","s","join","MENU_ITEM_SELECTOR","POPUP_CONTENT_SELECTOR","getMenuItems","popup","Array","from","querySelectorAll","filter","item","closest","Popup","props","id","button","buttonAriaLabel","buttonClassName","buttonSize","buttonType","caret","children","className","disabled","forceOpen","horizontalAlign","horizontalAlignProp","hoverSubmenu","initActive","noBackground","onToggleClose","onToggleOpen","popupAriaLabel","popupType","portalClassName","render","renderButton","showOnHover","showScrollbar","side","size","theme","verticalAlign","popupRef","containerRef","triggerRef","registerPopup","getTrigger","current","querySelector","container","generatedContentId","contentId","openedViaKeyboardRef","parentPopup","popupRole","undefined","submenuScope","isSubmenu","resolvedSide","active","setActiveInternal","isOnTop","setIsOnTop","setActive","isActive","viaKeyboard","coordinateParent","requestOpen","delay","closeActiveBranch","release","closePopup","restoreFocus","trigger","requestAnimationFrame","focus","close","closePopupChain","options","openFromParent","register","closeBranch","open","pointerIntent","contentRef","enabled","onClose","onOpen","Boolean","activeChildId","updatePosition","triggerRect","getBoundingClientRect","popupRect","offset","sideOffset","top","left","caretLeft","scrollContainer","popupPaddingTop","Number","parseFloat","window","getComputedStyle","paddingTop","maxTop","innerHeight","height","Math","max","min","anchorRect","width","right","innerWidth","onTop","bottom","topIfAbove","triggerCenter","newTop","round","newLeft","newCaretLeft","newPosition","style","position","getPropertyValue","setProperty","handleClickOutside","e","target","isOutsidePopup","contains","isOutsideTrigger","clickedPopupContent","isInsideChildPopup","handleKeyDown","activePopup","document","activeElement","key","preventDefault","stopPropagation","nestedTrigger","dispatchEvent","KeyboardEvent","bubbles","shiftKey","setTimeout","includes","menuItems","length","currentIndex","findIndex","nextIndex","forEach","index","setAttribute","focusable","el","goBackward","handleActionableClick","actionable","matches","showPopover","rafId","firstFocusable","addEventListener","capture","passive","cancelAnimationFrame","removeEventListener","hidePopover","Trigger","_jsx","isMenuItem","_jsxs","ref","onMouseEnter","onMouseLeave","role","tabIndex","value","popover","_Fragment"],"sources":["../../../src/elements/Popup/index.tsx"],"sourcesContent":["'use client'\nimport type { AriaAttributes, AriaRole, CSSProperties } from 'react'\n\nexport * as PopupList from './PopupButtonList/index.js'\n\nimport React, {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport { useEffectEvent } from '../../hooks/useEffectEvent.js'\nimport { useModalFocus } from '../../providers/ModalFocus/index.js'\nimport { ThemeProvider } from '../../providers/Theme/index.js'\nimport './index.css'\nimport { type PopupButtonRenderProps, PopupTrigger } from './PopupTrigger/index.js'\nimport { createSubmenuScope, type SubmenuScope } from './SubmenuScope.js'\nimport { useSubmenuPointerIntent } from './useSubmenuPointerIntent.js'\n\nconst baseClass = 'popup'\n\ntype PopupContextValue = {\n closePopupChain: (options?: { restoreFocus?: boolean }) => void\n popupRef: React.RefObject<HTMLDivElement | null>\n popupRole?: AriaRole\n submenuScope: SubmenuScope\n}\n\nconst PopupContext = createContext<null | PopupContextValue>(null)\n\n/**\n * Selector for all elements the browser considers tabbable.\n */\nconst TABBABLE_SELECTOR = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'audio[controls]',\n 'video[controls]',\n 'summary',\n]\n .map((s) => `${s}:not([tabindex=\"-1\"])`)\n .join(', ')\n\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]'\nconst POPUP_CONTENT_SELECTOR = `.${baseClass}__content, .${baseClass}__hidden-content`\n\nconst getMenuItems = (popup: HTMLElement): HTMLElement[] =>\n Array.from(popup.querySelectorAll<HTMLElement>(MENU_ITEM_SELECTOR)).filter(\n (item) => item.closest(POPUP_CONTENT_SELECTOR) === popup,\n )\n\nexport type PopupProps = {\n backgroundColor?: CSSProperties['backgroundColor']\n boundingRef?: React.RefObject<HTMLElement>\n button?: React.ReactNode\n buttonAriaLabel?: string\n buttonClassName?: string\n buttonSize?: 'large' | 'medium'\n buttonType?: 'custom' | 'default'\n caret?: boolean\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n forceOpen?: boolean\n /**\n * Preferred horizontal alignment of the popup, if there is enough space available.\n * Nested menu popups use 'left' and 'right' as their preferred side instead.\n * When omitted, nested menu popups prefer the right side.\n *\n * @default 'left'\n */\n horizontalAlign?: 'center' | 'left' | 'right'\n hoverSubmenu?: boolean\n id?: string\n initActive?: boolean\n noBackground?: boolean\n onToggleClose?: () => void\n onToggleOpen?: (active: boolean) => void\n popupAriaLabel?: string\n popupType?: AriaAttributes['aria-haspopup']\n portalClassName?: string\n render?: (args: { close: () => void }) => React.ReactNode\n /**\n * Render prop for custom trigger button. Receives onClick/onKeyDown/aria props.\n * When provided, `button` and `buttonType` are ignored.\n */\n renderButton?: (props: PopupButtonRenderProps) => React.ReactNode\n showOnHover?: boolean\n /**\n * By default, the scrollbar is hidden. If you want to show it, set this to true.\n * In both cases, the container is still scrollable.\n *\n * @default false\n */\n showScrollbar?: boolean\n /**\n * Position the popup to the side of the trigger instead of above/below.\n * The popup's top edge aligns with the trigger's top edge (with viewport clamping).\n * Automatically flips to the opposite side if there is not enough space.\n * When set, `verticalAlign`, `horizontalAlign`, and the caret are ignored.\n */\n side?: 'left' | 'right'\n size?: 'fit-content' | 'large' | 'small'\n /**\n * Theme for the popup content. Defaults to 'dark'.\n * Set to 'auto' to inherit the current theme.\n *\n * @default 'dark'\n */\n theme?: 'auto' | 'dark' | 'light'\n /**\n * Preferred vertical alignment of the popup (position below or above the trigger),\n * if there is enough space available.\n *\n * If the popup is too close to the edge of the viewport, it will flip to the opposite side\n * regardless of the preferred vertical alignment.\n *\n * @default 'bottom'\n */\n verticalAlign?: 'bottom' | 'top'\n}\n\n/**\n * Component that renders a popup, as well as a button that triggers the popup.\n *\n * The popup is rendered next to its trigger in the DOM and positioned above / below it,\n * depending on the verticalAlign prop and the space available.\n */\nexport const Popup: React.FC<PopupProps> = (props) => {\n const {\n id,\n button,\n buttonAriaLabel,\n buttonClassName,\n buttonSize,\n buttonType = 'default',\n caret = true,\n children,\n className,\n disabled,\n forceOpen,\n horizontalAlign: horizontalAlignProp,\n hoverSubmenu = false,\n initActive = false,\n noBackground,\n onToggleClose,\n onToggleOpen,\n popupAriaLabel,\n popupType,\n portalClassName,\n render,\n renderButton,\n showOnHover = false,\n showScrollbar = false,\n side,\n size = 'fit-content',\n theme = 'dark',\n verticalAlign = 'bottom',\n } = props\n\n const popupRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLDivElement>(null)\n const { registerPopup } = useModalFocus()\n const getTrigger = useCallback(\n () => triggerRef.current?.querySelector<HTMLElement>('button, [tabindex=\"0\"]') ?? null,\n [],\n )\n\n useLayoutEffect(() => {\n const container = containerRef.current\n\n if (container) {\n return registerPopup({ container, getTrigger })\n }\n }, [getTrigger, registerPopup])\n const generatedContentId = useId()\n const contentId = `${id || generatedContentId}-content`\n\n /**\n * Keeps track of whether the popup was opened via keyboard.\n * This is used to determine whether to autofocus the first element in the popup.\n * If the popup was opened via mouse, we do not want to autofocus the first element.\n */\n const openedViaKeyboardRef = useRef(false)\n\n const parentPopup = use(PopupContext)\n const popupRole = (popupType === true ? 'menu' : popupType || undefined) as AriaRole | undefined\n const submenuScope = useState(() => createSubmenuScope())[0]\n const isSubmenu = parentPopup?.popupRole === 'menu' && popupRole === 'menu'\n const horizontalAlign = horizontalAlignProp ?? 'left'\n const resolvedSide =\n side ?? (isSubmenu ? (horizontalAlignProp === 'left' ? 'left' : 'right') : undefined)\n\n const [active, setActiveInternal] = useState(initActive)\n const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top')\n\n const setActive = useCallback(\n (isActive: boolean, viaKeyboard = false, coordinateParent = true) => {\n if (isActive) {\n openedViaKeyboardRef.current = viaKeyboard\n if (coordinateParent && isSubmenu) {\n parentPopup.submenuScope.requestOpen({\n id: contentId,\n delay: false,\n viaKeyboard,\n })\n return\n }\n onToggleOpen?.(true)\n } else {\n onToggleClose?.()\n submenuScope.closeActiveBranch()\n parentPopup?.submenuScope.release(contentId)\n }\n setActiveInternal(isActive)\n },\n [contentId, isSubmenu, onToggleClose, onToggleOpen, parentPopup, submenuScope],\n )\n\n const closePopup = useCallback(\n ({ restoreFocus = true }: { restoreFocus?: boolean } = {}) => {\n const trigger = getTrigger()\n\n setActive(false)\n if (restoreFocus) {\n requestAnimationFrame(() => trigger?.focus())\n }\n },\n [getTrigger, setActive],\n )\n const close = useCallback(() => closePopup(), [closePopup])\n const closePopupChain = useCallback(\n (options: { restoreFocus?: boolean } = {}) => {\n if (parentPopup) {\n closePopup({ restoreFocus: false })\n parentPopup.closePopupChain(options)\n return\n }\n\n closePopup(options)\n },\n [closePopup, parentPopup],\n )\n\n const openFromParent = useCallback(\n (viaKeyboard: boolean) => setActive(true, viaKeyboard, false),\n [setActive],\n )\n\n useEffect(() => {\n if (!isSubmenu) {\n return\n }\n\n return parentPopup.submenuScope.register({\n id: contentId,\n closeBranch: () => closePopup({ restoreFocus: false }),\n open: openFromParent,\n })\n }, [closePopup, contentId, isSubmenu, openFromParent, parentPopup])\n\n const pointerIntent = useSubmenuPointerIntent({\n contentRef: popupRef,\n enabled: isSubmenu && hoverSubmenu,\n onClose: () => setActive(false),\n onOpen: () =>\n parentPopup?.submenuScope.requestOpen({\n id: contentId,\n delay: Boolean(parentPopup.submenuScope.activeChildId),\n }),\n })\n\n // /////////////////////////////////////\n // Position Calculation\n //\n // Calculates and applies popup position relative to trigger.\n // Always checks viewport bounds (for flipping), but only updates\n // styles if the calculated position differs from current position.\n // /////////////////////////////////////\n\n const updatePosition = useEffectEvent(() => {\n const trigger = triggerRef.current\n const popup = popupRef.current\n if (!trigger || !popup) {\n return\n }\n\n const triggerRect = trigger.getBoundingClientRect()\n const popupRect = popup.getBoundingClientRect()\n\n // Gap between the popup and the trigger/viewport edges (in pixels)\n const offset = 8\n // Additional gap used in side mode so the child popup has breathing room from its parent\n const sideOffset = 4\n\n let top: number\n let left: number\n let caretLeft: number\n\n if (resolvedSide) {\n // /////////////////////////////////////\n // Side Positioning\n // Places the popup to the left or right of the parent popup (not just the trigger),\n // top-aligned with the trigger. Flips to the opposite side if there is not enough\n // viewport space.\n // /////////////////////////////////////\n\n const scrollContainer = popup.querySelector<HTMLElement>(\n `:scope > .${baseClass}__scroll-container`,\n )\n const popupPaddingTop = scrollContainer\n ? Number.parseFloat(window.getComputedStyle(scrollContainer).paddingTop) || 0\n : 0\n\n // Align the first menu item with the trigger by accounting for the popup's top padding.\n top = triggerRect.top - popupPaddingTop\n const maxTop = window.innerHeight - popupRect.height - offset\n top = Math.max(offset, Math.min(top, maxTop))\n\n // Use the parent popup's bounding rect as the reference for left/right positioning\n // so the child appears 4px from the parent popup edge, not just the trigger button.\n const anchorRect = parentPopup?.popupRef.current\n ? parentPopup.popupRef.current.getBoundingClientRect()\n : triggerRect\n\n if (resolvedSide === 'left') {\n left = anchorRect.left - popupRect.width - sideOffset\n if (left < offset) {\n // flip to right side\n left = anchorRect.right + sideOffset\n }\n } else {\n left = anchorRect.right + sideOffset\n if (left + popupRect.width + offset > window.innerWidth) {\n // flip to left side\n left = anchorRect.left - popupRect.width - sideOffset\n }\n }\n\n left = Math.max(\n offset,\n Math.min(left, Math.max(offset, window.innerWidth - popupRect.width - offset)),\n )\n\n // Caret not used in side mode; set a neutral value\n caretLeft = popupRect.width / 2\n\n setIsOnTop(false)\n } else {\n // /////////////////////////////////////\n // Vertical Positioning\n // Calculates the `top` position in absolute page coordinates.\n // Uses `verticalAlign` prop as the preferred direction, but flips\n // to the opposite side if there's not enough viewport space.\n // /////////////////////////////////////\n\n let onTop = verticalAlign === 'top'\n\n if (verticalAlign === 'bottom') {\n top = triggerRect.bottom + offset\n\n if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {\n // Try to flip above — only do so if there's actually enough room\n const topIfAbove = triggerRect.top - popupRect.height - offset\n if (topIfAbove >= 0) {\n top = topIfAbove\n onTop = true\n }\n // else: not enough room above either — keep below and let it overflow rather than going off-screen\n }\n } else {\n top = triggerRect.top - popupRect.height - offset\n\n if (triggerRect.top - popupRect.height - offset < 0) {\n top = triggerRect.bottom + offset\n onTop = false\n }\n }\n\n const maxTop = Math.max(offset, window.innerHeight - popupRect.height - offset)\n top = Math.max(offset, Math.min(top, maxTop))\n\n setIsOnTop(onTop)\n\n // /////////////////////////////////////\n // Horizontal Positioning\n // Calculates the `left` position based on `horizontalAlign` prop:\n // - 'left': aligns popup's left edge with trigger's left edge\n // - 'right': aligns popup's right edge with trigger's right edge\n // - 'center': centers popup horizontally relative to trigger\n // Then clamps to keep the popup within viewport bounds.\n // /////////////////////////////////////\n\n left =\n horizontalAlign === 'right'\n ? triggerRect.right - popupRect.width\n : horizontalAlign === 'center'\n ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2\n : triggerRect.left\n\n left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset))\n\n // /////////////////////////////////////\n // Caret Positioning\n // Positions the caret arrow to point at the trigger's horizontal center.\n // Clamps between 12px from edges to prevent caret from overflowing the popup.\n // /////////////////////////////////////\n\n const triggerCenter = triggerRect.left + triggerRect.width / 2\n caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12))\n }\n\n // /////////////////////////////////////\n // Apply Styles (only if changed)\n // Compares calculated position with current styles to avoid unnecessary\n // DOM updates during scroll. This prevents visual lag by relying on the absolute\n // positioning where possible (popup slightly lags behind when scrolling really fast),\n // while still allowing position changes when needed (e.g., sticky parent, viewport flip).\n // Values are rounded to match browser's CSS precision and avoid false updates.\n // /////////////////////////////////////\n\n const newTop = `${Math.round(top)}px`\n const newLeft = `${Math.round(left)}px`\n const newCaretLeft = `${Math.round(caretLeft)}px`\n const newPosition = 'fixed'\n\n if (popup.style.position !== newPosition) {\n popup.style.position = newPosition\n }\n if (popup.style.top !== newTop) {\n popup.style.top = newTop\n }\n if (popup.style.left !== newLeft) {\n popup.style.left = newLeft\n }\n if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {\n popup.style.setProperty('--caret-left', newCaretLeft)\n }\n })\n\n // /////////////////////////////////////\n // Click Outside Handler\n // Closes popup when clicking outside both the popup and trigger.\n // Distinguishes between parent and child popups:\n // - Click in child popup: parent stays open\n // - Click in parent popup: child closes\n // /////////////////////////////////////\n\n const handleClickOutside = useEffectEvent((e: MouseEvent) => {\n const target = e.target as Node\n const isOutsidePopup = !popupRef.current?.contains(target)\n const isOutsideTrigger = !triggerRef.current?.contains(target)\n\n // Check if click is inside a popup portal\n const clickedPopupContent = (target as Element).closest?.('.popup__content')\n\n // If the clicked popup contains this popup's trigger, it's a parent popup\n // and we should close. If it doesn't contain our trigger, it's a child popup\n // and we should stay open to avoid closing parent when interacting with child.\n const isInsideChildPopup =\n clickedPopupContent && !clickedPopupContent.contains(triggerRef.current)\n\n if (isOutsidePopup && isOutsideTrigger && !isInsideChildPopup) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Keyboard Navigation\n // Handles keyboard interactions when popup is open:\n // - Escape: closes popup and returns focus to trigger\n // - Tab/Shift+Tab: closes menus; dialogs retain normal document tab order\n // - ArrowUp/ArrowDown: moves between menu items with wrapping\n // Focus is managed manually to support elements the browser might skip.\n // /////////////////////////////////////\n\n const handleKeyDown = useEffectEvent((e: KeyboardEvent) => {\n const popup = popupRef.current\n if (!popup || !active) {\n return\n }\n\n const activePopup = document.activeElement?.closest(`.${baseClass}__content`)\n if (activePopup && activePopup !== popup) {\n return\n }\n\n if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n closePopup()\n return\n }\n\n if (e.key === 'ArrowRight' && popupRole === 'menu') {\n const trigger = (document.activeElement as HTMLElement | null)?.closest<HTMLElement>(\n `.${baseClass}__trigger-wrap`,\n )\n const nestedTrigger = trigger?.querySelector<HTMLElement>('button, [role=\"menuitem\"]')\n if (nestedTrigger) {\n e.preventDefault()\n nestedTrigger.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true, key: 'Enter' }))\n return\n }\n }\n\n if (e.key === 'ArrowLeft' && parentPopup) {\n e.preventDefault()\n closePopup()\n return\n }\n\n if (e.key === 'Tab' && popupRole === 'menu') {\n if (e.shiftKey) {\n e.preventDefault()\n closePopupChain({ restoreFocus: true })\n return\n }\n\n setTimeout(closePopupChain)\n return\n }\n\n if (['ArrowDown', 'ArrowUp', 'End', 'Home'].includes(e.key)) {\n const menuItems = getMenuItems(popup)\n if (menuItems.length > 0) {\n e.preventDefault()\n\n const currentIndex = menuItems.findIndex((item) => item === document.activeElement)\n const nextIndex =\n e.key === 'Home'\n ? 0\n : e.key === 'End'\n ? menuItems.length - 1\n : e.key === 'ArrowUp'\n ? currentIndex <= 0\n ? menuItems.length - 1\n : currentIndex - 1\n : currentIndex === -1 || currentIndex === menuItems.length - 1\n ? 0\n : currentIndex + 1\n\n menuItems.forEach((item, index) =>\n item.setAttribute('tabindex', index === nextIndex ? '0' : '-1'),\n )\n menuItems[nextIndex].focus()\n return\n }\n }\n\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n const focusable = Array.from(popup.querySelectorAll<HTMLElement>(TABBABLE_SELECTOR))\n if (focusable.length === 0) {\n return\n }\n\n e.preventDefault()\n\n const currentIndex = focusable.findIndex((el) => el === document.activeElement)\n const goBackward = e.key === 'ArrowUp'\n\n let nextIndex: number\n if (currentIndex === -1) {\n nextIndex = goBackward ? focusable.length - 1 : 0\n } else if (goBackward) {\n nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1\n } else {\n nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1\n }\n\n focusable[nextIndex].focus()\n }\n })\n\n // /////////////////////////////////////\n // Click Handler for Actionable Elements\n // Closes popup when buttons/links inside are clicked (includes Enter/Space activation).\n // /////////////////////////////////////\n\n const handleActionableClick = useEffectEvent((e: MouseEvent) => {\n const target = e.target as HTMLElement\n\n // Allow opting out with data-popup-prevent-close attribute on element or ancestor\n if (target.closest('[data-popup-prevent-close]')) {\n return\n }\n\n // Check if the clicked element or any ancestor is an actionable element\n const actionable = target.closest('button, a[href], [role=\"button\"], [role=\"menuitem\"]')\n if (actionable && popupRef.current?.contains(actionable)) {\n if (actionable.closest(`.${baseClass}__content`) !== popupRef.current) {\n return\n }\n // Don't close if clicking a nested popup's trigger — it will manage its own open state\n if (actionable.closest(`.${baseClass}__trigger-wrap`)) {\n return\n }\n closePopup()\n }\n })\n\n // /////////////////////////////////////\n // Effect: Setup/Teardown position and focus management\n // /////////////////////////////////////\n\n useEffect(() => {\n if (!active) {\n const popup = popupRef.current\n if (popup) {\n // Clear inline position styles so the CSS `top: -9999px` rule on\n // `.popup__hidden-content` takes effect. Without this, the inline\n // styles set during positioning would win over the CSS rule, keeping\n // portaled children (e.g. a ReactSelect menu) visually on-screen.\n popup.style.position = ''\n popup.style.top = ''\n popup.style.left = ''\n }\n return\n }\n\n const popup = popupRef.current\n if (!popup) {\n return\n }\n\n if (!popup.matches(':popover-open')) {\n popup.showPopover()\n }\n\n const menuItems = getMenuItems(popup)\n menuItems.forEach((item, index) => item.setAttribute('tabindex', index === 0 ? '0' : '-1'))\n\n // /////////////////////////////////////\n // Initial Position\n // Calculate and apply popup position.\n // getBoundingClientRect() forces synchronous layout.\n //\n // We call updatePosition() twice: once synchronously (so the popup\n // snaps to roughly the right place immediately rather than flashing\n // from -9999px) and once in a requestAnimationFrame, which fires\n // after the browser has finished laying out the newly-visible popup\n // content. The rAF call is the authoritative one — it catches cases\n // where the popup height wasn't stable yet during the first call\n // (e.g. ColumnSelection popup content rendering after hidden → visible\n // class switch), which was causing incorrect flip-to-top decisions.\n // /////////////////////////////////////\n\n updatePosition()\n const rafId = requestAnimationFrame(() => {\n updatePosition()\n })\n\n // /////////////////////////////////////\n // Focus Management\n // When opened via keyboard, autofocus the first focusable button.\n // When opened via mouse, skip autofocus to avoid unwanted highlights.\n // /////////////////////////////////////\n\n if (openedViaKeyboardRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready.\n requestAnimationFrame(() => {\n const firstFocusable = menuItems[0] ?? popup.querySelector<HTMLElement>(TABBABLE_SELECTOR)\n firstFocusable?.focus()\n })\n }\n\n // /////////////////////////////////////\n // Event Listeners\n // - resize/scroll: recalculate position (only applies styles if changed)\n // - mousedown: detect clicks outside to close\n // - keydown: handle keyboard navigation\n // /////////////////////////////////////\n\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n document.addEventListener('mousedown', handleClickOutside)\n popup.addEventListener('keydown', handleKeyDown)\n popup.addEventListener('click', handleActionableClick)\n\n return () => {\n cancelAnimationFrame(rafId)\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n document.removeEventListener('mousedown', handleClickOutside)\n popup.removeEventListener('keydown', handleKeyDown)\n popup.removeEventListener('click', handleActionableClick)\n if (popup.matches(':popover-open')) {\n popup.hidePopover()\n }\n }\n }, [active])\n\n useEffect(() => {\n if (forceOpen !== undefined) {\n setActive(forceOpen)\n }\n }, [forceOpen, setActive])\n\n const Trigger = (\n <PopupTrigger\n active={active}\n button={button}\n buttonAriaLabel={buttonAriaLabel}\n buttonType={buttonType}\n className={buttonClassName}\n contentId={contentId}\n disabled={disabled}\n isMenuItem={parentPopup?.popupRole === 'menu'}\n noBackground={noBackground}\n popupType={popupType}\n renderButton={renderButton}\n setActive={setActive}\n size={buttonSize}\n />\n )\n\n return (\n <div className={[baseClass, className].filter(Boolean).join(' ')} id={id} ref={containerRef}>\n <div className={`${baseClass}__trigger-wrap`} ref={triggerRef}>\n {showOnHover ? (\n <div\n className={`${baseClass}__on-hover-watch`}\n onMouseEnter={() => setActive(true)}\n onMouseLeave={() => setActive(false)}\n role=\"button\"\n tabIndex={0}\n >\n {Trigger}\n </div>\n ) : hoverSubmenu && isSubmenu ? (\n <div {...pointerIntent} className={`${baseClass}__submenu-hover-watch`}>\n {Trigger}\n </div>\n ) : (\n Trigger\n )}\n </div>\n\n <PopupContext value={{ closePopupChain, popupRef, popupRole, submenuScope }}>\n {/* The menu surface tracks pointer intent while preserving its menu semantics. */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <div\n aria-label={popupAriaLabel}\n className={\n active\n ? [\n `${baseClass}__content`,\n `${baseClass}--size-${size}`,\n resolvedSide\n ? `${baseClass}--side-${resolvedSide}`\n : isOnTop\n ? `${baseClass}--v-top`\n : `${baseClass}--v-bottom`,\n portalClassName,\n ]\n .filter(Boolean)\n .join(' ')\n : // Do not share any class names between active and disabled popups, to make sure\n // tests do not accidentally target inactive popups.\n `${baseClass}__hidden-content`\n }\n data-popup-id={id || undefined}\n data-theme={theme === 'auto' ? undefined : theme}\n id={contentId}\n onMouseEnter={pointerIntent.onMouseEnter}\n onMouseLeave={pointerIntent.onMouseLeave}\n popover=\"manual\"\n ref={popupRef}\n role={popupRole}\n >\n <div\n className={`${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`}\n >\n {theme === 'auto' ? (\n <>\n {render?.({ close })}\n {children}\n </>\n ) : (\n <ThemeProvider theme={theme}>\n {render?.({ close })}\n {children}\n </ThemeProvider>\n )}\n </div>\n {caret && !resolvedSide && <div className={`${baseCl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.js","names":["PopupList","React","createContext","use","useCallback","useEffect","useId","useLayoutEffect","useRef","useState","useEffectEvent","useModalFocus","ThemeProvider","PopupTrigger","createSubmenuScope","useSubmenuPointerIntent","baseClass","PopupContext","TABBABLE_SELECTOR","map","s","join","MENU_ITEM_SELECTOR","POPUP_CONTENT_SELECTOR","getMenuItems","popup","Array","from","querySelectorAll","filter","item","closest","Popup","props","id","button","buttonAriaLabel","buttonClassName","buttonSize","buttonType","caret","children","className","disabled","forceOpen","horizontalAlign","horizontalAlignProp","hoverSubmenu","initActive","noBackground","onToggleClose","onToggleOpen","popupAriaLabel","popupType","portalClassName","render","renderButton","showOnHover","showScrollbar","side","size","theme","verticalAlign","popupRef","containerRef","triggerRef","registerPopup","getTrigger","current","querySelector","container","generatedContentId","contentId","openedViaKeyboardRef","parentPopup","popupRole","undefined","submenuScope","isSubmenu","resolvedSide","active","setActiveInternal","isOnTop","setIsOnTop","setActive","isActive","viaKeyboard","coordinateParent","requestOpen","closeActiveBranch","release","closePopup","restoreFocus","trigger","requestAnimationFrame","focus","close","closePopupChain","options","openFromParent","closeFromPointer","hasFocus","contains","document","activeElement","pointerIntent","contentRef","enabled","onClose","onOpen","viaPointer","onSafeAreaExpire","x","y","target","elementFromPoint","parentContent","siblingId","getAttribute","submenuCallbacks","parentSubmenuScope","register","closeBranch","isPointerProtected","isProtected","open","updatePosition","triggerRect","getBoundingClientRect","popupRect","offset","sideOffset","top","left","caretLeft","scrollContainer","popupPaddingTop","Number","parseFloat","window","getComputedStyle","paddingTop","maxTop","innerHeight","height","Math","max","min","anchorRect","width","right","innerWidth","onTop","bottom","topIfAbove","triggerCenter","newTop","round","newLeft","newCaretLeft","newPosition","style","position","getPropertyValue","setProperty","updateSafeArea","handleClickOutside","e","isOutsidePopup","isOutsideTrigger","clickedPopupContent","isInsideChildPopup","handleKeyDown","activePopup","key","preventDefault","stopPropagation","nestedTrigger","dispatchEvent","KeyboardEvent","bubbles","shiftKey","setTimeout","includes","menuItems","length","currentIndex","findIndex","nextIndex","forEach","index","setAttribute","focusable","el","goBackward","handleActionableClick","actionable","matches","showPopover","rafId","firstFocusable","addEventListener","capture","passive","cancelAnimationFrame","removeEventListener","hidePopover","Trigger","_jsx","isMenuItem","_jsxs","Boolean","ref","onMouseEnter","onMouseLeave","role","tabIndex","triggerProps","value","contentProps","popover","_Fragment"],"sources":["../../../src/elements/Popup/index.tsx"],"sourcesContent":["'use client'\nimport type { AriaAttributes, AriaRole, CSSProperties } from 'react'\n\nexport * as PopupList from './PopupButtonList/index.js'\n\nimport React, {\n createContext,\n use,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react'\n\nimport { useEffectEvent } from '../../hooks/useEffectEvent.js'\nimport { useModalFocus } from '../../providers/ModalFocus/index.js'\nimport { ThemeProvider } from '../../providers/Theme/index.js'\nimport './index.css'\nimport { type PopupButtonRenderProps, PopupTrigger } from './PopupTrigger/index.js'\nimport { createSubmenuScope, type SubmenuScope } from './SubmenuScope.js'\nimport { useSubmenuPointerIntent } from './useSubmenuPointerIntent.js'\n\nconst baseClass = 'popup'\n\ntype PopupContextValue = {\n closePopupChain: (options?: { restoreFocus?: boolean }) => void\n popupRef: React.RefObject<HTMLDivElement | null>\n popupRole?: AriaRole\n submenuScope: SubmenuScope\n}\n\nconst PopupContext = createContext<null | PopupContextValue>(null)\n\n/**\n * Selector for all elements the browser considers tabbable.\n */\nconst TABBABLE_SELECTOR = [\n 'a[href]',\n 'button:not(:disabled)',\n 'input:not(:disabled):not([type=\"hidden\"])',\n 'select:not(:disabled)',\n 'textarea:not(:disabled)',\n '[tabindex]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n 'audio[controls]',\n 'video[controls]',\n 'summary',\n]\n .map((s) => `${s}:not([tabindex=\"-1\"])`)\n .join(', ')\n\nconst MENU_ITEM_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]'\nconst POPUP_CONTENT_SELECTOR = `.${baseClass}__content, .${baseClass}__hidden-content`\n\nconst getMenuItems = (popup: HTMLElement): HTMLElement[] =>\n Array.from(popup.querySelectorAll<HTMLElement>(MENU_ITEM_SELECTOR)).filter(\n (item) => item.closest(POPUP_CONTENT_SELECTOR) === popup,\n )\n\nexport type PopupProps = {\n backgroundColor?: CSSProperties['backgroundColor']\n boundingRef?: React.RefObject<HTMLElement>\n button?: React.ReactNode\n buttonAriaLabel?: string\n buttonClassName?: string\n buttonSize?: 'large' | 'medium'\n buttonType?: 'custom' | 'default'\n caret?: boolean\n children?: React.ReactNode\n className?: string\n disabled?: boolean\n forceOpen?: boolean\n /**\n * Preferred horizontal alignment of the popup, if there is enough space available.\n * Nested menu popups use 'left' and 'right' as their preferred side instead.\n * When omitted, nested menu popups prefer the right side.\n *\n * @default 'left'\n */\n horizontalAlign?: 'center' | 'left' | 'right'\n hoverSubmenu?: boolean\n id?: string\n initActive?: boolean\n noBackground?: boolean\n onToggleClose?: () => void\n onToggleOpen?: (active: boolean) => void\n popupAriaLabel?: string\n popupType?: AriaAttributes['aria-haspopup']\n portalClassName?: string\n render?: (args: { close: () => void }) => React.ReactNode\n /**\n * Render prop for custom trigger button. Receives onClick/onKeyDown/aria props.\n * When provided, `button` and `buttonType` are ignored.\n */\n renderButton?: (props: PopupButtonRenderProps) => React.ReactNode\n showOnHover?: boolean\n /**\n * By default, the scrollbar is hidden. If you want to show it, set this to true.\n * In both cases, the container is still scrollable.\n *\n * @default false\n */\n showScrollbar?: boolean\n /**\n * Position the popup to the side of the trigger instead of above/below.\n * The popup's top edge aligns with the trigger's top edge (with viewport clamping).\n * Automatically flips to the opposite side if there is not enough space.\n * When set, `verticalAlign`, `horizontalAlign`, and the caret are ignored.\n */\n side?: 'left' | 'right'\n size?: 'fit-content' | 'large' | 'small'\n /**\n * Theme for the popup content. Defaults to 'dark'.\n * Set to 'auto' to inherit the current theme.\n *\n * @default 'dark'\n */\n theme?: 'auto' | 'dark' | 'light'\n /**\n * Preferred vertical alignment of the popup (position below or above the trigger),\n * if there is enough space available.\n *\n * If the popup is too close to the edge of the viewport, it will flip to the opposite side\n * regardless of the preferred vertical alignment.\n *\n * @default 'bottom'\n */\n verticalAlign?: 'bottom' | 'top'\n}\n\n/**\n * Component that renders a popup, as well as a button that triggers the popup.\n *\n * The popup is rendered next to its trigger in the DOM and positioned above / below it,\n * depending on the verticalAlign prop and the space available.\n */\nexport const Popup: React.FC<PopupProps> = (props) => {\n const {\n id,\n button,\n buttonAriaLabel,\n buttonClassName,\n buttonSize,\n buttonType = 'default',\n caret = true,\n children,\n className,\n disabled,\n forceOpen,\n horizontalAlign: horizontalAlignProp,\n hoverSubmenu = false,\n initActive = false,\n noBackground,\n onToggleClose,\n onToggleOpen,\n popupAriaLabel,\n popupType,\n portalClassName,\n render,\n renderButton,\n showOnHover = false,\n showScrollbar = false,\n side,\n size = 'fit-content',\n theme = 'dark',\n verticalAlign = 'bottom',\n } = props\n\n const popupRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const triggerRef = useRef<HTMLDivElement>(null)\n const { registerPopup } = useModalFocus()\n const getTrigger = useCallback(\n () => triggerRef.current?.querySelector<HTMLElement>('button, [tabindex=\"0\"]') ?? null,\n [],\n )\n\n useLayoutEffect(() => {\n const container = containerRef.current\n\n if (container) {\n return registerPopup({ container, getTrigger })\n }\n }, [getTrigger, registerPopup])\n const generatedContentId = useId()\n const contentId = `${id || generatedContentId}-content`\n\n /**\n * Keeps track of whether the popup was opened via keyboard.\n * This is used to determine whether to autofocus the first element in the popup.\n * If the popup was opened via mouse, we do not want to autofocus the first element.\n */\n const openedViaKeyboardRef = useRef(false)\n\n const parentPopup = use(PopupContext)\n const popupRole = (popupType === true ? 'menu' : popupType || undefined) as AriaRole | undefined\n const submenuScope = useState(() => createSubmenuScope())[0]\n const isSubmenu = parentPopup?.popupRole === 'menu' && popupRole === 'menu'\n const horizontalAlign = horizontalAlignProp ?? 'left'\n const resolvedSide =\n side ?? (isSubmenu ? (horizontalAlignProp === 'left' ? 'left' : 'right') : undefined)\n\n const [active, setActiveInternal] = useState(initActive)\n const [isOnTop, setIsOnTop] = useState(verticalAlign === 'top')\n\n const setActive = useCallback(\n (isActive: boolean, viaKeyboard = false, coordinateParent = true) => {\n if (isActive) {\n openedViaKeyboardRef.current = viaKeyboard\n if (coordinateParent && isSubmenu) {\n parentPopup.submenuScope.requestOpen({\n id: contentId,\n viaKeyboard,\n })\n return\n }\n onToggleOpen?.(true)\n } else {\n onToggleClose?.()\n submenuScope.closeActiveBranch()\n parentPopup?.submenuScope.release(contentId)\n }\n setActiveInternal(isActive)\n },\n [contentId, isSubmenu, onToggleClose, onToggleOpen, parentPopup, submenuScope],\n )\n\n const closePopup = useCallback(\n ({ restoreFocus = true }: { restoreFocus?: boolean } = {}) => {\n const trigger = getTrigger()\n\n setActive(false)\n if (restoreFocus) {\n requestAnimationFrame(() => trigger?.focus())\n }\n },\n [getTrigger, setActive],\n )\n const close = useCallback(() => closePopup(), [closePopup])\n const closePopupChain = useCallback(\n (options: { restoreFocus?: boolean } = {}) => {\n if (parentPopup) {\n closePopup({ restoreFocus: false })\n parentPopup.closePopupChain(options)\n return\n }\n\n closePopup(options)\n },\n [closePopup, parentPopup],\n )\n\n const openFromParent = useCallback(\n (viaKeyboard: boolean) => setActive(true, viaKeyboard, false),\n [setActive],\n )\n\n const closeFromPointer = useCallback(() => {\n const hasFocus = popupRef.current?.contains(document.activeElement)\n const trigger = triggerRef.current?.querySelector<HTMLElement>('[aria-haspopup=\"menu\"]')\n\n closePopup({ restoreFocus: false })\n if (hasFocus) {\n trigger?.focus()\n }\n }, [closePopup])\n\n const pointerIntent = useSubmenuPointerIntent({\n active,\n contentRef: popupRef,\n enabled: isSubmenu && hoverSubmenu,\n onClose: closeFromPointer,\n onOpen: () =>\n parentPopup?.submenuScope.requestOpen({\n id: contentId,\n viaPointer: true,\n }),\n onSafeAreaExpire: ({ x, y }) => {\n const target = document.elementFromPoint(x, y)\n const parentContent = parentPopup?.popupRef.current\n\n if (parentContent && target?.closest(POPUP_CONTENT_SELECTOR) === parentContent) {\n const trigger = target\n .closest('.popup__submenu-hover-watch')\n ?.querySelector<HTMLElement>('[aria-haspopup=\"menu\"][aria-controls]')\n const siblingId = trigger?.getAttribute('aria-controls')\n\n if (siblingId && trigger?.getAttribute('aria-disabled') !== 'true') {\n parentPopup?.submenuScope.requestOpen({ id: siblingId })\n return\n }\n }\n\n closeFromPointer()\n },\n triggerRef,\n })\n\n const submenuCallbacks = useRef({ closeFromPointer, openFromParent })\n const parentSubmenuScope = parentPopup?.submenuScope\n\n useEffect(() => {\n submenuCallbacks.current = { closeFromPointer, openFromParent }\n }, [closeFromPointer, openFromParent])\n\n useEffect(() => {\n if (!isSubmenu || !parentSubmenuScope) {\n return\n }\n\n return parentSubmenuScope.register({\n id: contentId,\n closeBranch: () => submenuCallbacks.current.closeFromPointer(),\n isPointerProtected: pointerIntent.isProtected,\n open: (viaKeyboard) => submenuCallbacks.current.openFromParent(viaKeyboard),\n })\n }, [contentId, isSubmenu, parentSubmenuScope, pointerIntent.isProtected])\n\n // /////////////////////////////////////\n // Position Calculation\n //\n // Calculates and applies popup position relative to trigger.\n // Always checks viewport bounds (for flipping), but only updates\n // styles if the calculated position differs from current position.\n // /////////////////////////////////////\n\n const updatePosition = useEffectEvent(() => {\n const trigger = triggerRef.current\n const popup = popupRef.current\n if (!trigger || !popup) {\n return\n }\n\n const triggerRect = trigger.getBoundingClientRect()\n const popupRect = popup.getBoundingClientRect()\n\n // Gap between the popup and the trigger/viewport edges (in pixels)\n const offset = 8\n // Additional gap used in side mode so the child popup has breathing room from its parent\n const sideOffset = 4\n\n let top: number\n let left: number\n let caretLeft: number\n\n if (resolvedSide) {\n // /////////////////////////////////////\n // Side Positioning\n // Places the popup to the left or right of the parent popup (not just the trigger),\n // top-aligned with the trigger. Flips to the opposite side if there is not enough\n // viewport space.\n // /////////////////////////////////////\n\n const scrollContainer = popup.querySelector<HTMLElement>(\n `:scope > .${baseClass}__scroll-container`,\n )\n const popupPaddingTop = scrollContainer\n ? Number.parseFloat(window.getComputedStyle(scrollContainer).paddingTop) || 0\n : 0\n\n // Align the first menu item with the trigger by accounting for the popup's top padding.\n top = triggerRect.top - popupPaddingTop\n const maxTop = window.innerHeight - popupRect.height - offset\n top = Math.max(offset, Math.min(top, maxTop))\n\n // Use the parent popup's bounding rect as the reference for left/right positioning\n // so the child appears 4px from the parent popup edge, not just the trigger button.\n const anchorRect = parentPopup?.popupRef.current\n ? parentPopup.popupRef.current.getBoundingClientRect()\n : triggerRect\n\n if (resolvedSide === 'left') {\n left = anchorRect.left - popupRect.width - sideOffset\n if (left < offset) {\n // flip to right side\n left = anchorRect.right + sideOffset\n }\n } else {\n left = anchorRect.right + sideOffset\n if (left + popupRect.width + offset > window.innerWidth) {\n // flip to left side\n left = anchorRect.left - popupRect.width - sideOffset\n }\n }\n\n left = Math.max(\n offset,\n Math.min(left, Math.max(offset, window.innerWidth - popupRect.width - offset)),\n )\n\n // Caret not used in side mode; set a neutral value\n caretLeft = popupRect.width / 2\n\n setIsOnTop(false)\n } else {\n // /////////////////////////////////////\n // Vertical Positioning\n // Calculates the `top` position in absolute page coordinates.\n // Uses `verticalAlign` prop as the preferred direction, but flips\n // to the opposite side if there's not enough viewport space.\n // /////////////////////////////////////\n\n let onTop = verticalAlign === 'top'\n\n if (verticalAlign === 'bottom') {\n top = triggerRect.bottom + offset\n\n if (triggerRect.bottom + popupRect.height + offset > window.innerHeight) {\n // Try to flip above — only do so if there's actually enough room\n const topIfAbove = triggerRect.top - popupRect.height - offset\n if (topIfAbove >= 0) {\n top = topIfAbove\n onTop = true\n }\n // else: not enough room above either — keep below and let it overflow rather than going off-screen\n }\n } else {\n top = triggerRect.top - popupRect.height - offset\n\n if (triggerRect.top - popupRect.height - offset < 0) {\n top = triggerRect.bottom + offset\n onTop = false\n }\n }\n\n const maxTop = Math.max(offset, window.innerHeight - popupRect.height - offset)\n top = Math.max(offset, Math.min(top, maxTop))\n\n setIsOnTop(onTop)\n\n // /////////////////////////////////////\n // Horizontal Positioning\n // Calculates the `left` position based on `horizontalAlign` prop:\n // - 'left': aligns popup's left edge with trigger's left edge\n // - 'right': aligns popup's right edge with trigger's right edge\n // - 'center': centers popup horizontally relative to trigger\n // Then clamps to keep the popup within viewport bounds.\n // /////////////////////////////////////\n\n left =\n horizontalAlign === 'right'\n ? triggerRect.right - popupRect.width\n : horizontalAlign === 'center'\n ? triggerRect.left + triggerRect.width / 2 - popupRect.width / 2\n : triggerRect.left\n\n left = Math.max(offset, Math.min(left, window.innerWidth - popupRect.width - offset))\n\n // /////////////////////////////////////\n // Caret Positioning\n // Positions the caret arrow to point at the trigger's horizontal center.\n // Clamps between 12px from edges to prevent caret from overflowing the popup.\n // /////////////////////////////////////\n\n const triggerCenter = triggerRect.left + triggerRect.width / 2\n caretLeft = Math.max(12, Math.min(triggerCenter - left, popupRect.width - 12))\n }\n\n // /////////////////////////////////////\n // Apply Styles (only if changed)\n // Compares calculated position with current styles to avoid unnecessary\n // DOM updates during scroll. This prevents visual lag by relying on the absolute\n // positioning where possible (popup slightly lags behind when scrolling really fast),\n // while still allowing position changes when needed (e.g., sticky parent, viewport flip).\n // Values are rounded to match browser's CSS precision and avoid false updates.\n // /////////////////////////////////////\n\n const newTop = `${Math.round(top)}px`\n const newLeft = `${Math.round(left)}px`\n const newCaretLeft = `${Math.round(caretLeft)}px`\n const newPosition = 'fixed'\n\n if (popup.style.position !== newPosition) {\n popup.style.position = newPosition\n }\n if (popup.style.top !== newTop) {\n popup.style.top = newTop\n }\n if (popup.style.left !== newLeft) {\n popup.style.left = newLeft\n }\n if (popup.style.getPropertyValue('--caret-left') !== newCaretLeft) {\n popup.style.setProperty('--caret-left', newCaretLeft)\n }\n pointerIntent.updateSafeArea()\n })\n\n // /////////////////////////////////////\n // Click Outside Handler\n // Closes popup when clicking outside both the popup and trigger.\n // Distinguishes between parent and child popups:\n // - Click in child popup: parent stays open\n // - Click in parent popup: child closes\n // /////////////////////////////////////\n\n const handleClickOutside = useEffectEvent((e: MouseEvent) => {\n const target = e.target as Node\n const isOutsidePopup = !popupRef.current?.contains(target)\n const isOutsideTrigger = !triggerRef.current?.contains(target)\n\n // Check if click is inside a popup portal\n const clickedPopupContent = (target as Element).closest?.('.popup__content')\n\n // If the clicked popup contains this popup's trigger, it's a parent popup\n // and we should close. If it doesn't contain our trigger, it's a child popup\n // and we should stay open to avoid closing parent when interacting with child.\n const isInsideChildPopup =\n clickedPopupContent && !clickedPopupContent.contains(triggerRef.current)\n\n if (isOutsidePopup && isOutsideTrigger && !isInsideChildPopup) {\n setActive(false)\n }\n })\n\n // /////////////////////////////////////\n // Keyboard Navigation\n // Handles keyboard interactions when popup is open:\n // - Escape: closes popup and returns focus to trigger\n // - Tab/Shift+Tab: closes menus; dialogs retain normal document tab order\n // - ArrowUp/ArrowDown: moves between menu items with wrapping\n // Focus is managed manually to support elements the browser might skip.\n // /////////////////////////////////////\n\n const handleKeyDown = useEffectEvent((e: KeyboardEvent) => {\n const popup = popupRef.current\n if (!popup || !active) {\n return\n }\n\n const activePopup = document.activeElement?.closest(`.${baseClass}__content`)\n if (activePopup && activePopup !== popup) {\n return\n }\n\n if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n closePopup()\n return\n }\n\n if (e.key === 'ArrowRight' && popupRole === 'menu') {\n const trigger = (document.activeElement as HTMLElement | null)?.closest<HTMLElement>(\n `.${baseClass}__trigger-wrap`,\n )\n const nestedTrigger = trigger?.querySelector<HTMLElement>('button, [role=\"menuitem\"]')\n if (nestedTrigger) {\n e.preventDefault()\n nestedTrigger.dispatchEvent(new KeyboardEvent('keydown', { bubbles: true, key: 'Enter' }))\n return\n }\n }\n\n if (e.key === 'ArrowLeft' && parentPopup) {\n e.preventDefault()\n closePopup()\n return\n }\n\n if (e.key === 'Tab' && popupRole === 'menu') {\n if (e.shiftKey) {\n e.preventDefault()\n closePopupChain({ restoreFocus: true })\n return\n }\n\n setTimeout(closePopupChain)\n return\n }\n\n if (['ArrowDown', 'ArrowUp', 'End', 'Home'].includes(e.key)) {\n const menuItems = getMenuItems(popup)\n if (menuItems.length > 0) {\n e.preventDefault()\n\n const currentIndex = menuItems.findIndex((item) => item === document.activeElement)\n const nextIndex =\n e.key === 'Home'\n ? 0\n : e.key === 'End'\n ? menuItems.length - 1\n : e.key === 'ArrowUp'\n ? currentIndex <= 0\n ? menuItems.length - 1\n : currentIndex - 1\n : currentIndex === -1 || currentIndex === menuItems.length - 1\n ? 0\n : currentIndex + 1\n\n menuItems.forEach((item, index) =>\n item.setAttribute('tabindex', index === nextIndex ? '0' : '-1'),\n )\n menuItems[nextIndex].focus()\n return\n }\n }\n\n if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n const focusable = Array.from(popup.querySelectorAll<HTMLElement>(TABBABLE_SELECTOR))\n if (focusable.length === 0) {\n return\n }\n\n e.preventDefault()\n\n const currentIndex = focusable.findIndex((el) => el === document.activeElement)\n const goBackward = e.key === 'ArrowUp'\n\n let nextIndex: number\n if (currentIndex === -1) {\n nextIndex = goBackward ? focusable.length - 1 : 0\n } else if (goBackward) {\n nextIndex = currentIndex === 0 ? focusable.length - 1 : currentIndex - 1\n } else {\n nextIndex = currentIndex === focusable.length - 1 ? 0 : currentIndex + 1\n }\n\n focusable[nextIndex].focus()\n }\n })\n\n // /////////////////////////////////////\n // Click Handler for Actionable Elements\n // Closes popup when buttons/links inside are clicked (includes Enter/Space activation).\n // /////////////////////////////////////\n\n const handleActionableClick = useEffectEvent((e: MouseEvent) => {\n const target = e.target as HTMLElement\n\n // Allow opting out with data-popup-prevent-close attribute on element or ancestor\n if (target.closest('[data-popup-prevent-close]')) {\n return\n }\n\n // Check if the clicked element or any ancestor is an actionable element\n const actionable = target.closest('button, a[href], [role=\"button\"], [role=\"menuitem\"]')\n if (actionable && popupRef.current?.contains(actionable)) {\n if (actionable.closest(`.${baseClass}__content`) !== popupRef.current) {\n return\n }\n // Don't close if clicking a nested popup's trigger — it will manage its own open state\n if (actionable.closest(`.${baseClass}__trigger-wrap`)) {\n return\n }\n closePopup()\n }\n })\n\n // /////////////////////////////////////\n // Effect: Setup/Teardown position and focus management\n // /////////////////////////////////////\n\n useEffect(() => {\n if (!active) {\n const popup = popupRef.current\n if (popup) {\n // Clear inline position styles so the CSS `top: -9999px` rule on\n // `.popup__hidden-content` takes effect. Without this, the inline\n // styles set during positioning would win over the CSS rule, keeping\n // portaled children (e.g. a ReactSelect menu) visually on-screen.\n popup.style.position = ''\n popup.style.top = ''\n popup.style.left = ''\n }\n return\n }\n\n const popup = popupRef.current\n if (!popup) {\n return\n }\n\n if (!popup.matches(':popover-open')) {\n popup.showPopover()\n }\n\n const menuItems = getMenuItems(popup)\n menuItems.forEach((item, index) => item.setAttribute('tabindex', index === 0 ? '0' : '-1'))\n\n // /////////////////////////////////////\n // Initial Position\n // Calculate and apply popup position.\n // getBoundingClientRect() forces synchronous layout.\n //\n // We call updatePosition() twice: once synchronously (so the popup\n // snaps to roughly the right place immediately rather than flashing\n // from -9999px) and once in a requestAnimationFrame, which fires\n // after the browser has finished laying out the newly-visible popup\n // content. The rAF call is the authoritative one — it catches cases\n // where the popup height wasn't stable yet during the first call\n // (e.g. ColumnSelection popup content rendering after hidden → visible\n // class switch), which was causing incorrect flip-to-top decisions.\n // /////////////////////////////////////\n\n updatePosition()\n const rafId = requestAnimationFrame(() => {\n updatePosition()\n })\n\n // /////////////////////////////////////\n // Focus Management\n // When opened via keyboard, autofocus the first focusable button.\n // When opened via mouse, skip autofocus to avoid unwanted highlights.\n // /////////////////////////////////////\n\n if (openedViaKeyboardRef.current) {\n // Use requestAnimationFrame to ensure DOM is ready.\n requestAnimationFrame(() => {\n const firstFocusable = menuItems[0] ?? popup.querySelector<HTMLElement>(TABBABLE_SELECTOR)\n firstFocusable?.focus()\n })\n }\n\n // /////////////////////////////////////\n // Event Listeners\n // - resize/scroll: recalculate position (only applies styles if changed)\n // - mousedown: detect clicks outside to close\n // - keydown: handle keyboard navigation\n // /////////////////////////////////////\n\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n document.addEventListener('mousedown', handleClickOutside)\n popup.addEventListener('keydown', handleKeyDown)\n popup.addEventListener('click', handleActionableClick)\n\n return () => {\n cancelAnimationFrame(rafId)\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n document.removeEventListener('mousedown', handleClickOutside)\n popup.removeEventListener('keydown', handleKeyDown)\n popup.removeEventListener('click', handleActionableClick)\n if (popup.matches(':popover-open')) {\n popup.hidePopover()\n }\n }\n }, [active])\n\n useEffect(() => {\n if (forceOpen !== undefined) {\n setActive(forceOpen)\n }\n }, [forceOpen, setActive])\n\n const Trigger = (\n <PopupTrigger\n active={active}\n button={button}\n buttonAriaLabel={buttonAriaLabel}\n buttonType={buttonType}\n className={buttonClassName}\n contentId={contentId}\n disabled={disabled}\n isMenuItem={parentPopup?.popupRole === 'menu'}\n noBackground={noBackground}\n popupType={popupType}\n renderButton={renderButton}\n setActive={setActive}\n size={buttonSize}\n />\n )\n\n return (\n <div className={[baseClass, className].filter(Boolean).join(' ')} id={id} ref={containerRef}>\n <div className={`${baseClass}__trigger-wrap`} ref={triggerRef}>\n {showOnHover ? (\n <div\n className={`${baseClass}__on-hover-watch`}\n onMouseEnter={() => setActive(true)}\n onMouseLeave={() => setActive(false)}\n role=\"button\"\n tabIndex={0}\n >\n {Trigger}\n </div>\n ) : hoverSubmenu && isSubmenu ? (\n <div {...pointerIntent.triggerProps} className={`${baseClass}__submenu-hover-watch`}>\n {Trigger}\n </div>\n ) : (\n Trigger\n )}\n </div>\n\n <PopupContext value={{ closePopupChain, popupRef, popupRole, submenuScope }}>\n <div\n {...pointerIntent.contentProps}\n aria-label={popupAriaLabel}\n className={\n active\n ? [\n `${baseClass}__content`,\n `${baseClass}--size-${size}`,\n resolvedSide\n ? `${baseClass}--side-${resolvedSide}`\n : isOnTop\n ? `${baseClass}--v-top`\n : `${baseClass}--v-bottom`,\n portalClassName,\n ]\n .filter(Boolean)\n .join(' ')\n : // Do not share any class names between active and disabled popups, to make sure\n // tests do not accidentally target inactive popups.\n `${baseClass}__hidden-content`\n }\n data-popup-id={id || undefined}\n data-theme={theme === 'auto' ? undefined : theme}\n id={contentId}\n popover=\"manual\"\n ref={popupRef}\n role={popupRole}\n >\n <div\n className={`${baseClass}__scroll-container${showScrollbar ? ` ${baseClass}__scroll-container--show-scrollbar` : ''}`}\n >\n {theme === 'auto' ? (\n <>\n {render?.({ close })}\n {children}\n </>\n ) : (\n <ThemeProvider theme={theme}>\n {render?.({ close })}\n {children}\n </ThemeProvider>\n )}\n </div>\n {caret && !resolvedSide && <div className={`${baseClass}__caret`} />}\n </div>\n </PopupContext>\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,OAAO,KAAKA,SAAS,MAAM;AAE3B,OAAOC,KAAA,IACLC,aAAa,EACbC,GAAG,EACHC,WAAW,EACXC,SAAS,EACTC,KAAK,EACLC,eAAe,EACfC,MAAM,EACNC,QAAQ,QACH;AAEP,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,QAAQ;AAC9B,SAASC,aAAa,QAAQ;AAC9B,OAAO;AACP,SAAsCC,YAAY,QAAQ;AAC1D,SAASC,kBAAkB,QAA2B;AACtD,SAASC,uBAAuB,QAAQ;AAExC,MAAMC,SAAA,GAAY;AASlB,MAAMC,YAAA,gBAAef,aAAA,CAAwC;AAE7D;;;AAGA,MAAMgB,iBAAA,GAAoB,CACxB,WACA,yBACA,6CACA,yBACA,2BACA,cACA,oDACA,mBACA,mBACA,UACD,CACEC,GAAG,CAAEC,CAAA,IAAM,GAAGA,CAAA,uBAAwB,EACtCC,IAAI,CAAC;AAER,MAAMC,kBAAA,GAAqB;AAC3B,MAAMC,sBAAA,GAAyB,IAAIP,SAAA,eAAwBA,SAAA,kBAA2B;AAEtF,MAAMQ,YAAA,GAAgBC,KAAA,IACpBC,KAAA,CAAMC,IAA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AAC;UACCtK,SAAA,EAAW,GAAG1B,SAAA,qBAA8B0C,aAAA,GAAgB,IAAI1C,SAAA,oCAA6C,GAAG,IAAI;oBAEnH6C,KAAA,KAAU,sBACTqJ,KAAA,CAAAW,SAAA;uBACGtK,MAAA,GAAS;cAAEyC;YAAM,IACjBvD,QAAA;4BAGHyK,KAAA,CAACtM,aAAA;YAAciD,KAAA,EAAOA,KAAA;uBACnBN,MAAA,GAAS;cAAEyC;YAAM,IACjBvD,QAAA;;YAIND,KAAA,IAAS,CAACuC,YAAA,iBAAgBiI,IAAA,CAAC;UAAItK,SAAA,EAAW,GAAG1B,SAAA;;;;;AAKxD","ignoreList":[]}
|
|
@@ -1,13 +1,25 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PointerEvent, RefObject } from 'react';
|
|
2
|
+
import type { PointerPosition } from '../../hooks/usePointerSafeArea.js';
|
|
2
3
|
type UseSubmenuPointerIntentArgs = {
|
|
4
|
+
active: boolean;
|
|
3
5
|
contentRef: RefObject<HTMLElement | null>;
|
|
4
6
|
enabled: boolean;
|
|
5
7
|
onClose: () => void;
|
|
6
8
|
onOpen: () => void;
|
|
9
|
+
onSafeAreaExpire: (pointer: PointerPosition) => void;
|
|
10
|
+
triggerRef: RefObject<HTMLElement | null>;
|
|
7
11
|
};
|
|
8
|
-
export declare const useSubmenuPointerIntent: ({ contentRef, enabled, onClose, onOpen, }: UseSubmenuPointerIntentArgs) => {
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
export declare const useSubmenuPointerIntent: ({ active, contentRef, enabled, onClose, onOpen, onSafeAreaExpire, triggerRef, }: UseSubmenuPointerIntentArgs) => {
|
|
13
|
+
contentProps: {
|
|
14
|
+
onPointerEnter: (event: PointerEvent) => void;
|
|
15
|
+
onPointerLeave: (event: PointerEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
isProtected: () => boolean;
|
|
18
|
+
triggerProps: {
|
|
19
|
+
onPointerEnter: (event: PointerEvent) => void;
|
|
20
|
+
onPointerLeave: (event: PointerEvent) => void;
|
|
21
|
+
};
|
|
22
|
+
updateSafeArea: () => boolean;
|
|
11
23
|
};
|
|
12
24
|
export {};
|
|
13
25
|
//# sourceMappingURL=useSubmenuPointerIntent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSubmenuPointerIntent.d.ts","sourceRoot":"","sources":["../../../src/elements/Popup/useSubmenuPointerIntent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"useSubmenuPointerIntent.d.ts","sourceRoot":"","sources":["../../../src/elements/Popup/useSubmenuPointerIntent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAA;AAIxE,KAAK,2BAA2B,GAAG;IACjC,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;IACzC,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,gBAAgB,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAA;IACpD,UAAU,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAA;CAC1C,CAAA;AAED,eAAO,MAAM,uBAAuB,oFAQjC,2BAA2B;IAuD1B,YAAY;QACV,cAAc,UA/BU,YAAY;QAgCpC,cAAc,UAlBU,YAAY;;IAoBtC,WAAW;IACX,YAAY;QACV,cAAc;QACd,cAAc;;IAEhB,cAAc;CAEjB,CAAA"}
|
|
@@ -1,42 +1,83 @@
|
|
|
1
|
-
import { useCallback
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { usePointerSafeArea } from '../../hooks/usePointerSafeArea.js';
|
|
2
3
|
export const useSubmenuPointerIntent = ({
|
|
4
|
+
active,
|
|
3
5
|
contentRef,
|
|
4
6
|
enabled,
|
|
5
7
|
onClose,
|
|
6
|
-
onOpen
|
|
8
|
+
onOpen,
|
|
9
|
+
onSafeAreaExpire,
|
|
10
|
+
triggerRef
|
|
7
11
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
const renderSafeArea = useCallback(({
|
|
13
|
+
polygon
|
|
14
|
+
}) => {
|
|
15
|
+
const content = contentRef.current;
|
|
16
|
+
if (polygon) {
|
|
17
|
+
content?.style.setProperty('--popup-safe-area', polygon);
|
|
18
|
+
content?.setAttribute('data-submenu-safe-area', '');
|
|
19
|
+
} else {
|
|
20
|
+
content?.style.removeProperty('--popup-safe-area');
|
|
21
|
+
content?.removeAttribute('data-submenu-safe-area');
|
|
22
|
+
}
|
|
23
|
+
}, [contentRef]);
|
|
24
|
+
const safeArea = usePointerSafeArea({
|
|
25
|
+
enabled: enabled && active,
|
|
26
|
+
from: triggerRef,
|
|
27
|
+
onChange: renderSafeArea,
|
|
28
|
+
onRelease: onSafeAreaExpire,
|
|
29
|
+
to: contentRef
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
clear,
|
|
33
|
+
protect,
|
|
34
|
+
trackSource,
|
|
35
|
+
trackTarget
|
|
36
|
+
} = safeArea;
|
|
37
|
+
const handleEnter = event => {
|
|
38
|
+
if (event.pointerType !== 'mouse') {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const pointer = {
|
|
42
|
+
x: event.clientX,
|
|
43
|
+
y: event.clientY
|
|
44
|
+
};
|
|
45
|
+
if (event.currentTarget === contentRef.current) {
|
|
46
|
+
trackTarget(pointer);
|
|
47
|
+
} else {
|
|
48
|
+
trackSource(pointer);
|
|
49
|
+
onOpen();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const handleLeave = event => {
|
|
53
|
+
if (event.pointerType !== 'mouse' || !active || !safeArea.isTracking()) {
|
|
54
|
+
return;
|
|
13
55
|
}
|
|
14
|
-
}, []);
|
|
15
|
-
const handleEnter = useCallback(() => {
|
|
16
|
-
cancelClose();
|
|
17
|
-
onOpen();
|
|
18
|
-
}, [cancelClose, onOpen]);
|
|
19
|
-
const handleLeave = useCallback(event => {
|
|
20
56
|
const target = event.relatedTarget;
|
|
21
|
-
if (target && contentRef.current?.contains(target)) {
|
|
22
|
-
cancelClose();
|
|
57
|
+
if (target && (contentRef.current?.contains(target) || triggerRef.current?.contains(target))) {
|
|
23
58
|
return;
|
|
24
59
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
60
|
+
if (!protect({
|
|
61
|
+
pointer: {
|
|
62
|
+
x: event.clientX,
|
|
63
|
+
y: event.clientY
|
|
64
|
+
}
|
|
65
|
+
})) {
|
|
66
|
+
clear();
|
|
28
67
|
onClose();
|
|
29
|
-
}, 250);
|
|
30
|
-
}, [cancelClose, contentRef, onClose]);
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
if (!enabled) {
|
|
33
|
-
cancelClose();
|
|
34
68
|
}
|
|
35
|
-
|
|
36
|
-
}, [cancelClose, enabled]);
|
|
69
|
+
};
|
|
37
70
|
return {
|
|
38
|
-
|
|
39
|
-
|
|
71
|
+
contentProps: {
|
|
72
|
+
onPointerEnter: enabled ? handleEnter : undefined,
|
|
73
|
+
onPointerLeave: enabled ? handleLeave : undefined
|
|
74
|
+
},
|
|
75
|
+
isProtected: safeArea.isProtected,
|
|
76
|
+
triggerProps: {
|
|
77
|
+
onPointerEnter: enabled ? handleEnter : undefined,
|
|
78
|
+
onPointerLeave: enabled ? handleLeave : undefined
|
|
79
|
+
},
|
|
80
|
+
updateSafeArea: safeArea.refresh
|
|
40
81
|
};
|
|
41
82
|
};
|
|
42
83
|
//# sourceMappingURL=useSubmenuPointerIntent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSubmenuPointerIntent.js","names":["useCallback","
|
|
1
|
+
{"version":3,"file":"useSubmenuPointerIntent.js","names":["useCallback","usePointerSafeArea","useSubmenuPointerIntent","active","contentRef","enabled","onClose","onOpen","onSafeAreaExpire","triggerRef","renderSafeArea","polygon","content","current","style","setProperty","setAttribute","removeProperty","removeAttribute","safeArea","from","onChange","onRelease","to","clear","protect","trackSource","trackTarget","handleEnter","event","pointerType","pointer","x","clientX","y","clientY","currentTarget","handleLeave","isTracking","target","relatedTarget","contains","contentProps","onPointerEnter","undefined","onPointerLeave","isProtected","triggerProps","updateSafeArea","refresh"],"sources":["../../../src/elements/Popup/useSubmenuPointerIntent.ts"],"sourcesContent":["import type { PointerEvent, RefObject } from 'react'\n\nimport { useCallback } from 'react'\n\nimport type { PointerPosition } from '../../hooks/usePointerSafeArea.js'\n\nimport { usePointerSafeArea } from '../../hooks/usePointerSafeArea.js'\n\ntype UseSubmenuPointerIntentArgs = {\n active: boolean\n contentRef: RefObject<HTMLElement | null>\n enabled: boolean\n onClose: () => void\n onOpen: () => void\n onSafeAreaExpire: (pointer: PointerPosition) => void\n triggerRef: RefObject<HTMLElement | null>\n}\n\nexport const useSubmenuPointerIntent = ({\n active,\n contentRef,\n enabled,\n onClose,\n onOpen,\n onSafeAreaExpire,\n triggerRef,\n}: UseSubmenuPointerIntentArgs) => {\n const renderSafeArea = useCallback(\n ({ polygon }: { polygon: null | string }) => {\n const content = contentRef.current\n\n if (polygon) {\n content?.style.setProperty('--popup-safe-area', polygon)\n content?.setAttribute('data-submenu-safe-area', '')\n } else {\n content?.style.removeProperty('--popup-safe-area')\n content?.removeAttribute('data-submenu-safe-area')\n }\n },\n [contentRef],\n )\n\n const safeArea = usePointerSafeArea({\n enabled: enabled && active,\n from: triggerRef,\n onChange: renderSafeArea,\n onRelease: onSafeAreaExpire,\n to: contentRef,\n })\n const { clear, protect, trackSource, trackTarget } = safeArea\n\n const handleEnter = (event: PointerEvent) => {\n if (event.pointerType !== 'mouse') {\n return\n }\n const pointer = { x: event.clientX, y: event.clientY }\n\n if (event.currentTarget === contentRef.current) {\n trackTarget(pointer)\n } else {\n trackSource(pointer)\n onOpen()\n }\n }\n\n const handleLeave = (event: PointerEvent) => {\n if (event.pointerType !== 'mouse' || !active || !safeArea.isTracking()) {\n return\n }\n const target = event.relatedTarget as Node | null\n\n if (target && (contentRef.current?.contains(target) || triggerRef.current?.contains(target))) {\n return\n }\n if (!protect({ pointer: { x: event.clientX, y: event.clientY } })) {\n clear()\n onClose()\n }\n }\n\n return {\n contentProps: {\n onPointerEnter: enabled ? handleEnter : undefined,\n onPointerLeave: enabled ? handleLeave : undefined,\n },\n isProtected: safeArea.isProtected,\n triggerProps: {\n onPointerEnter: enabled ? handleEnter : undefined,\n onPointerLeave: enabled ? handleLeave : undefined,\n },\n updateSafeArea: safeArea.refresh,\n }\n}\n"],"mappings":"AAEA,SAASA,WAAW,QAAQ;AAI5B,SAASC,kBAAkB,QAAQ;AAYnC,OAAO,MAAMC,uBAAA,GAA0BA,CAAC;EACtCC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,OAAO;EACPC,MAAM;EACNC,gBAAgB;EAChBC;AAAU,CACkB;EAC5B,MAAMC,cAAA,GAAiBV,WAAA,CACrB,CAAC;IAAEW;EAAO,CAA8B;IACtC,MAAMC,OAAA,GAAUR,UAAA,CAAWS,OAAO;IAElC,IAAIF,OAAA,EAAS;MACXC,OAAA,EAASE,KAAA,CAAMC,WAAA,CAAY,qBAAqBJ,OAAA;MAChDC,OAAA,EAASI,YAAA,CAAa,0BAA0B;IAClD,OAAO;MACLJ,OAAA,EAASE,KAAA,CAAMG,cAAA,CAAe;MAC9BL,OAAA,EAASM,eAAA,CAAgB;IAC3B;EACF,GACA,CAACd,UAAA,CAAW;EAGd,MAAMe,QAAA,GAAWlB,kBAAA,CAAmB;IAClCI,OAAA,EAASA,OAAA,IAAWF,MAAA;IACpBiB,IAAA,EAAMX,UAAA;IACNY,QAAA,EAAUX,cAAA;IACVY,SAAA,EAAWd,gBAAA;IACX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CC,cAAA,EAAgBxC,OAAA,GAAUgC,WAAA,GAAcO;IAC1C;IACAI,cAAA,EAAgB7B,QAAA,CAAS8B;EAC3B;AACF","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/PreviewButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAQpD,wBAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/PreviewButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAgC,MAAM,OAAO,CAAA;AAQpD,wBAAgB,aAAa,sBAsD5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["c","_c","React","useCallback","useState","LinkIcon","usePreviewURL","useTranslation","Button","Tooltip","PreviewButton","$","previewURL","t","copied","setCopied","hovered","setHovered","t0","event","metaKey","ctrlKey","window","open","navigator","clipboard","writeText","handleClick","t1","label","t2","t3","Symbol","for","_jsxs","onPointerEnter","onPointerLeave","style","position","children","_jsx","buttonStyle","icon","size","onClick","delay","id","show"],"sources":["../../../src/elements/PreviewButton/index.tsx"],"sourcesContent":["'use client'\nimport React, { useCallback, useState } from 'react'\n\nimport { LinkIcon } from '../../icons/Link/index.js'\nimport { usePreviewURL } from '../../providers/LivePreview/context.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { Button } from '../Button/index.js'\nimport { Tooltip } from '../Tooltip/index.js'\n\nexport function PreviewButton() {\n const { previewURL } = usePreviewURL()\n const { t } = useTranslation()\n const [copied, setCopied] = useState(false)\n const [hovered, setHovered] = useState(false)\n\n const handleClick = useCallback(\n async (event: React.MouseEvent<HTMLButtonElement>) => {\n if (!previewURL) {\n return\n }\n\n if (event.metaKey || event.ctrlKey) {\n window.open(previewURL, '_blank', 'noopener,noreferrer')\n return\n }\n\n await navigator.clipboard.writeText(previewURL)\n setCopied(true)\n },\n [previewURL],\n )\n\n if (!previewURL) {\n return null\n }\n\n const label = copied ? t('general:copied') : t('general:copy')\n\n return (\n <span\n onPointerEnter={() => {\n setHovered(true)\n setCopied(false)\n }}\n onPointerLeave={() => {\n setHovered(false)\n setCopied(false)\n }}\n style={{ position: 'relative' }}\n >\n <Button\n buttonStyle=\"ghost\"\n icon={<LinkIcon size={24} />}\n id=\"preview-button\"\n onClick={handleClick}\n />\n <Tooltip delay={0} id=\"preview-button-tooltip\" show={hovered || copied}>\n {label}\n </Tooltip>\n </span>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,WAAW,EAAEC,QAAQ,QAAQ;AAE7C,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,SAASC,OAAO,QAAQ;AAExB,OAAO,SAAAC,cAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EACL;IAAAW;EAAA,IAAuBN,aAAA;EACvB;IAAAO;EAAA,IAAcN,cAAA;EACd,OAAAO,MAAA,EAAAC,SAAA,IAA4BX,QAAA,CAAS;EACrC,OAAAY,OAAA,EAAAC,UAAA,IAA8Bb,QAAA,CAAS;EAAA,IAAAc,EAAA;EAAA,IAAAP,CAAA,QAAAC,UAAA;IAGrCM,EAAA,SAAAC,KAAA;MACE,IAAI,CAACP,UAAA;QAAA;MAAA;MAIL,IAAIO,KAAA,CAAAC,OAA8B,IAAbD,KAAA,CAAAE,OAAa;QAChCC,MAAA,CAAAC,IAAW,CAACX,UAAA,EAAY,UAAU;QAAA;MAAA;MAIpC,MAAMY,SAAA,CAAAC,SAAmB,CAAAC,SAAU,CAACd,UAAA;MACpCG,SAAA,CAAU;IAAA,CACZ;IAAAJ,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAbF,MAAAgB,WAAA,GAAoBT,EAcN;EAGd,IAAI,CAACN,UAAA;IAAA,OACI;EAAA;EACT,IAAAgB,EAAA;EAAA,IAAAjB,CAAA,QAAAG,MAAA,IAAAH,CAAA,QAAAgB,WAAA,IAAAhB,CAAA,QAAAK,OAAA,IAAAL,CAAA,QAAAE,CAAA;IAEA,MAAAgB,KAAA,GAAcf,MAAA,GAASD,CAAA,CAAE,gBAAsB,IAAFA,CAAA,CAAE;IAAA,IAAAiB,EAAA;IAAA,IAAAC,EAAA;IAAA,IAAApB,CAAA,QAAAqB,MAAA,CAAAC,GAAA;MAI3BH,EAAA,GAAAA,CAAA;QACdb,UAAA,CAAW;QACXF,SAAA,CAAU;MAAA,CACZ;MACgBgB,EAAA,GAAAA,CAAA;QACdd,UAAA,CAAW;QACXF,SAAA,CAAU;MAAA,CACZ;MAAAJ,CAAA,MAAAmB,EAAA;MAAAnB,CAAA,MAAAoB,EAAA;IAAA;MAAAD,EAAA,GAAAnB,CAAA;MAAAoB,EAAA,GAAApB,CAAA;IAAA;IARFiB,EAAA,GAAAM,KAAA,CAAC;MAAAC,cAAA,EACiBL,EAGhB;MAAAM,cAAA,EACgBL,EAGhB;MAAAM,KAAA,EACO;QAAAC,QAAA,EAAY;MAAW;MAAAC,QAAA,E,CAE9BC,IAAA,CAAChC,MAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":["c","_c","React","useCallback","useState","LinkIcon","usePreviewURL","useTranslation","Button","Tooltip","PreviewButton","$","previewURL","t","copied","setCopied","hovered","setHovered","t0","event","metaKey","ctrlKey","window","open","navigator","clipboard","writeText","handleClick","t1","label","t2","t3","Symbol","for","_jsxs","onPointerEnter","onPointerLeave","style","position","children","_jsx","buttonStyle","extraButtonProps","title","undefined","icon","size","onClick","delay","id","show"],"sources":["../../../src/elements/PreviewButton/index.tsx"],"sourcesContent":["'use client'\nimport React, { useCallback, useState } from 'react'\n\nimport { LinkIcon } from '../../icons/Link/index.js'\nimport { usePreviewURL } from '../../providers/LivePreview/context.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\nimport { Button } from '../Button/index.js'\nimport { Tooltip } from '../Tooltip/index.js'\n\nexport function PreviewButton() {\n const { previewURL } = usePreviewURL()\n const { t } = useTranslation()\n const [copied, setCopied] = useState(false)\n const [hovered, setHovered] = useState(false)\n\n const handleClick = useCallback(\n async (event: React.MouseEvent<HTMLButtonElement>) => {\n if (!previewURL) {\n return\n }\n\n if (event.metaKey || event.ctrlKey) {\n window.open(previewURL, '_blank', 'noopener,noreferrer')\n return\n }\n\n await navigator.clipboard.writeText(previewURL)\n setCopied(true)\n },\n [previewURL],\n )\n\n if (!previewURL) {\n return null\n }\n\n const label = copied ? t('general:copied') : t('general:copy')\n\n return (\n <span\n onPointerEnter={() => {\n setHovered(true)\n setCopied(false)\n }}\n onPointerLeave={() => {\n setHovered(false)\n setCopied(false)\n }}\n style={{ position: 'relative' }}\n >\n <Button\n aria-label={label}\n buttonStyle=\"ghost\"\n extraButtonProps={{ title: undefined }}\n icon={<LinkIcon size={24} />}\n id=\"preview-button\"\n onClick={handleClick}\n />\n <Tooltip delay={0} id=\"preview-button-tooltip\" show={hovered || copied}>\n {label}\n </Tooltip>\n </span>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,WAAW,EAAEC,QAAQ,QAAQ;AAE7C,SAASC,QAAQ,QAAQ;AACzB,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SAASC,MAAM,QAAQ;AACvB,SAASC,OAAO,QAAQ;AAExB,OAAO,SAAAC,cAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EACL;IAAAW;EAAA,IAAuBN,aAAA;EACvB;IAAAO;EAAA,IAAcN,cAAA;EACd,OAAAO,MAAA,EAAAC,SAAA,IAA4BX,QAAA,CAAS;EACrC,OAAAY,OAAA,EAAAC,UAAA,IAA8Bb,QAAA,CAAS;EAAA,IAAAc,EA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;QAAA,cACaqB,KAAA;QAAAY,WAAA,EACA;QAAAC,gBAAA,EACM;UAAAC,KAAA,EAASC;QAAU;QAAAC,IAAA,EAC/BL,IAAA,CAACnC,QAAA;UAAAyC,IAAA,EAAe;;YACnB;QAAAC,OAAA,EACMpB;UAEXa,IAAA,CAAC/B,OAAA;QAAAuC,KAAA,EAAe;QAAAC,EAAA,EAAM;QAAAC,IAAA,EAA+BlC,OAAW,IAAXF,MAAW;QAAAyB,QAAA,EAC7DV;;;;;;;;;;;SApBLD,E","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildUpcomingColumns.d.ts","sourceRoot":"","sources":["../../../../src/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAG1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAM/C,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IAC5C,IAAI,EAAE,aAAa,EAAE,CAAA;IACrB,IAAI,EAAE,UAAU,CAAA;IAChB,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,kBAAkB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAAA;IAC5E,CAAC,EAAE,SAAS,CAAA;CACb,CAAA;AAED,eAAO,MAAM,oBAAoB,oFAQ9B,IAAI,KAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"buildUpcomingColumns.d.ts","sourceRoot":"","sources":["../../../../src/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAEnD,OAAO,EAAkB,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAG1F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAM/C,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAA;IAC5C,IAAI,EAAE,aAAa,EAAE,CAAA;IACrB,IAAI,EAAE,UAAU,CAAA;IAChB,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,CAAA;IAC1C,kBAAkB,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAAA;IAC5E,CAAC,EAAE,SAAS,CAAA;CACb,CAAA;AAED,eAAO,MAAM,oBAAoB,oFAQ9B,IAAI,KAAG,MAAM,EA6Gf,CAAA"}
|
|
@@ -104,6 +104,7 @@ export const buildUpcomingColumns = ({
|
|
|
104
104
|
children: t('general:delete')
|
|
105
105
|
}),
|
|
106
106
|
renderedCells: docs.map(doc => /*#__PURE__*/_jsx(Button, {
|
|
107
|
+
"aria-label": t('general:delete'),
|
|
107
108
|
buttonStyle: "ghost",
|
|
108
109
|
className: "schedule-publish__delete",
|
|
109
110
|
icon: "x",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildUpcomingColumns.js","names":["getTranslation","React","formatDate","Button","Pill","buildUpcomingColumns","dateFormat","deleteHandler","docs","i18n","localization","supportedTimezones","t","columns","accessor","active","field","name","type","Heading","_jsx","renderedCells","map","doc","input","_jsxs","pillStyle","size","id","date","waitUntil","pattern","timezone","matchedTimezone","find","value","label","push","locale","matchedLocale","locales","code","buttonStyle","className","icon","onClick","e","preventDefault","tooltip"],"sources":["../../../../src/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.tsx"],"sourcesContent":["import type { ClientConfig, Column } from 'payload'\n\nimport { getTranslation, type I18nClient, type TFunction } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { UpcomingEvent } from './types.js'\n\nimport { formatDate } from '../../../utilities/formatDocTitle/formatDateTitle.js'\nimport { Button } from '../../Button/index.js'\nimport { Pill } from '../../Pill/index.js'\n\ntype Args = {\n dateFormat: string\n deleteHandler: (id: number | string) => void\n docs: UpcomingEvent[]\n i18n: I18nClient\n localization: ClientConfig['localization']\n supportedTimezones: ClientConfig['admin']['timezones']['supportedTimezones']\n t: TFunction\n}\n\nexport const buildUpcomingColumns = ({\n dateFormat,\n deleteHandler,\n docs,\n i18n,\n localization,\n supportedTimezones,\n t,\n}: Args): Column[] => {\n const columns: Column[] = [\n {\n accessor: 'input.type',\n active: true,\n field: {\n name: '',\n type: 'text',\n },\n Heading: <span>{t('version:type')}</span>,\n renderedCells: docs.map((doc) => {\n const type = doc.input?.type\n\n return (\n <Pill key={doc.id} pillStyle={type === 'publish' ? 'success' : 'warning'} size=\"small\">\n {type === 'publish' && t('version:publish')}\n {type === 'unpublish' && t('version:unpublish')}\n </Pill>\n )\n }),\n },\n {\n accessor: 'waitUntil',\n active: true,\n field: {\n name: '',\n type: 'date',\n },\n Heading: <span>{t('general:time')}</span>,\n renderedCells: docs.map((doc) => (\n <span key={doc.id}>\n {formatDate({\n date: doc.waitUntil,\n i18n,\n pattern: dateFormat,\n timezone: doc.input.timezone,\n })}\n </span>\n )),\n },\n {\n accessor: 'input.timezone',\n active: true,\n field: {\n name: '',\n type: 'text',\n },\n Heading: <span>{t('general:timezone')}</span>,\n renderedCells: docs.map((doc) => {\n const matchedTimezone = supportedTimezones.find(\n (timezone) => timezone.value === doc.input.timezone,\n )\n\n const timezone = matchedTimezone?.label || doc.input.timezone\n\n return <span key={doc.id}>{timezone || t('general:noValue')}</span>\n }),\n },\n ]\n\n if (localization) {\n columns.push({\n accessor: 'input.locale',\n active: true,\n field: {\n name: '',\n type: 'text',\n },\n Heading: <span>{t('general:locale')}</span>,\n renderedCells: docs.map((doc) => {\n if (doc.input.locale) {\n const matchedLocale = localization.locales.find(\n (locale) => locale.code === doc.input.locale,\n )\n if (matchedLocale) {\n return <span key={doc.id}>{getTranslation(matchedLocale.label, i18n)}</span>\n }\n }\n\n return <span key={doc.id}>{t('general:all')}</span>\n }),\n })\n }\n\n columns.push({\n accessor: 'delete',\n active: true,\n field: {\n name: 'delete',\n type: 'text',\n },\n Heading: <span>{t('general:delete')}</span>,\n renderedCells: docs.map((doc) => (\n <Button\n buttonStyle=\"ghost\"\n className=\"schedule-publish__delete\"\n icon=\"x\"\n key={doc.id}\n onClick={(e) => {\n e.preventDefault()\n deleteHandler(doc.id)\n }}\n tooltip={t('general:delete')}\n />\n )),\n })\n\n return columns\n}\n"],"mappings":";AAEA,SAASA,cAAc,QAAyC;AAChE,OAAOC,KAAA,MAAW;AAIlB,SAASC,UAAU,QAAQ;AAC3B,SAASC,MAAM,QAAQ;AACvB,SAASC,IAAI,QAAQ;AAYrB,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,UAAU;EACVC,aAAa;EACbC,IAAI;EACJC,IAAI;EACJC,YAAY;EACZC,kBAAkB;EAClBC;AAAC,CACI;EACL,MAAMC,OAAA,GAAoB,CACxB;IACEC,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,KAAA,EAAO;MACLC,IAAA,EAAM;MACNC,IAAA,EAAM;IACR;IACAC,OAAA,eAASC,IAAA,CAAC;gBAAMR,CAAA,CAAE;;IAClBS,aAAA,EAAeb,IAAA,CAAKc,GAAG,CAAEC,GAAA;MACvB,MAAML,IAAA,GAAOK,GAAA,CAAIC,KAAK,EAAEN,IAAA;MAExB,oBACEO,KAAA,CAACrB,IAAA;QAAkBsB,SAAA,EAAWR,IAAA,KAAS,YAAY,YAAY;QAAWS,IAAA,EAAK;mBAC5ET,IAAA,KAAS,aAAaN,CAAA,CAAE,oBACxBM,IAAA,KAAS,eAAeN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,CAAKc,GAAG,CAAEC,GAAA;QACvB,IAAIA,GAAA,CAAIC,KAAK,CAACc,MAAM,EAAE;UACpB,MAAMC,aAAA,GAAgB7B,YAAA,CAAa8B,OAAO,CAACN,IAAI,CAC5CI,MAAA,IAAWA,MAAA,CAAOG,IAAI,KAAKlB,GAAA,CAAIC,KAAK,CAACc,MAAM;UAE9C,IAAIC,aAAA,EAAe;YACjB,oBAAOnB,IAAA,CAAC;wBAAmBpB,cAAA,CAAeuC,aAAA,CAAcH,KAAK,EAAE3B,IAAA;eAA7Cc,GAAA,CAAIK,EAAE;UAC1B;QACF;QAEA,oBAAOR,IAAA,CAAC;oBAAmBR,CAAA,CAAE;WAAXW,GAAA,CAAIK,EAAE;MAC1B;IACF;EACF;EAEAf,OAAA,CAAQwB,IAAI,CAAC;IACXvB,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,KAAA,EAAO;MACLC,IAAA,EAAM;MACNC,IAAA,EAAM;IACR;IACAC,OAAA,eAASC,IAAA,CAAC;gBAAMR,CAAA,CAAE;;IAClBS,aAAA,EAAeb,IAAA,CAAKc,GAAG,CAAEC,GAAA,iBACvBH,IAAA,CAACjB,MAAA;
|
|
1
|
+
{"version":3,"file":"buildUpcomingColumns.js","names":["getTranslation","React","formatDate","Button","Pill","buildUpcomingColumns","dateFormat","deleteHandler","docs","i18n","localization","supportedTimezones","t","columns","accessor","active","field","name","type","Heading","_jsx","renderedCells","map","doc","input","_jsxs","pillStyle","size","id","date","waitUntil","pattern","timezone","matchedTimezone","find","value","label","push","locale","matchedLocale","locales","code","buttonStyle","className","icon","onClick","e","preventDefault","tooltip"],"sources":["../../../../src/elements/PublishButton/ScheduleDrawer/buildUpcomingColumns.tsx"],"sourcesContent":["import type { ClientConfig, Column } from 'payload'\n\nimport { getTranslation, type I18nClient, type TFunction } from '@payloadcms/translations'\nimport React from 'react'\n\nimport type { UpcomingEvent } from './types.js'\n\nimport { formatDate } from '../../../utilities/formatDocTitle/formatDateTitle.js'\nimport { Button } from '../../Button/index.js'\nimport { Pill } from '../../Pill/index.js'\n\ntype Args = {\n dateFormat: string\n deleteHandler: (id: number | string) => void\n docs: UpcomingEvent[]\n i18n: I18nClient\n localization: ClientConfig['localization']\n supportedTimezones: ClientConfig['admin']['timezones']['supportedTimezones']\n t: TFunction\n}\n\nexport const buildUpcomingColumns = ({\n dateFormat,\n deleteHandler,\n docs,\n i18n,\n localization,\n supportedTimezones,\n t,\n}: Args): Column[] => {\n const columns: Column[] = [\n {\n accessor: 'input.type',\n active: true,\n field: {\n name: '',\n type: 'text',\n },\n Heading: <span>{t('version:type')}</span>,\n renderedCells: docs.map((doc) => {\n const type = doc.input?.type\n\n return (\n <Pill key={doc.id} pillStyle={type === 'publish' ? 'success' : 'warning'} size=\"small\">\n {type === 'publish' && t('version:publish')}\n {type === 'unpublish' && t('version:unpublish')}\n </Pill>\n )\n }),\n },\n {\n accessor: 'waitUntil',\n active: true,\n field: {\n name: '',\n type: 'date',\n },\n Heading: <span>{t('general:time')}</span>,\n renderedCells: docs.map((doc) => (\n <span key={doc.id}>\n {formatDate({\n date: doc.waitUntil,\n i18n,\n pattern: dateFormat,\n timezone: doc.input.timezone,\n })}\n </span>\n )),\n },\n {\n accessor: 'input.timezone',\n active: true,\n field: {\n name: '',\n type: 'text',\n },\n Heading: <span>{t('general:timezone')}</span>,\n renderedCells: docs.map((doc) => {\n const matchedTimezone = supportedTimezones.find(\n (timezone) => timezone.value === doc.input.timezone,\n )\n\n const timezone = matchedTimezone?.label || doc.input.timezone\n\n return <span key={doc.id}>{timezone || t('general:noValue')}</span>\n }),\n },\n ]\n\n if (localization) {\n columns.push({\n accessor: 'input.locale',\n active: true,\n field: {\n name: '',\n type: 'text',\n },\n Heading: <span>{t('general:locale')}</span>,\n renderedCells: docs.map((doc) => {\n if (doc.input.locale) {\n const matchedLocale = localization.locales.find(\n (locale) => locale.code === doc.input.locale,\n )\n if (matchedLocale) {\n return <span key={doc.id}>{getTranslation(matchedLocale.label, i18n)}</span>\n }\n }\n\n return <span key={doc.id}>{t('general:all')}</span>\n }),\n })\n }\n\n columns.push({\n accessor: 'delete',\n active: true,\n field: {\n name: 'delete',\n type: 'text',\n },\n Heading: <span>{t('general:delete')}</span>,\n renderedCells: docs.map((doc) => (\n <Button\n aria-label={t('general:delete')}\n buttonStyle=\"ghost\"\n className=\"schedule-publish__delete\"\n icon=\"x\"\n key={doc.id}\n onClick={(e) => {\n e.preventDefault()\n deleteHandler(doc.id)\n }}\n tooltip={t('general:delete')}\n />\n )),\n })\n\n return columns\n}\n"],"mappings":";AAEA,SAASA,cAAc,QAAyC;AAChE,OAAOC,KAAA,MAAW;AAIlB,SAASC,UAAU,QAAQ;AAC3B,SAASC,MAAM,QAAQ;AACvB,SAASC,IAAI,QAAQ;AAYrB,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,UAAU;EACVC,aAAa;EACbC,IAAI;EACJC,IAAI;EACJC,YAAY;EACZC,kBAAkB;EAClBC;AAAC,CACI;EACL,MAAMC,OAAA,GAAoB,CACxB;IACEC,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,KAAA,EAAO;MACLC,IAAA,EAAM;MACNC,IAAA,EAAM;IACR;IACAC,OAAA,eAASC,IAAA,CAAC;gBAAMR,CAAA,CAAE;;IAClBS,aAAA,EAAeb,IAAA,CAAKc,GAAG,CAAEC,GAAA;MACvB,MAAML,IAAA,GAAOK,GAAA,CAAIC,KAAK,EAAEN,IAAA;MAExB,oBACEO,KAAA,CAACrB,IAAA;QAAkBsB,SAAA,EAAWR,IAAA,KAAS,YAAY,YAAY;QAAWS,IAAA,EAAK;mBAC5ET,IAAA,KAAS,aAAaN,CAAA,CAAE,oBACxBM,IAAA,KAAS,eAAeN,CAAA,CAAE;SAFlBW,GAAA,CAAIK,EAAE;IAKrB;EACF,GACA;IACEd,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,KAAA,EAAO;MACLC,IAAA,EAAM;MACNC,IAAA,EAAM;IACR;IACAC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A,MAAA,CAAOG,IAAI,KAAKlB,GAAA,CAAIC,KAAK,CAACc,MAAM;UAE9C,IAAIC,aAAA,EAAe;YACjB,oBAAOnB,IAAA,CAAC;wBAAmBpB,cAAA,CAAeuC,aAAA,CAAcH,KAAK,EAAE3B,IAAA;eAA7Cc,GAAA,CAAIK,EAAE;UAC1B;QACF;QAEA,oBAAOR,IAAA,CAAC;oBAAmBR,CAAA,CAAE;WAAXW,GAAA,CAAIK,EAAE;MAC1B;IACF;EACF;EAEAf,OAAA,CAAQwB,IAAI,CAAC;IACXvB,QAAA,EAAU;IACVC,MAAA,EAAQ;IACRC,KAAA,EAAO;MACLC,IAAA,EAAM;MACNC,IAAA,EAAM;IACR;IACAC,OAAA,eAASC,IAAA,CAAC;gBAAMR,CAAA,CAAE;;IAClBS,aAAA,EAAeb,IAAA,CAAKc,GAAG,CAAEC,GAAA,iBACvBH,IAAA,CAACjB,MAAA;MACC,cAAYS,CAAA,CAAE;MACd8B,WAAA,EAAY;MACZC,SAAA,EAAU;MACVC,IAAA,EAAK;MAELC,OAAA,EAAUC,CAAA;QACRA,CAAA,CAAEC,cAAc;QAChBxC,aAAA,CAAcgB,GAAA,CAAIK,EAAE;MACtB;MACAoB,OAAA,EAASpC,CAAA,CAAE;OALNW,GAAA,CAAIK,EAAE;EAQjB;EAEA,OAAOf,OAAA;AACT","ignoreList":[]}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
-webkit-appearance: none;
|
|
19
19
|
appearance: none;
|
|
20
20
|
height: auto;
|
|
21
|
-
padding-block: calc(var(--spacer-1)
|
|
21
|
+
padding-block: calc(var(--spacer-1) - var(--stroke-width-small));
|
|
22
22
|
padding-inline: var(--field-padding-inline) var(--spacer-5);
|
|
23
23
|
flex-wrap: wrap;
|
|
24
24
|
gap: var(--spacer-1);
|
|
@@ -59,7 +59,9 @@
|
|
|
59
59
|
|
|
60
60
|
.rs__input-container {
|
|
61
61
|
color: var(--color-text);
|
|
62
|
-
height: var(--
|
|
62
|
+
height: var(--spacer-4);
|
|
63
|
+
min-width: var(--spacer-4);
|
|
64
|
+
grid-template-columns: 0 minmax(var(--spacer-4), min-content);
|
|
63
65
|
margin: 0;
|
|
64
66
|
padding: 0;
|
|
65
67
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/ReactSelect/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAI/E,OAAO,KAAK,EAAU,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACjE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAoBxC,OAAO,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/ReactSelect/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2D,MAAM,OAAO,CAAA;AAI/E,OAAO,KAAK,EAAU,uBAAuB,EAAE,MAAM,YAAY,CAAA;AACjE,YAAY,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAoBxC,OAAO,aAAa,CAAA;AAwRpB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAQzD,CAAA"}
|
|
@@ -150,10 +150,15 @@ const SelectAdapter = props => {
|
|
|
150
150
|
minHeight: undefined,
|
|
151
151
|
...externalStyles?.control?.(rsStyles_0, state_2)
|
|
152
152
|
}),
|
|
153
|
-
|
|
154
|
-
option: (rsStyles_1, state_3) => ({
|
|
153
|
+
input: (rsStyles_1, state_3) => ({
|
|
155
154
|
...rsStyles_1,
|
|
156
|
-
|
|
155
|
+
gridTemplateColumns: undefined,
|
|
156
|
+
...externalStyles?.input?.(rsStyles_1, state_3)
|
|
157
|
+
}),
|
|
158
|
+
// Allow external option styles to override emotion defaults
|
|
159
|
+
option: (rsStyles_2, state_4) => ({
|
|
160
|
+
...rsStyles_2,
|
|
161
|
+
...externalStyles?.option?.(rsStyles_2, state_4)
|
|
157
162
|
}),
|
|
158
163
|
// Keep react-select's computed maxHeight so the menu can fit available
|
|
159
164
|
// viewport space near screen edges (instead of using a fixed class value).
|