mirror of
https://github.com/toeverything/AFFiNE.git
synced 2025-01-09 04:10:09 +03:00
refactor(core): rename doc property component name (#8500)
This commit is contained in:
parent
c0601e04fb
commit
e7dcf63c77
@ -1,12 +1,12 @@
|
||||
import { Button, Menu } from '@affine/component';
|
||||
import { SettingHeader } from '@affine/component/setting-components';
|
||||
import { DocPropertyManager } from '@affine/core/components/doc-properties/manager';
|
||||
import { CreatePropertyMenuItems } from '@affine/core/components/doc-properties/menu/create-doc-property';
|
||||
import { useWorkspaceInfo } from '@affine/core/components/hooks/use-workspace-info';
|
||||
import { Trans, useI18n } from '@affine/i18n';
|
||||
import { FrameworkScope, type WorkspaceMetadata } from '@toeverything/infra';
|
||||
|
||||
import { useWorkspace } from '../../../../../components/hooks/use-workspace';
|
||||
import { DocPropertyManager } from '../../../page-properties/manager';
|
||||
import { CreatePropertyMenuItems } from '../../../page-properties/menu/create-doc-property';
|
||||
import * as styles from './styles.css';
|
||||
|
||||
const WorkspaceSettingPropertiesMain = () => {
|
||||
|
@ -34,11 +34,11 @@ import React, {
|
||||
useRef,
|
||||
} from 'react';
|
||||
|
||||
import { DocPropertiesTable } from '../../affine/page-properties';
|
||||
import {
|
||||
AffinePageReference,
|
||||
AffineSharedPageReference,
|
||||
} from '../../affine/reference-link';
|
||||
import { DocPropertiesTable } from '../../doc-properties';
|
||||
import { BiDirectionalLinkPanel } from './bi-directional-link-panel';
|
||||
import { BlocksuiteEditorJournalDocTitle } from './journal-doc-title';
|
||||
import {
|
||||
|
@ -22,9 +22,9 @@ import {
|
||||
} from '@toeverything/infra';
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { BlocksuiteHeaderTitle } from '../../../blocksuite/block-suite-header/title';
|
||||
import { BlocksuiteHeaderTitle } from '../../blocksuite/block-suite-header/title';
|
||||
import { CreatePropertyMenuItems } from '../menu/create-doc-property';
|
||||
import { PagePropertyRow } from '../table';
|
||||
import { DocPropertyRow } from '../table';
|
||||
import * as styles from './info-modal.css';
|
||||
import { LinksRow } from './links-row';
|
||||
import { TimeRow } from './time-row';
|
||||
@ -163,7 +163,7 @@ export const InfoTable = ({
|
||||
}
|
||||
>
|
||||
{properties.map(property => (
|
||||
<PagePropertyRow
|
||||
<DocPropertyRow
|
||||
key={property.id}
|
||||
propertyInfo={property}
|
||||
defaultOpenEditMenu={newPropertyId === property.id}
|
@ -1,6 +1,6 @@
|
||||
import type { Backlink, Link } from '@affine/core/modules/doc-link';
|
||||
|
||||
import { AffinePageReference } from '../../reference-link';
|
||||
import { AffinePageReference } from '../../affine/reference-link';
|
||||
import * as styles from './links-row.css';
|
||||
|
||||
export const LinksRow = ({
|
@ -34,21 +34,21 @@ import type React from 'react';
|
||||
import type { HTMLProps, PropsWithChildren } from 'react';
|
||||
import { forwardRef, useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { AffinePageReference } from '../reference-link';
|
||||
import { AffinePageReference } from '../affine/reference-link';
|
||||
import { DocPropertyIcon } from './icons/doc-property-icon';
|
||||
import { CreatePropertyMenuItems } from './menu/create-doc-property';
|
||||
import { EditDocPropertyMenuItems } from './menu/edit-doc-property';
|
||||
import * as styles from './table.css';
|
||||
import { DocPropertyTypes, isSupportedDocPropertyType } from './types/constant';
|
||||
|
||||
type PageBacklinksPopupProps = PropsWithChildren<{
|
||||
type DocBacklinksPopupProps = PropsWithChildren<{
|
||||
backlinks: { docId: string; blockId: string; title: string }[];
|
||||
}>;
|
||||
|
||||
export const PageBacklinksPopup = ({
|
||||
export const DocBacklinksPopup = ({
|
||||
backlinks,
|
||||
children,
|
||||
}: PageBacklinksPopupProps) => {
|
||||
}: DocBacklinksPopupProps) => {
|
||||
return (
|
||||
<Menu
|
||||
contentOptions={{
|
||||
@ -74,7 +74,7 @@ export const PageBacklinksPopup = ({
|
||||
);
|
||||
};
|
||||
|
||||
interface PagePropertiesTableHeaderProps {
|
||||
interface DocPropertiesTableHeaderProps {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
open: boolean;
|
||||
@ -84,25 +84,25 @@ interface PagePropertiesTableHeaderProps {
|
||||
// backlinks - #no Updated yyyy-mm-dd
|
||||
// ─────────────────────────────────────────────────
|
||||
// Page Info ...
|
||||
export const PagePropertiesTableHeader = ({
|
||||
export const DocPropertiesTableHeader = ({
|
||||
className,
|
||||
style,
|
||||
open,
|
||||
onOpenChange,
|
||||
}: PagePropertiesTableHeaderProps) => {
|
||||
}: DocPropertiesTableHeaderProps) => {
|
||||
const t = useI18n();
|
||||
const {
|
||||
docLinksServices,
|
||||
docLinksService,
|
||||
docService,
|
||||
workspaceService,
|
||||
editorSettingService,
|
||||
} = useServices({
|
||||
DocLinksServices: DocLinksService,
|
||||
DocLinksService,
|
||||
DocService,
|
||||
WorkspaceService,
|
||||
EditorSettingService,
|
||||
});
|
||||
const docBacklinks = docLinksServices.backlinks;
|
||||
const docBacklinks = docLinksService.backlinks;
|
||||
const backlinks = useLiveData(docBacklinks.backlinks$);
|
||||
|
||||
const displayDocInfo = useLiveData(
|
||||
@ -187,11 +187,11 @@ export const PagePropertiesTableHeader = ({
|
||||
{/* TODO(@Peng): add click handler to backlinks */}
|
||||
<div className={styles.tableHeaderInfoRow}>
|
||||
{backlinks.length > 0 ? (
|
||||
<PageBacklinksPopup backlinks={backlinks}>
|
||||
<DocBacklinksPopup backlinks={backlinks}>
|
||||
<div className={styles.tableHeaderBacklinksHint}>
|
||||
{t['com.affine.page-properties.backlinks']()} · {backlinks.length}
|
||||
</div>
|
||||
</PageBacklinksPopup>
|
||||
</DocBacklinksPopup>
|
||||
) : null}
|
||||
{dTimestampElement}
|
||||
</div>
|
||||
@ -220,16 +220,16 @@ export const PagePropertiesTableHeader = ({
|
||||
);
|
||||
};
|
||||
|
||||
interface PagePropertyRowProps {
|
||||
interface DocPropertyRowProps {
|
||||
propertyInfo: DocCustomPropertyInfo;
|
||||
showAll?: boolean;
|
||||
defaultOpenEditMenu?: boolean;
|
||||
}
|
||||
|
||||
export const PagePropertyRow = ({
|
||||
export const DocPropertyRow = ({
|
||||
propertyInfo,
|
||||
defaultOpenEditMenu,
|
||||
}: PagePropertyRowProps) => {
|
||||
}: DocPropertyRowProps) => {
|
||||
const t = useI18n();
|
||||
const docService = useService(DocService);
|
||||
const docsService = useService(DocsService);
|
||||
@ -338,7 +338,7 @@ export const PagePropertyRow = ({
|
||||
);
|
||||
};
|
||||
|
||||
interface PagePropertiesTableBodyProps {
|
||||
interface DocPropertiesTableBodyProps {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}
|
||||
@ -346,9 +346,9 @@ interface PagePropertiesTableBodyProps {
|
||||
// 🏷️ Tags (⋅ xxx) (⋅ yyy)
|
||||
// #️⃣ Number 123456
|
||||
// + Add a property
|
||||
export const PagePropertiesTableBody = forwardRef<
|
||||
export const DocPropertiesTableBody = forwardRef<
|
||||
HTMLDivElement,
|
||||
PagePropertiesTableBodyProps & HTMLProps<HTMLDivElement>
|
||||
DocPropertiesTableBodyProps & HTMLProps<HTMLDivElement>
|
||||
>(({ className, style, ...props }, ref) => {
|
||||
const t = useI18n();
|
||||
const docsService = useService(DocsService);
|
||||
@ -390,7 +390,7 @@ export const PagePropertiesTableBody = forwardRef<
|
||||
}
|
||||
>
|
||||
{properties.map(property => (
|
||||
<PagePropertyRow
|
||||
<DocPropertyRow
|
||||
key={property.id}
|
||||
propertyInfo={property}
|
||||
defaultOpenEditMenu={newPropertyId === property.id}
|
||||
@ -438,7 +438,7 @@ export const PagePropertiesTableBody = forwardRef<
|
||||
</div>
|
||||
);
|
||||
});
|
||||
PagePropertiesTableBody.displayName = 'PagePropertiesTableBody';
|
||||
DocPropertiesTableBody.displayName = 'PagePropertiesTableBody';
|
||||
|
||||
const DocPropertiesTableInner = () => {
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
@ -449,9 +449,9 @@ const DocPropertiesTableInner = () => {
|
||||
onOpenChange={setExpanded}
|
||||
className={styles.rootCentered}
|
||||
>
|
||||
<PagePropertiesTableHeader open={expanded} onOpenChange={setExpanded} />
|
||||
<DocPropertiesTableHeader open={expanded} onOpenChange={setExpanded} />
|
||||
<Collapsible.Content asChild>
|
||||
<PagePropertiesTableBody />
|
||||
<DocPropertiesTableBody />
|
||||
</Collapsible.Content>
|
||||
</Collapsible.Root>
|
||||
</div>
|
@ -20,7 +20,7 @@ import { clamp } from 'lodash-es';
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
import { useCallback, useMemo, useReducer, useRef, useState } from 'react';
|
||||
|
||||
import { TagItem, TempTagItem } from '../../page-list';
|
||||
import { TagItem, TempTagItem } from '../page-list';
|
||||
import * as styles from './tags-inline-editor.css';
|
||||
|
||||
interface TagsEditorProps {
|
@ -21,7 +21,6 @@ import { AuthModal } from '../affine/auth';
|
||||
import { AiLoginRequiredModal } from '../affine/auth/ai-login-required';
|
||||
import { HistoryTipsModal } from '../affine/history-tips-modal';
|
||||
import { IssueFeedbackModal } from '../affine/issue-feedback-modal';
|
||||
import { InfoModal } from '../affine/page-properties/info-modal/info-modal';
|
||||
import {
|
||||
CloudQuotaModal,
|
||||
LocalQuotaModal,
|
||||
@ -31,6 +30,7 @@ import { SignOutModal } from '../affine/sign-out-modal';
|
||||
import { StarAFFiNEModal } from '../affine/star-affine-modal';
|
||||
import type { SettingAtom } from '../atoms';
|
||||
import { openSettingModalAtom, openSignOutModalAtom } from '../atoms';
|
||||
import { InfoModal } from '../doc-properties/info-modal/info-modal';
|
||||
import { useTrashModalHelper } from '../hooks/affine/use-trash-modal-helper';
|
||||
import { useAsyncCallback } from '../hooks/affine-async-hooks';
|
||||
import { useNavigateHelper } from '../hooks/use-navigate-helper';
|
||||
|
@ -3,8 +3,8 @@ import { PageDetailSkeleton } from '@affine/component/page-detail-skeleton';
|
||||
import type { ChatPanel } from '@affine/core/blocksuite/presets/ai';
|
||||
import { AIProvider } from '@affine/core/blocksuite/presets/ai';
|
||||
import { PageAIOnboarding } from '@affine/core/components/affine/ai-onboarding';
|
||||
import { DocPropertySidebar } from '@affine/core/components/affine/page-properties/sidebar';
|
||||
import { EditorOutlineViewer } from '@affine/core/components/blocksuite/outline-viewer';
|
||||
import { DocPropertySidebar } from '@affine/core/components/doc-properties/sidebar';
|
||||
import { useAppSettingHelper } from '@affine/core/components/hooks/affine/use-app-setting-helper';
|
||||
import { useDocMetaHelper } from '@affine/core/components/hooks/use-block-suite-page-meta';
|
||||
import { EditorService } from '@affine/core/modules/editor';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Divider, Scrollable } from '@affine/component';
|
||||
import { DocPropertiesTable } from '@affine/core/components/affine/page-properties';
|
||||
import { LinksRow } from '@affine/core/components/affine/page-properties/info-modal/links-row';
|
||||
import { TimeRow } from '@affine/core/components/affine/page-properties/info-modal/time-row';
|
||||
import { DocPropertiesTable } from '@affine/core/components/doc-properties';
|
||||
import { LinksRow } from '@affine/core/components/doc-properties/info-modal/links-row';
|
||||
import { TimeRow } from '@affine/core/components/doc-properties/info-modal/time-row';
|
||||
import { DocsSearchService } from '@affine/core/modules/docs-search';
|
||||
import { useI18n } from '@affine/i18n';
|
||||
import { LiveData, useLiveData, useService } from '@toeverything/infra';
|
||||
|
@ -2,12 +2,12 @@ import { NotificationCenter } from '@affine/component';
|
||||
import { AiLoginRequiredModal } from '@affine/core/components/affine/auth/ai-login-required';
|
||||
import { HistoryTipsModal } from '@affine/core/components/affine/history-tips-modal';
|
||||
import { IssueFeedbackModal } from '@affine/core/components/affine/issue-feedback-modal';
|
||||
import { InfoModal } from '@affine/core/components/affine/page-properties';
|
||||
import {
|
||||
CloudQuotaModal,
|
||||
LocalQuotaModal,
|
||||
} from '@affine/core/components/affine/quota-reached-modal';
|
||||
import { StarAFFiNEModal } from '@affine/core/components/affine/star-affine-modal';
|
||||
import { InfoModal } from '@affine/core/components/doc-properties';
|
||||
import { useTrashModalHelper } from '@affine/core/components/hooks/affine/use-trash-modal-helper';
|
||||
import { MoveToTrash } from '@affine/core/components/page-list';
|
||||
import { SignOutConfirmModal } from '@affine/core/components/providers/modal-provider';
|
||||
|
Loading…
Reference in New Issue
Block a user