mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
@@ -73,10 +73,7 @@ export const mobileRoot = style([
|
||||
padding: '0 16px',
|
||||
selectors: {
|
||||
'&[data-collapsible="true"]:hover': {
|
||||
backgroundColor: 'transparent',
|
||||
},
|
||||
'&[data-collapsible="true"]:active': {
|
||||
backgroundColor: cssVarV2('layer/background/hoverOverlay'),
|
||||
backgroundColor: 'none',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -53,9 +53,11 @@ export const CategoryDivider = forwardRef(
|
||||
/>
|
||||
) : null}
|
||||
</div>
|
||||
<div className={styles.actions} onClick={e => e.stopPropagation()}>
|
||||
{children}
|
||||
</div>
|
||||
{mobile ? null : (
|
||||
<div className={styles.actions} onClick={e => e.stopPropagation()}>
|
||||
{children}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ export const CollapsibleSection = ({
|
||||
ref={headerRef}
|
||||
className={clsx(header, headerClassName)}
|
||||
>
|
||||
{mobile ? null : actions}
|
||||
{actions}
|
||||
</CategoryDivider>
|
||||
<Collapsible.Content
|
||||
data-testid="collapsible-section-content"
|
||||
|
||||
@@ -189,7 +189,7 @@ export const mobileItemRoot = style([
|
||||
gap: 12,
|
||||
selectors: {
|
||||
'&:hover': {
|
||||
background: 'transparent',
|
||||
background: 'none',
|
||||
},
|
||||
'&:active': {
|
||||
background: cssVar('hoverColor'),
|
||||
|
||||
@@ -138,19 +138,21 @@ export const ExplorerTreeNode = ({
|
||||
AffineDNDData & { draggable: { __cid: string } }
|
||||
>(
|
||||
() => ({
|
||||
canDrag: () => !mobile,
|
||||
data: { ...dndData?.draggable, __cid: cid },
|
||||
dragPreviewPosition: 'pointer-outside',
|
||||
}),
|
||||
[cid, dndData]
|
||||
[cid, dndData, mobile]
|
||||
);
|
||||
const handleCanDrop = useMemo<DropTargetOptions<AffineDNDData>['canDrop']>(
|
||||
() => args => {
|
||||
if (mobile) return false;
|
||||
if (!reorderable && args.treeInstruction?.type !== 'make-child') {
|
||||
return false;
|
||||
}
|
||||
return (typeof canDrop === 'function' ? canDrop(args) : canDrop) ?? true;
|
||||
},
|
||||
[canDrop, reorderable]
|
||||
[canDrop, mobile, reorderable]
|
||||
);
|
||||
const {
|
||||
dropTargetRef,
|
||||
@@ -347,33 +349,35 @@ export const ExplorerTreeNode = ({
|
||||
</div>
|
||||
|
||||
{postfix}
|
||||
<div
|
||||
className={styles.postfix}
|
||||
onClick={e => {
|
||||
// prevent jump to page
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{inlineOperations.map(({ view }, index) => (
|
||||
<Fragment key={index}>{view}</Fragment>
|
||||
))}
|
||||
{menuOperations.length > 0 && (
|
||||
<Menu
|
||||
items={menuOperations.map(({ view }, index) => (
|
||||
<Fragment key={index}>{view}</Fragment>
|
||||
))}
|
||||
>
|
||||
<IconButton
|
||||
size="16"
|
||||
data-testid="explorer-tree-node-operation-button"
|
||||
style={{ marginLeft: 4 }}
|
||||
{mobile ? null : (
|
||||
<div
|
||||
className={styles.postfix}
|
||||
onClick={e => {
|
||||
// prevent jump to page
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
{inlineOperations.map(({ view }, index) => (
|
||||
<Fragment key={index}>{view}</Fragment>
|
||||
))}
|
||||
{menuOperations.length > 0 && (
|
||||
<Menu
|
||||
items={menuOperations.map(({ view }, index) => (
|
||||
<Fragment key={index}>{view}</Fragment>
|
||||
))}
|
||||
>
|
||||
<MoreHorizontalIcon />
|
||||
</IconButton>
|
||||
</Menu>
|
||||
)}
|
||||
</div>
|
||||
<IconButton
|
||||
size="16"
|
||||
data-testid="explorer-tree-node-operation-button"
|
||||
style={{ marginLeft: 4 }}
|
||||
>
|
||||
<MoreHorizontalIcon />
|
||||
</IconButton>
|
||||
</Menu>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{renameable && (
|
||||
|
||||
Reference in New Issue
Block a user