@wistia/ui 0.15.12-beta.4ccc4307.9870827 → 0.15.12-beta.bbcd8471.64c2d83
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/index.cjs +12 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -5
- package/dist/index.d.ts +1 -5
- package/dist/index.mjs +12 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1634,10 +1634,6 @@ declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchVa
|
|
|
1634
1634
|
type ContextMenuProps = {
|
|
1635
1635
|
children: ReactNode;
|
|
1636
1636
|
onRequestClose?: () => void;
|
|
1637
|
-
/**
|
|
1638
|
-
* If the menu is compact
|
|
1639
|
-
*/
|
|
1640
|
-
compact?: boolean;
|
|
1641
1637
|
} & ({
|
|
1642
1638
|
position: {
|
|
1643
1639
|
x: number;
|
|
@@ -1656,7 +1652,7 @@ type ContextMenuProps = {
|
|
|
1656
1652
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1657
1653
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1658
1654
|
*/
|
|
1659
|
-
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose,
|
|
1655
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1660
1656
|
|
|
1661
1657
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1662
1658
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1634,10 +1634,6 @@ declare const Combobox: ({ placeholder, value, onChange, searchValue, onSearchVa
|
|
|
1634
1634
|
type ContextMenuProps = {
|
|
1635
1635
|
children: ReactNode;
|
|
1636
1636
|
onRequestClose?: () => void;
|
|
1637
|
-
/**
|
|
1638
|
-
* If the menu is compact
|
|
1639
|
-
*/
|
|
1640
|
-
compact?: boolean;
|
|
1641
1637
|
} & ({
|
|
1642
1638
|
position: {
|
|
1643
1639
|
x: number;
|
|
@@ -1656,7 +1652,7 @@ type ContextMenuProps = {
|
|
|
1656
1652
|
* 1. By providing a `triggerRef`, which will render the menu when the referenced element is right-clicked.
|
|
1657
1653
|
* 2. By providing a `position` prop, which will render the menu at the specified coordinates.
|
|
1658
1654
|
*/
|
|
1659
|
-
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose,
|
|
1655
|
+
declare const ContextMenu: ({ position, triggerRef, children, side, onRequestClose, }: ContextMenuProps) => react_jsx_runtime.JSX.Element | null;
|
|
1660
1656
|
|
|
1661
1657
|
type DataCardProps = ComponentPropsWithoutRef<'div'> & Partial<Pick<ButtonAsLinkProps, 'beforeAction' | 'disabled' | 'href' | 'onClick' | 'type'>> & {
|
|
1662
1658
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
/*
|
|
3
|
-
* @license @wistia/ui v0.15.12-beta.
|
|
3
|
+
* @license @wistia/ui v0.15.12-beta.bbcd8471.64c2d83
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -12835,6 +12835,7 @@ var Combobox2 = ({
|
|
|
12835
12835
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12836
12836
|
import { isNil as isNil15, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
12837
12837
|
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12838
|
+
import { createPortal } from "react-dom";
|
|
12838
12839
|
|
|
12839
12840
|
// src/components/Menu/Menu.tsx
|
|
12840
12841
|
import {
|
|
@@ -13516,8 +13517,7 @@ var ContextMenu = ({
|
|
|
13516
13517
|
triggerRef,
|
|
13517
13518
|
children,
|
|
13518
13519
|
side = "bottom",
|
|
13519
|
-
onRequestClose = () => null
|
|
13520
|
-
compact = false
|
|
13520
|
+
onRequestClose = () => null
|
|
13521
13521
|
}) => {
|
|
13522
13522
|
const [isRightClicked, setIsRightClicked] = useState17(false);
|
|
13523
13523
|
const [menuPosition, setMenuPosition] = useState17(position ?? { x: 0, y: 0 });
|
|
@@ -13537,10 +13537,12 @@ var ContextMenu = ({
|
|
|
13537
13537
|
return () => null;
|
|
13538
13538
|
}, [position, triggerRef]);
|
|
13539
13539
|
const isOpen = isNotNil24(position) || isRightClicked;
|
|
13540
|
-
|
|
13540
|
+
if (!isOpen) {
|
|
13541
|
+
return null;
|
|
13542
|
+
}
|
|
13543
|
+
const menu = /* @__PURE__ */ jsx267(
|
|
13541
13544
|
Menu,
|
|
13542
13545
|
{
|
|
13543
|
-
compact,
|
|
13544
13546
|
isOpen,
|
|
13545
13547
|
onOpenChange: (next) => {
|
|
13546
13548
|
setIsRightClicked(next);
|
|
@@ -13566,7 +13568,11 @@ var ContextMenu = ({
|
|
|
13566
13568
|
),
|
|
13567
13569
|
children
|
|
13568
13570
|
}
|
|
13569
|
-
)
|
|
13571
|
+
);
|
|
13572
|
+
if (isNotNil24(triggerRef)) {
|
|
13573
|
+
return createPortal(menu, document.body);
|
|
13574
|
+
}
|
|
13575
|
+
return menu;
|
|
13570
13576
|
};
|
|
13571
13577
|
|
|
13572
13578
|
// src/components/DataCards/DataCard.tsx
|