feat(core): adjust doc property style (#8561)

This commit is contained in:
EYHN
2024-10-21 09:41:45 +00:00
parent 42b3e069f9
commit 7cd4028176
8 changed files with 40 additions and 24 deletions

View File

@@ -65,7 +65,7 @@ export const hide = style({
export const propertyNameContainer = style({
display: 'flex',
flexDirection: 'column',
justifyContent: 'center',
justifyContent: 'start',
position: 'relative',
borderRadius: 4,
fontSize: cssVar('fontSm'),

View File

@@ -134,7 +134,7 @@ const PropertyItem = ({
<MoreHorizontalIcon />
</IconButton>
</Menu>
<DropIndicator edge={closestEdge} />
<DropIndicator edge={closestEdge} noTerminal />
</div>
);
};

View File

@@ -148,7 +148,7 @@ export const tableBodySortable = style({
export const actionContainer = style({
display: 'flex',
flexDirection: 'row',
gap: 8,
paddingTop: '2px',
selectors: {
[`[data-property-collapsed="true"] &`]: {
display: 'none',
@@ -157,13 +157,15 @@ export const actionContainer = style({
});
export const propertyActionButton = style({
alignSelf: 'flex-start',
fontSize: cssVar('fontSm'),
color: `${cssVarV2('text/secondary')}`,
padding: '0 6px',
height: 36,
height: 34,
fontWeight: 400,
gap: 6,
width: '160px',
borderRadius: '4px',
justifyContent: 'start',
'@media': {
print: {
display: 'none',

View File

@@ -21,6 +21,13 @@ import { TextValue } from './text';
import type { PropertyValueProps } from './types';
export const DocPropertyTypes = {
tags: {
icon: TagIcon,
value: TagsValue,
name: 'com.affine.page-properties.property.tags',
uniqueId: 'tags',
renameable: false,
},
text: {
icon: TextIcon,
value: TextValue,
@@ -31,16 +38,16 @@ export const DocPropertyTypes = {
value: NumberValue,
name: 'com.affine.page-properties.property.number',
},
date: {
icon: DateTimeIcon,
value: DateValue,
name: 'com.affine.page-properties.property.date',
},
checkbox: {
icon: CheckBoxCheckLinearIcon,
value: CheckboxValue,
name: 'com.affine.page-properties.property.checkbox',
},
date: {
icon: DateTimeIcon,
value: DateValue,
name: 'com.affine.page-properties.property.date',
},
createdBy: {
icon: CreatedEditedIcon,
value: CreatedByValue,
@@ -51,13 +58,6 @@ export const DocPropertyTypes = {
value: UpdatedByValue,
name: 'com.affine.page-properties.property.updatedBy',
},
tags: {
icon: TagIcon,
value: TagsValue,
name: 'com.affine.page-properties.property.tags',
uniqueId: 'tags',
renameable: false,
},
docPrimaryMode: {
icon: FileIcon,
value: DocPrimaryModeValue,
@@ -67,8 +67,6 @@ export const DocPropertyTypes = {
icon: TodayIcon,
value: JournalValue,
name: 'com.affine.page-properties.property.journal',
uniqueId: 'journal',
renameable: false,
},
} as Record<
string,

View File

@@ -0,0 +1,10 @@
import { style } from '@vanilla-extract/css';
export const radioGroup = style({
// height: '28px',
});
export const container = style({
paddingTop: '3px',
paddingBottom: '3px',
});

View File

@@ -9,6 +9,8 @@ import type { DocMode } from '@blocksuite/affine/blocks';
import { DocService, useLiveData, useService } from '@toeverything/infra';
import { useCallback, useMemo } from 'react';
import * as styles from './doc-primary-mode.css';
export const DocPrimaryModeValue = () => {
const t = useI18n();
const doc = useService(DocService).doc;
@@ -46,12 +48,14 @@ export const DocPrimaryModeValue = () => {
[doc, t]
);
return (
<PropertyValue>
<PropertyValue className={styles.container}>
<RadioGroup
width={194}
itemHeight={24}
value={primaryMode}
onChange={handleChange}
items={DocModeItems}
className={styles.radioGroup}
/>
</PropertyValue>
);