@dxos/react-ui-menu 0.8.4-main.c1de068 → 0.8.4-main.e098934
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/lib/browser/index.mjs +64 -41
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +64 -41
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/builder.d.ts +2 -2
- package/dist/types/src/builder.d.ts.map +1 -1
- package/dist/types/src/components/ActionLabel.d.ts +1 -1
- package/dist/types/src/components/ActionLabel.d.ts.map +1 -1
- package/dist/types/src/components/DropdownMenu.d.ts +1 -1
- package/dist/types/src/components/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/MenuContext.d.ts.map +1 -1
- package/dist/types/src/components/ToolbarMenu.d.ts +1 -1
- package/dist/types/src/components/ToolbarMenu.d.ts.map +1 -1
- package/dist/types/src/components/{Menus.stories.d.ts → ToolbarMenu.stories.d.ts} +8 -12
- package/dist/types/src/components/ToolbarMenu.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/useMenuActions.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts +2 -2
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +2 -2
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +1 -1
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -16
- package/src/builder.ts +10 -10
- package/src/components/ActionLabel.tsx +3 -3
- package/src/components/DropdownMenu.tsx +3 -2
- package/src/components/MenuContext.tsx +1 -1
- package/src/components/{Menus.stories.tsx → ToolbarMenu.stories.tsx} +13 -7
- package/src/components/ToolbarMenu.tsx +33 -23
- package/src/hooks/useMenuActions.ts +1 -1
- package/src/testing/generator.ts +4 -4
- package/src/types.ts +2 -2
- package/src/util.ts +1 -1
- package/dist/types/src/components/Menus.stories.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-menu",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.e098934",
|
|
4
4
|
"description": "Components for facilitating reactive and consistent menus.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
@@ -28,26 +29,26 @@
|
|
|
28
29
|
"@preact/signals-react": "^3.2.0",
|
|
29
30
|
"@radix-ui/react-context": "1.1.1",
|
|
30
31
|
"@radix-ui/react-use-controllable-state": "1.1.0",
|
|
31
|
-
"@dxos/app-graph": "0.8.4-main.
|
|
32
|
-
"@dxos/invariant": "0.8.4-main.
|
|
33
|
-
"@dxos/keyboard": "0.8.4-main.
|
|
34
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
35
|
-
"@dxos/util": "0.8.4-main.
|
|
32
|
+
"@dxos/app-graph": "0.8.4-main.e098934",
|
|
33
|
+
"@dxos/invariant": "0.8.4-main.e098934",
|
|
34
|
+
"@dxos/keyboard": "0.8.4-main.e098934",
|
|
35
|
+
"@dxos/react-ui-attention": "0.8.4-main.e098934",
|
|
36
|
+
"@dxos/util": "0.8.4-main.e098934"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@effect-rx/rx-react": "0.38.0",
|
|
39
|
-
"@effect/platform": "0.
|
|
40
|
+
"@effect/platform": "0.90.2",
|
|
40
41
|
"@types/react": "~18.2.0",
|
|
41
42
|
"@types/react-dom": "~18.2.0",
|
|
42
|
-
"effect": "3.17.
|
|
43
|
+
"effect": "3.17.7",
|
|
43
44
|
"react": "~18.2.0",
|
|
44
45
|
"react-dom": "~18.2.0",
|
|
45
|
-
"vite": "
|
|
46
|
-
"@dxos/live-object": "0.8.4-main.
|
|
47
|
-
"@dxos/random": "0.8.4-main.
|
|
48
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
49
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
50
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
46
|
+
"vite": "7.1.1",
|
|
47
|
+
"@dxos/live-object": "0.8.4-main.e098934",
|
|
48
|
+
"@dxos/random": "0.8.4-main.e098934",
|
|
49
|
+
"@dxos/react-ui": "0.8.4-main.e098934",
|
|
50
|
+
"@dxos/react-ui-theme": "0.8.4-main.e098934",
|
|
51
|
+
"@dxos/storybook-utils": "0.8.4-main.e098934"
|
|
51
52
|
},
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -55,8 +56,8 @@
|
|
|
55
56
|
"effect": "^3.13.3",
|
|
56
57
|
"react": "~18.2.0",
|
|
57
58
|
"react-dom": "~18.2.0",
|
|
58
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
59
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
59
|
+
"@dxos/react-ui": "0.8.4-main.e098934",
|
|
60
|
+
"@dxos/react-ui-theme": "0.8.4-main.e098934"
|
|
60
61
|
},
|
|
61
62
|
"publishConfig": {
|
|
62
63
|
"access": "public"
|
package/src/builder.ts
CHANGED
|
@@ -9,10 +9,10 @@ import type { MenuActionProperties, MenuItemGroupProperties } from './types';
|
|
|
9
9
|
import { createMenuAction, createMenuItemGroup } from './util';
|
|
10
10
|
|
|
11
11
|
export interface ActionGroupBuilder {
|
|
12
|
-
action<P extends {} = {}>(id: string,
|
|
12
|
+
action<P extends {} = {}>(id: string, props: P & MenuActionProperties, invoke: () => void): this;
|
|
13
13
|
group<P extends {} = {}>(
|
|
14
14
|
id: string,
|
|
15
|
-
|
|
15
|
+
props: P & MenuItemGroupProperties,
|
|
16
16
|
cb: (builder: ActionGroupBuilder) => void,
|
|
17
17
|
): this;
|
|
18
18
|
}
|
|
@@ -32,12 +32,6 @@ class MenuBuilderImpl implements MenuBuilder {
|
|
|
32
32
|
private readonly _rootId: string,
|
|
33
33
|
) {}
|
|
34
34
|
|
|
35
|
-
action<P extends {} = {}>(id: string, invoke: () => void, properties: P & MenuActionProperties): this {
|
|
36
|
-
this._data.nodes.push(createMenuAction(id, invoke, properties));
|
|
37
|
-
this._data.edges.push({ source: this._rootId, target: id });
|
|
38
|
-
return this;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
35
|
root(props: MenuItemGroupProperties): this {
|
|
42
36
|
invariant(this._rootId === 'root', 'Root group can only be at the top level');
|
|
43
37
|
invariant(this._data.nodes.find((node) => node.id === 'root') === undefined, 'Root group can only be created once');
|
|
@@ -45,12 +39,18 @@ class MenuBuilderImpl implements MenuBuilder {
|
|
|
45
39
|
return this;
|
|
46
40
|
}
|
|
47
41
|
|
|
42
|
+
action<P extends {} = {}>(id: string, props: P & MenuActionProperties, invoke: () => void): this {
|
|
43
|
+
this._data.nodes.push(createMenuAction(id, invoke, props));
|
|
44
|
+
this._data.edges.push({ source: this._rootId, target: id });
|
|
45
|
+
return this;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
48
|
group<P extends {} = {}>(
|
|
49
49
|
id: string,
|
|
50
|
-
|
|
50
|
+
props: P & MenuItemGroupProperties,
|
|
51
51
|
cb: (builder: ActionGroupBuilder) => void,
|
|
52
52
|
): this {
|
|
53
|
-
this._data.nodes.push(createMenuItemGroup(id,
|
|
53
|
+
this._data.nodes.push(createMenuItemGroup(id, props));
|
|
54
54
|
this._data.edges.push({ source: this._rootId, target: id });
|
|
55
55
|
cb(new MenuBuilderImpl(this._data, id));
|
|
56
56
|
return this;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type Action as GraphAction
|
|
7
|
+
import { type ActionGroup, type Action as GraphAction } from '@dxos/app-graph';
|
|
8
8
|
import { keySymbols } from '@dxos/keyboard';
|
|
9
|
-
import { toLocalizedString, useTranslation
|
|
10
|
-
import {
|
|
9
|
+
import { type TFunction, toLocalizedString, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { descriptionText, mx } from '@dxos/react-ui-theme';
|
|
11
11
|
|
|
12
12
|
import { translationKey } from '../translations';
|
|
13
13
|
import { type MenuActionProperties } from '../types';
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
6
6
|
import React, { type MouseEvent, useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { type DropdownMenuRootProps, Icon, DropdownMenu as NaturalDropdownMenu } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { type MenuAction, type MenuItem, type MenuItemGroup } from '../types';
|
|
9
11
|
|
|
10
12
|
import { ActionLabel } from './ActionLabel';
|
|
11
13
|
import { type MenuScopedProps, useMenu, useMenuItems } from './MenuContext';
|
|
12
|
-
import { type MenuAction, type MenuItem, type MenuItemGroup } from '../types';
|
|
13
14
|
|
|
14
15
|
export type DropdownMenuProps = DropdownMenuRootProps & {
|
|
15
16
|
group?: MenuItemGroup;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type Scope, createContextScope } from '@radix-ui/react-context';
|
|
6
6
|
import React, { type PropsWithChildren, useMemo } from 'react';
|
|
7
7
|
|
|
8
8
|
import { type MenuContextValue, type MenuItem, type MenuItemGroup } from '../types';
|
|
@@ -3,13 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
8
|
import React, { useCallback, useMemo } from 'react';
|
|
7
9
|
|
|
8
10
|
import { faker } from '@dxos/random';
|
|
9
11
|
import { IconButton } from '@dxos/react-ui';
|
|
10
12
|
import { withTheme } from '@dxos/storybook-utils';
|
|
11
13
|
|
|
12
|
-
import { DropdownMenu as NaturalDropdownMenu, ToolbarMenu
|
|
14
|
+
import { MenuProvider, DropdownMenu as NaturalDropdownMenu, ToolbarMenu } from '../components';
|
|
13
15
|
import { useMenuActions } from '../hooks';
|
|
14
16
|
import { createActions, createNestedActions, createNestedActionsResolver, useMutateActions } from '../testing';
|
|
15
17
|
import { translations } from '../translations';
|
|
@@ -17,16 +19,20 @@ import { type MenuAction } from '../types';
|
|
|
17
19
|
|
|
18
20
|
faker.seed(1234);
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
title: 'ui/react-ui-menu/
|
|
22
|
+
const meta = {
|
|
23
|
+
title: 'ui/react-ui-menu/ToolbarMenu',
|
|
22
24
|
component: ToolbarMenu,
|
|
23
25
|
decorators: [withTheme],
|
|
24
26
|
parameters: {
|
|
25
27
|
translations,
|
|
26
28
|
},
|
|
27
|
-
}
|
|
29
|
+
} satisfies Meta<typeof ToolbarMenu>;
|
|
30
|
+
|
|
31
|
+
export default meta;
|
|
32
|
+
|
|
33
|
+
type Story = StoryObj<typeof meta>;
|
|
28
34
|
|
|
29
|
-
export const DropdownMenu = {
|
|
35
|
+
export const DropdownMenu: Story = {
|
|
30
36
|
render: () => {
|
|
31
37
|
const menuActions = useMemo(() => createActions() as MenuAction[], []);
|
|
32
38
|
const resolveGroupItems = useCallback(() => menuActions, [menuActions]);
|
|
@@ -44,7 +50,7 @@ export const DropdownMenu = {
|
|
|
44
50
|
},
|
|
45
51
|
};
|
|
46
52
|
|
|
47
|
-
export const Toolbar = {
|
|
53
|
+
export const Toolbar: Story = {
|
|
48
54
|
render: () => {
|
|
49
55
|
const nestedMenuActions = useMemo(() => createNestedActionsResolver(), []);
|
|
50
56
|
|
|
@@ -56,7 +62,7 @@ export const Toolbar = {
|
|
|
56
62
|
},
|
|
57
63
|
};
|
|
58
64
|
|
|
59
|
-
export const UseMenuActionsToolbar = {
|
|
65
|
+
export const UseMenuActionsToolbar: Story = {
|
|
60
66
|
render: () => {
|
|
61
67
|
const menu = useMenuActions(createNestedActions);
|
|
62
68
|
|
|
@@ -8,21 +8,22 @@ import { Icon, Toolbar as NaturalToolbar, type ToolbarRootProps, useTranslation
|
|
|
8
8
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
9
9
|
import { mx, textBlockWidth, toolbarLayout } from '@dxos/react-ui-theme';
|
|
10
10
|
|
|
11
|
-
import { actionLabel, ActionLabel } from './ActionLabel';
|
|
12
|
-
import { DropdownMenu } from './DropdownMenu';
|
|
13
|
-
import { type MenuScopedProps, useMenu, useMenuItems } from './MenuContext';
|
|
14
11
|
import { translationKey } from '../translations';
|
|
15
12
|
import {
|
|
16
13
|
type MenuAction,
|
|
14
|
+
type MenuActionProperties,
|
|
17
15
|
type MenuItem,
|
|
18
|
-
isMenuGroup,
|
|
19
|
-
isSeparator,
|
|
20
16
|
type MenuItemGroup,
|
|
21
|
-
type MenuActionProperties,
|
|
22
17
|
type MenuMultipleSelectActionGroup,
|
|
23
18
|
type MenuSingleSelectActionGroup,
|
|
19
|
+
isMenuGroup,
|
|
20
|
+
isSeparator,
|
|
24
21
|
} from '../types';
|
|
25
22
|
|
|
23
|
+
import { ActionLabel, actionLabel } from './ActionLabel';
|
|
24
|
+
import { DropdownMenu } from './DropdownMenu';
|
|
25
|
+
import { type MenuScopedProps, useMenu, useMenuItems } from './MenuContext';
|
|
26
|
+
|
|
26
27
|
export type ToolbarMenuDropdownMenuActionGroup = Omit<MenuActionProperties, 'variant' | 'icon'> & {
|
|
27
28
|
variant: 'dropdownMenu';
|
|
28
29
|
icon: string;
|
|
@@ -60,6 +61,7 @@ const ActionToolbarItem = ({ action, __menuScope }: MenuScopedProps<{ action: Me
|
|
|
60
61
|
const rootProps = icon
|
|
61
62
|
? { icon, size: iconSize, iconOnly, label: actionLabel(action, t) }
|
|
62
63
|
: { children: <ActionLabel action={action} /> };
|
|
64
|
+
|
|
63
65
|
return hidden ? null : (
|
|
64
66
|
<Root
|
|
65
67
|
key={action.id}
|
|
@@ -100,6 +102,7 @@ const DropdownMenuToolbarItem = ({
|
|
|
100
102
|
</>
|
|
101
103
|
),
|
|
102
104
|
};
|
|
105
|
+
|
|
103
106
|
return (
|
|
104
107
|
<DropdownMenu.Root group={group} items={items}>
|
|
105
108
|
<DropdownMenu.Trigger asChild>
|
|
@@ -118,6 +121,7 @@ const ToggleGroupItem = ({ group, action, __menuScope }: MenuScopedProps<Toolbar
|
|
|
118
121
|
const rootProps = icon
|
|
119
122
|
? { icon, size: iconSize, iconOnly, label: actionLabel(action, t) }
|
|
120
123
|
: { children: <ActionLabel action={action} /> };
|
|
124
|
+
|
|
121
125
|
return hidden ? null : (
|
|
122
126
|
<Root
|
|
123
127
|
key={action.id}
|
|
@@ -139,8 +143,9 @@ const ToggleGroupToolbarItem = ({
|
|
|
139
143
|
}: MenuScopedProps<ToolbarMenuActionGroupProps>) => {
|
|
140
144
|
const items = useMenuItems(group, propsItems, 'ToggleGroupToolbarItem', __menuScope);
|
|
141
145
|
const { selectCardinality, value } = group.properties;
|
|
146
|
+
|
|
142
147
|
return (
|
|
143
|
-
// TODO(thure):
|
|
148
|
+
// TODO(thure): Fix.
|
|
144
149
|
// @ts-ignore
|
|
145
150
|
<NaturalToolbar.ToggleGroup type={selectCardinality} value={value}>
|
|
146
151
|
{
|
|
@@ -164,6 +169,7 @@ export const ToolbarMenu = ({
|
|
|
164
169
|
const { hasAttention } = useAttention(attendableId);
|
|
165
170
|
const InnerRoot = wrapContents ? 'div' : Fragment;
|
|
166
171
|
const innerRootProps = wrapContents ? { role: 'none', className: mx(textBlockWidth, toolbarLayout, 'bs-full') } : {};
|
|
172
|
+
|
|
167
173
|
return (
|
|
168
174
|
<NaturalToolbar.Root
|
|
169
175
|
{...props}
|
|
@@ -171,23 +177,27 @@ export const ToolbarMenu = ({
|
|
|
171
177
|
classNames={[attendableId && !hasAttention && '*:opacity-20 !bg-transparent', classNames]}
|
|
172
178
|
>
|
|
173
179
|
<InnerRoot {...innerRootProps}>
|
|
174
|
-
{items?.map((item: MenuItem, i: number) =>
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
) : isMenuGroup(item) ? (
|
|
178
|
-
item.properties.variant === 'dropdownMenu' ? (
|
|
179
|
-
// TODO(thure): Figure out type narrowing that doesn’t require so much use of `as`.
|
|
180
|
-
<DropdownMenuToolbarItem key={item.id} group={item as MenuItemGroup<ToolbarMenuActionGroupProperties>} />
|
|
181
|
-
) : (
|
|
182
|
-
// TODO(thure): Figure out type narrowing that doesn’t require so much use of `as`.
|
|
183
|
-
<ToggleGroupToolbarItem key={item.id} group={item as MenuItemGroup<ToolbarMenuActionGroupProperties>} />
|
|
184
|
-
)
|
|
185
|
-
) : (
|
|
186
|
-
// TODO(thure): Figure out type narrowing that doesn’t require so much use of `as`.
|
|
187
|
-
<ActionToolbarItem key={item.id} action={item as MenuAction} />
|
|
188
|
-
),
|
|
189
|
-
)}
|
|
180
|
+
{items?.map((item: MenuItem, i: number) => (
|
|
181
|
+
<ToolbarMenuItem key={item.id ?? i} item={item} />
|
|
182
|
+
))}
|
|
190
183
|
</InnerRoot>
|
|
191
184
|
</NaturalToolbar.Root>
|
|
192
185
|
);
|
|
193
186
|
};
|
|
187
|
+
|
|
188
|
+
const ToolbarMenuItem = ({ item }: { item: MenuItem }) => {
|
|
189
|
+
if (isSeparator(item)) {
|
|
190
|
+
return <NaturalToolbar.Separator variant={item.properties.variant} />;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// TODO(thure): Figure out type narrowing that doesn’t require so much use of `as`.
|
|
194
|
+
if (isMenuGroup(item)) {
|
|
195
|
+
if (item.properties.variant === 'dropdownMenu') {
|
|
196
|
+
return <DropdownMenuToolbarItem group={item as MenuItemGroup<ToolbarMenuActionGroupProperties>} />;
|
|
197
|
+
} else {
|
|
198
|
+
return <ToggleGroupToolbarItem group={item as MenuItemGroup<ToolbarMenuActionGroupProperties>} />;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return <ActionToolbarItem action={item as MenuAction} />;
|
|
203
|
+
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { RegistryContext, type Rx, useRxValue } from '@effect-rx/rx-react';
|
|
6
6
|
import { useCallback, useContext, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type Edge, type Edges, Graph, type
|
|
8
|
+
import { type Edge, type Edges, Graph, type Node, type NodeArg, ROOT_ID } from '@dxos/app-graph';
|
|
9
9
|
|
|
10
10
|
import { type MenuItem, type MenuItemGroup } from '../types';
|
|
11
11
|
|
package/src/testing/generator.ts
CHANGED
|
@@ -6,20 +6,20 @@ import { Rx } from '@effect-rx/rx-react';
|
|
|
6
6
|
import { useEffect } from 'react';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
+
ACTION_GROUP_TYPE,
|
|
10
|
+
ACTION_TYPE,
|
|
9
11
|
type Action,
|
|
10
12
|
Graph,
|
|
11
13
|
type NodeArg,
|
|
12
|
-
ACTION_TYPE,
|
|
13
|
-
ACTION_GROUP_TYPE,
|
|
14
|
-
actionGroupSymbol,
|
|
15
14
|
ROOT_ID,
|
|
15
|
+
actionGroupSymbol,
|
|
16
16
|
} from '@dxos/app-graph';
|
|
17
17
|
import { live } from '@dxos/live-object';
|
|
18
18
|
import { faker } from '@dxos/random';
|
|
19
19
|
import { type DeepWriteable } from '@dxos/util';
|
|
20
20
|
|
|
21
21
|
import { type ActionGraphProps } from '../hooks/useMenuActions';
|
|
22
|
-
import { type MenuAction, type
|
|
22
|
+
import { type MenuAction, type MenuItem, type MenuItemGroup } from '../types';
|
|
23
23
|
|
|
24
24
|
export type CreateActionsParams = Partial<{
|
|
25
25
|
type?: typeof ACTION_TYPE | typeof ACTION_GROUP_TYPE;
|
package/src/types.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import { type
|
|
5
|
+
import { ACTION_GROUP_TYPE, type Action, type ActionGroup, type Node } from '@dxos/app-graph';
|
|
6
|
+
import { type ClassNameValue, type IconButtonProps, type Label, type ToolbarSeparatorProps } from '@dxos/react-ui';
|
|
7
7
|
|
|
8
8
|
export type MenuActionProperties = {
|
|
9
9
|
label: Label;
|
package/src/util.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { ACTION_GROUP_TYPE, ACTION_TYPE,
|
|
5
|
+
import { ACTION_GROUP_TYPE, ACTION_TYPE, type ActionLike, actionGroupSymbol } from '@dxos/app-graph';
|
|
6
6
|
import { getHostPlatform } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
import {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menus.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Menus.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AACrB,OAAO,KAA+B,MAAM,OAAO,CAAC;;;;;;;;;;;;;AAcpD,wBAOE;AAEF,eAAO,MAAM,YAAY;;CAgBxB,CAAC;AAEF,eAAO,MAAM,OAAO;;CAUnB,CAAC;AAEF,eAAO,MAAM,qBAAqB;;CAUjC,CAAC"}
|