mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-09 05:05:52 +08:00
4b6c4ed546
fix AF-1454
1. move inline tags editor to components
2. add progress component
3. adjust doc properties styles for desktop
4. subscribe bs database links and display in doc info
5. move update/create dates to doc info
6. a trivial e2e test
<div class='graphite__hidden'>
<div>🎥 Video uploaded on Graphite:</div>
<a href="https://app.graphite.dev/media/video/T2klNLEk0wxLh4NRDzhk/eed266c1-fdac-4f0e-baa9-4aa00d14a2e8.mp4">
<img src="https://app.graphite.dev/api/v1/graphite/video/thumbnail/T2klNLEk0wxLh4NRDzhk/eed266c1-fdac-4f0e-baa9-4aa00d14a2e8.mp4">
</a>
</div>
<video src="https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/eed266c1-fdac-4f0e-baa9-4aa00d14a2e8.mp4">10月23日.mp4</video>
157 lines
4.1 KiB
TypeScript
157 lines
4.1 KiB
TypeScript
import { FrameIcon } from '@blocksuite/icons/rc';
|
|
|
|
import { useDraggable, useDropTarget } from '../dnd';
|
|
import { MenuItem } from '../menu';
|
|
import {
|
|
PropertyCollapsibleContent,
|
|
PropertyCollapsibleSection,
|
|
PropertyName,
|
|
PropertyRoot,
|
|
PropertyValue,
|
|
} from './property';
|
|
|
|
export default {
|
|
title: 'UI/Property',
|
|
};
|
|
|
|
export const SingleProperty = () => {
|
|
return (
|
|
<>
|
|
<PropertyRoot>
|
|
<PropertyName name="Name" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot>
|
|
<PropertyName name="Long nameeeeeeeeeeeeeeeee" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
|
|
<PropertyRoot>
|
|
<PropertyName
|
|
name="With Menu"
|
|
icon={<FrameIcon />}
|
|
menuItems={<MenuItem>Menu</MenuItem>}
|
|
/>
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
|
|
<PropertyRoot>
|
|
<PropertyName name="Readonly" icon={<FrameIcon />} />
|
|
<PropertyValue readonly>Readonly Value</PropertyValue>
|
|
</PropertyRoot>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export const DNDProperty = () => {
|
|
const { dragRef: dragRef1 } = useDraggable(
|
|
() => ({
|
|
data: { text: 'hello' },
|
|
}),
|
|
[]
|
|
);
|
|
const { dragRef: dragRef2 } = useDraggable(
|
|
() => ({
|
|
data: { text: 'hello' },
|
|
}),
|
|
[]
|
|
);
|
|
const { dropTargetRef, closestEdge } = useDropTarget(
|
|
() => ({
|
|
closestEdge: {
|
|
allowedEdges: ['top', 'bottom'],
|
|
},
|
|
}),
|
|
[]
|
|
);
|
|
return (
|
|
<>
|
|
<PropertyRoot ref={dragRef1}>
|
|
<PropertyName name="Draggable" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot ref={dragRef2}>
|
|
<PropertyName
|
|
name="Draggable Menu"
|
|
icon={<FrameIcon />}
|
|
menuItems={<MenuItem>Menu</MenuItem>}
|
|
/>
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot ref={dropTargetRef} dropIndicatorEdge={closestEdge}>
|
|
<PropertyName name="DropTarget" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export const HideEmptyProperty = () => {
|
|
return (
|
|
<>
|
|
<PropertyRoot hideEmpty>
|
|
<PropertyName name="Should not be hidden" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot hideEmpty>
|
|
<PropertyName name="Should be hidden" icon={<FrameIcon />} />
|
|
<PropertyValue isEmpty>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export const BasicPropertyCollapsibleContent = () => {
|
|
return (
|
|
<PropertyCollapsibleContent collapsible>
|
|
<PropertyRoot>
|
|
<PropertyName name="Always show" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot hideEmpty>
|
|
<PropertyName name="Hide with empty" icon={<FrameIcon />} />
|
|
<PropertyValue isEmpty>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot hide>
|
|
<PropertyName name="Hide" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
</PropertyCollapsibleContent>
|
|
);
|
|
};
|
|
|
|
export const BasicPropertyCollapsibleSection = () => {
|
|
return (
|
|
<PropertyCollapsibleSection
|
|
icon={<FrameIcon />}
|
|
title="Collapsible Section"
|
|
>
|
|
<BasicPropertyCollapsibleContent />
|
|
</PropertyCollapsibleSection>
|
|
);
|
|
};
|
|
|
|
export const PropertyCollapsibleCustomButton = () => {
|
|
return (
|
|
<PropertyCollapsibleContent
|
|
collapsible
|
|
collapseButtonText={({ hide, isCollapsed }) =>
|
|
`${isCollapsed ? 'Show' : 'Hide'} ${hide} properties`
|
|
}
|
|
>
|
|
<PropertyRoot>
|
|
<PropertyName name="Always show" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot hideEmpty>
|
|
<PropertyName name="Hide with empty" icon={<FrameIcon />} />
|
|
<PropertyValue isEmpty>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
<PropertyRoot hide>
|
|
<PropertyName name="Hide" icon={<FrameIcon />} />
|
|
<PropertyValue>Value</PropertyValue>
|
|
</PropertyRoot>
|
|
</PropertyCollapsibleContent>
|
|
);
|
|
};
|