@dxos/react-ui-menu 0.8.4-main.f5c0578 → 0.8.4-main.fcfe5033a5
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 +556 -391
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +556 -391
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/builder.d.ts +28 -3
- package/dist/types/src/builder.d.ts.map +1 -1
- package/dist/types/src/builder.test.d.ts +2 -0
- package/dist/types/src/builder.test.d.ts.map +1 -0
- package/dist/types/src/components/ActionLabel.d.ts +3 -3
- package/dist/types/src/components/ActionLabel.d.ts.map +1 -1
- package/dist/types/src/components/DropdownMenu.d.ts +4 -2
- package/dist/types/src/components/DropdownMenu.d.ts.map +1 -1
- package/dist/types/src/components/Menu.d.ts +50 -0
- package/dist/types/src/components/Menu.d.ts.map +1 -0
- package/dist/types/src/components/Menu.stories.d.ts +21 -0
- package/dist/types/src/components/Menu.stories.d.ts.map +1 -0
- package/dist/types/src/components/Menu.test.d.ts +2 -0
- package/dist/types/src/components/Menu.test.d.ts.map +1 -0
- package/dist/types/src/components/ToolbarMenu.d.ts +7 -6
- package/dist/types/src/components/ToolbarMenu.d.ts.map +1 -1
- package/dist/types/src/components/ToolbarMenu.stories.d.ts +22 -0
- package/dist/types/src/components/ToolbarMenu.stories.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useMenuActions.d.ts +8 -7
- package/dist/types/src/hooks/useMenuActions.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/testing/generator.d.ts +19 -13
- package/dist/types/src/testing/generator.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +37 -26
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util.d.ts +14 -5
- package/dist/types/src/util.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -29
- package/src/builder.test.ts +224 -0
- package/src/builder.ts +76 -26
- package/src/components/ActionLabel.tsx +5 -5
- package/src/components/DropdownMenu.tsx +12 -6
- package/src/components/Menu.stories.tsx +265 -0
- package/src/components/Menu.test.tsx +447 -0
- package/src/components/Menu.tsx +348 -0
- package/src/components/ToolbarMenu.stories.tsx +82 -0
- package/src/components/ToolbarMenu.tsx +153 -95
- package/src/components/index.ts +1 -3
- package/src/hooks/useMenuActions.ts +30 -53
- package/src/index.ts +1 -3
- package/src/testing/generator.ts +74 -64
- package/src/translations.ts +1 -1
- package/src/types.ts +39 -27
- package/src/util.ts +34 -15
- package/dist/types/src/components/MenuContext.d.ts +0 -13
- package/dist/types/src/components/MenuContext.d.ts.map +0 -1
- package/dist/types/src/components/Menus.stories.d.ts +0 -25
- package/dist/types/src/components/Menus.stories.d.ts.map +0 -1
- package/src/components/MenuContext.tsx +0 -50
- package/src/components/Menus.stories.tsx +0 -69
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
import { type
|
|
4
|
-
export type ActionGraphNodes = NodeArg<any>[];
|
|
5
|
-
export type ActionGraphEdges = Edge[];
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import { Graph, Node } from '@dxos/app-graph';
|
|
3
|
+
import { type MenuItemsAccessor } from '../types';
|
|
4
|
+
export type ActionGraphNodes = Node.NodeArg<any>[];
|
|
5
|
+
export type ActionGraphEdges = Graph.Edge[];
|
|
6
6
|
export type ActionGraphProps = {
|
|
7
7
|
nodes: ActionGraphNodes;
|
|
8
8
|
edges: ActionGraphEdges;
|
|
9
9
|
};
|
|
10
|
-
export
|
|
11
|
-
|
|
10
|
+
export type MenuActions = {
|
|
11
|
+
items: MenuItemsAccessor;
|
|
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,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;AACnD,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;AAC5C,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,gBAAgB,CAAC;IACxB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,iBAAiB,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAG,WAuBnE,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export { rxFromSignal } from '@dxos/app-graph';
|
|
2
1
|
export * from './components';
|
|
3
2
|
export * from './hooks';
|
|
4
3
|
export * from './types';
|
|
5
4
|
export { createMenuAction, createMenuItemGroup, createLineSeparator, createGapSeparator } from './util';
|
|
6
|
-
export { MenuBuilder } from './builder';
|
|
5
|
+
export { type ActionGroupBuilder, type ActionGroupBuilderFn, MenuBuilder } from './builder';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,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,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Atom, Registry } from '@effect-atom/atom-react';
|
|
2
|
+
import { Node } from '@dxos/app-graph';
|
|
3
3
|
import { type ActionGraphProps } from '../hooks/useMenuActions';
|
|
4
|
-
import { type
|
|
5
|
-
export type
|
|
6
|
-
type?: typeof
|
|
4
|
+
import { type MenuItemsAccessor } from '../types';
|
|
5
|
+
export type CreateActionsProps = Partial<{
|
|
6
|
+
type?: typeof Node.ActionType | typeof Node.ActionGroupType;
|
|
7
7
|
callback: () => void;
|
|
8
8
|
count: number;
|
|
9
9
|
}>;
|
|
10
|
-
export declare const createActions: (params?:
|
|
10
|
+
export declare const createActions: (params?: CreateActionsProps) => {
|
|
11
11
|
id: string;
|
|
12
|
-
type: "dxos.
|
|
12
|
+
type: "org.dxos.type.graphActionGroup" | "org.dxos.type.graphAction";
|
|
13
13
|
data: symbol | (() => void);
|
|
14
14
|
properties: {
|
|
15
15
|
variant?: string | undefined;
|
|
@@ -17,11 +17,17 @@ export declare const createActions: (params?: CreateActionsParams) => import("@d
|
|
|
17
17
|
icon: string;
|
|
18
18
|
disabled: boolean;
|
|
19
19
|
};
|
|
20
|
-
}
|
|
21
|
-
export declare const createNestedActions:
|
|
22
|
-
export declare const createNestedActionsResolver: (
|
|
23
|
-
|
|
20
|
+
}[];
|
|
21
|
+
export declare const createNestedActions: Atom.Writable<ActionGraphProps, ActionGraphProps>;
|
|
22
|
+
export declare const createNestedActionsResolver: (props?: {
|
|
23
|
+
groupParams?: CreateActionsProps;
|
|
24
|
+
params?: CreateActionsProps;
|
|
25
|
+
registry?: Registry.Registry;
|
|
26
|
+
}) => {
|
|
27
|
+
items: MenuItemsAccessor;
|
|
24
28
|
};
|
|
25
|
-
|
|
26
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Hook to mutate actions in an atom on an interval for testing reactivity.
|
|
31
|
+
*/
|
|
32
|
+
export declare const useMutateActions: (actionsAtom: Atom.Writable<ActionGraphProps>) => void;
|
|
27
33
|
//# sourceMappingURL=generator.d.ts.map
|
|
@@ -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,QAAQ,EAAmB,MAAM,yBAAyB,CAAC;AAG1E,OAAO,EAAS,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAqC,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErF,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC;IACvC,IAAI,CAAC,EAAE,OAAO,IAAI,CAAC,UAAU,GAAG,OAAO,IAAI,CAAC,eAAe,CAAC;IAC5D,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAqBH,eAAO,MAAM,aAAa,GAAI,SAAS,kBAAkB;;;0BAvBvC,IAAI;;;;;;;GAuCrB,CAAC;AAgBF,eAAO,MAAM,mBAAmB,mDAAuD,CAAC;AAExF,eAAO,MAAM,2BAA2B,GAAI,QAAQ;IAClD,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;CAC9B;;CAkBA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,SA0B5E,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const translationKey = "react-ui-menu";
|
|
1
|
+
export declare const translationKey = "@dxos/react-ui-menu";
|
|
2
2
|
export declare const translations: [{
|
|
3
3
|
readonly 'en-US': {
|
|
4
|
-
readonly "react-ui-menu": {};
|
|
4
|
+
readonly "@dxos/react-ui-menu": {};
|
|
5
5
|
};
|
|
6
6
|
}];
|
|
7
7
|
//# sourceMappingURL=translations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,wBAAwB,CAAC;AAEpD,eAAO,MAAM,YAAY;;;;EAMM,CAAC"}
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
value?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
hidden?: boolean;
|
|
9
|
-
iconOnly?: boolean;
|
|
10
|
-
testId?: string;
|
|
11
|
-
variant?: 'action' | 'toggle';
|
|
12
|
-
checked?: boolean;
|
|
13
|
-
classNames?: ClassNameValue;
|
|
14
|
-
};
|
|
15
|
-
export type MenuItemGroupProperties = {
|
|
16
|
-
label: Label;
|
|
17
|
-
icon?: string;
|
|
18
|
-
iconOnly?: boolean;
|
|
19
|
-
};
|
|
20
|
-
export type MenuAction<P extends {} = {}> = Action<P & MenuActionProperties>;
|
|
1
|
+
import { type Atom } from '@effect-atom/atom-react';
|
|
2
|
+
import { Node } from '@dxos/app-graph';
|
|
3
|
+
import { type IconButtonProps, type ToolbarSeparatorProps } from '@dxos/react-ui';
|
|
4
|
+
import { type MenuActionProperties } from '@dxos/ui-types';
|
|
5
|
+
export type MenuAction<P extends {} = {}> = Node.Action<P & MenuActionProperties>;
|
|
21
6
|
export declare const MenuSeparatorType: "@dxos/react-ui-toolbar/separator";
|
|
22
|
-
export type MenuSeparator = Node<never, Pick<ToolbarSeparatorProps, 'variant'>> & {
|
|
7
|
+
export type MenuSeparator = Node.Node<never, Pick<ToolbarSeparatorProps, 'variant'>> & {
|
|
23
8
|
type: typeof MenuSeparatorType;
|
|
24
9
|
};
|
|
25
|
-
export declare const isSeparator: (node: Node) => node is MenuSeparator;
|
|
10
|
+
export declare const isSeparator: (node: Node.Node) => node is MenuSeparator;
|
|
26
11
|
export type MenuSingleSelectActionGroup = {
|
|
27
12
|
selectCardinality: 'single';
|
|
28
13
|
value: string;
|
|
@@ -31,13 +16,39 @@ export type MenuMultipleSelectActionGroup = {
|
|
|
31
16
|
selectCardinality: 'multiple';
|
|
32
17
|
value: string[];
|
|
33
18
|
};
|
|
34
|
-
export type MenuItemGroup<P extends Record<string, any> = Record<string, any>> = ActionGroup<P>;
|
|
35
|
-
export declare const isMenuGroup: (node: Node) => node is MenuItemGroup;
|
|
19
|
+
export type MenuItemGroup<P extends Record<string, any> = Record<string, any>> = Node.ActionGroup<P>;
|
|
20
|
+
export declare const isMenuGroup: (node: Node.Node) => node is MenuItemGroup;
|
|
36
21
|
export type MenuItem = MenuSeparator | MenuAction | MenuItemGroup;
|
|
37
|
-
|
|
22
|
+
/** Atom-family-style accessor: returns an atom of items for a given group (or root when undefined). */
|
|
23
|
+
export type MenuItemsAccessor = (group?: MenuItemGroup) => Atom.Atom<MenuItem[] | null>;
|
|
24
|
+
export type ActionExecutor = (action: MenuAction, params: Node.InvokeProps) => void;
|
|
25
|
+
export type MenuItemsMode = 'additive' | 'replacement';
|
|
26
|
+
export type AddMenuItemsProps = {
|
|
27
|
+
id: string;
|
|
28
|
+
mode: MenuItemsMode;
|
|
29
|
+
priority?: number;
|
|
30
|
+
items: MenuItem[];
|
|
31
|
+
groupFilter?: (group?: MenuItemGroup) => boolean;
|
|
32
|
+
};
|
|
33
|
+
export type MenuItems = Omit<AddMenuItemsProps, 'priority'> & {
|
|
34
|
+
priority: number;
|
|
35
|
+
};
|
|
36
|
+
export type MenuItemsMap = Map<string, MenuItems>;
|
|
38
37
|
export type MenuContextValue = {
|
|
39
|
-
|
|
38
|
+
/** Atom-family accessor for base menu items, keyed by group (similar to Tree model). */
|
|
39
|
+
items: MenuItemsAccessor;
|
|
40
40
|
iconSize: IconButtonProps['size'];
|
|
41
41
|
attendableId?: string;
|
|
42
|
+
/** TODO(burdon): Remove and assume always active if attendableId is undefined. */
|
|
43
|
+
/** If true, the menu is always active regardless of attention state. */
|
|
44
|
+
alwaysActive?: boolean;
|
|
45
|
+
/** Atom holding the current set of imperatively added menu items. */
|
|
46
|
+
menuItemsAtom: Atom.Atom<MenuItemsMap>;
|
|
47
|
+
/** Imperatively add menu items to the nearest MenuProvider. */
|
|
48
|
+
addMenuItems: (props: AddMenuItemsProps) => void;
|
|
49
|
+
/** Remove previously added menu items by id. */
|
|
50
|
+
removeMenuItems: (id: string) => void;
|
|
51
|
+
/** Optional action executor. If provided, will be used instead of default execution. */
|
|
52
|
+
onAction?: ActionExecutor;
|
|
42
53
|
};
|
|
43
54
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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":"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"}
|
package/dist/types/src/util.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import * as Effect from 'effect/Effect';
|
|
2
|
+
import { Node } from '@dxos/app-graph';
|
|
3
|
+
import { type MenuActionProperties, type MenuItemGroupProperties } from '@dxos/ui-types';
|
|
4
|
+
import { type MenuAction } from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Execute a menu action's Effect with its captured context.
|
|
7
|
+
* This provides the `_actionContext` layer if available.
|
|
8
|
+
*/
|
|
9
|
+
export declare const executeMenuAction: (action: MenuAction, params?: Node.InvokeProps) => Promise<void>;
|
|
10
|
+
export declare const getShortcut: (action: Node.ActionLike) => any;
|
|
4
11
|
export declare const fallbackIcon = "ph--placeholder--regular";
|
|
5
12
|
export declare const createMenuAction: <P extends {} = {}>(id: string, invoke: () => void, properties: P & MenuActionProperties) => {
|
|
6
13
|
id: string;
|
|
7
14
|
type: string;
|
|
8
15
|
properties: P & MenuActionProperties;
|
|
9
|
-
data: () => void
|
|
16
|
+
data: () => Effect.Effect<void, never, never>;
|
|
10
17
|
};
|
|
11
18
|
export declare const createMenuItemGroup: <P extends MenuItemGroupProperties = MenuItemGroupProperties & Partial<MenuActionProperties>>(id: string, properties: P) => {
|
|
12
19
|
id: string;
|
|
13
20
|
type: string;
|
|
14
21
|
properties: P;
|
|
15
|
-
data: typeof actionGroupSymbol;
|
|
22
|
+
data: typeof Node.actionGroupSymbol;
|
|
16
23
|
};
|
|
17
24
|
export declare const createGapSeparator: (id?: string, source?: string) => {
|
|
18
25
|
nodes: {
|
|
@@ -26,6 +33,7 @@ export declare const createGapSeparator: (id?: string, source?: string) => {
|
|
|
26
33
|
edges: {
|
|
27
34
|
source: string;
|
|
28
35
|
target: string;
|
|
36
|
+
relation: "child";
|
|
29
37
|
}[];
|
|
30
38
|
};
|
|
31
39
|
export declare const createLineSeparator: (id?: string, source?: string) => {
|
|
@@ -40,6 +48,7 @@ export declare const createLineSeparator: (id?: string, source?: string) => {
|
|
|
40
48
|
edges: {
|
|
41
49
|
source: string;
|
|
42
50
|
target: string;
|
|
51
|
+
relation: "child";
|
|
43
52
|
}[];
|
|
44
53
|
};
|
|
45
54
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../src/util.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGzF,OAAO,EAAE,KAAK,UAAU,EAA0C,MAAM,SAAS,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAU,QAAQ,UAAU,EAAE,SAAQ,IAAI,CAAC,WAAgB,KAAG,OAAO,CAAC,IAAI,CASvG,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,QAAQ,IAAI,CAAC,UAAU,QAIlD,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;;;;;CAOb,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;;;;;;;CAU5B,CAAC;AAEH,eAAO,MAAM,mBAAmB,GAAI,KAAI,MAAe,EAAE,SAAQ,MAAe;;;;;;;cAMvD,KAAK;;;;;;;CAI5B,CAAC"}
|