oasis-editor 0.0.288 → 0.0.289
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/{OasisEditorApp-Co2bJnga.js → OasisEditorApp-CNataZyb.js} +1 -1
- package/dist/defaultToolbar-BDzoEM0I.js +1 -0
- package/dist/oasis-editor.js +1 -1
- package/dist/oasis-editor.umd.cjs +1 -1
- package/dist/ui/components/Toolbar/primitives/Menu.d.ts +13 -0
- package/dist/ui/components/Toolbar/renderers/renderers.d.ts +7 -0
- package/package.json +1 -1
- package/dist/defaultToolbar-BM0I93SF.js +0 -1
|
@@ -13,6 +13,19 @@ export interface MenuProps {
|
|
|
13
13
|
/** Reposition tall panels so they remain within the viewport vertically. */
|
|
14
14
|
fitViewport?: boolean;
|
|
15
15
|
keepMounted?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Role for the trigger button. Nested dropdowns pass `"menuitem"` so the
|
|
18
|
+
* parent `role="menu"` panel only contains menu items (plus its submenu
|
|
19
|
+
* trigger, which is itself a menuitem with `aria-haspopup`).
|
|
20
|
+
*/
|
|
21
|
+
role?: JSX.HTMLAttributes<HTMLButtonElement>["role"];
|
|
22
|
+
/**
|
|
23
|
+
* Controlled open state. Omit for the usual uncontrolled dropdown; passing
|
|
24
|
+
* `false` force-closes a dropdown whose trigger is about to be hidden (a
|
|
25
|
+
* collapsed Ribbon group that expands again), so the portalled panel cannot
|
|
26
|
+
* outlive its anchor.
|
|
27
|
+
*/
|
|
28
|
+
open?: boolean;
|
|
16
29
|
onOpenChange?: (open: boolean) => void;
|
|
17
30
|
children: JSX.Element;
|
|
18
31
|
}
|
|
@@ -3,6 +3,11 @@ import { ToolbarActionApi, ToolbarItem, ToolbarItemType } from '../schema/items.
|
|
|
3
3
|
export interface RendererProps<I extends ToolbarItem = ToolbarItem> {
|
|
4
4
|
item: I;
|
|
5
5
|
api: ToolbarActionApi;
|
|
6
|
+
/**
|
|
7
|
+
* True when the item is rendered inside a `role="menu"` panel. Action items
|
|
8
|
+
* then expose `role="menuitem"` so the panel's role is valid.
|
|
9
|
+
*/
|
|
10
|
+
menuItem?: boolean;
|
|
6
11
|
}
|
|
7
12
|
export declare const TOOLBAR_RENDERERS: Record<ToolbarItemType, Component<RendererProps>>;
|
|
8
13
|
/**
|
|
@@ -25,4 +30,6 @@ export declare function resolveRenderer(type: string): Component<RendererProps>
|
|
|
25
30
|
export declare function ToolbarItemRenderer(props: {
|
|
26
31
|
item: ToolbarItem;
|
|
27
32
|
api: ToolbarActionApi;
|
|
33
|
+
/** Rendered inside a `role="menu"` panel: action items become menuitems. */
|
|
34
|
+
menuItem?: boolean;
|
|
28
35
|
}): JSX.Element;
|