@enonic/ui 0.47.11 → 0.48.0
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/enonic-ui.cjs +1 -1
- package/dist/enonic-ui.es.js +180 -177
- package/dist/styles/style.css +1 -1
- package/dist/types/components/context-menu/context-menu.d.ts +39 -0
- package/dist/types/components/context-menu/index.d.ts +1 -1
- package/dist/types/hooks/index.d.ts +2 -1
- package/dist/types/hooks/use-floating-position.d.ts +21 -39
- package/dist/types/hooks/use-submenu-safe-area.d.ts +38 -0
- package/dist/types/providers/context-menu-content-provider.d.ts +29 -0
- package/dist/types/providers/context-menu-provider.d.ts +8 -6
- package/dist/types/providers/context-menu-sub-provider.d.ts +28 -0
- package/dist/types/providers/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ContextMenuContentContextValue } from './context-menu-content-provider';
|
|
3
|
+
/**
|
|
4
|
+
* Context value for a single `ContextMenu.Sub` wrapper.
|
|
5
|
+
*
|
|
6
|
+
* Coordinates between the submenu's local open state and the parent content's
|
|
7
|
+
* navigation state (so ArrowLeft from a submenu can restore active on its trigger).
|
|
8
|
+
*/
|
|
9
|
+
export type ContextMenuSubContextValue = {
|
|
10
|
+
/** Unique ID used by the SubTrigger (also the registry key in the parent content) */
|
|
11
|
+
subId: string;
|
|
12
|
+
/** ID of the submenu content element (for aria-controls) */
|
|
13
|
+
contentId: string;
|
|
14
|
+
/** Whether the submenu is currently open */
|
|
15
|
+
open: boolean;
|
|
16
|
+
/** Open/close the submenu */
|
|
17
|
+
setOpen: (open: boolean) => void;
|
|
18
|
+
/** Ref to the SubTrigger DOM node (for ArrowLeft refocus and collision anchoring) */
|
|
19
|
+
triggerRef: RefObject<HTMLDivElement> | null;
|
|
20
|
+
/**
|
|
21
|
+
* Snapshot of the parent content context captured at mount time.
|
|
22
|
+
* Used by SubContent's ArrowLeft handler to set parent `active` back to the trigger.
|
|
23
|
+
*/
|
|
24
|
+
parentContent: ContextMenuContentContextValue;
|
|
25
|
+
};
|
|
26
|
+
export declare const ContextMenuSubProvider: import('preact').Provider<ContextMenuSubContextValue | undefined>;
|
|
27
|
+
export declare const useContextMenuSub: () => ContextMenuSubContextValue;
|
|
28
|
+
export declare const useContextMenuSubOptional: () => ContextMenuSubContextValue | undefined;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from './avatar-provider';
|
|
2
2
|
export * from './combobox-provider';
|
|
3
|
+
export * from './context-menu-content-provider';
|
|
3
4
|
export * from './context-menu-provider';
|
|
5
|
+
export * from './context-menu-sub-provider';
|
|
4
6
|
export * from './date-picker-provider';
|
|
5
7
|
export * from './dialog-provider';
|
|
6
8
|
export * from './focus-container-provider';
|