@wistia/ui 0.15.13-beta.e65c0481.a780530 → 0.15.13
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 +4 -14
- 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 +4 -14
- 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.13
|
|
3
|
+
* @license @wistia/ui v0.15.13
|
|
4
4
|
*
|
|
5
5
|
* Copyright (c) 2024-2025, Wistia, Inc. and its affiliates.
|
|
6
6
|
*
|
|
@@ -12877,7 +12877,6 @@ var Combobox2 = ({
|
|
|
12877
12877
|
// src/components/ContextMenu/ContextMenu.tsx
|
|
12878
12878
|
import { isNil as isNil16, isNotNil as isNotNil24 } from "@wistia/type-guards";
|
|
12879
12879
|
import { useEffect as useEffect16, useState as useState17 } from "react";
|
|
12880
|
-
import { createPortal } from "react-dom";
|
|
12881
12880
|
|
|
12882
12881
|
// src/components/Menu/Menu.tsx
|
|
12883
12882
|
import {
|
|
@@ -13559,8 +13558,7 @@ var ContextMenu = ({
|
|
|
13559
13558
|
triggerRef,
|
|
13560
13559
|
children,
|
|
13561
13560
|
side = "bottom",
|
|
13562
|
-
onRequestClose = () => null
|
|
13563
|
-
compact = false
|
|
13561
|
+
onRequestClose = () => null
|
|
13564
13562
|
}) => {
|
|
13565
13563
|
const [isRightClicked, setIsRightClicked] = useState17(false);
|
|
13566
13564
|
const [menuPosition, setMenuPosition] = useState17(position ?? { x: 0, y: 0 });
|
|
@@ -13580,13 +13578,9 @@ var ContextMenu = ({
|
|
|
13580
13578
|
return () => null;
|
|
13581
13579
|
}, [position, triggerRef]);
|
|
13582
13580
|
const isOpen = isNotNil24(position) || isRightClicked;
|
|
13583
|
-
|
|
13584
|
-
return null;
|
|
13585
|
-
}
|
|
13586
|
-
const menu = /* @__PURE__ */ jsx267(
|
|
13581
|
+
return isOpen ? /* @__PURE__ */ jsx267(
|
|
13587
13582
|
Menu,
|
|
13588
13583
|
{
|
|
13589
|
-
compact,
|
|
13590
13584
|
isOpen,
|
|
13591
13585
|
onOpenChange: (next) => {
|
|
13592
13586
|
setIsRightClicked(next);
|
|
@@ -13612,11 +13606,7 @@ var ContextMenu = ({
|
|
|
13612
13606
|
),
|
|
13613
13607
|
children
|
|
13614
13608
|
}
|
|
13615
|
-
);
|
|
13616
|
-
if (isNotNil24(triggerRef)) {
|
|
13617
|
-
return createPortal(menu, document.body);
|
|
13618
|
-
}
|
|
13619
|
-
return menu;
|
|
13609
|
+
) : null;
|
|
13620
13610
|
};
|
|
13621
13611
|
|
|
13622
13612
|
// src/components/DataCards/DataCard.tsx
|