mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
Feat/blocksuit version (#760)
This commit is contained in:
@@ -11,10 +11,10 @@
|
||||
"dependencies": {
|
||||
"@affine/datacenter": "workspace:*",
|
||||
"@affine/i18n": "workspace:*",
|
||||
"@blocksuite/blocks": "0.4.0-20230113023110-28a7fdc",
|
||||
"@blocksuite/editor": "0.4.0-20230113023110-28a7fdc",
|
||||
"@blocksuite/blocks": "0.4.0-20230201063624-4e0463b",
|
||||
"@blocksuite/editor": "0.4.0-20230201063624-4e0463b",
|
||||
"@blocksuite/icons": "^2.0.2",
|
||||
"@blocksuite/store": "0.4.0-20230113023110-28a7fdc",
|
||||
"@blocksuite/store": "0.4.0-20230201063624-4e0463b",
|
||||
"@emotion/css": "^11.10.0",
|
||||
"@emotion/react": "^11.10.4",
|
||||
"@emotion/server": "^11.10.0",
|
||||
|
||||
@@ -42,19 +42,18 @@ export const Editor = ({ page, workspace, setEditor }: Props) => {
|
||||
? 'Welcome to AFFiNE Alpha "Downhill"'
|
||||
: '';
|
||||
workspace?.setPageMeta(page.id, { title });
|
||||
|
||||
const pageId = page.addBlock({
|
||||
flavour: 'affine:page',
|
||||
title,
|
||||
});
|
||||
page.addBlock({ flavour: 'affine:surface' });
|
||||
const frameId = page.addBlock({ flavour: 'affine:frame' }, pageId);
|
||||
page.addBlock({ flavour: 'affine:frame' }, pageId);
|
||||
const pageBlockId = page.addBlockByFlavour('affine:page', { title });
|
||||
page.addBlockByFlavour('affine:surface', {}, null);
|
||||
// Add frame block inside page block
|
||||
const frameId = page.addBlockByFlavour('affine:frame', {}, pageBlockId);
|
||||
// Add paragraph block inside frame block
|
||||
// If this is a first page in workspace, init an introduction markdown
|
||||
if (isFirstPage) {
|
||||
editor.clipboard.importMarkdown(exampleMarkdown, `${frameId}`);
|
||||
editor.clipboard.importMarkdown(exampleMarkdown, frameId);
|
||||
workspace.setPageMeta(page.id, { title });
|
||||
page.resetHistory();
|
||||
} else {
|
||||
page.addBlockByFlavour('affine:paragraph', {}, frameId);
|
||||
}
|
||||
page.resetHistory();
|
||||
}
|
||||
|
||||
@@ -3,8 +3,9 @@ import {
|
||||
CloudIcon,
|
||||
LocalIcon,
|
||||
OfflineIcon,
|
||||
PublishedIcon,
|
||||
} from '@/components/workspace-modal/icons';
|
||||
import { PublishIcon, UsersIcon } from '@blocksuite/icons';
|
||||
import { UsersIcon } from '@blocksuite/icons';
|
||||
import { WorkspaceUnit } from '@affine/datacenter';
|
||||
import { useAppState } from '@/providers/app-state-provider';
|
||||
import { StyleWorkspaceInfo, StyleWorkspaceTitle, StyledCard } from './styles';
|
||||
@@ -61,7 +62,7 @@ export const WorkspaceCard = ({
|
||||
)}
|
||||
{workspaceData.published && (
|
||||
<p>
|
||||
<PublishIcon fontSize={16} />
|
||||
<PublishedIcon />
|
||||
{t('Published to Web')}
|
||||
</p>
|
||||
)}
|
||||
|
||||
@@ -78,6 +78,7 @@ export const InviteMemberModal = ({
|
||||
<ModalCloseButton
|
||||
onClick={() => {
|
||||
onClose();
|
||||
setEmail('');
|
||||
}}
|
||||
/>
|
||||
</Header>
|
||||
@@ -123,6 +124,7 @@ export const InviteMemberModal = ({
|
||||
style={{ width: '364px', height: '38px', borderRadius: '40px' }}
|
||||
onClick={async () => {
|
||||
await inviteMember(email);
|
||||
setEmail('');
|
||||
onInviteSuccess();
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
"yjs": "^13.5.44"
|
||||
},
|
||||
"dependencies": {
|
||||
"@blocksuite/blocks": "0.4.0-20230113023110-28a7fdc",
|
||||
"@blocksuite/store": "0.4.0-20230113023110-28a7fdc",
|
||||
"@blocksuite/blocks": "0.4.0-20230201063624-4e0463b",
|
||||
"@blocksuite/store": "0.4.0-20230201063624-4e0463b",
|
||||
"debug": "^4.3.4",
|
||||
"encoding": "^0.1.13",
|
||||
"firebase": "^9.15.0",
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { Workspace as BlocksuiteWorkspace } from '@blocksuite/store';
|
||||
import { BlockSchema } from '@blocksuite/blocks/models';
|
||||
import { builtInSchemas } from '@blocksuite/blocks/models';
|
||||
|
||||
export const createBlocksuiteWorkspace = (workspaceId: string) => {
|
||||
return new BlocksuiteWorkspace({
|
||||
room: workspaceId,
|
||||
}).register(BlockSchema);
|
||||
}).register(builtInSchemas);
|
||||
};
|
||||
|
||||
const DefaultHeadImgColors = [
|
||||
|
||||
Reference in New Issue
Block a user