fix: modify with new blocksuite version about subpage (#2060)
This commit is contained in:
@@ -18,11 +18,11 @@
|
|||||||
"@affine/jotai": "workspace:*",
|
"@affine/jotai": "workspace:*",
|
||||||
"@affine/templates": "workspace:*",
|
"@affine/templates": "workspace:*",
|
||||||
"@affine/workspace": "workspace:*",
|
"@affine/workspace": "workspace:*",
|
||||||
"@blocksuite/blocks": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/blocks": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/editor": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/editor": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/global": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/global": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/icons": "^2.1.10",
|
"@blocksuite/icons": "^2.1.10",
|
||||||
"@blocksuite/store": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/store": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@dnd-kit/core": "^6.0.8",
|
"@dnd-kit/core": "^6.0.8",
|
||||||
"@dnd-kit/sortable": "^7.0.2",
|
"@dnd-kit/sortable": "^7.0.2",
|
||||||
"@emotion/cache": "^11.10.7",
|
"@emotion/cache": "^11.10.7",
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ function createPublicWorkspace(
|
|||||||
);
|
);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_block_hub', false);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_block_hub', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_set_remote_flag', false);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_set_remote_flag', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_database', true);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_database', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_edgeless_toolbar', false);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_edgeless_toolbar', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_slash_menu', false);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_slash_menu', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_drag_handle', false);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_drag_handle', false);
|
||||||
|
|||||||
@@ -1,235 +0,0 @@
|
|||||||
/**
|
|
||||||
* @vitest-environment happy-dom
|
|
||||||
*/
|
|
||||||
import 'fake-indexeddb/auto';
|
|
||||||
|
|
||||||
import { rootCurrentWorkspaceIdAtom } from '@affine/workspace/atom';
|
|
||||||
import matchers from '@testing-library/jest-dom/matchers';
|
|
||||||
import type { RenderResult } from '@testing-library/react';
|
|
||||||
import { render, renderHook } from '@testing-library/react';
|
|
||||||
import { createStore, getDefaultStore, Provider } from 'jotai';
|
|
||||||
import type { FC, PropsWithChildren } from 'react';
|
|
||||||
import { beforeEach, describe, expect, test } from 'vitest';
|
|
||||||
|
|
||||||
import { workspacesAtom } from '../../atoms';
|
|
||||||
import { rootCurrentWorkspaceAtom } from '../../atoms/root';
|
|
||||||
import { useCurrentWorkspace } from '../../hooks/current/use-current-workspace';
|
|
||||||
import { useAppHelper } from '../../hooks/use-workspaces';
|
|
||||||
import { ThemeProvider } from '../../providers/ThemeProvider';
|
|
||||||
import type { BlockSuiteWorkspace } from '../../shared';
|
|
||||||
import type { PinboardProps } from '../pure/workspace-slider-bar/Pinboard';
|
|
||||||
import Pinboard from '../pure/workspace-slider-bar/Pinboard';
|
|
||||||
|
|
||||||
expect.extend(matchers);
|
|
||||||
|
|
||||||
let store = getDefaultStore();
|
|
||||||
beforeEach(async () => {
|
|
||||||
store = createStore();
|
|
||||||
await store.get(workspacesAtom);
|
|
||||||
});
|
|
||||||
|
|
||||||
const ProviderWrapper: FC<PropsWithChildren> = ({ children }) => {
|
|
||||||
return <Provider store={store}>{children}</Provider>;
|
|
||||||
};
|
|
||||||
|
|
||||||
const initPinBoard = async () => {
|
|
||||||
// create one workspace with 2 root pages and 2 pinboard pages
|
|
||||||
// - hasPinboardPage
|
|
||||||
// - hasPinboardPage
|
|
||||||
// - pinboard1
|
|
||||||
// - pinboard2
|
|
||||||
// - noPinboardPage
|
|
||||||
|
|
||||||
const mutationHook = renderHook(() => useAppHelper(), {
|
|
||||||
wrapper: ProviderWrapper,
|
|
||||||
});
|
|
||||||
const rootPageIds = ['hasPinboardPage', 'noPinboardPage'];
|
|
||||||
const pinboardPageIds = ['pinboard1', 'pinboard2'];
|
|
||||||
const id = await mutationHook.result.current.createLocalWorkspace('test0');
|
|
||||||
|
|
||||||
store.set(rootCurrentWorkspaceIdAtom, id);
|
|
||||||
await store.get(workspacesAtom);
|
|
||||||
|
|
||||||
await store.get(rootCurrentWorkspaceAtom);
|
|
||||||
const currentWorkspaceHook = renderHook(() => useCurrentWorkspace(), {
|
|
||||||
wrapper: ProviderWrapper,
|
|
||||||
});
|
|
||||||
currentWorkspaceHook.result.current[1](id);
|
|
||||||
const currentWorkspace = await store.get(rootCurrentWorkspaceAtom);
|
|
||||||
const blockSuiteWorkspace =
|
|
||||||
currentWorkspace?.blockSuiteWorkspace as BlockSuiteWorkspace;
|
|
||||||
|
|
||||||
mutationHook.rerender();
|
|
||||||
// create root pinboard
|
|
||||||
mutationHook.result.current.createWorkspacePage(id, 'rootPinboard');
|
|
||||||
blockSuiteWorkspace.meta.setPageMeta('rootPinboard', {
|
|
||||||
isRootPinboard: true,
|
|
||||||
subpageIds: rootPageIds,
|
|
||||||
});
|
|
||||||
// create parent
|
|
||||||
rootPageIds.forEach(rootPageId => {
|
|
||||||
mutationHook.result.current.createWorkspacePage(id, rootPageId);
|
|
||||||
blockSuiteWorkspace.meta.setPageMeta(rootPageId, {
|
|
||||||
subpageIds: rootPageId === rootPageIds[0] ? pinboardPageIds : [],
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// create children to first parent
|
|
||||||
pinboardPageIds.forEach(pinboardId => {
|
|
||||||
mutationHook.result.current.createWorkspacePage(id, pinboardId);
|
|
||||||
blockSuiteWorkspace.meta.setPageMeta(pinboardId, {
|
|
||||||
title: pinboardId,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
const App = (props: PinboardProps) => {
|
|
||||||
return (
|
|
||||||
<ThemeProvider>
|
|
||||||
<ProviderWrapper>
|
|
||||||
<Pinboard {...props} />
|
|
||||||
</ProviderWrapper>
|
|
||||||
</ThemeProvider>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const app = render(
|
|
||||||
<App
|
|
||||||
blockSuiteWorkspace={blockSuiteWorkspace as BlockSuiteWorkspace}
|
|
||||||
openPage={() => {}}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
|
|
||||||
return {
|
|
||||||
rootPageIds,
|
|
||||||
pinboardPageIds,
|
|
||||||
app,
|
|
||||||
blockSuiteWorkspace,
|
|
||||||
};
|
|
||||||
};
|
|
||||||
const openOperationMenu = async (app: RenderResult, pageId: string) => {
|
|
||||||
const rootPinboard = await app.findByTestId(`pinboard-${pageId}`);
|
|
||||||
const operationBtn = (await rootPinboard.querySelector(
|
|
||||||
'[data-testid="pinboard-operation-button"]'
|
|
||||||
)) as HTMLElement;
|
|
||||||
await operationBtn.click();
|
|
||||||
const menu = await app.findByTestId('pinboard-operation-menu');
|
|
||||||
expect(menu).toBeInTheDocument();
|
|
||||||
};
|
|
||||||
describe('PinBoard', () => {
|
|
||||||
test('add pinboard', async () => {
|
|
||||||
const { app, blockSuiteWorkspace, rootPageIds } = await initPinBoard();
|
|
||||||
const [hasChildrenPageId] = rootPageIds;
|
|
||||||
await openOperationMenu(app, hasChildrenPageId);
|
|
||||||
|
|
||||||
const addBtn = await app.findByTestId('pinboard-operation-add');
|
|
||||||
await addBtn.click();
|
|
||||||
|
|
||||||
const hasChildrenPageMeta =
|
|
||||||
blockSuiteWorkspace.meta.getPageMeta(hasChildrenPageId);
|
|
||||||
|
|
||||||
// Page meta have been added
|
|
||||||
expect(blockSuiteWorkspace.meta.pageMetas.length).toBe(6);
|
|
||||||
// New page meta is added in initial page meta
|
|
||||||
|
|
||||||
expect(hasChildrenPageMeta?.subpageIds.length).toBe(3);
|
|
||||||
app.unmount();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('delete pinboard', async () => {
|
|
||||||
const {
|
|
||||||
app,
|
|
||||||
blockSuiteWorkspace,
|
|
||||||
rootPageIds: [hasChildrenPageId],
|
|
||||||
} = await initPinBoard();
|
|
||||||
await openOperationMenu(app, hasChildrenPageId);
|
|
||||||
|
|
||||||
const deleteBtn = await app.findByTestId(
|
|
||||||
'pinboard-operation-move-to-trash'
|
|
||||||
);
|
|
||||||
await deleteBtn.click();
|
|
||||||
|
|
||||||
const confirmBtn = await app.findByTestId('move-to-trash-confirm');
|
|
||||||
expect(confirmBtn).toBeInTheDocument();
|
|
||||||
await confirmBtn.click();
|
|
||||||
|
|
||||||
// Every page should be tagged as trash
|
|
||||||
expect(blockSuiteWorkspace.meta.pageMetas.filter(m => m.trash).length).toBe(
|
|
||||||
3
|
|
||||||
);
|
|
||||||
app.unmount();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('rename pinboard', async () => {
|
|
||||||
const {
|
|
||||||
app,
|
|
||||||
rootPageIds: [hasChildrenPageId],
|
|
||||||
} = await initPinBoard();
|
|
||||||
await openOperationMenu(app, hasChildrenPageId);
|
|
||||||
|
|
||||||
const renameBtn = await app.findByTestId('pinboard-operation-rename');
|
|
||||||
await renameBtn.click();
|
|
||||||
|
|
||||||
const input = await app.findByTestId(`pinboard-input-${hasChildrenPageId}`);
|
|
||||||
expect(input).toBeInTheDocument();
|
|
||||||
|
|
||||||
// TODO: Fix this test
|
|
||||||
// fireEvent.change(input, { target: { value: 'tteesstt' } });
|
|
||||||
// expect(
|
|
||||||
// blockSuiteWorkspace.meta.getPageMeta(hasChildrenPageId)?.name
|
|
||||||
// ).toBe('tteesstt');
|
|
||||||
app.unmount();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('move pinboard', async () => {
|
|
||||||
const {
|
|
||||||
app,
|
|
||||||
blockSuiteWorkspace,
|
|
||||||
rootPageIds: [hasChildrenPageId],
|
|
||||||
pinboardPageIds: [pinboardId1, pinboardId2],
|
|
||||||
} = await initPinBoard();
|
|
||||||
await openOperationMenu(app, pinboardId1);
|
|
||||||
|
|
||||||
const moveToBtn = await app.findByTestId('pinboard-operation-move-to');
|
|
||||||
await moveToBtn.click();
|
|
||||||
|
|
||||||
const pinboardMenu = await app.findByTestId('pinboard-menu');
|
|
||||||
expect(pinboardMenu).toBeInTheDocument();
|
|
||||||
|
|
||||||
await (
|
|
||||||
pinboardMenu.querySelector(
|
|
||||||
`[data-testid="pinboard-${pinboardId2}"]`
|
|
||||||
) as HTMLElement
|
|
||||||
).click();
|
|
||||||
|
|
||||||
const hasChildrenPageMeta =
|
|
||||||
blockSuiteWorkspace.meta.getPageMeta(hasChildrenPageId);
|
|
||||||
|
|
||||||
expect(hasChildrenPageMeta?.subpageIds.includes(pinboardId1)).toBe(false);
|
|
||||||
expect(hasChildrenPageMeta?.subpageIds.includes(pinboardId2)).toBe(true);
|
|
||||||
app.unmount();
|
|
||||||
});
|
|
||||||
|
|
||||||
test('remove from pinboard', async () => {
|
|
||||||
const {
|
|
||||||
app,
|
|
||||||
blockSuiteWorkspace,
|
|
||||||
rootPageIds: [hasChildrenPageId],
|
|
||||||
pinboardPageIds: [pinboardId1],
|
|
||||||
} = await initPinBoard();
|
|
||||||
await openOperationMenu(app, pinboardId1);
|
|
||||||
|
|
||||||
const moveToBtn = await app.findByTestId('pinboard-operation-move-to');
|
|
||||||
await moveToBtn.click();
|
|
||||||
|
|
||||||
const removeFromPinboardBtn = await app.findByTestId(
|
|
||||||
'remove-from-pinboard-button'
|
|
||||||
);
|
|
||||||
removeFromPinboardBtn.click();
|
|
||||||
|
|
||||||
const hasPinboardPageMeta =
|
|
||||||
blockSuiteWorkspace.meta.getPageMeta(hasChildrenPageId);
|
|
||||||
|
|
||||||
expect(hasPinboardPageMeta?.subpageIds.length).toBe(1);
|
|
||||||
expect(hasPinboardPageMeta?.subpageIds.includes(pinboardId1)).toBe(false);
|
|
||||||
app.unmount();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -3,9 +3,9 @@ import { Input, PureMenu, TreeView } from '@affine/component';
|
|||||||
import { useTranslation } from '@affine/i18n';
|
import { useTranslation } from '@affine/i18n';
|
||||||
import { RemoveIcon, SearchIcon } from '@blocksuite/icons';
|
import { RemoveIcon, SearchIcon } from '@blocksuite/icons';
|
||||||
import type { PageMeta } from '@blocksuite/store';
|
import type { PageMeta } from '@blocksuite/store';
|
||||||
import { usePageMetaHelper } from '@toeverything/hooks/use-block-suite-page-meta';
|
|
||||||
import React, { useCallback, useMemo, useState } from 'react';
|
import React, { useCallback, useMemo, useState } from 'react';
|
||||||
|
|
||||||
|
import { useReferenceLinkHelper } from '../../../../hooks/affine/use-reference-link-helper';
|
||||||
import { usePinboardData } from '../../../../hooks/use-pinboard-data';
|
import { usePinboardData } from '../../../../hooks/use-pinboard-data';
|
||||||
import { usePinboardHandler } from '../../../../hooks/use-pinboard-handler';
|
import { usePinboardHandler } from '../../../../hooks/use-pinboard-handler';
|
||||||
import type { BlockSuiteWorkspace } from '../../../../shared';
|
import type { BlockSuiteWorkspace } from '../../../../shared';
|
||||||
@@ -41,13 +41,13 @@ export const PinboardMenu = ({
|
|||||||
[currentMeta.id, propsMetas]
|
[currentMeta.id, propsMetas]
|
||||||
);
|
);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { setPageMeta } = usePageMetaHelper(blockSuiteWorkspace);
|
|
||||||
const [query, setQuery] = useState('');
|
const [query, setQuery] = useState('');
|
||||||
const isSearching = query.length > 0;
|
const isSearching = query.length > 0;
|
||||||
|
|
||||||
const searchResult = metas.filter(
|
const searchResult = metas.filter(
|
||||||
meta => !meta.trash && meta.title.includes(query)
|
meta => !meta.trash && meta.title.includes(query)
|
||||||
);
|
);
|
||||||
|
const { removeReferenceLink } = useReferenceLinkHelper(blockSuiteWorkspace);
|
||||||
|
|
||||||
const { dropPin } = usePinboardHandler({
|
const { dropPin } = usePinboardHandler({
|
||||||
blockSuiteWorkspace,
|
blockSuiteWorkspace,
|
||||||
@@ -117,16 +117,7 @@ export const PinboardMenu = ({
|
|||||||
<StyledPinboard
|
<StyledPinboard
|
||||||
data-testid={'remove-from-pinboard-button'}
|
data-testid={'remove-from-pinboard-button'}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const parentMeta = metas.find(m =>
|
removeReferenceLink(currentMeta.id);
|
||||||
m.subpageIds.includes(currentMeta.id)
|
|
||||||
);
|
|
||||||
if (!parentMeta) return;
|
|
||||||
const newSubpageIds = [...parentMeta.subpageIds];
|
|
||||||
const deleteIndex = newSubpageIds.findIndex(
|
|
||||||
id => id === currentMeta.id
|
|
||||||
);
|
|
||||||
newSubpageIds.splice(deleteIndex, 1);
|
|
||||||
setPageMeta(parentMeta.id, { subpageIds: newSubpageIds });
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<RemoveIcon />
|
<RemoveIcon />
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
import { PlusIcon } from '@blocksuite/icons';
|
||||||
|
|
||||||
|
import { StyledOperationButton } from '../styles';
|
||||||
|
import type { OperationButtonProps } from './OperationButton';
|
||||||
|
|
||||||
|
export const AddButton = ({
|
||||||
|
onAdd,
|
||||||
|
visible,
|
||||||
|
}: Pick<OperationButtonProps, 'onAdd' | 'visible'>) => {
|
||||||
|
return (
|
||||||
|
<StyledOperationButton
|
||||||
|
visible={visible}
|
||||||
|
size="small"
|
||||||
|
onClick={e => {
|
||||||
|
e.stopPropagation();
|
||||||
|
onAdd();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<PlusIcon />
|
||||||
|
</StyledOperationButton>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -28,7 +28,7 @@ export type OperationButtonProps = {
|
|||||||
metas: PageMeta[];
|
metas: PageMeta[];
|
||||||
currentMeta: PageMeta;
|
currentMeta: PageMeta;
|
||||||
blockSuiteWorkspace: BlockSuiteWorkspace;
|
blockSuiteWorkspace: BlockSuiteWorkspace;
|
||||||
isHover: boolean;
|
visible: boolean;
|
||||||
onRename?: () => void;
|
onRename?: () => void;
|
||||||
onMenuClose?: () => void;
|
onMenuClose?: () => void;
|
||||||
};
|
};
|
||||||
@@ -39,7 +39,7 @@ export const OperationButton = ({
|
|||||||
metas,
|
metas,
|
||||||
currentMeta,
|
currentMeta,
|
||||||
blockSuiteWorkspace,
|
blockSuiteWorkspace,
|
||||||
isHover,
|
visible,
|
||||||
onMenuClose,
|
onMenuClose,
|
||||||
onRename,
|
onRename,
|
||||||
}: OperationButtonProps) => {
|
}: OperationButtonProps) => {
|
||||||
@@ -61,6 +61,7 @@ export const OperationButton = ({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
|
style={{ display: 'flex' }}
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
}}
|
}}
|
||||||
@@ -81,7 +82,7 @@ export const OperationButton = ({
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOperationMenuOpen(!operationMenuOpen);
|
setOperationMenuOpen(!operationMenuOpen);
|
||||||
}}
|
}}
|
||||||
visible={isHover}
|
visible={visible}
|
||||||
>
|
>
|
||||||
<MoreVerticalIcon />
|
<MoreVerticalIcon />
|
||||||
</StyledOperationButton>
|
</StyledOperationButton>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { useMemo, useState } from 'react';
|
|||||||
import { workspacePreferredModeAtom } from '../../../../atoms';
|
import { workspacePreferredModeAtom } from '../../../../atoms';
|
||||||
import type { PinboardNode } from '../../../../hooks/use-pinboard-data';
|
import type { PinboardNode } from '../../../../hooks/use-pinboard-data';
|
||||||
import { StyledCollapsedButton, StyledPinboard } from '../styles';
|
import { StyledCollapsedButton, StyledPinboard } from '../styles';
|
||||||
|
import { AddButton } from './AddButton';
|
||||||
import EmptyItem from './EmptyItem';
|
import EmptyItem from './EmptyItem';
|
||||||
import { OperationButton } from './OperationButton';
|
import { OperationButton } from './OperationButton';
|
||||||
|
|
||||||
@@ -84,10 +85,8 @@ export const PinboardRender: PinboardNode['render'] = (
|
|||||||
<ArrowDownSmallIcon />
|
<ArrowDownSmallIcon />
|
||||||
</StyledCollapsedButton>
|
</StyledCollapsedButton>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{asPath && !isRoot ? <LevelIcon className="path-icon" /> : null}
|
{asPath && !isRoot ? <LevelIcon className="path-icon" /> : null}
|
||||||
{getIcon(isRoot ? 'root' : record[node.id])}
|
{getIcon(isRoot ? 'root' : record[node.id])}
|
||||||
|
|
||||||
{showRename ? (
|
{showRename ? (
|
||||||
<Input
|
<Input
|
||||||
data-testid={`pinboard-input-${node.id}`}
|
data-testid={`pinboard-input-${node.id}`}
|
||||||
@@ -106,6 +105,7 @@ export const PinboardRender: PinboardNode['render'] = (
|
|||||||
) : (
|
) : (
|
||||||
<span>{isRoot ? 'Pinboard' : currentMeta.title || 'Untitled'}</span>
|
<span>{isRoot ? 'Pinboard' : currentMeta.title || 'Untitled'}</span>
|
||||||
)}
|
)}
|
||||||
|
{showOperationButton && <AddButton onAdd={onAdd} visible={isHover} />}
|
||||||
|
|
||||||
{showOperationButton && (
|
{showOperationButton && (
|
||||||
<OperationButton
|
<OperationButton
|
||||||
@@ -115,7 +115,7 @@ export const PinboardRender: PinboardNode['render'] = (
|
|||||||
metas={metas}
|
metas={metas}
|
||||||
currentMeta={currentMeta!}
|
currentMeta={currentMeta!}
|
||||||
blockSuiteWorkspace={blockSuiteWorkspace!}
|
blockSuiteWorkspace={blockSuiteWorkspace!}
|
||||||
isHover={isHover}
|
visible={isHover}
|
||||||
onMenuClose={() => setIsHover(false)}
|
onMenuClose={() => setIsHover(false)}
|
||||||
onRename={() => {
|
onRename={() => {
|
||||||
setShowRename(true);
|
setShowRename(true);
|
||||||
|
|||||||
@@ -5,11 +5,14 @@ import {
|
|||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
import type { BlockSuiteWorkspace } from '../../shared';
|
import type { BlockSuiteWorkspace } from '../../shared';
|
||||||
|
import { useReferenceLinkHelper } from './use-reference-link-helper';
|
||||||
|
|
||||||
export function useBlockSuiteMetaHelper(
|
export function useBlockSuiteMetaHelper(
|
||||||
blockSuiteWorkspace: BlockSuiteWorkspace
|
blockSuiteWorkspace: BlockSuiteWorkspace
|
||||||
) {
|
) {
|
||||||
const { setPageMeta, getPageMeta } = usePageMetaHelper(blockSuiteWorkspace);
|
const { setPageMeta, getPageMeta } = usePageMetaHelper(blockSuiteWorkspace);
|
||||||
|
const { addReferenceLink, removeReferenceLink } =
|
||||||
|
useReferenceLinkHelper(blockSuiteWorkspace);
|
||||||
const metas = useBlockSuitePageMeta(blockSuiteWorkspace);
|
const metas = useBlockSuitePageMeta(blockSuiteWorkspace);
|
||||||
|
|
||||||
const removeToTrash = useCallback(
|
const removeToTrash = useCallback(
|
||||||
@@ -29,17 +32,10 @@ export function useBlockSuiteMetaHelper(
|
|||||||
|
|
||||||
// Just the trash root need delete its id from parent
|
// Just the trash root need delete its id from parent
|
||||||
if (parentMeta && isRoot) {
|
if (parentMeta && isRoot) {
|
||||||
const deleteIndex = parentMeta.subpageIds.findIndex(
|
removeReferenceLink(pageId);
|
||||||
id => id === pageId
|
|
||||||
);
|
|
||||||
const newSubpageIds = [...parentMeta.subpageIds];
|
|
||||||
newSubpageIds.splice(deleteIndex, 1);
|
|
||||||
setPageMeta(parentMeta.id, {
|
|
||||||
subpageIds: newSubpageIds,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[getPageMeta, metas, setPageMeta]
|
[getPageMeta, metas, removeReferenceLink, setPageMeta]
|
||||||
);
|
);
|
||||||
|
|
||||||
const restoreFromTrash = useCallback(
|
const restoreFromTrash = useCallback(
|
||||||
@@ -47,11 +43,7 @@ export function useBlockSuiteMetaHelper(
|
|||||||
const { subpageIds = [], trashRelate } = getPageMeta(pageId) ?? {};
|
const { subpageIds = [], trashRelate } = getPageMeta(pageId) ?? {};
|
||||||
|
|
||||||
if (trashRelate) {
|
if (trashRelate) {
|
||||||
const parentMeta = metas.find(m => m.id === trashRelate);
|
addReferenceLink(trashRelate, pageId);
|
||||||
parentMeta &&
|
|
||||||
setPageMeta(parentMeta.id, {
|
|
||||||
subpageIds: [...parentMeta.subpageIds, pageId],
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setPageMeta(pageId, {
|
setPageMeta(pageId, {
|
||||||
@@ -63,7 +55,7 @@ export function useBlockSuiteMetaHelper(
|
|||||||
restoreFromTrash(id);
|
restoreFromTrash(id);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[getPageMeta, metas, setPageMeta]
|
[addReferenceLink, getPageMeta, setPageMeta]
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
45
apps/web/src/hooks/affine/use-reference-link-helper.ts
Normal file
45
apps/web/src/hooks/affine/use-reference-link-helper.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
import { useCallback } from 'react';
|
||||||
|
|
||||||
|
import type { BlockSuiteWorkspace } from '../../shared';
|
||||||
|
|
||||||
|
export function useReferenceLinkHelper(
|
||||||
|
blockSuiteWorkspace: BlockSuiteWorkspace
|
||||||
|
) {
|
||||||
|
const addReferenceLink = useCallback(
|
||||||
|
(pageId: string, referenceId: string) => {
|
||||||
|
const page = blockSuiteWorkspace?.getPage(pageId);
|
||||||
|
if (!page) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const text = page.Text.fromDelta([
|
||||||
|
{
|
||||||
|
insert: ' ',
|
||||||
|
attributes: {
|
||||||
|
reference: {
|
||||||
|
type: 'Subpage',
|
||||||
|
pageId: referenceId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
const [frame] = page.getBlockByFlavour('affine:frame');
|
||||||
|
|
||||||
|
frame && page.addBlock('affine:paragraph', { text }, frame.id);
|
||||||
|
},
|
||||||
|
[blockSuiteWorkspace]
|
||||||
|
);
|
||||||
|
const removeReferenceLink = useCallback(
|
||||||
|
(deleteId: string) => {
|
||||||
|
blockSuiteWorkspace.indexer.backlink.removeSubpageNode(
|
||||||
|
blockSuiteWorkspace,
|
||||||
|
deleteId
|
||||||
|
);
|
||||||
|
},
|
||||||
|
[blockSuiteWorkspace]
|
||||||
|
);
|
||||||
|
|
||||||
|
return {
|
||||||
|
addReferenceLink,
|
||||||
|
removeReferenceLink,
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -4,10 +4,11 @@ import type { PageMeta } from '@blocksuite/store';
|
|||||||
import { nanoid } from '@blocksuite/store';
|
import { nanoid } from '@blocksuite/store';
|
||||||
import { usePageMetaHelper } from '@toeverything/hooks/use-block-suite-page-meta';
|
import { usePageMetaHelper } from '@toeverything/hooks/use-block-suite-page-meta';
|
||||||
import { useBlockSuiteWorkspaceHelper } from '@toeverything/hooks/use-block-suite-workspace-helper';
|
import { useBlockSuiteWorkspaceHelper } from '@toeverything/hooks/use-block-suite-workspace-helper';
|
||||||
import { useCallback } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
|
|
||||||
import type { BlockSuiteWorkspace } from '../shared';
|
import type { BlockSuiteWorkspace } from '../shared';
|
||||||
import { useBlockSuiteMetaHelper } from './affine/use-block-suite-meta-helper';
|
import { useBlockSuiteMetaHelper } from './affine/use-block-suite-meta-helper';
|
||||||
|
import { useReferenceLinkHelper } from './affine/use-reference-link-helper';
|
||||||
import type { NodeRenderProps } from './use-pinboard-data';
|
import type { NodeRenderProps } from './use-pinboard-data';
|
||||||
|
|
||||||
const logger = new DebugLogger('pinboard');
|
const logger = new DebugLogger('pinboard');
|
||||||
@@ -21,50 +22,32 @@ function findRootIds(metas: PageMeta[], id: string): string[] {
|
|||||||
}
|
}
|
||||||
export function usePinboardHandler({
|
export function usePinboardHandler({
|
||||||
blockSuiteWorkspace,
|
blockSuiteWorkspace,
|
||||||
metas,
|
metas: propsMetas,
|
||||||
onAdd,
|
onAdd,
|
||||||
onDelete,
|
onDelete,
|
||||||
onDrop,
|
onDrop,
|
||||||
}: {
|
}: {
|
||||||
blockSuiteWorkspace: BlockSuiteWorkspace;
|
blockSuiteWorkspace: BlockSuiteWorkspace;
|
||||||
metas: PageMeta[];
|
metas?: PageMeta[];
|
||||||
onAdd?: (addedId: string, parentId: string) => void;
|
onAdd?: (addedId: string, parentId: string) => void;
|
||||||
onDelete?: TreeViewProps<NodeRenderProps>['onDelete'];
|
onDelete?: TreeViewProps<NodeRenderProps>['onDelete'];
|
||||||
onDrop?: TreeViewProps<NodeRenderProps>['onDrop'];
|
onDrop?: TreeViewProps<NodeRenderProps>['onDrop'];
|
||||||
}) {
|
}) {
|
||||||
|
const metas = useMemo(
|
||||||
|
() => propsMetas || blockSuiteWorkspace.meta.pageMetas || [],
|
||||||
|
[blockSuiteWorkspace.meta.pageMetas, propsMetas]
|
||||||
|
);
|
||||||
const { createPage } = useBlockSuiteWorkspaceHelper(blockSuiteWorkspace);
|
const { createPage } = useBlockSuiteWorkspaceHelper(blockSuiteWorkspace);
|
||||||
const { setPageMeta } = usePageMetaHelper(blockSuiteWorkspace);
|
const { setPageMeta } = usePageMetaHelper(blockSuiteWorkspace);
|
||||||
const { removeToTrash: removeToTrashHelper } =
|
const { removeToTrash: removeToTrashHelper } =
|
||||||
useBlockSuiteMetaHelper(blockSuiteWorkspace);
|
useBlockSuiteMetaHelper(blockSuiteWorkspace);
|
||||||
// Just need handle add operation, delete check is handled in blockSuite's reference link
|
const { addReferenceLink, removeReferenceLink } =
|
||||||
const addReferenceLink = useCallback(
|
useReferenceLinkHelper(blockSuiteWorkspace);
|
||||||
(pageId: string, referenceId: string) => {
|
|
||||||
const page = blockSuiteWorkspace?.getPage(pageId);
|
|
||||||
if (!page) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const text = page.Text.fromDelta([
|
|
||||||
{
|
|
||||||
insert: ' ',
|
|
||||||
attributes: {
|
|
||||||
reference: {
|
|
||||||
type: 'Subpage',
|
|
||||||
pageId: referenceId,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const [frame] = page.getBlockByFlavour('affine:frame');
|
|
||||||
|
|
||||||
frame && page.addBlock('affine:paragraph', { text }, frame.id);
|
|
||||||
},
|
|
||||||
[blockSuiteWorkspace]
|
|
||||||
);
|
|
||||||
|
|
||||||
const addPin = useCallback(
|
const addPin = useCallback(
|
||||||
(parentId: string) => {
|
(parentId: string) => {
|
||||||
const id = nanoid();
|
const id = nanoid();
|
||||||
createPage(id, parentId);
|
createPage(id);
|
||||||
onAdd?.(id, parentId);
|
onAdd?.(id, parentId);
|
||||||
addReferenceLink(parentId, id);
|
addReferenceLink(parentId, id);
|
||||||
},
|
},
|
||||||
@@ -127,24 +110,7 @@ export function usePinboardHandler({
|
|||||||
return onDrop?.(dragId, dropId, position);
|
return onDrop?.(dragId, dropId, position);
|
||||||
}
|
}
|
||||||
// Old parent will delete drag node, new parent will be added
|
// Old parent will delete drag node, new parent will be added
|
||||||
const newDragParentSubpageIds = [...(dragParentMeta?.subpageIds ?? [])];
|
removeReferenceLink(dragId);
|
||||||
const deleteIndex = newDragParentSubpageIds.findIndex(
|
|
||||||
id => id === dragId
|
|
||||||
);
|
|
||||||
newDragParentSubpageIds.splice(deleteIndex, 1);
|
|
||||||
|
|
||||||
const newDropParentSubpageIds = [...(dropParentMeta?.subpageIds ?? [])];
|
|
||||||
const insertIndex =
|
|
||||||
newDropParentSubpageIds.findIndex(id => id === dropId) + insertOffset;
|
|
||||||
newDropParentSubpageIds.splice(insertIndex, 0, dragId);
|
|
||||||
dragParentMeta &&
|
|
||||||
setPageMeta(dragParentMeta.id, {
|
|
||||||
subpageIds: newDragParentSubpageIds,
|
|
||||||
});
|
|
||||||
dropParentMeta &&
|
|
||||||
setPageMeta(dropParentMeta.id, {
|
|
||||||
subpageIds: newDropParentSubpageIds,
|
|
||||||
});
|
|
||||||
dropParentMeta && addReferenceLink(dropParentMeta.id, dragId);
|
dropParentMeta && addReferenceLink(dropParentMeta.id, dragId);
|
||||||
return onDrop?.(dragId, dropId, position);
|
return onDrop?.(dragId, dropId, position);
|
||||||
}
|
}
|
||||||
@@ -154,23 +120,12 @@ export function usePinboardHandler({
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (dragParentMeta) {
|
if (dragParentMeta) {
|
||||||
const metaIndex = dragParentMeta.subpageIds.findIndex(
|
removeReferenceLink(dragId);
|
||||||
id => id === dragId
|
|
||||||
);
|
|
||||||
const newSubpageIds = [...dragParentMeta.subpageIds];
|
|
||||||
newSubpageIds.splice(metaIndex, 1);
|
|
||||||
setPageMeta(dragParentMeta.id, {
|
|
||||||
subpageIds: newSubpageIds,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
const dropMeta = metas.find(meta => meta.id === dropId)!;
|
const dropMeta = metas.find(meta => meta.id === dropId)!;
|
||||||
const newSubpageIds = [dragId, ...(dropMeta.subpageIds ?? [])];
|
|
||||||
setPageMeta(dropMeta.id, {
|
|
||||||
subpageIds: newSubpageIds,
|
|
||||||
});
|
|
||||||
addReferenceLink(dropMeta.id, dragId);
|
addReferenceLink(dropMeta.id, dragId);
|
||||||
},
|
},
|
||||||
[addReferenceLink, metas, onDrop, setPageMeta]
|
[addReferenceLink, metas, onDrop, removeReferenceLink, setPageMeta]
|
||||||
);
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import type { BlockSuiteWorkspace, NextPageWithLayout } from '../../../shared';
|
|||||||
|
|
||||||
function enableFullFlags(blockSuiteWorkspace: BlockSuiteWorkspace) {
|
function enableFullFlags(blockSuiteWorkspace: BlockSuiteWorkspace) {
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_set_remote_flag', false);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_set_remote_flag', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_database', true);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_database', false);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_slash_menu', true);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_slash_menu', true);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_edgeless_toolbar', true);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_edgeless_toolbar', true);
|
||||||
blockSuiteWorkspace.awarenessStore.setFlag('enable_block_hub', true);
|
blockSuiteWorkspace.awarenessStore.setFlag('enable_block_hub', true);
|
||||||
|
|||||||
@@ -45,11 +45,11 @@
|
|||||||
"react-is": "^18.2.0"
|
"react-is": "^18.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/blocks": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/blocks": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/editor": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/editor": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/global": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/global": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/icons": "^2.1.10",
|
"@blocksuite/icons": "^2.1.10",
|
||||||
"@blocksuite/store": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/store": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@storybook/addon-actions": "^7.0.5",
|
"@storybook/addon-actions": "^7.0.5",
|
||||||
"@storybook/addon-coverage": "^0.0.8",
|
"@storybook/addon-coverage": "^0.0.8",
|
||||||
"@storybook/addon-essentials": "^7.0.5",
|
"@storybook/addon-essentials": "^7.0.5",
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import type {
|
import type { DragEndEvent } from '@dnd-kit/core';
|
||||||
DragEndEvent} from '@dnd-kit/core';
|
|
||||||
import {
|
import {
|
||||||
closestCenter,
|
closestCenter,
|
||||||
DndContext,
|
DndContext,
|
||||||
DragOverlay,
|
DragOverlay,
|
||||||
PointerSensor,
|
PointerSensor,
|
||||||
useSensor,
|
useSensor,
|
||||||
useSensors
|
useSensors,
|
||||||
} from '@dnd-kit/core';
|
} from '@dnd-kit/core';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
@@ -47,7 +46,7 @@ export const TreeView = <RenderProps,>({
|
|||||||
const { active, over } = e;
|
const { active, over } = e;
|
||||||
const position = over?.data.current?.position;
|
const position = over?.data.current?.position;
|
||||||
const dropId = over?.data.current?.node.id;
|
const dropId = over?.data.current?.node.id;
|
||||||
|
setDraggingId(undefined);
|
||||||
if (!over || !active || !position) {
|
if (!over || !active || !position) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
2
packages/env/package.json
vendored
2
packages/env/package.json
vendored
@@ -4,7 +4,7 @@
|
|||||||
"main": "./src/index.ts",
|
"main": "./src/index.ts",
|
||||||
"module": "./src/index.ts",
|
"module": "./src/index.ts",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/global": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/global": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"next": "=13.2.3",
|
"next": "=13.2.3",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ import { useMemo } from 'react';
|
|||||||
export function useBlockSuiteWorkspaceHelper(blockSuiteWorkspace: Workspace) {
|
export function useBlockSuiteWorkspaceHelper(blockSuiteWorkspace: Workspace) {
|
||||||
return useMemo(
|
return useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
createPage: (pageId: string, parentId?: string): Page => {
|
createPage: (pageId: string): Page => {
|
||||||
assertExists(blockSuiteWorkspace);
|
assertExists(blockSuiteWorkspace);
|
||||||
return blockSuiteWorkspace.createPage(pageId, parentId);
|
return blockSuiteWorkspace.createPage(pageId);
|
||||||
},
|
},
|
||||||
markMilestone: async (name: string) => {
|
markMilestone: async (name: string) => {
|
||||||
assertExists(blockSuiteWorkspace);
|
assertExists(blockSuiteWorkspace);
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
"jotai": "^2.0.4"
|
"jotai": "^2.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/blocks": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/blocks": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/editor": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/editor": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/global": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/global": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/store": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/store": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"lottie-web": "^5.11.0"
|
"lottie-web": "^5.11.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
"idb": "^7.1.1"
|
"idb": "^7.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@blocksuite/blocks": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/blocks": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"@blocksuite/store": "0.0.0-20230420160324-857b396c-nightly",
|
"@blocksuite/store": "0.0.0-20230420210727-85b7de79-nightly",
|
||||||
"vite": "^4.2.1",
|
"vite": "^4.2.1",
|
||||||
"vite-plugin-dts": "^2.2.0",
|
"vite-plugin-dts": "^2.2.0",
|
||||||
"y-indexeddb": "^9.0.10"
|
"y-indexeddb": "^9.0.10"
|
||||||
|
|||||||
110
yarn.lock
110
yarn.lock
@@ -38,11 +38,11 @@ __metadata:
|
|||||||
"@affine/i18n": "workspace:*"
|
"@affine/i18n": "workspace:*"
|
||||||
"@affine/jotai": "workspace:*"
|
"@affine/jotai": "workspace:*"
|
||||||
"@affine/workspace": "workspace:^"
|
"@affine/workspace": "workspace:^"
|
||||||
"@blocksuite/blocks": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/blocks": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/editor": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/editor": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/icons": ^2.1.10
|
"@blocksuite/icons": ^2.1.10
|
||||||
"@blocksuite/store": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/store": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@dnd-kit/core": ^6.0.8
|
"@dnd-kit/core": ^6.0.8
|
||||||
"@dnd-kit/sortable": ^7.0.2
|
"@dnd-kit/sortable": ^7.0.2
|
||||||
"@emotion/cache": ^11.10.7
|
"@emotion/cache": ^11.10.7
|
||||||
@@ -139,7 +139,7 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@affine/env@workspace:packages/env"
|
resolution: "@affine/env@workspace:packages/env"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
lit: ^2.7.2
|
lit: ^2.7.2
|
||||||
next: =13.2.3
|
next: =13.2.3
|
||||||
react: ^18.2.0
|
react: ^18.2.0
|
||||||
@@ -173,10 +173,10 @@ __metadata:
|
|||||||
resolution: "@affine/jotai@workspace:packages/jotai"
|
resolution: "@affine/jotai@workspace:packages/jotai"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@affine/env": "workspace:*"
|
"@affine/env": "workspace:*"
|
||||||
"@blocksuite/blocks": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/blocks": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/editor": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/editor": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/store": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/store": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
jotai: ^2.0.4
|
jotai: ^2.0.4
|
||||||
lottie-web: ^5.11.0
|
lottie-web: ^5.11.0
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -248,11 +248,11 @@ __metadata:
|
|||||||
"@affine/jotai": "workspace:*"
|
"@affine/jotai": "workspace:*"
|
||||||
"@affine/templates": "workspace:*"
|
"@affine/templates": "workspace:*"
|
||||||
"@affine/workspace": "workspace:*"
|
"@affine/workspace": "workspace:*"
|
||||||
"@blocksuite/blocks": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/blocks": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/editor": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/editor": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/icons": ^2.1.10
|
"@blocksuite/icons": ^2.1.10
|
||||||
"@blocksuite/store": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/store": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@dnd-kit/core": ^6.0.8
|
"@dnd-kit/core": ^6.0.8
|
||||||
"@dnd-kit/sortable": ^7.0.2
|
"@dnd-kit/sortable": ^7.0.2
|
||||||
"@emotion/cache": ^11.10.7
|
"@emotion/cache": ^11.10.7
|
||||||
@@ -2046,14 +2046,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/blocks@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/blocks@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/blocks@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/blocks@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/connector": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/connector": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/phasor": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/phasor": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/virgo": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/virgo": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@popperjs/core": ^2.11.6
|
"@popperjs/core": ^2.11.6
|
||||||
hotkeys-js: ^3.10.1
|
hotkeys-js: ^3.10.1
|
||||||
lit: ^2.6.1
|
lit: ^2.6.1
|
||||||
@@ -2062,36 +2062,36 @@ __metadata:
|
|||||||
turndown: ^7.1.1
|
turndown: ^7.1.1
|
||||||
zod: ^3.21.4
|
zod: ^3.21.4
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
"@blocksuite/store": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/store": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
checksum: 629fefbed1aa45c8a8672df9d75fbb9ee23351278d5e7c05af81ac1a5f4d07eba79d017340baace53c0a644654284bb41bb3056662bc8eb16751e7c22a496337
|
checksum: db77e6eea73249792fb923d0e219a7f9192f42eb90d2331e7148504b024777973fd29b06c543157be821fa52e2858718ea7b8a35bf5d93ff70d2a112d30b886d
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/connector@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/connector@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/connector@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/connector@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
checksum: 8c6d65e73722265e2c0c537947a14720fae1db6fa11d74ecb78bbc2b9d9124da52eeb4b9387a9383edb548acce568b14185d4f47739efa28f81dbf14f13d5395
|
checksum: 25cd55b2ca735935f314df56cd2e02d7949fb2e629b75ff49ad9207bd815d3047c36a783bf9a2d6f17e78d18fefe707ce097e5867fa6a864f9caf2d5d648c700
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/editor@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/editor@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/editor@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/editor@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
lit: ^2.6.1
|
lit: ^2.6.1
|
||||||
marked: ^4.2.12
|
marked: ^4.2.12
|
||||||
turndown: ^7.1.1
|
turndown: ^7.1.1
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
"@blocksuite/blocks": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/blocks": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/store": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/store": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
checksum: eca3f2e3edfa13d6fb15eb789fb03b572a4394be624f3fcbb2eda5b9028e46e17fcd0f68962368c702a3684e1a73adddb76f5690fcf6bf569d38f695935e3003
|
checksum: 5d35e374cc2f217587f5020bb20eafd011b652f3f36004b8bbd9ea45a7a4469e61ec08458e0c37d32c66612f1386b8b3364ff8144af61e52fa53d2bb17baa62c
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/global@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/global@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/global@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/global@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
dependencies:
|
dependencies:
|
||||||
ansi-colors: ^4.1.3
|
ansi-colors: ^4.1.3
|
||||||
zod: ^3.21.4
|
zod: ^3.21.4
|
||||||
@@ -2100,7 +2100,7 @@ __metadata:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
lit:
|
lit:
|
||||||
optional: true
|
optional: true
|
||||||
checksum: 2ab996bbc43ac5cffdd43ba3f4f632d68b01c23f2c647ea19e092f087b434ea4f117c00a848e9fbeb6cdef45b41c5a731ff3f0635c7b5f3974bc554a8ea88b40
|
checksum: 8dea674935ce703601eb528bd18c498c2cea0469a741f28f342606f6ab9eb088be3074a73ce5a7fefe987890326fcd3f3a3deda4a88c8b4a2087d5fac3def137
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -2114,25 +2114,25 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/phasor@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/phasor@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/phasor@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/phasor@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
fractional-indexing: ^3.2.0
|
fractional-indexing: ^3.2.0
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
nanoid: ^4
|
nanoid: ^4
|
||||||
yjs: ^13
|
yjs: ^13
|
||||||
checksum: 4651d0ee841a0305ef0194c6d8fa18e190fa985df66d86558c36eb5209f8e829b10fdd17b8c9a4d0f801caf3a0ea5f7b6a9101b672f12d4bba9c537c748c5e86
|
checksum: 6b08fcdd8a576746dd64b59ab380012e4b0d280801515b7f74bbe108f7ede58af120e209ca082234bdece25a1e58e993d4549c9f82f3b8a6be26b024f965c21d
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/store@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/store@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/store@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/store@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/virgo": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/virgo": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@types/flexsearch": ^0.7.3
|
"@types/flexsearch": ^0.7.3
|
||||||
buffer: ^6.0.3
|
buffer: ^6.0.3
|
||||||
flexsearch: 0.7.21
|
flexsearch: 0.7.21
|
||||||
@@ -2146,20 +2146,20 @@ __metadata:
|
|||||||
zod: ^3.21.4
|
zod: ^3.21.4
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
yjs: ^13
|
yjs: ^13
|
||||||
checksum: a6629b1f62f54bf8583679bdce5077f950ea4b27b2ba08a1d563f7efa44a2800342def7d64ad4f8d95491214b94acb463cf5959e3438fb75281db68565c0c0c1
|
checksum: 9a8f293d4d5480e8dc6a45ed5d01eebf551a2c94543f1ddef0d1707a3b193cb5ade5c05a79d3c91a5c3e4b29752a9dded2f037ea379f437e9a53fe9460e03f92
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"@blocksuite/virgo@npm:0.0.0-20230420160324-857b396c-nightly":
|
"@blocksuite/virgo@npm:0.0.0-20230420210727-85b7de79-nightly":
|
||||||
version: 0.0.0-20230420160324-857b396c-nightly
|
version: 0.0.0-20230420210727-85b7de79-nightly
|
||||||
resolution: "@blocksuite/virgo@npm:0.0.0-20230420160324-857b396c-nightly"
|
resolution: "@blocksuite/virgo@npm:0.0.0-20230420210727-85b7de79-nightly"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/global": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/global": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
zod: ^3.21.4
|
zod: ^3.21.4
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
lit: ^2
|
lit: ^2
|
||||||
yjs: ^13
|
yjs: ^13
|
||||||
checksum: e46dc780536c83e29bd6688f6b02e2e3b84dc99d068827f8d85d4a79700ee8d6e6207de89ec0ff6c31ccd7d51b123f244c6c2952fc06d8f2ef5ec880a04441a3
|
checksum: 9e887260fbb5517ebe1495ac853ac66131f5593fd0b5eb20caf946aa7c9c59bf7173155752ea5a0310d245550b7c7bf0d9f3163c4acfbee9af75ce0200b5f9ff
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
@@ -7581,8 +7581,8 @@ __metadata:
|
|||||||
version: 0.0.0-use.local
|
version: 0.0.0-use.local
|
||||||
resolution: "@toeverything/y-indexeddb@workspace:packages/y-indexeddb"
|
resolution: "@toeverything/y-indexeddb@workspace:packages/y-indexeddb"
|
||||||
dependencies:
|
dependencies:
|
||||||
"@blocksuite/blocks": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/blocks": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
"@blocksuite/store": 0.0.0-20230420160324-857b396c-nightly
|
"@blocksuite/store": 0.0.0-20230420210727-85b7de79-nightly
|
||||||
idb: ^7.1.1
|
idb: ^7.1.1
|
||||||
vite: ^4.2.1
|
vite: ^4.2.1
|
||||||
vite-plugin-dts: ^2.2.0
|
vite-plugin-dts: ^2.2.0
|
||||||
|
|||||||
Reference in New Issue
Block a user