mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 13:29:02 +08:00
refactor(core): doc property (#8465)
doc property upgraded to use orm. The visibility of the property are simplified to three types: `always show`, `always hide`, `hide when empty`, and the default is `always show`.  Added a sidebar view to manage properties  new property ui in workspace settings  Property lists can be collapsed 
This commit is contained in:
@@ -259,28 +259,28 @@ export const ExplorerFolderNodeFolder = ({
|
||||
}
|
||||
node.moveHere(data.source.data.entity.id, node.indexAt('before'));
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({ type: 'folder' });
|
||||
} else if (
|
||||
data.source.data.from?.at === 'explorer:organize:folder-node'
|
||||
) {
|
||||
node.moveHere(data.source.data.from.nodeId, node.indexAt('before'));
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
} else if (
|
||||
data.source.data.entity?.type === 'collection' ||
|
||||
data.source.data.entity?.type === 'doc' ||
|
||||
data.source.data.entity?.type === 'tag'
|
||||
) {
|
||||
node.createLink(
|
||||
data.source.data.entity?.type,
|
||||
data.source.data.entity.id,
|
||||
node.indexAt('before')
|
||||
);
|
||||
track.$.navigationPanel.organize.createOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
if (data.source.data.from?.at === 'explorer:organize:folder-node') {
|
||||
node.moveHere(data.source.data.from.nodeId, node.indexAt('before'));
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
} else {
|
||||
node.createLink(
|
||||
data.source.data.entity?.type,
|
||||
data.source.data.entity.id,
|
||||
node.indexAt('before')
|
||||
);
|
||||
track.$.navigationPanel.organize.createOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
onDrop?.(data);
|
||||
@@ -330,27 +330,27 @@ export const ExplorerFolderNodeFolder = ({
|
||||
}
|
||||
node.moveHere(data.source.data.entity.id, node.indexAt('before'));
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({ type: 'folder' });
|
||||
} else if (
|
||||
data.source.data.from?.at === 'explorer:organize:folder-node'
|
||||
) {
|
||||
node.moveHere(data.source.data.from.nodeId, node.indexAt('before'));
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({
|
||||
type: data.source.data.entity?.type,
|
||||
});
|
||||
} else if (
|
||||
data.source.data.entity?.type === 'collection' ||
|
||||
data.source.data.entity?.type === 'doc' ||
|
||||
data.source.data.entity?.type === 'tag'
|
||||
) {
|
||||
node.createLink(
|
||||
data.source.data.entity?.type,
|
||||
data.source.data.entity.id,
|
||||
node.indexAt('before')
|
||||
);
|
||||
track.$.navigationPanel.organize.createOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
if (data.source.data.from?.at === 'explorer:organize:folder-node') {
|
||||
node.moveHere(data.source.data.from.nodeId, node.indexAt('before'));
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({
|
||||
type: data.source.data.entity?.type,
|
||||
});
|
||||
} else {
|
||||
node.createLink(
|
||||
data.source.data.entity?.type,
|
||||
data.source.data.entity.id,
|
||||
node.indexAt('before')
|
||||
);
|
||||
track.$.navigationPanel.organize.createOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
[node]
|
||||
@@ -379,32 +379,32 @@ export const ExplorerFolderNodeFolder = ({
|
||||
node.indexAt(at, dropAtNode.id)
|
||||
);
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({ type: 'folder' });
|
||||
} else if (
|
||||
data.source.data.from?.at === 'explorer:organize:folder-node'
|
||||
) {
|
||||
node.moveHere(
|
||||
data.source.data.from.nodeId,
|
||||
node.indexAt(at, dropAtNode.id)
|
||||
);
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
} else if (
|
||||
data.source.data.entity?.type === 'collection' ||
|
||||
data.source.data.entity?.type === 'doc' ||
|
||||
data.source.data.entity?.type === 'tag'
|
||||
) {
|
||||
node.createLink(
|
||||
data.source.data.entity?.type,
|
||||
data.source.data.entity.id,
|
||||
node.indexAt(at, dropAtNode.id)
|
||||
);
|
||||
if (data.source.data.from?.at === 'explorer:organize:folder-node') {
|
||||
node.moveHere(
|
||||
data.source.data.from.nodeId,
|
||||
node.indexAt(at, dropAtNode.id)
|
||||
);
|
||||
track.$.navigationPanel.organize.moveOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
} else {
|
||||
node.createLink(
|
||||
data.source.data.entity?.type,
|
||||
data.source.data.entity.id,
|
||||
node.indexAt(at, dropAtNode.id)
|
||||
);
|
||||
|
||||
track.$.navigationPanel.organize.createOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
track.$.navigationPanel.organize.createOrganizeItem({
|
||||
type: 'link',
|
||||
target: data.source.data.entity?.type,
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (data.treeInstruction?.type === 'reparent') {
|
||||
const currentLevel = data.treeInstruction.currentLevel;
|
||||
|
||||
@@ -86,7 +86,7 @@ export const ExplorerOrganize = () => {
|
||||
const entity = data.source.data.entity;
|
||||
if (!entity) return;
|
||||
const { type, id } = entity;
|
||||
if (type === 'folder') return;
|
||||
if (type !== 'doc' && type !== 'tag' && type !== 'collection') return;
|
||||
|
||||
const folder = newFolder$.value;
|
||||
if (!folder) return;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { generateFractionalIndexingKeyBetween } from '@affine/core/utils/fractional-indexing';
|
||||
import { Entity } from '@toeverything/infra';
|
||||
import {
|
||||
Entity,
|
||||
generateFractionalIndexingKeyBetween,
|
||||
} from '@toeverything/infra';
|
||||
|
||||
import type { FavoriteSupportType } from '../constant';
|
||||
import type { FavoriteRecord, FavoriteStore } from '../stores/favorite';
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import { generateFractionalIndexingKeyBetween } from '@affine/core/utils';
|
||||
import { Entity, LiveData } from '@toeverything/infra';
|
||||
import {
|
||||
Entity,
|
||||
generateFractionalIndexingKeyBetween,
|
||||
LiveData,
|
||||
} from '@toeverything/infra';
|
||||
import { map, of, switchMap } from 'rxjs';
|
||||
|
||||
import type { FolderStore } from '../stores/folder';
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Suspense, useCallback } from 'react';
|
||||
import { Outlet } from 'react-router-dom';
|
||||
|
||||
import { AppSidebarService } from '../../app-sidebar';
|
||||
import { SidebarSwitch } from '../../app-sidebar/views';
|
||||
import { SidebarSwitch } from '../../app-sidebar/views/sidebar-header';
|
||||
import { ViewService } from '../services/view';
|
||||
import { WorkbenchService } from '../services/workbench';
|
||||
import * as styles from './route-container.css';
|
||||
|
||||
Reference in New Issue
Block a user