chore: bump version (#3041)

This commit is contained in:
Alex Yang
2023-07-06 11:49:17 +08:00
committed by GitHub
parent e95d28e136
commit fa1cd87348
44 changed files with 508 additions and 495 deletions

View File

@@ -51,12 +51,12 @@
"rxjs": "^7.8.1"
},
"devDependencies": {
"@blocksuite/blocks": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/editor": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/global": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/blocks": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/editor": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/global": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/icons": "^2.1.24",
"@blocksuite/lit": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/store": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/lit": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/store": "0.0.0-20230705162600-2cb608e4-nightly",
"@types/react": "^18.2.14",
"@types/react-datepicker": "^4.11.2",
"@types/react-dnd": "^3.0.2",

View File

@@ -6,7 +6,7 @@ import { Observable } from 'rxjs';
function rpcToObservable<
T,
H extends () => Promise<T>,
E extends (callback: (t: T) => void) => () => void
E extends (callback: (t: T) => void) => () => void,
>(
initialValue: T,
{

View File

@@ -29,7 +29,7 @@ const tabIcons = {
export type ShareMenuProps<
Workspace extends AffineCloudWorkspace | LocalWorkspace =
| AffineCloudWorkspace
| LocalWorkspace
| LocalWorkspace,
> = {
workspace: Workspace;
currentPage: Page;

View File

@@ -1,10 +1,12 @@
import { styled } from '../../styles';
import type { ButtonProps } from './interface';
import { getButtonColors } from './utils';
export const LoadingContainer = styled('div')<Pick<ButtonProps, 'type'>>(
({ theme, type = 'default' }) => {
const { color } = getButtonColors(theme, type, false);
return `
export const LoadingContainer = styled('div')<Pick<ButtonProps, 'type'>>(({
theme,
type = 'default',
}) => {
const { color } = getButtonColors(theme, type, false);
return `
margin: 0px auto;
width: 38px;
text-align: center;
@@ -45,8 +47,7 @@ export const LoadingContainer = styled('div')<Pick<ButtonProps, 'type'>>(
}
}
`;
}
);
});
export const Loading = ({ type }: Pick<ButtonProps, 'type'>) => {
return (

View File

@@ -28,36 +28,34 @@ export const StyledIconButton = styled('button', {
hoverStyle?: CSSProperties;
// In some cases, button is in a normal hover status, it should be darkened
fontSize?: CSSProperties['fontSize'];
}>(
({
}>(({
width,
height,
borderRadius,
disabled,
hoverBackground,
hoverColor,
hoverStyle,
fontSize,
}) => {
return {
width,
height,
borderRadius,
disabled,
hoverBackground,
hoverColor,
hoverStyle,
fontSize,
}) => {
return {
width,
height,
fontSize,
WebkitAppRegion: 'no-drag',
color: 'var(--affine-icon-color)',
...displayInlineFlex('center', 'center'),
...(disabled ? { cursor: 'not-allowed', pointerEvents: 'none' } : {}),
transition: 'background .15s',
borderRadius,
WebkitAppRegion: 'no-drag',
color: 'var(--affine-icon-color)',
...displayInlineFlex('center', 'center'),
...(disabled ? { cursor: 'not-allowed', pointerEvents: 'none' } : {}),
transition: 'background .15s',
borderRadius,
':hover': {
color: hoverColor ?? 'var(--affine-icon-color)',
background: hoverBackground || 'var(--affine-hover-color)',
...(hoverStyle ?? {}),
},
};
}
);
':hover': {
color: hoverColor ?? 'var(--affine-icon-color)',
background: hoverBackground || 'var(--affine-hover-color)',
...(hoverStyle ?? {}),
},
};
});
export const StyledTextButton = styled('button', {
shouldForwardProp: prop => {
@@ -85,42 +83,40 @@ export const StyledTextButton = styled('button', {
| 'type'
| 'bold'
>
>(
({
size = 'default',
disabled,
hoverBackground,
hoverColor,
hoverStyle,
bold = false,
shape = 'default',
// TODO: Implement type
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// type = 'default',
}) => {
const { fontSize, borderRadius, padding, height } = getSize(size);
>(({
size = 'default',
disabled,
hoverBackground,
hoverColor,
hoverStyle,
bold = false,
shape = 'default',
// TODO: Implement type
// eslint-disable-next-line @typescript-eslint/no-unused-vars
// type = 'default',
}) => {
const { fontSize, borderRadius, padding, height } = getSize(size);
return {
height,
paddingLeft: padding,
paddingRight: padding,
...displayInlineFlex('flex-start', 'center'),
position: 'relative',
...(disabled ? { cursor: 'not-allowed', pointerEvents: 'none' } : {}),
transition: 'background .15s',
// TODO: Implement circle shape
borderRadius: shape === 'default' ? borderRadius : height / 2,
fontSize,
fontWeight: bold ? '500' : '400',
return {
height,
paddingLeft: padding,
paddingRight: padding,
...displayInlineFlex('flex-start', 'center'),
position: 'relative',
...(disabled ? { cursor: 'not-allowed', pointerEvents: 'none' } : {}),
transition: 'background .15s',
// TODO: Implement circle shape
borderRadius: shape === 'default' ? borderRadius : height / 2,
fontSize,
fontWeight: bold ? '500' : '400',
':hover': {
color: hoverColor ?? 'var(--affine-primary-color)',
background: hoverBackground ?? 'var(--affine-hover-color)',
...(hoverStyle ?? {}),
},
};
}
);
':hover': {
color: hoverColor ?? 'var(--affine-primary-color)',
background: hoverBackground ?? 'var(--affine-hover-color)',
...(hoverStyle ?? {}),
},
};
});
export const StyledButton = styled('button', {
shouldForwardProp: prop => {
@@ -147,70 +143,68 @@ export const StyledButton = styled('button', {
| 'bold'
| 'noBorder'
>
>(
({
theme,
size = 'default',
disabled,
hoverBackground,
hoverColor,
hoverStyle,
bold = false,
shape = 'default',
type = 'default',
noBorder = false,
}) => {
const { fontSize, borderRadius, padding, height } = getSize(size);
>(({
theme,
size = 'default',
disabled,
hoverBackground,
hoverColor,
hoverStyle,
bold = false,
shape = 'default',
type = 'default',
noBorder = false,
}) => {
const { fontSize, borderRadius, padding, height } = getSize(size);
return {
height,
paddingLeft: padding,
paddingRight: padding,
border: noBorder ? 'none' : '1px solid',
WebkitAppRegion: 'no-drag',
...displayInlineFlex('center', 'center'),
gap: '8px',
position: 'relative',
// TODO: disabled color is not decided
...(disabled
? {
cursor: 'not-allowed',
pointerEvents: 'none',
color: 'var(--affine-text-disable-color)',
}
: {}),
transition: 'background .15s',
// TODO: Implement circle shape
borderRadius: shape === 'default' ? borderRadius : height / 2,
fontSize,
fontWeight: bold ? '500' : '400',
'.affine-button-icon': {
color: 'var(--affine-icon-color)',
},
'.affine-button-icon__fixed': {
color: 'var(--affine-icon-color)',
},
'>span': {
width: 'max-content',
},
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
...getButtonColors(theme, type, disabled, {
hoverBackground,
hoverColor,
hoverStyle,
}),
return {
height,
paddingLeft: padding,
paddingRight: padding,
border: noBorder ? 'none' : '1px solid',
WebkitAppRegion: 'no-drag',
...displayInlineFlex('center', 'center'),
gap: '8px',
position: 'relative',
// TODO: disabled color is not decided
...(disabled
? {
cursor: 'not-allowed',
pointerEvents: 'none',
color: 'var(--affine-text-disable-color)',
}
: {}),
transition: 'background .15s',
// TODO: Implement circle shape
borderRadius: shape === 'default' ? borderRadius : height / 2,
fontSize,
fontWeight: bold ? '500' : '400',
'.affine-button-icon': {
color: 'var(--affine-icon-color)',
},
'.affine-button-icon__fixed': {
color: 'var(--affine-icon-color)',
},
'>span': {
width: 'max-content',
},
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
...getButtonColors(theme, type, disabled, {
hoverBackground,
hoverColor,
hoverStyle,
}),
// TODO: disabled hover should be implemented
//
// ':hover': {
// color: hoverColor ?? 'var(--affine-primary-color)',
// background: hoverBackground ?? 'var(--affine-hover-color)',
// '.affine-button-icon':{
//
// }
// ...(hoverStyle ?? {}),
// },
};
}
);
// TODO: disabled hover should be implemented
//
// ':hover': {
// color: hoverColor ?? 'var(--affine-primary-color)',
// background: hoverBackground ?? 'var(--affine-hover-color)',
// '.affine-button-icon':{
//
// }
// ...(hoverStyle ?? {}),
// },
};
});

View File

@@ -2,18 +2,18 @@ import type { CSSProperties } from 'react';
import { displayFlex, styled } from '../../styles';
export const StyledEmptyContainer = styled('div')<{ style?: CSSProperties }>(
({ style }) => {
return {
height: '100%',
...displayFlex('center', 'center'),
flexDirection: 'column',
color: 'var(--affine-text-secondary-color)',
svg: {
width: style?.width ?? '248px',
height: style?.height ?? '216px',
fontSize: style?.fontSize ?? 'inherit',
},
};
}
);
export const StyledEmptyContainer = styled('div')<{ style?: CSSProperties }>(({
style,
}) => {
return {
height: '100%',
...displayFlex('center', 'center'),
flexDirection: 'column',
color: 'var(--affine-text-secondary-color)',
svg: {
width: style?.width ?? '248px',
height: style?.height ?? '216px',
fontSize: style?.fontSize ?? 'inherit',
},
};
});

View File

@@ -29,30 +29,28 @@ export const Content = styled('div', {
'align',
].includes(prop as string);
},
})<ContentProps>(
({
color,
fontSize,
weight,
lineHeight,
ellipsis,
lineNum,
})<ContentProps>(({
color,
fontSize,
weight,
lineHeight,
ellipsis,
lineNum,
width,
maxWidth,
align,
}) => {
return {
width,
maxWidth,
align,
}) => {
return {
width,
maxWidth,
textAlign: align,
display: 'inline-block',
color: color ?? 'var(--affine-text-primary-color)',
fontSize: fontSize ?? 'var(--affine-font-base)',
fontWeight: weight ?? 400,
lineHeight: lineHeight ?? 1.5,
...(ellipsis ? textEllipsis(lineNum) : {}),
};
}
);
textAlign: align,
display: 'inline-block',
color: color ?? 'var(--affine-text-primary-color)',
fontSize: fontSize ?? 'var(--affine-font-base)',
fontWeight: weight ?? 400,
lineHeight: lineHeight ?? 1.5,
...(ellipsis ? textEllipsis(lineNum) : {}),
};
});
export default Content;

View File

@@ -47,8 +47,22 @@ export const Wrapper = styled('div', {
'marginBottom',
].includes(prop as string);
},
})<WrapperProps>(
({
})<WrapperProps>(({
display,
width,
height,
padding,
margin,
paddingTop,
paddingRight,
paddingLeft,
paddingBottom,
marginTop,
marginLeft,
marginRight,
marginBottom,
}) => {
return {
display,
width,
height,
@@ -62,24 +76,8 @@ export const Wrapper = styled('div', {
marginLeft,
marginRight,
marginBottom,
}) => {
return {
display,
width,
height,
padding,
margin,
paddingTop,
paddingRight,
paddingLeft,
paddingBottom,
marginTop,
marginLeft,
marginRight,
marginBottom,
};
}
);
};
});
export const FlexWrapper = styled(Wrapper, {
shouldForwardProp: prop => {
@@ -92,26 +90,24 @@ export const FlexWrapper = styled(Wrapper, {
'flexGrow',
].includes(prop as string);
},
})<FlexWrapperProps>(
({
})<FlexWrapperProps>(({
justifyContent,
alignItems,
wrap = false,
flexDirection,
flexShrink,
flexGrow,
}) => {
return {
display: 'flex',
justifyContent,
alignItems,
wrap = false,
flexWrap: wrap ? 'wrap' : 'nowrap',
flexDirection,
flexShrink,
flexGrow,
}) => {
return {
display: 'flex',
justifyContent,
alignItems,
flexWrap: wrap ? 'wrap' : 'nowrap',
flexDirection,
flexShrink,
flexGrow,
};
}
);
};
});
// TODO: Complete me
export const GridWrapper = styled(Wrapper, {

View File

@@ -54,53 +54,51 @@ export const StyledMenuItem = styled('button')<{
disabled?: boolean;
active?: boolean;
disableHover?: boolean;
}>(
({
isDir = false,
disabled = false,
active = false,
disableHover = false,
}) => {
return {
width: '100%',
borderRadius: '5px',
padding: '0 14px',
fontSize: 'var(--affine-font-base)',
height: '32px',
...displayFlex('flex-start', 'center'),
cursor: isDir ? 'pointer' : '',
position: 'relative',
backgroundColor: 'transparent',
}>(({
isDir = false,
disabled = false,
active = false,
disableHover = false,
}) => {
return {
width: '100%',
borderRadius: '5px',
padding: '0 14px',
fontSize: 'var(--affine-font-base)',
height: '32px',
...displayFlex('flex-start', 'center'),
cursor: isDir ? 'pointer' : '',
position: 'relative',
backgroundColor: 'transparent',
color: disabled
? 'var(--affine-text-disable-color)'
: 'var(--affine-text-primary-color)',
svg: {
color: disabled
? 'var(--affine-text-disable-color)'
: 'var(--affine-text-primary-color)',
svg: {
color: disabled
? 'var(--affine-text-disable-color)'
: 'var(--affine-icon-color)',
},
...(disabled
? {
cursor: 'not-allowed',
pointerEvents: 'none',
}
: {}),
: 'var(--affine-icon-color)',
},
...(disabled
? {
cursor: 'not-allowed',
pointerEvents: 'none',
}
: {}),
':hover':
disabled || disableHover
? {}
: {
backgroundColor: 'var(--affine-hover-color)',
},
...(active && !disabled
? {
':hover':
disabled || disableHover
? {}
: {
backgroundColor: 'var(--affine-hover-color)',
}
: {}),
};
}
);
},
...(active && !disabled
? {
backgroundColor: 'var(--affine-hover-color)',
}
: {}),
};
});
export const StyledButton = styled(Button)(() => {
return {

View File

@@ -1,36 +1,36 @@
import { styled, textEllipsis } from '../../styles';
import type { TableCellProps } from './interface';
export const StyledTable = styled('table')<{ showBorder?: boolean }>(
({ showBorder }) => {
return {
fontSize: 'var(--affine-font-base)',
color: 'var(--affine-text-primary-color)',
tableLayout: 'fixed',
width: '100%',
borderCollapse: 'collapse',
borderSpacing: '0',
export const StyledTable = styled('table')<{ showBorder?: boolean }>(({
showBorder,
}) => {
return {
fontSize: 'var(--affine-font-base)',
color: 'var(--affine-text-primary-color)',
tableLayout: 'fixed',
width: '100%',
borderCollapse: 'collapse',
borderSpacing: '0',
...(typeof showBorder === 'boolean'
? {
thead: {
'::after': {
display: 'block',
position: 'absolute',
content: '""',
width: '100%',
height: '1px',
left: 0,
background: 'var(--affine-border-color)',
transition: 'opacity .15s',
opacity: showBorder ? 1 : 0,
},
...(typeof showBorder === 'boolean'
? {
thead: {
'::after': {
display: 'block',
position: 'absolute',
content: '""',
width: '100%',
height: '1px',
left: 0,
background: 'var(--affine-border-color)',
transition: 'opacity .15s',
opacity: showBorder ? 1 : 0,
},
}
: {}),
};
}
);
},
}
: {}),
};
});
export const StyledTableBody = styled('tbody')(() => {
return {
@@ -43,31 +43,29 @@ export const StyledTableCell = styled('td')<
TableCellProps,
'ellipsis' | 'align' | 'proportion' | 'active' | 'onClick'
>
>(
({
align = 'left',
ellipsis = false,
proportion,
active = false,
onClick,
}) => {
const width = proportion ? `${proportion * 100}%` : 'auto';
return {
width,
height: '52px',
paddingLeft: '16px',
boxSizing: 'border-box',
textAlign: align,
verticalAlign: 'middle',
whiteSpace: 'nowrap',
userSelect: 'none',
fontSize: 'var(--affine-font-sm)',
...(active ? { color: 'var(--affine-text-primary-color)' } : {}),
...(ellipsis ? textEllipsis(1) : {}),
...(onClick ? { cursor: 'pointer' } : {}),
};
}
);
>(({
align = 'left',
ellipsis = false,
proportion,
active = false,
onClick,
}) => {
const width = proportion ? `${proportion * 100}%` : 'auto';
return {
width,
height: '52px',
paddingLeft: '16px',
boxSizing: 'border-box',
textAlign: align,
verticalAlign: 'middle',
whiteSpace: 'nowrap',
userSelect: 'none',
fontSize: 'var(--affine-font-sm)',
...(active ? { color: 'var(--affine-text-primary-color)' } : {}),
...(ellipsis ? textEllipsis(1) : {}),
...(onClick ? { cursor: 'pointer' } : {}),
};
});
export const StyledTableHead = styled('thead')(() => {
return {

View File

@@ -5,7 +5,7 @@
"module": "./src/index.ts",
"types": "./src/global.ts",
"devDependencies": {
"@blocksuite/global": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/global": "0.0.0-20230705162600-2cb608e4-nightly",
"next": "=13.4.2",
"react": "18.3.0-canary-1fdacbefd-20230630",
"react-dom": "18.3.0-canary-1fdacbefd-20230630",

View File

@@ -134,7 +134,7 @@ type NewSettingProps<Flavour extends keyof WorkspaceRegistry> =
onDeleteWorkspace: (id: string) => Promise<void>;
onTransformWorkspace: <
From extends keyof WorkspaceRegistry,
To extends keyof WorkspaceRegistry
To extends keyof WorkspaceRegistry,
>(
from: From,
to: To,

View File

@@ -16,7 +16,7 @@
"@graphql-codegen/typescript-operations": "^4.0.1",
"@types/lodash-es": "^4.17.7",
"lodash-es": "^4.17.21",
"prettier": "^2.8.8"
"prettier": "^3.0.0"
},
"scripts": {
"postinstall": "gql-gen"

View File

@@ -12,7 +12,7 @@ export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {
};
export type MakeEmpty<
T extends { [key: string]: unknown },
K extends keyof T
K extends keyof T,
> = { [_ in K]?: never };
export type Incremental<T> =
| T

View File

@@ -33,7 +33,7 @@
"devDependencies": {
"@types/node": "^18.16.19",
"@types/prettier": "^2.7.3",
"prettier": "^2.8.8",
"prettier": "^3.0.0",
"ts-node": "^10.9.1",
"typescript": "^5.1.6"
},

View File

@@ -138,7 +138,7 @@ const main = async () => {
await fs.writeFile(
path.resolve(RES_DIR, 'index.ts'),
format(code, {
await format(code, {
parser: 'typescript',
singleQuote: true,
trailingComma: 'es5',

View File

@@ -2,7 +2,7 @@ import type { TypedEventEmitter } from './core/event-emitter';
export abstract class HandlerManager<
Namespace extends string,
Handlers extends Record<string, PrimitiveHandlers>
Handlers extends Record<string, PrimitiveHandlers>,
> {
static instance: HandlerManager<string, Record<string, PrimitiveHandlers>>;
private _app: App<Namespace, Handlers>;
@@ -128,7 +128,7 @@ export type UnwrapManagerHandlerToServerSide<
frameId: number;
processId: number;
},
Manager extends HandlerManager<string, Record<string, PrimitiveHandlers>>
Manager extends HandlerManager<string, Record<string, PrimitiveHandlers>>,
> = Manager extends HandlerManager<infer _, infer Handlers>
? {
[K in keyof Handlers]: Handlers[K] extends (
@@ -140,7 +140,7 @@ export type UnwrapManagerHandlerToServerSide<
: never;
export type UnwrapManagerHandlerToClientSide<
Manager extends HandlerManager<string, Record<string, PrimitiveHandlers>>
Manager extends HandlerManager<string, Record<string, PrimitiveHandlers>>,
> = Manager extends HandlerManager<infer _, infer Handlers>
? {
[K in keyof Handlers]: Handlers[K] extends (
@@ -156,7 +156,7 @@ export type UnwrapManagerHandlerToClientSide<
*/
export type App<
Namespace extends string,
Handlers extends Record<string, PrimitiveHandlers>
Handlers extends Record<string, PrimitiveHandlers>,
> = TypedEventEmitter<{
[K in keyof Handlers as `${Namespace}:${K & string}`]: Handlers[K];
}>;

View File

@@ -6,11 +6,11 @@
"jotai": "^2.2.1"
},
"devDependencies": {
"@blocksuite/blocks": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/editor": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/global": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/lit": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/store": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/blocks": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/editor": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/global": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/lit": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/store": "0.0.0-20230705162600-2cb608e4-nightly",
"lottie-web": "^5.12.2"
},
"peerDependencies": {

View File

@@ -21,11 +21,11 @@
}
},
"dependencies": {
"@blocksuite/blocks": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/editor": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/global": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/lit": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/store": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/blocks": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/editor": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/global": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/lit": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/store": "0.0.0-20230705162600-2cb608e4-nightly",
"jotai": "^2.2.1"
},
"devDependencies": {

View File

@@ -88,7 +88,7 @@ const rootWorkspacesMetadataPromiseAtom = atom<
flavour: Plugin.flavour,
// new workspace should all support sub-doc feature
version: WorkspaceVersion.SubDoc,
} satisfies RootWorkspaceMetadataV2)
}) satisfies RootWorkspaceMetadataV2
);
}).filter((ids): ids is RootWorkspaceMetadataV2 => !!ids);
};

View File

@@ -36,8 +36,8 @@
"idb": "^7.1.1"
},
"devDependencies": {
"@blocksuite/blocks": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/store": "0.0.0-20230705060316-3f52aee9-nightly",
"@blocksuite/blocks": "0.0.0-20230705162600-2cb608e4-nightly",
"@blocksuite/store": "0.0.0-20230705162600-2cb608e4-nightly",
"vite": "^4.3.9",
"vite-plugin-dts": "3.0.2",
"y-indexeddb": "^9.0.11"