Открыть боковую панель
Teknokomo
universo-react
Коммиты
e47fc769
Не подтверждена
Коммит
e47fc769
создал
Дек 19, 2023
по автору
EYHN
Просмотр файлов
refactor(infra): move currentPageAtom to core
владелец
35492611
Изменения
8
Скрыть пробелы
Построчно
Рядом
packages/common/infra/src/atom/index.ts
Просмотр файла @
e47fc769
...
@@ -4,4 +4,3 @@ export const loadedPluginNameAtom = atom<string[]>([]);
...
@@ -4,4 +4,3 @@ export const loadedPluginNameAtom = atom<string[]>([]);
export
*
from
'
./root-store
'
;
export
*
from
'
./root-store
'
;
export
*
from
'
./settings
'
;
export
*
from
'
./settings
'
;
export
*
from
'
./workspace
'
;
packages/common/infra/src/atom/workspace.ts
удалено
100644 → 0
Просмотр файла @
35492611
import
{
atom
}
from
'
jotai
'
;
export
const
currentPageIdAtom
=
atom
<
string
|
null
>
(
null
);
packages/common/sdk/src/entry.ts
Просмотр файла @
e47fc769
...
@@ -60,6 +60,5 @@ export declare const pushLayoutAtom: WritableAtom<
...
@@ -60,6 +60,5 @@ export declare const pushLayoutAtom: WritableAtom<
void
void
>
;
>
;
export
declare
const
deleteLayoutAtom
:
WritableAtom
<
null
,
[
string
],
void
>
;
export
declare
const
deleteLayoutAtom
:
WritableAtom
<
null
,
[
string
],
void
>
;
export
declare
const
currentPageIdAtom
:
Atom
<
string
|
null
>
;
export
declare
const
currentWorkspaceAtom
:
Atom
<
Promise
<
Workspace
>>
;
export
declare
const
currentWorkspaceAtom
:
Atom
<
Promise
<
Workspace
>>
;
export
declare
const
rootStore
:
ReturnType
<
typeof
getDefaultStore
>
;
export
declare
const
rootStore
:
ReturnType
<
typeof
getDefaultStore
>
;
packages/frontend/core/src/atoms/mode.ts
Просмотр файла @
e47fc769
import
{
currentPageIdAtom
}
from
'
@toeverything/infra/atom
'
;
import
{
atom
}
from
'
jotai/vanilla
'
;
import
{
atom
}
from
'
jotai/vanilla
'
;
import
{
pageSettingFamily
}
from
'
./index
'
;
import
{
pageSettingFamily
}
from
'
./index
'
;
export
const
currentPageIdAtom
=
atom
<
string
|
null
>
(
null
);
export
const
currentModeAtom
=
atom
<
'
page
'
|
'
edgeless
'
>
(
get
=>
{
export
const
currentModeAtom
=
atom
<
'
page
'
|
'
edgeless
'
>
(
get
=>
{
const
pageId
=
get
(
currentPageIdAtom
);
const
pageId
=
get
(
currentPageIdAtom
);
if
(
!
pageId
)
{
if
(
!
pageId
)
{
...
...
packages/frontend/core/src/components/affine/affine-error-boundary/error-basic/info-logger.tsx
Просмотр файла @
e47fc769
...
@@ -2,11 +2,12 @@ import {
...
@@ -2,11 +2,12 @@ import {
currentWorkspaceAtom
,
currentWorkspaceAtom
,
workspaceListAtom
,
workspaceListAtom
,
}
from
'
@affine/workspace/atom
'
;
}
from
'
@affine/workspace/atom
'
;
import
{
currentPageIdAtom
}
from
'
@toeverything/infra/atom
'
;
import
{
useAtomValue
}
from
'
jotai/react
'
;
import
{
useAtomValue
}
from
'
jotai/react
'
;
import
{
useEffect
}
from
'
react
'
;
import
{
useEffect
}
from
'
react
'
;
import
{
useLocation
,
useParams
}
from
'
react-router-dom
'
;
import
{
useLocation
,
useParams
}
from
'
react-router-dom
'
;
import
{
currentPageIdAtom
}
from
'
../../../../atoms/mode
'
;
export
interface
DumpInfoProps
{
export
interface
DumpInfoProps
{
error
:
any
;
error
:
any
;
}
}
...
...
packages/frontend/core/src/components/pure/cmdk/data.tsx
Просмотр файла @
e47fc769
...
@@ -12,7 +12,7 @@ import {
...
@@ -12,7 +12,7 @@ import {
useBlockSuitePageMeta
,
useBlockSuitePageMeta
,
usePageMetaHelper
,
usePageMetaHelper
,
}
from
'
@toeverything/hooks/use-block-suite-page-meta
'
;
}
from
'
@toeverything/hooks/use-block-suite-page-meta
'
;
import
{
currentPageIdAtom
,
getCurrentStore
}
from
'
@toeverything/infra/atom
'
;
import
{
getCurrentStore
}
from
'
@toeverything/infra/atom
'
;
import
{
import
{
type
AffineCommand
,
type
AffineCommand
,
AffineCommandRegistry
,
AffineCommandRegistry
,
...
@@ -29,6 +29,7 @@ import {
...
@@ -29,6 +29,7 @@ import {
recentPageIdsBaseAtom
,
recentPageIdsBaseAtom
,
}
from
'
../../../atoms
'
;
}
from
'
../../../atoms
'
;
import
{
collectionsCRUDAtom
}
from
'
../../../atoms/collections
'
;
import
{
collectionsCRUDAtom
}
from
'
../../../atoms/collections
'
;
import
{
currentPageIdAtom
}
from
'
../../../atoms/mode
'
;
import
{
useNavigateHelper
}
from
'
../../../hooks/use-navigate-helper
'
;
import
{
useNavigateHelper
}
from
'
../../../hooks/use-navigate-helper
'
;
import
{
WorkspaceSubPath
}
from
'
../../../shared
'
;
import
{
WorkspaceSubPath
}
from
'
../../../shared
'
;
import
{
usePageHelper
}
from
'
../../blocksuite/block-suite-page-list/utils
'
;
import
{
usePageHelper
}
from
'
../../blocksuite/block-suite-page-list/utils
'
;
...
...
packages/frontend/core/src/hooks/current/use-current-page.ts
Просмотр файла @
e47fc769
import
{
waitForCurrentWorkspaceAtom
}
from
'
@affine/workspace/atom
'
;
import
{
waitForCurrentWorkspaceAtom
}
from
'
@affine/workspace/atom
'
;
import
{
useBlockSuiteWorkspacePage
}
from
'
@toeverything/hooks/use-block-suite-workspace-page
'
;
import
{
useBlockSuiteWorkspacePage
}
from
'
@toeverything/hooks/use-block-suite-workspace-page
'
;
import
{
currentPageIdAtom
}
from
'
@toeverything/infra/atom
'
;
import
{
useAtomValue
}
from
'
jotai
'
;
import
{
useAtomValue
}
from
'
jotai
'
;
import
{
currentPageIdAtom
}
from
'
../../atoms/mode
'
;
export
const
useCurrentPage
=
()
=>
{
export
const
useCurrentPage
=
()
=>
{
const
currentPageId
=
useAtomValue
(
currentPageIdAtom
);
const
currentPageId
=
useAtomValue
(
currentPageIdAtom
);
const
currentWorkspace
=
useAtomValue
(
waitForCurrentWorkspaceAtom
);
const
currentWorkspace
=
useAtomValue
(
waitForCurrentWorkspaceAtom
);
...
...
packages/frontend/core/src/pages/workspace/detail-page/detail-page.tsx
Просмотр файла @
e47fc769
...
@@ -11,7 +11,7 @@ import type { AffineEditorContainer } from '@blocksuite/presets';
...
@@ -11,7 +11,7 @@ import type { AffineEditorContainer } from '@blocksuite/presets';
import
type
{
Page
,
Workspace
}
from
'
@blocksuite/store
'
;
import
type
{
Page
,
Workspace
}
from
'
@blocksuite/store
'
;
import
{
useBlockSuitePageMeta
}
from
'
@toeverything/hooks/use-block-suite-page-meta
'
;
import
{
useBlockSuitePageMeta
}
from
'
@toeverything/hooks/use-block-suite-page-meta
'
;
import
{
useWorkspaceStatus
}
from
'
@toeverything/hooks/use-workspace-status
'
;
import
{
useWorkspaceStatus
}
from
'
@toeverything/hooks/use-workspace-status
'
;
import
{
appSettingAtom
,
currentPageIdAtom
}
from
'
@toeverything/infra/atom
'
;
import
{
appSettingAtom
}
from
'
@toeverything/infra/atom
'
;
import
{
useAtomValue
,
useSetAtom
}
from
'
jotai
'
;
import
{
useAtomValue
,
useSetAtom
}
from
'
jotai
'
;
import
{
import
{
memo
,
memo
,
...
@@ -26,7 +26,7 @@ import type { Map as YMap } from 'yjs';
...
@@ -26,7 +26,7 @@ import type { Map as YMap } from 'yjs';
import
{
setPageModeAtom
}
from
'
../../../atoms
'
;
import
{
setPageModeAtom
}
from
'
../../../atoms
'
;
import
{
collectionsCRUDAtom
}
from
'
../../../atoms/collections
'
;
import
{
collectionsCRUDAtom
}
from
'
../../../atoms/collections
'
;
import
{
currentModeAtom
}
from
'
../../../atoms/mode
'
;
import
{
currentModeAtom
,
currentPageIdAtom
}
from
'
../../../atoms/mode
'
;
import
{
AffineErrorBoundary
}
from
'
../../../components/affine/affine-error-boundary
'
;
import
{
AffineErrorBoundary
}
from
'
../../../components/affine/affine-error-boundary
'
;
import
{
HubIsland
}
from
'
../../../components/affine/hub-island
'
;
import
{
HubIsland
}
from
'
../../../components/affine/hub-island
'
;
import
{
GlobalPageHistoryModal
}
from
'
../../../components/affine/page-history-modal
'
;
import
{
GlobalPageHistoryModal
}
from
'
../../../components/affine/page-history-modal
'
;
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать