feat(core): add more collection rules (#12458)
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
export {
|
||||||
|
EdgelessThemeDocListProperty,
|
||||||
|
EdgelessThemeFilterValue,
|
||||||
|
EdgelessThemeGroupHeader,
|
||||||
|
} from '../workspace-property-types/edgeless-theme';
|
||||||
@@ -3,11 +3,15 @@ import type { DocRecord } from '@affine/core/modules/doc';
|
|||||||
import type { I18nString } from '@affine/i18n';
|
import type { I18nString } from '@affine/i18n';
|
||||||
import {
|
import {
|
||||||
DateTimeIcon,
|
DateTimeIcon,
|
||||||
|
EdgelessIcon,
|
||||||
FavoriteIcon,
|
FavoriteIcon,
|
||||||
HistoryIcon,
|
HistoryIcon,
|
||||||
|
IntegrationsIcon,
|
||||||
|
LongerIcon,
|
||||||
MemberIcon,
|
MemberIcon,
|
||||||
ShareIcon,
|
ShareIcon,
|
||||||
TagIcon,
|
TagIcon,
|
||||||
|
TemplateIcon,
|
||||||
} from '@blocksuite/icons/rc';
|
} from '@blocksuite/icons/rc';
|
||||||
|
|
||||||
import type { GroupHeaderProps } from '../explorer/types';
|
import type { GroupHeaderProps } from '../explorer/types';
|
||||||
@@ -26,9 +30,29 @@ import {
|
|||||||
ModifiedByGroupHeader,
|
ModifiedByGroupHeader,
|
||||||
UpdatedByDocListInlineProperty,
|
UpdatedByDocListInlineProperty,
|
||||||
} from './created-updated-by';
|
} from './created-updated-by';
|
||||||
|
import {
|
||||||
|
EdgelessThemeDocListProperty,
|
||||||
|
EdgelessThemeFilterValue,
|
||||||
|
EdgelessThemeGroupHeader,
|
||||||
|
} from './edgeless-theme';
|
||||||
import { FavoriteFilterValue } from './favorite';
|
import { FavoriteFilterValue } from './favorite';
|
||||||
|
import {
|
||||||
|
IntegrationTypeDocListProperty,
|
||||||
|
IntegrationTypeFilterValue,
|
||||||
|
IntegrationTypeGroupHeader,
|
||||||
|
} from './integration-type';
|
||||||
|
import {
|
||||||
|
PageWidthDocListProperty,
|
||||||
|
PageWidthFilterValue,
|
||||||
|
PageWidthGroupHeader,
|
||||||
|
} from './page-width';
|
||||||
import { SharedFilterValue } from './shared';
|
import { SharedFilterValue } from './shared';
|
||||||
import { TagsDocListProperty, TagsFilterValue, TagsGroupHeader } from './tags';
|
import { TagsDocListProperty, TagsFilterValue, TagsGroupHeader } from './tags';
|
||||||
|
import {
|
||||||
|
TemplateDocListProperty,
|
||||||
|
TemplateFilterValue,
|
||||||
|
TemplateGroupHeader,
|
||||||
|
} from './template';
|
||||||
|
|
||||||
export const SystemPropertyTypes = {
|
export const SystemPropertyTypes = {
|
||||||
tags: {
|
tags: {
|
||||||
@@ -122,6 +146,66 @@ export const SystemPropertyTypes = {
|
|||||||
},
|
},
|
||||||
filterValue: SharedFilterValue,
|
filterValue: SharedFilterValue,
|
||||||
},
|
},
|
||||||
|
edgelessTheme: {
|
||||||
|
icon: EdgelessIcon,
|
||||||
|
name: 'com.affine.page-properties.property.edgelessTheme',
|
||||||
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
|
docListProperty: EdgelessThemeDocListProperty,
|
||||||
|
groupHeader: EdgelessThemeGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: EdgelessThemeFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'system' },
|
||||||
|
},
|
||||||
|
pageWidth: {
|
||||||
|
icon: LongerIcon,
|
||||||
|
name: 'com.affine.page-properties.property.pageWidth',
|
||||||
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
|
docListProperty: PageWidthDocListProperty,
|
||||||
|
groupHeader: PageWidthGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: PageWidthFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'fullWidth' },
|
||||||
|
},
|
||||||
|
template: {
|
||||||
|
icon: TemplateIcon,
|
||||||
|
name: 'com.affine.page-properties.property.template',
|
||||||
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
|
docListProperty: TemplateDocListProperty,
|
||||||
|
groupHeader: TemplateGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: TemplateFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'true' },
|
||||||
|
},
|
||||||
|
integrationType: {
|
||||||
|
icon: IntegrationsIcon,
|
||||||
|
name: 'com.affine.integration.integrations',
|
||||||
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
|
docListProperty: IntegrationTypeDocListProperty,
|
||||||
|
groupHeader: IntegrationTypeGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: IntegrationTypeFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'readwise' },
|
||||||
|
},
|
||||||
} as {
|
} as {
|
||||||
[type: string]: {
|
[type: string]: {
|
||||||
icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
icon: React.FC<React.SVGProps<SVGSVGElement>>;
|
||||||
|
|||||||
@@ -0,0 +1,98 @@
|
|||||||
|
import { Menu, MenuItem, type MenuRef } from '@affine/component';
|
||||||
|
import type { FilterParams } from '@affine/core/modules/collection-rules';
|
||||||
|
import type { DocRecord } from '@affine/core/modules/doc';
|
||||||
|
import { useI18n } from '@affine/i18n';
|
||||||
|
import { IntegrationsIcon, ReadwiseIcon } from '@blocksuite/icons/rc';
|
||||||
|
import { useLiveData } from '@toeverything/infra';
|
||||||
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
import { PlainTextDocGroupHeader } from '../explorer/docs-view/group-header';
|
||||||
|
import { StackProperty } from '../explorer/docs-view/stack-property';
|
||||||
|
import type { GroupHeaderProps } from '../explorer/types';
|
||||||
|
|
||||||
|
export const IntegrationTypeFilterValue = ({
|
||||||
|
filter,
|
||||||
|
isDraft,
|
||||||
|
onDraftCompleted,
|
||||||
|
onChange,
|
||||||
|
}: {
|
||||||
|
filter: FilterParams;
|
||||||
|
isDraft?: boolean;
|
||||||
|
onDraftCompleted?: () => void;
|
||||||
|
onChange?: (filter: FilterParams) => void;
|
||||||
|
}) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const menuRef = useRef<MenuRef>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isDraft) {
|
||||||
|
menuRef.current?.changeOpen(true);
|
||||||
|
}
|
||||||
|
}, [isDraft]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Menu
|
||||||
|
ref={menuRef}
|
||||||
|
rootOptions={{
|
||||||
|
onClose: onDraftCompleted,
|
||||||
|
}}
|
||||||
|
items={
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'readwise',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
prefixIcon={<ReadwiseIcon />}
|
||||||
|
selected={filter.value === 'readwise'}
|
||||||
|
>
|
||||||
|
{t['com.affine.integration.readwise.name']()}
|
||||||
|
</MenuItem>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
{filter.value === 'readwise'
|
||||||
|
? t['com.affine.integration.readwise.name']()
|
||||||
|
: filter.value}
|
||||||
|
</span>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const IntegrationTypeDocListProperty = ({ doc }: { doc: DocRecord }) => {
|
||||||
|
const integrationType = useLiveData(doc.property$('integrationType'));
|
||||||
|
|
||||||
|
if (!integrationType) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<StackProperty
|
||||||
|
icon={
|
||||||
|
integrationType === 'readwise' ? <ReadwiseIcon /> : <IntegrationsIcon />
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{integrationType}
|
||||||
|
</StackProperty>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const IntegrationTypeGroupHeader = ({
|
||||||
|
groupId,
|
||||||
|
docCount,
|
||||||
|
}: GroupHeaderProps) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const text =
|
||||||
|
groupId === 'readwise'
|
||||||
|
? t['com.affine.integration.readwise.name']()
|
||||||
|
: groupId
|
||||||
|
? groupId
|
||||||
|
: 'No integrations';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PlainTextDocGroupHeader groupId={groupId} docCount={docCount}>
|
||||||
|
{text}
|
||||||
|
</PlainTextDocGroupHeader>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export {
|
||||||
|
PageWidthDocListProperty,
|
||||||
|
PageWidthFilterValue,
|
||||||
|
PageWidthGroupHeader,
|
||||||
|
} from '../workspace-property-types/page-width';
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
export {
|
||||||
|
TemplateDocListProperty,
|
||||||
|
TemplateFilterValue,
|
||||||
|
TemplateGroupHeader,
|
||||||
|
} from '../workspace-property-types/template';
|
||||||
@@ -123,7 +123,11 @@ export const CheckboxGroupHeader = ({
|
|||||||
groupId,
|
groupId,
|
||||||
docCount,
|
docCount,
|
||||||
}: GroupHeaderProps) => {
|
}: GroupHeaderProps) => {
|
||||||
const text = groupId === 'true' ? 'Checked' : 'Unchecked';
|
const t = useI18n();
|
||||||
|
const text =
|
||||||
|
groupId === 'true'
|
||||||
|
? t['com.affine.all-docs.group.is-checked']()
|
||||||
|
: t['com.affine.all-docs.group.is-not-checked']();
|
||||||
return (
|
return (
|
||||||
<PlainTextDocGroupHeader docCount={docCount} groupId={groupId}>
|
<PlainTextDocGroupHeader docCount={docCount} groupId={groupId}>
|
||||||
{text}
|
{text}
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
import { PropertyValue, type RadioItem } from '@affine/component';
|
import {
|
||||||
import { DocService } from '@affine/core/modules/doc';
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
type MenuRef,
|
||||||
|
PropertyValue,
|
||||||
|
type RadioItem,
|
||||||
|
} from '@affine/component';
|
||||||
|
import type { FilterParams } from '@affine/core/modules/collection-rules';
|
||||||
|
import { type DocRecord, DocService } from '@affine/core/modules/doc';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { EdgelessIcon } from '@blocksuite/icons/rc';
|
import { EdgelessIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import { PlainTextDocGroupHeader } from '../explorer/docs-view/group-header';
|
||||||
import { StackProperty } from '../explorer/docs-view/stack-property';
|
import { StackProperty } from '../explorer/docs-view/stack-property';
|
||||||
import type { DocListPropertyProps } from '../explorer/types';
|
import type { GroupHeaderProps } from '../explorer/types';
|
||||||
import type { PropertyValueProps } from '../properties/types';
|
import type { PropertyValueProps } from '../properties/types';
|
||||||
import { PropertyRadioGroup } from '../properties/widgets/radio-group';
|
import { PropertyRadioGroup } from '../properties/widgets/radio-group';
|
||||||
import * as styles from './edgeless-theme.css';
|
import * as styles from './edgeless-theme.css';
|
||||||
@@ -60,7 +68,7 @@ export const EdgelessThemeValue = ({
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const EdgelessThemeDocListProperty = ({ doc }: DocListPropertyProps) => {
|
export const EdgelessThemeDocListProperty = ({ doc }: { doc: DocRecord }) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const edgelessTheme = useLiveData(
|
const edgelessTheme = useLiveData(
|
||||||
doc.properties$.selector(p => p.edgelessColorTheme)
|
doc.properties$.selector(p => p.edgelessColorTheme)
|
||||||
@@ -76,3 +84,99 @@ export const EdgelessThemeDocListProperty = ({ doc }: DocListPropertyProps) => {
|
|||||||
</StackProperty>
|
</StackProperty>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const EdgelessThemeFilterValue = ({
|
||||||
|
filter,
|
||||||
|
isDraft,
|
||||||
|
onDraftCompleted,
|
||||||
|
onChange,
|
||||||
|
}: {
|
||||||
|
filter: FilterParams;
|
||||||
|
isDraft?: boolean;
|
||||||
|
onDraftCompleted?: () => void;
|
||||||
|
onChange?: (filter: FilterParams) => void;
|
||||||
|
}) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const menuRef = useRef<MenuRef>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isDraft) {
|
||||||
|
menuRef.current?.changeOpen(true);
|
||||||
|
}
|
||||||
|
}, [isDraft]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Menu
|
||||||
|
ref={menuRef}
|
||||||
|
rootOptions={{
|
||||||
|
onClose: onDraftCompleted,
|
||||||
|
}}
|
||||||
|
items={
|
||||||
|
<>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'system',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value === 'system'}
|
||||||
|
>
|
||||||
|
{t['com.affine.themeSettings.auto']()}
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'light',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value === 'light'}
|
||||||
|
>
|
||||||
|
{t['com.affine.themeSettings.light']()}
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'dark',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value === 'dark'}
|
||||||
|
>
|
||||||
|
{t['com.affine.themeSettings.dark']()}
|
||||||
|
</MenuItem>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
{filter.value === 'system'
|
||||||
|
? t['com.affine.themeSettings.auto']()
|
||||||
|
: filter.value === 'light'
|
||||||
|
? t['com.affine.themeSettings.light']()
|
||||||
|
: t['com.affine.themeSettings.dark']()}
|
||||||
|
</span>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const EdgelessThemeGroupHeader = ({
|
||||||
|
groupId,
|
||||||
|
docCount,
|
||||||
|
}: GroupHeaderProps) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const text =
|
||||||
|
groupId === 'light'
|
||||||
|
? t['com.affine.themeSettings.light']()
|
||||||
|
: groupId === 'dark'
|
||||||
|
? t['com.affine.themeSettings.dark']()
|
||||||
|
: groupId === 'system'
|
||||||
|
? t['com.affine.themeSettings.auto']()
|
||||||
|
: 'Default';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PlainTextDocGroupHeader groupId={groupId} docCount={docCount}>
|
||||||
|
{text}
|
||||||
|
</PlainTextDocGroupHeader>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ import {
|
|||||||
} from './doc-primary-mode';
|
} from './doc-primary-mode';
|
||||||
import {
|
import {
|
||||||
EdgelessThemeDocListProperty,
|
EdgelessThemeDocListProperty,
|
||||||
|
EdgelessThemeFilterValue,
|
||||||
|
EdgelessThemeGroupHeader,
|
||||||
EdgelessThemeValue,
|
EdgelessThemeValue,
|
||||||
} from './edgeless-theme';
|
} from './edgeless-theme';
|
||||||
import {
|
import {
|
||||||
@@ -69,14 +71,24 @@ import {
|
|||||||
JournalValue,
|
JournalValue,
|
||||||
} from './journal';
|
} from './journal';
|
||||||
import { NumberDocListProperty, NumberValue } from './number';
|
import { NumberDocListProperty, NumberValue } from './number';
|
||||||
import { PageWidthDocListProperty, PageWidthValue } from './page-width';
|
import {
|
||||||
|
PageWidthDocListProperty,
|
||||||
|
PageWidthFilterValue,
|
||||||
|
PageWidthGroupHeader,
|
||||||
|
PageWidthValue,
|
||||||
|
} from './page-width';
|
||||||
import {
|
import {
|
||||||
TagsDocListProperty,
|
TagsDocListProperty,
|
||||||
TagsFilterValue,
|
TagsFilterValue,
|
||||||
TagsGroupHeader,
|
TagsGroupHeader,
|
||||||
TagsValue,
|
TagsValue,
|
||||||
} from './tags';
|
} from './tags';
|
||||||
import { TemplateDocListProperty, TemplateValue } from './template';
|
import {
|
||||||
|
TemplateDocListProperty,
|
||||||
|
TemplateFilterValue,
|
||||||
|
TemplateGroupHeader,
|
||||||
|
TemplateValue,
|
||||||
|
} from './template';
|
||||||
import {
|
import {
|
||||||
TextDocListProperty,
|
TextDocListProperty,
|
||||||
TextFilterValue,
|
TextFilterValue,
|
||||||
@@ -290,7 +302,16 @@ export const WorkspacePropertyTypes = {
|
|||||||
name: 'com.affine.page-properties.property.edgelessTheme',
|
name: 'com.affine.page-properties.property.edgelessTheme',
|
||||||
description: 'com.affine.page-properties.property.edgelessTheme.tooltips',
|
description: 'com.affine.page-properties.property.edgelessTheme.tooltips',
|
||||||
showInDocList: 'stack',
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
docListProperty: EdgelessThemeDocListProperty,
|
docListProperty: EdgelessThemeDocListProperty,
|
||||||
|
groupHeader: EdgelessThemeGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: EdgelessThemeFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'system' },
|
||||||
},
|
},
|
||||||
pageWidth: {
|
pageWidth: {
|
||||||
icon: LongerIcon,
|
icon: LongerIcon,
|
||||||
@@ -298,7 +319,16 @@ export const WorkspacePropertyTypes = {
|
|||||||
name: 'com.affine.page-properties.property.pageWidth',
|
name: 'com.affine.page-properties.property.pageWidth',
|
||||||
description: 'com.affine.page-properties.property.pageWidth.tooltips',
|
description: 'com.affine.page-properties.property.pageWidth.tooltips',
|
||||||
showInDocList: 'stack',
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
docListProperty: PageWidthDocListProperty,
|
docListProperty: PageWidthDocListProperty,
|
||||||
|
groupHeader: PageWidthGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: PageWidthFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'fullWidth' },
|
||||||
},
|
},
|
||||||
template: {
|
template: {
|
||||||
icon: TemplateIcon,
|
icon: TemplateIcon,
|
||||||
@@ -307,7 +337,16 @@ export const WorkspacePropertyTypes = {
|
|||||||
renameable: true,
|
renameable: true,
|
||||||
description: 'com.affine.page-properties.property.template.tooltips',
|
description: 'com.affine.page-properties.property.template.tooltips',
|
||||||
showInDocList: 'stack',
|
showInDocList: 'stack',
|
||||||
|
allowInGroupBy: true,
|
||||||
|
allowInOrderBy: true,
|
||||||
docListProperty: TemplateDocListProperty,
|
docListProperty: TemplateDocListProperty,
|
||||||
|
groupHeader: TemplateGroupHeader,
|
||||||
|
filterMethod: {
|
||||||
|
is: 'com.affine.editCollection.rules.include.is',
|
||||||
|
'is-not': 'com.affine.editCollection.rules.include.is-not',
|
||||||
|
},
|
||||||
|
filterValue: TemplateFilterValue,
|
||||||
|
defaultFilter: { method: 'is', value: 'true' },
|
||||||
},
|
},
|
||||||
unknown: {
|
unknown: {
|
||||||
icon: PropertyIcon,
|
icon: PropertyIcon,
|
||||||
|
|||||||
@@ -254,7 +254,11 @@ export const JournalDocListProperty = ({ doc }: DocListPropertyProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const JournalGroupHeader = ({ groupId, docCount }: GroupHeaderProps) => {
|
export const JournalGroupHeader = ({ groupId, docCount }: GroupHeaderProps) => {
|
||||||
const text = groupId === 'true' ? 'Journal' : 'Not Journal';
|
const t = useI18n();
|
||||||
|
const text =
|
||||||
|
groupId === 'true'
|
||||||
|
? t['com.affine.all-docs.group.is-journal']()
|
||||||
|
: t['com.affine.all-docs.group.is-not-journal']();
|
||||||
return (
|
return (
|
||||||
<PlainTextDocGroupHeader groupId={groupId} docCount={docCount}>
|
<PlainTextDocGroupHeader groupId={groupId} docCount={docCount}>
|
||||||
{text}
|
{text}
|
||||||
|
|||||||
@@ -1,13 +1,21 @@
|
|||||||
import { PropertyValue, type RadioItem } from '@affine/component';
|
import {
|
||||||
import { DocService } from '@affine/core/modules/doc';
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
type MenuRef,
|
||||||
|
PropertyValue,
|
||||||
|
type RadioItem,
|
||||||
|
} from '@affine/component';
|
||||||
|
import type { FilterParams } from '@affine/core/modules/collection-rules';
|
||||||
|
import { type DocRecord, DocService } from '@affine/core/modules/doc';
|
||||||
import { EditorSettingService } from '@affine/core/modules/editor-setting';
|
import { EditorSettingService } from '@affine/core/modules/editor-setting';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { LongerIcon } from '@blocksuite/icons/rc';
|
import { LongerIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
||||||
|
|
||||||
|
import { PlainTextDocGroupHeader } from '../explorer/docs-view/group-header';
|
||||||
import { StackProperty } from '../explorer/docs-view/stack-property';
|
import { StackProperty } from '../explorer/docs-view/stack-property';
|
||||||
import type { DocListPropertyProps } from '../explorer/types';
|
import type { GroupHeaderProps } from '../explorer/types';
|
||||||
import type { PropertyValueProps } from '../properties/types';
|
import type { PropertyValueProps } from '../properties/types';
|
||||||
import { PropertyRadioGroup } from '../properties/widgets/radio-group';
|
import { PropertyRadioGroup } from '../properties/widgets/radio-group';
|
||||||
import { container } from './page-width.css';
|
import { container } from './page-width.css';
|
||||||
@@ -62,7 +70,7 @@ export const PageWidthValue = ({ readonly }: PropertyValueProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const PageWidthDocListProperty = ({ doc }: DocListPropertyProps) => {
|
export const PageWidthDocListProperty = ({ doc }: { doc: DocRecord }) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const pageWidth = useLiveData(doc.properties$.selector(p => p.pageWidth));
|
const pageWidth = useLiveData(doc.properties$.selector(p => p.pageWidth));
|
||||||
|
|
||||||
@@ -78,3 +86,96 @@ export const PageWidthDocListProperty = ({ doc }: DocListPropertyProps) => {
|
|||||||
</StackProperty>
|
</StackProperty>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const PageWidthFilterValue = ({
|
||||||
|
filter,
|
||||||
|
isDraft,
|
||||||
|
onDraftCompleted,
|
||||||
|
onChange,
|
||||||
|
}: {
|
||||||
|
filter: FilterParams;
|
||||||
|
isDraft?: boolean;
|
||||||
|
onDraftCompleted?: () => void;
|
||||||
|
onChange?: (filter: FilterParams) => void;
|
||||||
|
}) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const menuRef = useRef<MenuRef>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isDraft) {
|
||||||
|
menuRef.current?.changeOpen(true);
|
||||||
|
}
|
||||||
|
}, [isDraft]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Menu
|
||||||
|
ref={menuRef}
|
||||||
|
rootOptions={{
|
||||||
|
onClose: onDraftCompleted,
|
||||||
|
}}
|
||||||
|
items={
|
||||||
|
<>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'fullWidth',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value === 'fullWidth'}
|
||||||
|
>
|
||||||
|
{t[
|
||||||
|
'com.affine.settings.editorSettings.page.default-page-width.full-width'
|
||||||
|
]()}
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'standard',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value !== 'fullWidth'}
|
||||||
|
>
|
||||||
|
{t[
|
||||||
|
'com.affine.settings.editorSettings.page.default-page-width.standard'
|
||||||
|
]()}
|
||||||
|
</MenuItem>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span>
|
||||||
|
{filter.value === 'fullWidth'
|
||||||
|
? t[
|
||||||
|
'com.affine.settings.editorSettings.page.default-page-width.full-width'
|
||||||
|
]()
|
||||||
|
: t[
|
||||||
|
'com.affine.settings.editorSettings.page.default-page-width.standard'
|
||||||
|
]()}
|
||||||
|
</span>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const PageWidthGroupHeader = ({
|
||||||
|
groupId,
|
||||||
|
docCount,
|
||||||
|
}: GroupHeaderProps) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const text =
|
||||||
|
groupId === 'fullWidth'
|
||||||
|
? t[
|
||||||
|
'com.affine.settings.editorSettings.page.default-page-width.full-width'
|
||||||
|
]()
|
||||||
|
: groupId === 'standard'
|
||||||
|
? t[
|
||||||
|
'com.affine.settings.editorSettings.page.default-page-width.standard'
|
||||||
|
]()
|
||||||
|
: 'Default';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PlainTextDocGroupHeader groupId={groupId} docCount={docCount}>
|
||||||
|
{text}
|
||||||
|
</PlainTextDocGroupHeader>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
import { Checkbox, PropertyValue } from '@affine/component';
|
import {
|
||||||
import { DocService } from '@affine/core/modules/doc';
|
Checkbox,
|
||||||
|
Menu,
|
||||||
|
MenuItem,
|
||||||
|
type MenuRef,
|
||||||
|
PropertyValue,
|
||||||
|
} from '@affine/component';
|
||||||
|
import type { FilterParams } from '@affine/core/modules/collection-rules';
|
||||||
|
import { type DocRecord, DocService } from '@affine/core/modules/doc';
|
||||||
import { useI18n } from '@affine/i18n';
|
import { useI18n } from '@affine/i18n';
|
||||||
import { TemplateIcon } from '@blocksuite/icons/rc';
|
import { TemplateIcon } from '@blocksuite/icons/rc';
|
||||||
import { useLiveData, useService } from '@toeverything/infra';
|
import { useLiveData, useService } from '@toeverything/infra';
|
||||||
import { type ChangeEvent, useCallback } from 'react';
|
import { type ChangeEvent, useCallback, useEffect, useRef } from 'react';
|
||||||
|
|
||||||
|
import { PlainTextDocGroupHeader } from '../explorer/docs-view/group-header';
|
||||||
import { StackProperty } from '../explorer/docs-view/stack-property';
|
import { StackProperty } from '../explorer/docs-view/stack-property';
|
||||||
import type { DocListPropertyProps } from '../explorer/types';
|
import type { GroupHeaderProps } from '../explorer/types';
|
||||||
import type { PropertyValueProps } from '../properties/types';
|
import type { PropertyValueProps } from '../properties/types';
|
||||||
import * as styles from './template.css';
|
import * as styles from './template.css';
|
||||||
|
|
||||||
@@ -44,7 +52,7 @@ export const TemplateValue = ({ readonly }: PropertyValueProps) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TemplateDocListProperty = ({ doc }: DocListPropertyProps) => {
|
export const TemplateDocListProperty = ({ doc }: { doc: DocRecord }) => {
|
||||||
const t = useI18n();
|
const t = useI18n();
|
||||||
const isTemplate = useLiveData(doc.properties$.selector(p => p.isTemplate));
|
const isTemplate = useLiveData(doc.properties$.selector(p => p.isTemplate));
|
||||||
|
|
||||||
@@ -56,3 +64,79 @@ export const TemplateDocListProperty = ({ doc }: DocListPropertyProps) => {
|
|||||||
<StackProperty icon={<TemplateIcon />}>{t['Template']()}</StackProperty>
|
<StackProperty icon={<TemplateIcon />}>{t['Template']()}</StackProperty>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const TemplateGroupHeader = ({
|
||||||
|
groupId,
|
||||||
|
docCount,
|
||||||
|
}: GroupHeaderProps) => {
|
||||||
|
const t = useI18n();
|
||||||
|
const text =
|
||||||
|
groupId === 'true'
|
||||||
|
? t['com.affine.all-docs.group.is-template']()
|
||||||
|
: groupId === 'false'
|
||||||
|
? t['com.affine.all-docs.group.is-not-template']()
|
||||||
|
: 'Default';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PlainTextDocGroupHeader groupId={groupId} docCount={docCount}>
|
||||||
|
{text}
|
||||||
|
</PlainTextDocGroupHeader>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const TemplateFilterValue = ({
|
||||||
|
filter,
|
||||||
|
isDraft,
|
||||||
|
onDraftCompleted,
|
||||||
|
onChange,
|
||||||
|
}: {
|
||||||
|
filter: FilterParams;
|
||||||
|
isDraft?: boolean;
|
||||||
|
onDraftCompleted?: () => void;
|
||||||
|
onChange?: (filter: FilterParams) => void;
|
||||||
|
}) => {
|
||||||
|
const menuRef = useRef<MenuRef>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (isDraft) {
|
||||||
|
menuRef.current?.changeOpen(true);
|
||||||
|
}
|
||||||
|
}, [isDraft]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Menu
|
||||||
|
ref={menuRef}
|
||||||
|
rootOptions={{
|
||||||
|
onClose: onDraftCompleted,
|
||||||
|
}}
|
||||||
|
items={
|
||||||
|
<>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'true',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value === 'true'}
|
||||||
|
>
|
||||||
|
{'True'}
|
||||||
|
</MenuItem>
|
||||||
|
<MenuItem
|
||||||
|
onClick={() => {
|
||||||
|
onChange?.({
|
||||||
|
...filter,
|
||||||
|
value: 'false',
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
selected={filter.value !== 'true'}
|
||||||
|
>
|
||||||
|
{'False'}
|
||||||
|
</MenuItem>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<span>{filter.value === 'true' ? 'True' : 'False'}</span>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import type { WorkspacePropertyFilter } from '@affine/core/modules/workspace-property';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { FilterProvider } from '../../provider';
|
||||||
|
import type { FilterParams } from '../../types';
|
||||||
|
|
||||||
|
export class EdgelessThemeFilterProvider
|
||||||
|
extends Service
|
||||||
|
implements FilterProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
filter$(params: FilterParams): Observable<Set<string>> {
|
||||||
|
const method = params.method as WorkspacePropertyFilter<'edgelessTheme'>;
|
||||||
|
if (method === 'is') {
|
||||||
|
return this.docsService.propertyValues$('edgelessColorTheme').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if ((value ?? 'system') === params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else if (method === 'is-not') {
|
||||||
|
return this.docsService.propertyValues$('edgelessColorTheme').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if ((value ?? 'system') !== params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw new Error(`Unsupported method: ${params.method}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { FilterProvider } from '../../provider';
|
||||||
|
import type { FilterParams } from '../../types';
|
||||||
|
|
||||||
|
export class IntegrationTypeFilterProvider
|
||||||
|
extends Service
|
||||||
|
implements FilterProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
filter$(params: FilterParams): Observable<Set<string>> {
|
||||||
|
const method = params.method as 'is' | 'is-not';
|
||||||
|
if (method === 'is') {
|
||||||
|
return this.docsService.propertyValues$('integrationType').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if (value === params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else if (method === 'is-not') {
|
||||||
|
return this.docsService.propertyValues$('integrationType').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if (value !== params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw new Error(`Unsupported method: ${params.method}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import type { WorkspacePropertyFilter } from '@affine/core/modules/workspace-property';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { FilterProvider } from '../../provider';
|
||||||
|
import type { FilterParams } from '../../types';
|
||||||
|
|
||||||
|
export class PageWidthFilterProvider extends Service implements FilterProvider {
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
filter$(params: FilterParams): Observable<Set<string>> {
|
||||||
|
const method = params.method as WorkspacePropertyFilter<'pageWidth'>;
|
||||||
|
if (method === 'is') {
|
||||||
|
return this.docsService.propertyValues$('pageWidth').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if ((value ?? 'standard') === params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else if (method === 'is-not') {
|
||||||
|
return this.docsService.propertyValues$('pageWidth').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if ((value ?? 'standard') !== params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw new Error(`Unsupported method: ${params.method}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import type { WorkspacePropertyFilter } from '@affine/core/modules/workspace-property';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { FilterProvider } from '../../provider';
|
||||||
|
import type { FilterParams } from '../../types';
|
||||||
|
|
||||||
|
export class TemplateFilterProvider extends Service implements FilterProvider {
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
filter$(params: FilterParams): Observable<Set<string>> {
|
||||||
|
const method = params.method as WorkspacePropertyFilter<'template'>;
|
||||||
|
if (method === 'is') {
|
||||||
|
return this.docsService.propertyValues$('isTemplate').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if ((value ? 'true' : 'false') === params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else if (method === 'is-not') {
|
||||||
|
return this.docsService.propertyValues$('isTemplate').pipe(
|
||||||
|
map(values => {
|
||||||
|
const match = new Set<string>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
if ((value ? 'true' : 'false') !== params.value) {
|
||||||
|
match.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
throw new Error(`Unsupported method: ${params.method}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { GroupByProvider } from '../../provider';
|
||||||
|
import type { GroupByParams } from '../../types';
|
||||||
|
|
||||||
|
export class EdgelessThemeGroupByProvider
|
||||||
|
extends Service
|
||||||
|
implements GroupByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
groupBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
_params: GroupByParams
|
||||||
|
): Observable<Map<string, Set<string>>> {
|
||||||
|
return this.docsService.propertyValues$('edgelessColorTheme').pipe(
|
||||||
|
map(values => {
|
||||||
|
const result = new Map<string, Set<string>>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
const theme = value ?? 'system';
|
||||||
|
if (!result.has(theme)) {
|
||||||
|
result.set(theme, new Set([id]));
|
||||||
|
} else {
|
||||||
|
result.get(theme)?.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { GroupByProvider } from '../../provider';
|
||||||
|
import type { GroupByParams } from '../../types';
|
||||||
|
|
||||||
|
export class IntegrationTypeGroupByProvider
|
||||||
|
extends Service
|
||||||
|
implements GroupByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
groupBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
_params: GroupByParams
|
||||||
|
): Observable<Map<string, Set<string>>> {
|
||||||
|
return this.docsService.propertyValues$('integrationType').pipe(
|
||||||
|
map(values => {
|
||||||
|
const result = new Map<string, Set<string>>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
const integrationType = value;
|
||||||
|
if (!integrationType) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!result.has(integrationType)) {
|
||||||
|
result.set(integrationType, new Set([id]));
|
||||||
|
} else {
|
||||||
|
result.get(integrationType)?.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { GroupByProvider } from '../../provider';
|
||||||
|
import type { GroupByParams } from '../../types';
|
||||||
|
|
||||||
|
export class PageWidthGroupByProvider
|
||||||
|
extends Service
|
||||||
|
implements GroupByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
groupBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
_params: GroupByParams
|
||||||
|
): Observable<Map<string, Set<string>>> {
|
||||||
|
return this.docsService.propertyValues$('pageWidth').pipe(
|
||||||
|
map(values => {
|
||||||
|
const result = new Map<string, Set<string>>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
const pageWidth = value ?? 'standard';
|
||||||
|
if (!result.has(pageWidth)) {
|
||||||
|
result.set(pageWidth, new Set([id]));
|
||||||
|
} else {
|
||||||
|
result.get(pageWidth)?.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { GroupByProvider } from '../../provider';
|
||||||
|
import type { GroupByParams } from '../../types';
|
||||||
|
|
||||||
|
export class TemplateGroupByProvider
|
||||||
|
extends Service
|
||||||
|
implements GroupByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
groupBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
_params: GroupByParams
|
||||||
|
): Observable<Map<string, Set<string>>> {
|
||||||
|
return this.docsService.propertyValues$('isTemplate').pipe(
|
||||||
|
map(values => {
|
||||||
|
const result = new Map<string, Set<string>>();
|
||||||
|
for (const [id, value] of values) {
|
||||||
|
const isTemplate = value ? 'true' : 'false';
|
||||||
|
if (!result.has(isTemplate)) {
|
||||||
|
result.set(isTemplate, new Set([id]));
|
||||||
|
} else {
|
||||||
|
result.get(isTemplate)?.add(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { OrderByProvider } from '../../provider';
|
||||||
|
import type { OrderByParams } from '../../types';
|
||||||
|
|
||||||
|
export class EdgelessThemeOrderByProvider
|
||||||
|
extends Service
|
||||||
|
implements OrderByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
orderBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
params: OrderByParams
|
||||||
|
): Observable<string[]> {
|
||||||
|
return this.docsService.propertyValues$('edgelessColorTheme').pipe(
|
||||||
|
map(values => {
|
||||||
|
const docs = Array.from(values).map(([id, value]) => ({
|
||||||
|
id,
|
||||||
|
theme: value ?? 'system',
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (params.desc) {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => b.theme.localeCompare(a.theme))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
} else {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => a.theme.localeCompare(b.theme))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { OrderByProvider } from '../../provider';
|
||||||
|
import type { OrderByParams } from '../../types';
|
||||||
|
|
||||||
|
export class IntegrationTypeOrderByProvider
|
||||||
|
extends Service
|
||||||
|
implements OrderByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
orderBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
params: OrderByParams
|
||||||
|
): Observable<string[]> {
|
||||||
|
return this.docsService.propertyValues$('integrationType').pipe(
|
||||||
|
map(values => {
|
||||||
|
const docs = Array.from(values)
|
||||||
|
.filter(([, value]) => value !== undefined)
|
||||||
|
.map(([id, value]) => ({
|
||||||
|
id,
|
||||||
|
type: value as string,
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (params.desc) {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => b.type.localeCompare(a.type))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
} else {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => a.type.localeCompare(b.type))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { OrderByProvider } from '../../provider';
|
||||||
|
import type { OrderByParams } from '../../types';
|
||||||
|
|
||||||
|
export class PageWidthOrderByProvider
|
||||||
|
extends Service
|
||||||
|
implements OrderByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
orderBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
params: OrderByParams
|
||||||
|
): Observable<string[]> {
|
||||||
|
return this.docsService.propertyValues$('pageWidth').pipe(
|
||||||
|
map(values => {
|
||||||
|
const docs = Array.from(values).map(([id, value]) => ({
|
||||||
|
id,
|
||||||
|
width: value ?? 'standard',
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (params.desc) {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => b.width.localeCompare(a.width))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
} else {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => a.width.localeCompare(b.width))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
import type { DocsService } from '@affine/core/modules/doc';
|
||||||
|
import { Service } from '@toeverything/infra';
|
||||||
|
import { map, type Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import type { OrderByProvider } from '../../provider';
|
||||||
|
import type { OrderByParams } from '../../types';
|
||||||
|
|
||||||
|
export class TemplateOrderByProvider
|
||||||
|
extends Service
|
||||||
|
implements OrderByProvider
|
||||||
|
{
|
||||||
|
constructor(private readonly docsService: DocsService) {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
orderBy$(
|
||||||
|
_items$: Observable<Set<string>>,
|
||||||
|
params: OrderByParams
|
||||||
|
): Observable<string[]> {
|
||||||
|
return this.docsService.propertyValues$('isTemplate').pipe(
|
||||||
|
map(values => {
|
||||||
|
const docs = Array.from(values).map(([id, value]) => ({
|
||||||
|
id,
|
||||||
|
isTemplate: value ? 'true' : 'false',
|
||||||
|
}));
|
||||||
|
|
||||||
|
if (params.desc) {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => b.isTemplate.localeCompare(a.isTemplate))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
} else {
|
||||||
|
return docs
|
||||||
|
.sort((a, b) => a.isTemplate.localeCompare(b.isTemplate))
|
||||||
|
.map(doc => doc.id);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,13 +12,17 @@ import { CreatedAtFilterProvider } from './impls/filters/created-at';
|
|||||||
import { CreatedByFilterProvider } from './impls/filters/created-by';
|
import { CreatedByFilterProvider } from './impls/filters/created-by';
|
||||||
import { DatePropertyFilterProvider } from './impls/filters/date';
|
import { DatePropertyFilterProvider } from './impls/filters/date';
|
||||||
import { DocPrimaryModeFilterProvider } from './impls/filters/doc-primary-mode';
|
import { DocPrimaryModeFilterProvider } from './impls/filters/doc-primary-mode';
|
||||||
|
import { EdgelessThemeFilterProvider } from './impls/filters/edgeless-theme';
|
||||||
import { EmptyJournalFilterProvider } from './impls/filters/empty-journal';
|
import { EmptyJournalFilterProvider } from './impls/filters/empty-journal';
|
||||||
import { FavoriteFilterProvider } from './impls/filters/favorite';
|
import { FavoriteFilterProvider } from './impls/filters/favorite';
|
||||||
|
import { IntegrationTypeFilterProvider } from './impls/filters/integration-type';
|
||||||
import { JournalFilterProvider } from './impls/filters/journal';
|
import { JournalFilterProvider } from './impls/filters/journal';
|
||||||
|
import { PageWidthFilterProvider } from './impls/filters/page-width';
|
||||||
import { PropertyFilterProvider } from './impls/filters/property';
|
import { PropertyFilterProvider } from './impls/filters/property';
|
||||||
import { SharedFilterProvider } from './impls/filters/shared';
|
import { SharedFilterProvider } from './impls/filters/shared';
|
||||||
import { SystemFilterProvider } from './impls/filters/system';
|
import { SystemFilterProvider } from './impls/filters/system';
|
||||||
import { TagsFilterProvider } from './impls/filters/tags';
|
import { TagsFilterProvider } from './impls/filters/tags';
|
||||||
|
import { TemplateFilterProvider } from './impls/filters/template';
|
||||||
import { TextPropertyFilterProvider } from './impls/filters/text';
|
import { TextPropertyFilterProvider } from './impls/filters/text';
|
||||||
import { TitleFilterProvider } from './impls/filters/title';
|
import { TitleFilterProvider } from './impls/filters/title';
|
||||||
import { TrashFilterProvider } from './impls/filters/trash';
|
import { TrashFilterProvider } from './impls/filters/trash';
|
||||||
@@ -29,10 +33,14 @@ import { CreatedAtGroupByProvider } from './impls/group-by/created-at';
|
|||||||
import { CreatedByGroupByProvider } from './impls/group-by/created-by';
|
import { CreatedByGroupByProvider } from './impls/group-by/created-by';
|
||||||
import { DatePropertyGroupByProvider } from './impls/group-by/date';
|
import { DatePropertyGroupByProvider } from './impls/group-by/date';
|
||||||
import { DocPrimaryModeGroupByProvider } from './impls/group-by/doc-primary-mode';
|
import { DocPrimaryModeGroupByProvider } from './impls/group-by/doc-primary-mode';
|
||||||
|
import { EdgelessThemeGroupByProvider } from './impls/group-by/edgeless-theme';
|
||||||
|
import { IntegrationTypeGroupByProvider } from './impls/group-by/integration-type';
|
||||||
import { JournalGroupByProvider } from './impls/group-by/journal';
|
import { JournalGroupByProvider } from './impls/group-by/journal';
|
||||||
|
import { PageWidthGroupByProvider } from './impls/group-by/page-width';
|
||||||
import { PropertyGroupByProvider } from './impls/group-by/property';
|
import { PropertyGroupByProvider } from './impls/group-by/property';
|
||||||
import { SystemGroupByProvider } from './impls/group-by/system';
|
import { SystemGroupByProvider } from './impls/group-by/system';
|
||||||
import { TagsGroupByProvider } from './impls/group-by/tags';
|
import { TagsGroupByProvider } from './impls/group-by/tags';
|
||||||
|
import { TemplateGroupByProvider } from './impls/group-by/template';
|
||||||
import { TextPropertyGroupByProvider } from './impls/group-by/text';
|
import { TextPropertyGroupByProvider } from './impls/group-by/text';
|
||||||
import { UpdatedAtGroupByProvider } from './impls/group-by/updated-at';
|
import { UpdatedAtGroupByProvider } from './impls/group-by/updated-at';
|
||||||
import { UpdatedByGroupByProvider } from './impls/group-by/updated-by';
|
import { UpdatedByGroupByProvider } from './impls/group-by/updated-by';
|
||||||
@@ -41,10 +49,14 @@ import { CreatedAtOrderByProvider } from './impls/order-by/created-at';
|
|||||||
import { CreatedByOrderByProvider } from './impls/order-by/created-by';
|
import { CreatedByOrderByProvider } from './impls/order-by/created-by';
|
||||||
import { DatePropertyOrderByProvider } from './impls/order-by/date';
|
import { DatePropertyOrderByProvider } from './impls/order-by/date';
|
||||||
import { DocPrimaryModeOrderByProvider } from './impls/order-by/doc-primary-mode';
|
import { DocPrimaryModeOrderByProvider } from './impls/order-by/doc-primary-mode';
|
||||||
|
import { EdgelessThemeOrderByProvider } from './impls/order-by/edgeless-theme';
|
||||||
|
import { IntegrationTypeOrderByProvider } from './impls/order-by/integration-type';
|
||||||
import { JournalOrderByProvider } from './impls/order-by/journal';
|
import { JournalOrderByProvider } from './impls/order-by/journal';
|
||||||
|
import { PageWidthOrderByProvider } from './impls/order-by/page-width';
|
||||||
import { PropertyOrderByProvider } from './impls/order-by/property';
|
import { PropertyOrderByProvider } from './impls/order-by/property';
|
||||||
import { SystemOrderByProvider } from './impls/order-by/system';
|
import { SystemOrderByProvider } from './impls/order-by/system';
|
||||||
import { TagsOrderByProvider } from './impls/order-by/tags';
|
import { TagsOrderByProvider } from './impls/order-by/tags';
|
||||||
|
import { TemplateOrderByProvider } from './impls/order-by/template';
|
||||||
import { TextPropertyOrderByProvider } from './impls/order-by/text';
|
import { TextPropertyOrderByProvider } from './impls/order-by/text';
|
||||||
import { UpdatedAtOrderByProvider } from './impls/order-by/updated-at';
|
import { UpdatedAtOrderByProvider } from './impls/order-by/updated-at';
|
||||||
import { UpdatedByOrderByProvider } from './impls/order-by/updated-by';
|
import { UpdatedByOrderByProvider } from './impls/order-by/updated-by';
|
||||||
@@ -135,6 +147,31 @@ export function configureCollectionRulesModule(framework: Framework) {
|
|||||||
.impl(FilterProvider('system:title'), TitleFilterProvider, [
|
.impl(FilterProvider('system:title'), TitleFilterProvider, [
|
||||||
DocsSearchService,
|
DocsSearchService,
|
||||||
])
|
])
|
||||||
|
.impl(
|
||||||
|
FilterProvider('system:integrationType'),
|
||||||
|
IntegrationTypeFilterProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(
|
||||||
|
FilterProvider('property:edgelessTheme'),
|
||||||
|
EdgelessThemeFilterProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(FilterProvider('system:edgelessTheme'), EdgelessThemeFilterProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(FilterProvider('property:template'), TemplateFilterProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(FilterProvider('system:template'), TemplateFilterProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(FilterProvider('property:pageWidth'), PageWidthFilterProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(FilterProvider('system:pageWidth'), PageWidthFilterProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
// --------------- Group By ---------------
|
// --------------- Group By ---------------
|
||||||
.impl(GroupByProvider('system'), SystemGroupByProvider)
|
.impl(GroupByProvider('system'), SystemGroupByProvider)
|
||||||
.impl(GroupByProvider('property'), PropertyGroupByProvider, [
|
.impl(GroupByProvider('property'), PropertyGroupByProvider, [
|
||||||
@@ -199,6 +236,33 @@ export function configureCollectionRulesModule(framework: Framework) {
|
|||||||
.impl(GroupByProvider('system:updatedBy'), UpdatedByGroupByProvider, [
|
.impl(GroupByProvider('system:updatedBy'), UpdatedByGroupByProvider, [
|
||||||
DocsService,
|
DocsService,
|
||||||
])
|
])
|
||||||
|
.impl(
|
||||||
|
GroupByProvider('system:integrationType'),
|
||||||
|
IntegrationTypeGroupByProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(
|
||||||
|
GroupByProvider('property:edgelessTheme'),
|
||||||
|
EdgelessThemeGroupByProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(
|
||||||
|
GroupByProvider('system:edgelessTheme'),
|
||||||
|
EdgelessThemeGroupByProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(GroupByProvider('property:pageWidth'), PageWidthGroupByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(GroupByProvider('system:pageWidth'), PageWidthGroupByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(GroupByProvider('property:template'), TemplateGroupByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(GroupByProvider('system:template'), TemplateGroupByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
// --------------- Order By ---------------
|
// --------------- Order By ---------------
|
||||||
.impl(OrderByProvider('system'), SystemOrderByProvider)
|
.impl(OrderByProvider('system'), SystemOrderByProvider)
|
||||||
.impl(OrderByProvider('property'), PropertyOrderByProvider, [
|
.impl(OrderByProvider('property'), PropertyOrderByProvider, [
|
||||||
@@ -262,5 +326,32 @@ export function configureCollectionRulesModule(framework: Framework) {
|
|||||||
])
|
])
|
||||||
.impl(OrderByProvider('system:updatedBy'), UpdatedByOrderByProvider, [
|
.impl(OrderByProvider('system:updatedBy'), UpdatedByOrderByProvider, [
|
||||||
DocsService,
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(
|
||||||
|
OrderByProvider('system:integrationType'),
|
||||||
|
IntegrationTypeOrderByProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(
|
||||||
|
OrderByProvider('property:edgelessTheme'),
|
||||||
|
EdgelessThemeOrderByProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(
|
||||||
|
OrderByProvider('system:edgelessTheme'),
|
||||||
|
EdgelessThemeOrderByProvider,
|
||||||
|
[DocsService]
|
||||||
|
)
|
||||||
|
.impl(OrderByProvider('property:pageWidth'), PageWidthOrderByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(OrderByProvider('system:pageWidth'), PageWidthOrderByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(OrderByProvider('property:template'), TemplateOrderByProvider, [
|
||||||
|
DocsService,
|
||||||
|
])
|
||||||
|
.impl(OrderByProvider('system:template'), TemplateOrderByProvider, [
|
||||||
|
DocsService,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,9 +39,9 @@ export type WorkspacePropertyTypes = {
|
|||||||
createdAt: { filter: DateFilters };
|
createdAt: { filter: DateFilters };
|
||||||
docPrimaryMode: { filter: 'is' | 'is-not' };
|
docPrimaryMode: { filter: 'is' | 'is-not' };
|
||||||
journal: { filter: 'is' | 'is-not' };
|
journal: { filter: 'is' | 'is-not' };
|
||||||
edgelessTheme: { filter: never };
|
edgelessTheme: { filter: 'is' | 'is-not' };
|
||||||
pageWidth: { filter: never };
|
pageWidth: { filter: 'is' | 'is-not' };
|
||||||
template: { filter: never };
|
template: { filter: 'is' | 'is-not' };
|
||||||
unknown: { filter: never };
|
unknown: { filter: never };
|
||||||
};
|
};
|
||||||
export type WorkspacePropertyType = keyof WorkspacePropertyTypes;
|
export type WorkspacePropertyType = keyof WorkspacePropertyTypes;
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
{
|
{
|
||||||
"ar": 95,
|
"ar": 94,
|
||||||
"ca": 4,
|
"ca": 4,
|
||||||
"da": 4,
|
"da": 4,
|
||||||
"de": 95,
|
"de": 94,
|
||||||
"el-GR": 95,
|
"el-GR": 94,
|
||||||
"en": 100,
|
"en": 100,
|
||||||
"es-AR": 95,
|
"es-AR": 95,
|
||||||
"es-CL": 96,
|
"es-CL": 96,
|
||||||
"es": 95,
|
"es": 94,
|
||||||
"fa": 95,
|
"fa": 94,
|
||||||
"fr": 95,
|
"fr": 94,
|
||||||
"hi": 2,
|
"hi": 2,
|
||||||
"it-IT": 95,
|
"it-IT": 94,
|
||||||
"it": 1,
|
"it": 1,
|
||||||
"ja": 95,
|
"ja": 94,
|
||||||
"ko": 55,
|
"ko": 54,
|
||||||
"pl": 95,
|
"pl": 94,
|
||||||
"pt-BR": 95,
|
"pt-BR": 94,
|
||||||
"ru": 95,
|
"ru": 94,
|
||||||
"sv-SE": 95,
|
"sv-SE": 94,
|
||||||
"uk": 95,
|
"uk": 94,
|
||||||
"ur": 2,
|
"ur": 2,
|
||||||
"zh-Hans": 95,
|
"zh-Hans": 94,
|
||||||
"zh-Hant": 95
|
"zh-Hant": 94
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7080,6 +7080,30 @@ export function useAFFiNEI18N(): {
|
|||||||
* `All`
|
* `All`
|
||||||
*/
|
*/
|
||||||
["com.affine.all-docs.pinned-collection.all"](): string;
|
["com.affine.all-docs.pinned-collection.all"](): string;
|
||||||
|
/**
|
||||||
|
* `Template`
|
||||||
|
*/
|
||||||
|
["com.affine.all-docs.group.is-template"](): string;
|
||||||
|
/**
|
||||||
|
* `Not Template`
|
||||||
|
*/
|
||||||
|
["com.affine.all-docs.group.is-not-template"](): string;
|
||||||
|
/**
|
||||||
|
* `Journal`
|
||||||
|
*/
|
||||||
|
["com.affine.all-docs.group.is-journal"](): string;
|
||||||
|
/**
|
||||||
|
* `Not Journal`
|
||||||
|
*/
|
||||||
|
["com.affine.all-docs.group.is-not-journal"](): string;
|
||||||
|
/**
|
||||||
|
* `Checked`
|
||||||
|
*/
|
||||||
|
["com.affine.all-docs.group.is-checked"](): string;
|
||||||
|
/**
|
||||||
|
* `Unchecked`
|
||||||
|
*/
|
||||||
|
["com.affine.all-docs.group.is-not-checked"](): string;
|
||||||
/**
|
/**
|
||||||
* `core`
|
* `core`
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1767,6 +1767,12 @@
|
|||||||
"com.affine.all-docs.quick-action.tab": "Open in new tab",
|
"com.affine.all-docs.quick-action.tab": "Open in new tab",
|
||||||
"com.affine.all-docs.quick-action.select": "Select checkbox",
|
"com.affine.all-docs.quick-action.select": "Select checkbox",
|
||||||
"com.affine.all-docs.pinned-collection.all": "All",
|
"com.affine.all-docs.pinned-collection.all": "All",
|
||||||
|
"com.affine.all-docs.group.is-template": "Template",
|
||||||
|
"com.affine.all-docs.group.is-not-template": "Not Template",
|
||||||
|
"com.affine.all-docs.group.is-journal": "Journal",
|
||||||
|
"com.affine.all-docs.group.is-not-journal": "Not Journal",
|
||||||
|
"com.affine.all-docs.group.is-checked": "Checked",
|
||||||
|
"com.affine.all-docs.group.is-not-checked": "Unchecked",
|
||||||
"core": "core",
|
"core": "core",
|
||||||
"dark": "Dark",
|
"dark": "Dark",
|
||||||
"invited you to join": "invited you to join",
|
"invited you to join": "invited you to join",
|
||||||
|
|||||||
Reference in New Issue
Block a user