Skip to content

Commit b96ad57

Browse files
committed
feat(core): import template (#8000)
1 parent 4ec45a2 commit b96ad57

File tree

67 files changed

+1835
-974
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1835
-974
lines changed

packages/common/infra/src/modules/workspace/entities/list.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ export class WorkspaceList extends Entity {
1717
.flat()
1818
.map(isLoadings => isLoadings.some(isLoading => isLoading));
1919

20+
workspace$(id: string) {
21+
return this.workspaces$.map(workspaces =>
22+
workspaces.find(workspace => workspace.id === id)
23+
);
24+
}
25+
2026
constructor(private readonly providers: WorkspaceFlavourProvider[]) {
2127
super();
2228
}

packages/frontend/component/src/components/card/workspace-card/index.tsx

Lines changed: 0 additions & 111 deletions
This file was deleted.

packages/frontend/component/src/components/card/workspace-card/styles.css.ts

Lines changed: 0 additions & 94 deletions
This file was deleted.

packages/frontend/component/src/components/workspace-list/index.css.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/frontend/component/src/components/workspace-list/index.tsx

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
import * as DropdownMenu from '@radix-ui/react-dropdown-menu';
22
import clsx from 'clsx';
3-
import { Fragment } from 'react';
43

54
import type { MenuProps } from '../menu.types';
65
import * as styles from '../styles.css';
6+
import * as desktopStyles from './styles.css';
77

88
export const DesktopMenu = ({
99
children,
1010
items,
1111
portalOptions,
1212
rootOptions,
13-
noPortal,
1413
contentOptions: {
1514
className = '',
1615
style: contentStyle = {},
1716
...otherContentOptions
1817
} = {},
1918
}: MenuProps) => {
20-
const Wrapper = noPortal ? Fragment : DropdownMenu.Portal;
21-
const wrapperProps = noPortal ? {} : portalOptions;
2219
return (
2320
<DropdownMenu.Root {...rootOptions}>
2421
<DropdownMenu.Trigger asChild>{children}</DropdownMenu.Trigger>
2522

26-
<Wrapper {...wrapperProps}>
23+
<DropdownMenu.Portal {...portalOptions}>
2724
<DropdownMenu.Content
28-
className={clsx(styles.menuContent, className)}
25+
className={clsx(
26+
styles.menuContent,
27+
desktopStyles.contentAnimation,
28+
className
29+
)}
2930
sideOffset={5}
3031
align="start"
3132
style={{ zIndex: 'var(--affine-z-index-popover)', ...contentStyle }}
3233
{...otherContentOptions}
34+
side="bottom"
3335
>
3436
{items}
3537
</DropdownMenu.Content>
36-
</Wrapper>
38+
</DropdownMenu.Portal>
3739
</DropdownMenu.Root>
3840
);
3941
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { keyframes, style } from '@vanilla-extract/css';
2+
3+
const slideDown = keyframes({
4+
from: {
5+
opacity: 0,
6+
transform: 'translateY(-10px)',
7+
},
8+
to: {
9+
opacity: 1,
10+
transform: 'translateY(0)',
11+
},
12+
});
13+
14+
const slideUp = keyframes({
15+
to: {
16+
opacity: 0,
17+
transform: 'translateY(-10px)',
18+
},
19+
from: {
20+
opacity: 1,
21+
transform: 'translateY(0)',
22+
},
23+
});
24+
25+
export const contentAnimation = style({
26+
animation: `${slideDown} 150ms cubic-bezier(0.42, 0, 0.58, 1)`,
27+
selectors: {
28+
'&[data-state="closed"]': {
29+
pointerEvents: 'none',
30+
animation: `${slideUp} 150ms cubic-bezier(0.42, 0, 0.58, 1)`,
31+
animationFillMode: 'forwards',
32+
},
33+
},
34+
});

0 commit comments

Comments
 (0)