mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 21:27:20 +00:00
refactor(core): desktop project struct (#8334)
This commit is contained in:
@@ -4,17 +4,17 @@ import type { DocMode } from '@blocksuite/affine/blocks';
|
||||
import { ImportIcon, PlusIcon } from '@blocksuite/icons/rc';
|
||||
|
||||
import type { usePageHelper } from '../components/blocksuite/block-suite-page-list/utils';
|
||||
import type { CreateWorkspaceDialogService } from '../modules/create-workspace';
|
||||
import type { GlobalDialogService } from '../modules/dialogs';
|
||||
import { registerAffineCommand } from './registry';
|
||||
|
||||
export function registerAffineCreationCommands({
|
||||
pageHelper,
|
||||
t,
|
||||
createWorkspaceDialogService,
|
||||
globalDialogService,
|
||||
}: {
|
||||
t: ReturnType<typeof useI18n>;
|
||||
pageHelper: ReturnType<typeof usePageHelper>;
|
||||
createWorkspaceDialogService: CreateWorkspaceDialogService;
|
||||
globalDialogService: GlobalDialogService;
|
||||
}) {
|
||||
const unsubs: Array<() => void> = [];
|
||||
unsubs.push(
|
||||
@@ -62,7 +62,7 @@ export function registerAffineCreationCommands({
|
||||
run() {
|
||||
track.$.cmdk.workspace.createWorkspace();
|
||||
|
||||
createWorkspaceDialogService.dialog.open('new');
|
||||
globalDialogService.open('create-workspace', undefined);
|
||||
},
|
||||
})
|
||||
);
|
||||
@@ -80,7 +80,7 @@ export function registerAffineCreationCommands({
|
||||
control: 'import',
|
||||
});
|
||||
|
||||
createWorkspaceDialogService.dialog.open('add');
|
||||
globalDialogService.open('import-workspace', undefined);
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
import type { useI18n } from '@affine/i18n';
|
||||
import { track } from '@affine/track';
|
||||
import { ContactWithUsIcon, NewIcon } from '@blocksuite/icons/rc';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import { openSettingModalAtom } from '../components/atoms';
|
||||
import type { GlobalDialogService } from '../modules/dialogs';
|
||||
import type { UrlService } from '../modules/url';
|
||||
import { registerAffineCommand } from './registry';
|
||||
|
||||
export function registerAffineHelpCommands({
|
||||
t,
|
||||
store,
|
||||
urlService,
|
||||
globalDialogService,
|
||||
}: {
|
||||
t: ReturnType<typeof useI18n>;
|
||||
store: ReturnType<typeof createStore>;
|
||||
urlService: UrlService;
|
||||
globalDialogService: GlobalDialogService;
|
||||
}) {
|
||||
const unsubs: Array<() => void> = [];
|
||||
unsubs.push(
|
||||
@@ -37,8 +36,7 @@ export function registerAffineHelpCommands({
|
||||
label: t['com.affine.cmdk.affine.contact-us'](),
|
||||
run() {
|
||||
track.$.cmdk.help.contactUs();
|
||||
store.set(openSettingModalAtom, {
|
||||
open: true,
|
||||
globalDialogService.open('setting', {
|
||||
activeTab: 'about',
|
||||
workspaceMetadata: null,
|
||||
});
|
||||
|
||||
@@ -4,11 +4,9 @@ import type { DocCollection } from '@blocksuite/affine/store';
|
||||
import { ArrowRightBigIcon } from '@blocksuite/icons/rc';
|
||||
import type { createStore } from 'jotai';
|
||||
|
||||
import {
|
||||
openSettingModalAtom,
|
||||
openWorkspaceListModalAtom,
|
||||
} from '../components/atoms';
|
||||
import { openWorkspaceListModalAtom } from '../components/atoms';
|
||||
import type { useNavigateHelper } from '../components/hooks/use-navigate-helper';
|
||||
import type { GlobalDialogService } from '../modules/dialogs';
|
||||
import { registerAffineCommand } from './registry';
|
||||
|
||||
export function registerAffineNavigationCommands({
|
||||
@@ -16,11 +14,13 @@ export function registerAffineNavigationCommands({
|
||||
store,
|
||||
docCollection,
|
||||
navigationHelper,
|
||||
globalDialogService,
|
||||
}: {
|
||||
t: ReturnType<typeof useI18n>;
|
||||
store: ReturnType<typeof createStore>;
|
||||
navigationHelper: ReturnType<typeof useNavigateHelper>;
|
||||
docCollection: DocCollection;
|
||||
globalDialogService: GlobalDialogService;
|
||||
}) {
|
||||
const unsubs: Array<() => void> = [];
|
||||
unsubs.push(
|
||||
@@ -96,10 +96,9 @@ export function registerAffineNavigationCommands({
|
||||
keyBinding: '$mod+,',
|
||||
run() {
|
||||
track.$.cmdk.settings.openSettings();
|
||||
store.set(openSettingModalAtom, s => ({
|
||||
globalDialogService.open('setting', {
|
||||
activeTab: 'appearance',
|
||||
open: !s.open,
|
||||
}));
|
||||
});
|
||||
},
|
||||
})
|
||||
);
|
||||
@@ -112,10 +111,9 @@ export function registerAffineNavigationCommands({
|
||||
label: t['com.affine.cmdk.affine.navigation.open-account-settings'](),
|
||||
run() {
|
||||
track.$.cmdk.settings.openSettings({ to: 'account' });
|
||||
store.set(openSettingModalAtom, s => ({
|
||||
globalDialogService.open('setting', {
|
||||
activeTab: 'account',
|
||||
open: !s.open,
|
||||
}));
|
||||
});
|
||||
},
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user