@dxos/react-ui-menu 0.8.4-main.f9ba587 → 0.8.4-main.fffef41
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 +63 -53
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +63 -53
- 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 +3 -1
- package/dist/types/src/components/MenuContext.d.ts.map +1 -1
- package/dist/types/src/components/ToolbarMenu.d.ts +2 -2
- package/dist/types/src/components/ToolbarMenu.d.ts.map +1 -1
- package/dist/types/src/components/ToolbarMenu.stories.d.ts +20 -0
- package/dist/types/src/components/ToolbarMenu.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/useMenuActions.d.ts +3 -2
- package/dist/types/src/hooks/useMenuActions.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts +4 -4
- 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 +26 -25
- package/src/builder.ts +10 -10
- package/src/components/ActionLabel.tsx +3 -3
- package/src/components/DropdownMenu.tsx +6 -3
- package/src/components/MenuContext.tsx +7 -3
- package/src/components/{Menus.stories.tsx → ToolbarMenu.stories.tsx} +14 -10
- package/src/components/ToolbarMenu.tsx +45 -30
- package/src/hooks/useMenuActions.ts +13 -6
- package/src/index.ts +1 -1
- package/src/testing/generator.ts +6 -6
- package/src/types.ts +2 -2
- package/src/util.ts +7 -2
- package/dist/types/src/components/Menus.stories.d.ts +0 -25
- package/dist/types/src/components/Menus.stories.d.ts.map +0 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ __menuScope, classNames, textBlockWidth: textBlockWidthParam, ...props }: import("./MenuContext").MenuScopedProps<import("./ToolbarMenu").ToolbarMenuProps>) => React.JSX.Element;
|
|
6
|
+
decorators: import("@storybook/react").Decorator[];
|
|
7
|
+
parameters: {
|
|
8
|
+
translations: [{
|
|
9
|
+
readonly 'en-US': {
|
|
10
|
+
readonly "react-ui-menu": {};
|
|
11
|
+
};
|
|
12
|
+
}];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const DropdownMenu: Story;
|
|
18
|
+
export declare const Toolbar: Story;
|
|
19
|
+
export declare const UseMenuActionsToolbar: Story;
|
|
20
|
+
//# sourceMappingURL=ToolbarMenu.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolbarMenu.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ToolbarMenu.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAA+B,MAAM,OAAO,CAAC;AAcpD,QAAA,MAAM,IAAI;;;;;;;;;;;CAO0B,CAAC;AAErC,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,YAAY,EAAE,KAgB1B,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAUnC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
2
2
|
import { type Edge, type NodeArg } from '@dxos/app-graph';
|
|
3
3
|
import { type MenuItem, type MenuItemGroup } from '../types';
|
|
4
4
|
export type ActionGraphNodes = NodeArg<any>[];
|
|
@@ -7,7 +7,8 @@ export type ActionGraphProps = {
|
|
|
7
7
|
nodes: ActionGraphNodes;
|
|
8
8
|
edges: ActionGraphEdges;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type MenuActions = {
|
|
11
11
|
useGroupItems: (sourceNode?: MenuItemGroup) => MenuItem[];
|
|
12
12
|
};
|
|
13
|
+
export declare const useMenuActions: (props: Atom.Atom<ActionGraphProps>) => MenuActions;
|
|
13
14
|
//# sourceMappingURL=useMenuActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMenuActions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useMenuActions.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"useMenuActions.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useMenuActions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,IAAI,EAAiC,MAAM,yBAAyB,CAAC;AAGnF,OAAO,EAAE,KAAK,IAAI,EAAgC,KAAK,OAAO,EAAW,MAAM,iBAAiB,CAAC;AAEjG,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AA6B7D,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AAC9C,MAAM,MAAM,gBAAgB,GAAG,IAAI,EAAE,CAAC;AACtC,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,aAAa,EAAE,CAAC,UAAU,CAAC,EAAE,aAAa,KAAK,QAAQ,EAAE,CAAC;CAC3D,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAG,WA0BnE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACxG,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import { ACTION_GROUP_TYPE, ACTION_TYPE, type Action } from '@dxos/app-graph';
|
|
3
3
|
import { type ActionGraphProps } from '../hooks/useMenuActions';
|
|
4
|
-
import { type MenuAction, type
|
|
4
|
+
import { type MenuAction, type MenuItem, type MenuItemGroup } from '../types';
|
|
5
5
|
export type CreateActionsParams = Partial<{
|
|
6
6
|
type?: typeof ACTION_TYPE | typeof ACTION_GROUP_TYPE;
|
|
7
7
|
callback: () => void;
|
|
@@ -18,7 +18,7 @@ export declare const createActions: (params?: CreateActionsParams) => import("@d
|
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
};
|
|
20
20
|
}>[];
|
|
21
|
-
export declare const createNestedActions:
|
|
21
|
+
export declare const createNestedActions: Atom.Atom<ActionGraphProps>;
|
|
22
22
|
export declare const createNestedActionsResolver: (groupParams?: CreateActionsParams, params?: CreateActionsParams) => {
|
|
23
23
|
resolveGroupItems: (groupNode?: MenuItemGroup) => MenuItem[] | null;
|
|
24
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/testing/generator.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAG/C,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AAKzB,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9E,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC;IACxC,IAAI,CAAC,EAAE,OAAO,WAAW,GAAG,OAAO,iBAAiB,CAAC;IACrD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAqBH,eAAO,MAAM,aAAa,GAAI,SAAS,mBAAmB;;;0BAvBxC,IAAI;;;;;;;IAyCrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,6BAY9B,CAAC;AAEH,eAAO,MAAM,2BAA2B,GAAI,cAAc,mBAAmB,EAAE,SAAS,mBAAmB;oCAYlE,aAAa,KACM,QAAQ,EAAE,GAAG,IAAI;CAE5E,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,SAAS,MAAM,EAAE,mBAUxD,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,SAAS,UAAU,EAAE,SAI9C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type Action, type ActionGroup, type Node } from '@dxos/app-graph';
|
|
2
|
+
import { type ClassNameValue, type IconButtonProps, type Label, type ToolbarSeparatorProps } from '@dxos/react-ui';
|
|
3
3
|
export type MenuActionProperties = {
|
|
4
4
|
label: Label;
|
|
5
5
|
icon?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,MAAM,EAAE,KAAK,WAAW,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,KAAK,KAAK,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEnH,MAAM,MAAM,oBAAoB,GAAG;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,cAAc,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IACpC,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CA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/dist/types/src/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { type ActionLike, actionGroupSymbol } from '@dxos/app-graph';
|
|
2
2
|
import { type MenuActionProperties, type MenuItemGroupProperties } from './types';
|
|
3
3
|
export declare const getShortcut: (action: ActionLike) => any;
|
|
4
4
|
export declare const fallbackIcon = "ph--placeholder--regular";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,EAAkC,KAAK,UAAU,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAGrG,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,uBAAuB,EAE7B,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,WAAW,GAAI,QAAQ,UAAU,QAI7C,CAAC;AAEF,eAAO,MAAM,YAAY,6BAA6B,CAAC;AAEvD,eAAO,MAAM,gBAAgB,GAAI,CAAC,SAAS,EAAE,GAAG,EAAE,EAChD,IAAI,MAAM,EACV,QAAQ,MAAM,IAAI,EAClB,YAAY,CAAC,GAAG,oBAAoB;;;;gBADtB,IAAI;CAQK,CAAC;AAE1B,eAAO,MAAM,mBAAmB,GAC9B,CAAC,SAAS,uBAAuB,GAAG,uBAAuB,GAAG,OAAO,CAAC,oBAAoB,CAAC,EAE3F,IAAI,MAAM,EACV,YAAY,CAAC;;;;;CAOa,CAAC;AAE7B,eAAO,MAAM,kBAAkB,GAAI,KAAI,MAAc,EAAE,SAAQ,MAAe;;;;;;;cAMrD,KAAK;;;;;;CAS5B,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAAI,KAAI,MAAe,EAAE,SAAQ,MAAe;;;;;;;cAMvD,KAAK;;;;;;CAI5B,CAAC"}
|