Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(share): share one compact layout across topic, page and artifact shares (#20123)

Innei4ff4ee0a0661
diff --git a/apps/share/src/features/artifact/ArtifactShareChrome.tsx b/apps/share/src/features/artifact/ArtifactShareChrome.tsx
deleted file mode 100644
index a5e45d83a45..00000000000
--- a/apps/share/src/features/artifact/ArtifactShareChrome.tsx
+++ /dev/null
@@ -1,76 +0,0 @@
-'use client';
-
-import { copyToClipboard, Flexbox } from '@lobehub/ui';
-import { Button, Text, toast } from '@lobehub/ui/base-ui';
-import { createStaticStyles } from 'antd-style';
-import { useTranslation } from 'react-i18next';
-
-import { ProductLogo } from '@/components/Branding';
-
-const styles = createStaticStyles(({ css, cssVar }) => ({
- header: css`
- flex-shrink: 0;
-
- height: 48px;
- padding-inline: 12px;
- border-block-end: 1px solid ${cssVar.colorBorderSecondary};
-
- background: ${cssVar.colorBgContainer};
- `,
- logo: css`
- display: flex;
- color: inherit;
- `,
- title: css`
- min-width: 0;
- `,
-}));
-
-interface ArtifactShareChromeProps {
- title?: string | null;
-}
-
-export const ArtifactShareChrome = ({ title }: ArtifactShareChromeProps) => {
- const { t } = useTranslation('chat');
-
- const handleShare = async () => {
- await copyToClipboard(window.location.href);
- toast.success(t('shareModal.copyLinkSuccess'));
- };
-
- return (
- <Flexbox
- horizontal
- align={'center'}
- className={styles.header}
- gap={12}
- justify={'space-between'}
- >
- <Flexbox horizontal align={'center'} flex={1} style={{ minWidth: 0 }}>
- <a className={styles.logo} href={'/'}>
- <ProductLogo size={28} />
- </a>
- </Flexbox>
- <Flexbox flex={2} style={{ minWidth: 0 }}>
- <Text
- ellipsis
- strong
- align={'center'}
- className={styles.title}
- fontSize={14}
- style={{ margin: 0 }}
- >
- {title}
- </Text>
- </Flexbox>
- <Flexbox horizontal align={'center'} flex={1} gap={8} justify={'flex-end'}>
- <Button size={'small'} onClick={handleShare}>
- {t('sharePage.artifact.share')}
- </Button>
- <Button href={'/'} size={'small'} type={'primary'}>
- {t('sharePage.menu.goToLobeHub')}
- </Button>
- </Flexbox>
- </Flexbox>
- );
-};
diff --git a/apps/share/src/features/artifact/SharedArtifactView.tsx b/apps/share/src/features/artifact/SharedArtifactView.tsx
index c2d4ded04a2..2d9cc53ba70 100644
--- a/apps/share/src/features/artifact/SharedArtifactView.tsx
+++ b/apps/share/src/features/artifact/SharedArtifactView.tsx
@@ -1,16 +1,13 @@
'use client';
-import { Center } from '@lobehub/ui';
import { createStaticStyles } from 'antd-style';
import { useParams } from 'react-router';
import useSWR from 'swr';
-import Loading from '@/components/Loading/BrandTextLoading';
-import ShareErrorView from '@/features/Share/ErrorView';
import { shareKeys } from '@/libs/swr/keys';
import { lambdaClient } from '@/libs/trpc/client';
-import { ArtifactShareChrome } from './ArtifactShareChrome';
+import ShareLayout from '../../shell/ShareLayout';
const styles = createStaticStyles(({ css, cssVar }) => ({
frame: css`
@@ -19,19 +16,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
border: 0;
background: ${cssVar.colorBgLayout};
`,
- root: css`
- display: flex;
- flex-direction: column;
-
- width: 100%;
- height: 100dvh;
-
- background: ${cssVar.colorBgLayout};
- `,
- stage: css`
- overflow: hidden;
- flex: 1;
- `,
}));
const SharedArtifactView = () => {
@@ -43,29 +27,11 @@ const SharedArtifactView = () => {
{ revalidateOnFocus: false },
);
- if (!error && !data && isLoading) {
- return (
- <Center height={'100dvh'}>
- <Loading debugId="SharedArtifactView" />
- </Center>
- );
- }
-
- if (error || !data) {
- return (
- <div className={styles.root}>
- <ArtifactShareChrome />
- <div className={styles.stage}>
- <ShareErrorView error={error} />
- </div>
- </div>
- );
- }
+ const loading = isLoading && !data;
return (
- <div className={styles.root}>
- <ArtifactShareChrome title={data.title} />
- <div className={styles.stage}>
+ <ShareLayout error={error || (!loading && !data)} loading={loading} title={data?.title}>
+ {data && (
<iframe
className={styles.frame}
referrerPolicy={'no-referrer'}
@@ -73,8 +39,8 @@ const SharedArtifactView = () => {
src={data.iframeSrc}
title={data.title ?? 'Artifact'}
/>
- </div>
- </div>
+ )}
+ </ShareLayout>
);
};
diff --git a/apps/share/src/features/page/SharedPageView.tsx b/apps/share/src/features/page/SharedPageView.tsx
index b907f15bf99..3be61941117 100644
--- a/apps/share/src/features/page/SharedPageView.tsx
+++ b/apps/share/src/features/page/SharedPageView.tsx
@@ -1,17 +1,19 @@
'use client';
-import { Center } from '@lobehub/ui';
import { memo } from 'react';
import { useParams } from 'react-router';
import useSWR from 'swr';
import PublishedShell from '@/business/client/features/PageShare/PublishedShell';
import ReadOnlyPageViewer from '@/business/client/features/PageShare/ReadOnlyPageViewer';
-import Loading from '@/components/Loading/BrandTextLoading';
import { shareKeys } from '@/libs/swr/keys';
import { lambdaClient } from '@/libs/trpc/client';
import { getIdFromIdentifier } from '@/utils/identifier';
+import ShareLayout from '../../shell/ShareLayout';
+
+const PAGE_READER_WIDTH = 820;
+
const SharedPageView = memo(() => {
const { id } = useParams<{ id: string }>();
const documentId = getIdFromIdentifier(id ?? '', 'docs');
@@ -22,20 +24,21 @@ const SharedPageView = memo(() => {
{ revalidateOnFocus: false },
);
- // The SSR document already carries the page, and SWR revalidates on mount
- // with it in cache — gating on `isLoading` alone would blank it.
- if (!error && !data && isLoading) {
- return (
- <Center height={'100vh'}>
- <Loading debugId="SharedPageView" />
- </Center>
- );
- }
-
return (
- <PublishedShell data={data} error={error}>
- {data ? <ReadOnlyPageViewer data={data} /> : null}
- </PublishedShell>
+ <ShareLayout
+ contentWidth={PAGE_READER_WIDTH}
+ error={error}
+ // The SSR document already carries the page, and SWR revalidates on mount
+ // with it in cache — gating on `isLoading` alone would blank it.
+ loading={isLoading && !data}
+ title={data?.document.title}
+ >
+ {data ? (
+ <PublishedShell data={data}>
+ <ReadOnlyPageViewer data={data} />
+ </PublishedShell>
+ ) : null}
+ </ShareLayout>
);
});
diff --git a/apps/share/src/features/topic/ExplainTopic.tsx b/apps/share/src/features/topic/ExplainTopic.tsx
index 1121affabc9..b3084254234 100644
--- a/apps/share/src/features/topic/ExplainTopic.tsx
+++ b/apps/share/src/features/topic/ExplainTopic.tsx
@@ -24,7 +24,7 @@ export default function ExplainTopic({ shareId }: { shareId: string }) {
};
return (
- <Button icon={Sparkles} loading={loading} onClick={copyPrompt}>
+ <Button icon={Sparkles} loading={loading} size={'small'} type={'fill'} onClick={copyPrompt}>
{t('sharePage.explain.action')}
</Button>
);
diff --git a/apps/share/src/features/topic/SharedTopicView.tsx b/apps/share/src/features/topic/SharedTopicView.tsx
index 7fd389bc4f1..8bf89c2953b 100644
--- a/apps/share/src/features/topic/SharedTopicView.tsx
+++ b/apps/share/src/features/topic/SharedTopicView.tsx
@@ -5,7 +5,7 @@ import { memo } from 'react';
import { useParams } from 'react-router';
import useSWR from 'swr';
-import ShareShell, { ShareHero } from '@/business/client/features/ShareShell';
+import { ShareHero } from '@/business/client/features/ShareShell';
import { CONVERSATION_MIN_WIDTH } from '@/const/layoutTokens';
import { shareKeys } from '@/libs/swr/keys';
import { lambdaClient } from '@/libs/trpc/client';
@@ -14,6 +14,7 @@ import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
import { clientOnly } from '../../shell/clientOnly';
+import ShareLayout from '../../shell/ShareLayout';
import ExplainTopic from './ExplainTopic';
import TopicAvatar from './TopicAvatar';
import { buildTopicByline } from './topicByline';
@@ -52,7 +53,7 @@ const SharedTopicView = memo(() => {
) : null;
return (
- <ShareShell
+ <ShareLayout
actions={id && data?.visibility === 'link' ? <ExplainTopic shareId={id} /> : undefined}
aside={<SharedTopicAside />}
contentWidth={wideScreen ? undefined : CONVERSATION_MIN_WIDTH}
@@ -63,7 +64,7 @@ const SharedTopicView = memo(() => {
title={data?.title}
>
{id && data ? <SharedTopicBody fallback={hero} shareId={id} /> : null}
- </ShareShell>
+ </ShareLayout>
);
});
diff --git a/apps/share/src/shell/ShareLayout.tsx b/apps/share/src/shell/ShareLayout.tsx
new file mode 100644
index 00000000000..494c331977a
--- /dev/null
+++ b/apps/share/src/shell/ShareLayout.tsx
@@ -0,0 +1,191 @@
+'use client';
+
+import { copyToClipboard, Flexbox } from '@lobehub/ui';
+import { ActionIcon, Text, toast } from '@lobehub/ui/base-ui';
+import { createStaticStyles } from 'antd-style';
+import { LinkIcon } from 'lucide-react';
+import { type CSSProperties, type ReactNode } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import { ShareHeaderMenu, ShareLogoLink } from '@/business/client/features/ShareChrome';
+import { ProductLogo } from '@/components/Branding';
+import Loading from '@/components/Loading/BrandTextLoading';
+import { DESKTOP_HEADER_ICON_SMALL_SIZE } from '@/const/layoutTokens';
+import ShareErrorView from '@/features/Share/ErrorView';
+
+const HEADER_HEIGHT = 44;
+const GUTTER_MIN_WIDTH = 316;
+
+// The floating/bar switch is resolved in CSS so the SSR document already has
+// the final geometry: `--share-bar-height` is the header height while the lane is
+// narrower than `--share-float-min`, and 0 once the side gutters can hold the
+// header — the backdrop collapses and the body's top offset goes with it.
+// Scroll content that starts under a floating header pads itself by
+// `--share-header-overlap` (see ShareHero).
+const styles = createStaticStyles(({ css, cssVar }) => ({
+ body: css`
+ position: relative;
+ overflow: hidden;
+ padding-block-start: var(--share-bar-height);
+ `,
+ divider: css`
+ flex: none;
+ width: 1px;
+ height: 16px;
+ background: ${cssVar.colorFill};
+ `,
+ header: css`
+ pointer-events: none;
+
+ position: absolute;
+ z-index: 10;
+ inset-block-start: 0;
+ inset-inline: 0;
+
+ display: flex;
+ gap: 12px;
+ align-items: center;
+ justify-content: space-between;
+
+ height: ${HEADER_HEIGHT}px;
+ padding-inline: 12px;
+
+ &::before {
+ content: '';
+
+ position: absolute;
+ z-index: -1;
+ inset-block-start: 0;
+ inset-inline: 0;
+
+ height: var(--share-bar-height);
+
+ background: ${cssVar.colorBgContainer};
+ box-shadow: inset 0 -1px 0 ${cssVar.colorBorderSecondary};
+ }
+
+ > * {
+ pointer-events: auto;
+ }
+ `,
+ lane: css`
+ --share-bar-height: clamp(
+ 0px,
+ calc((var(--share-float-min, 100000px) - 100cqw) * 1000),
+ ${HEADER_HEIGHT}px
+ );
+ --share-header-overlap: calc(${HEADER_HEIGHT}px - var(--share-bar-height));
+
+ position: relative;
+
+ container-type: inline-size;
+ overflow: hidden;
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+
+ min-width: 0;
+
+ background: ${cssVar.colorBgContainer};
+ `,
+ lead: css`
+ display: flex;
+ flex: 0 1 auto;
+ gap: 10px;
+ align-items: center;
+
+ min-width: 0;
+ max-width: max(
+ calc((100cqw - var(--share-content-width, 0px)) / 2 - 24px),
+ calc(var(--share-bar-height) * 1000)
+ );
+ `,
+}));
+
+export interface ShareLayoutProps {
+ actions?: ReactNode;
+ aside?: ReactNode;
+ children?: ReactNode;
+ contentWidth?: number;
+ error?: unknown;
+ loading?: boolean;
+ title?: string | null;
+}
+
+const CopyLinkAction = () => {
+ const { t } = useTranslation('chat');
+
+ const handleCopy = async () => {
+ await copyToClipboard(window.location.href);
+ toast.success(t('shareModal.copyLinkSuccess'));
+ };
+
+ return (
+ <ActionIcon
+ aria-label={t('sharePage.menu.copyLink')}
+ icon={LinkIcon}
+ size={DESKTOP_HEADER_ICON_SMALL_SIZE}
+ title={t('sharePage.menu.copyLink')}
+ onClick={handleCopy}
+ />
+ );
+};
+
+const ShareLayout = ({
+ actions,
+ aside,
+ children,
+ contentWidth,
+ error,
+ loading,
+ title,
+}: ShareLayoutProps) => {
+ let body = children;
+ if (error) body = <ShareErrorView error={error} />;
+ else if (loading) body = <Loading debugId="share layout" />;
+
+ const laneStyle = contentWidth
+ ? ({
+ '--share-content-width': `${contentWidth}px`,
+ '--share-float-min': `${contentWidth + 2 * GUTTER_MIN_WIDTH}px`,
+ } as CSSProperties)
+ : undefined;
+
+ return (
+ <Flexbox horizontal height={'100%'} style={{ overflow: 'hidden' }} width={'100%'}>
+ <div className={styles.lane} style={laneStyle}>
+ <header className={styles.header}>
+ <div className={styles.lead}>
+ <ShareLogoLink>
+ <ProductLogo size={24} />
+ </ShareLogoLink>
+ {title && !error && (
+ <>
+ <span className={styles.divider} />
+ <Text
+ ellipsis={{ tooltipWhenOverflow: true }}
+ fontSize={14}
+ style={{ minWidth: 0 }}
+ weight={600}
+ >
+ {title}
+ </Text>
+ </>
+ )}
+ </div>
+ <Flexbox horizontal align={'center'} flex={'none'} gap={2}>
+ {!error && !loading && actions}
+ {!error && <CopyLinkAction />}
+ <ShareHeaderMenu />
+ </Flexbox>
+ </header>
+ <Flexbox className={styles.body} flex={1}>
+ {body}
+ </Flexbox>
+ </div>
+ {aside}
+ </Flexbox>
+ );
+};
+
+export default ShareLayout;
diff --git a/locales/ar/chat.json b/locales/ar/chat.json
index 1a5c6400bb7..da162a0d6c9 100644
--- a/locales/ar/chat.json
+++ b/locales/ar/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "تضمين دور الرسالة",
"shareModal.withSystemRole": "تضمين ملف الوكيل",
"sharePage.actions.tryItYourself": "جرّبه بنفسك",
- "sharePage.artifact.share": "مشاركة",
"sharePage.error.forbidden.subtitle": "هذه المشاركة خاصة ولا يمكن الوصول إليها.",
"sharePage.error.forbidden.title": "تم رفض الوصول",
"sharePage.error.notFound.subtitle": "هذا الموضوع غير موجود أو تم حذفه.",
diff --git a/locales/bg-BG/chat.json b/locales/bg-BG/chat.json
index 122922a874b..eba89a545de 100644
--- a/locales/bg-BG/chat.json
+++ b/locales/bg-BG/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Включи роля на съобщението",
"shareModal.withSystemRole": "Включи профил на агента",
"sharePage.actions.tryItYourself": "Опитай сам",
- "sharePage.artifact.share": "Сподели",
"sharePage.error.forbidden.subtitle": "Това споделяне е поверително и не е достъпно.",
"sharePage.error.forbidden.title": "Достъпът е отказан",
"sharePage.error.notFound.subtitle": "Тази тема не съществува или е била премахната.",
diff --git a/locales/de-DE/chat.json b/locales/de-DE/chat.json
index 28957c02cd7..7ce7034f7fd 100644
--- a/locales/de-DE/chat.json
+++ b/locales/de-DE/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Rolleninformationen einbeziehen",
"shareModal.withSystemRole": "Agentenprofil einbeziehen",
"sharePage.actions.tryItYourself": "Probiere es selbst aus",
- "sharePage.artifact.share": "Teilen",
"sharePage.error.forbidden.subtitle": "Diese Freigabe ist privat und nicht zugänglich.",
"sharePage.error.forbidden.title": "Zugriff verweigert",
"sharePage.error.notFound.subtitle": "Dieses Thema existiert nicht oder wurde entfernt.",
diff --git a/locales/en-US/chat.json b/locales/en-US/chat.json
index 55aae0ea2c9..62d36f821bb 100644
--- a/locales/en-US/chat.json
+++ b/locales/en-US/chat.json
@@ -1641,7 +1641,6 @@
"shareModal.withRole": "Include Message Role",
"shareModal.withSystemRole": "Include Agent Profile",
"sharePage.actions.tryItYourself": "Try it yourself",
- "sharePage.artifact.share": "Share",
"sharePage.error.forbidden.subtitle": "This share is private and not accessible.",
"sharePage.error.forbidden.title": "Access Denied",
"sharePage.error.notFound.subtitle": "This topic does not exist or has been removed.",
diff --git a/locales/es-ES/chat.json b/locales/es-ES/chat.json
index db4ecd2669b..bb8161bfd62 100644
--- a/locales/es-ES/chat.json
+++ b/locales/es-ES/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Incluir rol del mensaje",
"shareModal.withSystemRole": "Incluir perfil del agente",
"sharePage.actions.tryItYourself": "Pruébalo tú mismo",
- "sharePage.artifact.share": "Compartir",
"sharePage.error.forbidden.subtitle": "Este contenido compartido es privado y no está accesible.",
"sharePage.error.forbidden.title": "Acceso denegado",
"sharePage.error.notFound.subtitle": "Este tema no existe o ha sido eliminado.",
diff --git a/locales/fa-IR/chat.json b/locales/fa-IR/chat.json
index b846c7cfda2..00069418064 100644
--- a/locales/fa-IR/chat.json
+++ b/locales/fa-IR/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "شامل نقش پیام",
"shareModal.withSystemRole": "شامل پروفایل نماینده",
"sharePage.actions.tryItYourself": "خودتان امتحان کنید",
- "sharePage.artifact.share": "اشتراک‌گذاری",
"sharePage.error.forbidden.subtitle": "این اشتراک‌گذاری خصوصی است و قابل دسترسی نیست.",
"sharePage.error.forbidden.title": "دسترسی غیرمجاز",
"sharePage.error.notFound.subtitle": "این موضوع وجود ندارد یا حذف شده است.",
diff --git a/locales/fr-FR/chat.json b/locales/fr-FR/chat.json
index 05721bc96b5..b879ac2f94a 100644
--- a/locales/fr-FR/chat.json
+++ b/locales/fr-FR/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Inclure le rôle du message",
"shareModal.withSystemRole": "Inclure le profil de l'agent",
"sharePage.actions.tryItYourself": "Essayez par vous-même",
- "sharePage.artifact.share": "Partager",
"sharePage.error.forbidden.subtitle": "Ce partage est privé et inaccessible.",
"sharePage.error.forbidden.title": "Accès refusé",
"sharePage.error.notFound.subtitle": "Ce sujet n’existe pas ou a été supprimé.",
diff --git a/locales/it-IT/chat.json b/locales/it-IT/chat.json
index f2442bca923..bc46860f1b6 100644
--- a/locales/it-IT/chat.json
+++ b/locales/it-IT/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Includi ruolo messaggio",
"shareModal.withSystemRole": "Includi profilo agente",
"sharePage.actions.tryItYourself": "Prova tu stesso",
- "sharePage.artifact.share": "Condividi",
"sharePage.error.forbidden.subtitle": "Questa condivisione è privata e non accessibile.",
"sharePage.error.forbidden.title": "Accesso negato",
"sharePage.error.notFound.subtitle": "Questo argomento non esiste o è stato rimosso.",
diff --git a/locales/ja-JP/chat.json b/locales/ja-JP/chat.json
index 7be8df91027..635ea7dfd76 100644
--- a/locales/ja-JP/chat.json
+++ b/locales/ja-JP/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "メッセージの役割を含める",
"shareModal.withSystemRole": "アシスタントプロフィールを含める",
"sharePage.actions.tryItYourself": "自分で試す",
- "sharePage.artifact.share": "共有",
"sharePage.error.forbidden.subtitle": "この共有は非公開のため、アクセスできません。",
"sharePage.error.forbidden.title": "アクセスが拒否されました",
"sharePage.error.notFound.subtitle": "このトピックは存在しないか、削除されました。",
diff --git a/locales/ko-KR/chat.json b/locales/ko-KR/chat.json
index 552002e06c0..f476b7a670b 100644
--- a/locales/ko-KR/chat.json
+++ b/locales/ko-KR/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "메시지 역할 포함",
"shareModal.withSystemRole": "도우미 프로필 포함",
"sharePage.actions.tryItYourself": "직접 해보세요",
- "sharePage.artifact.share": "공유",
"sharePage.error.forbidden.subtitle": "이 공유는 비공개이며 접근할 수 없습니다.",
"sharePage.error.forbidden.title": "접근 거부됨",
"sharePage.error.notFound.subtitle": "이 주제는 존재하지 않거나 삭제되었습니다.",
diff --git a/locales/nl-NL/chat.json b/locales/nl-NL/chat.json
index 9c0ee42b246..1734c72bff7 100644
--- a/locales/nl-NL/chat.json
+++ b/locales/nl-NL/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Berichtrol opnemen",
"shareModal.withSystemRole": "Agentprofiel opnemen",
"sharePage.actions.tryItYourself": "Probeer het zelf",
- "sharePage.artifact.share": "Delen",
"sharePage.error.forbidden.subtitle": "Deze gedeelde link is privé en niet toegankelijk.",
"sharePage.error.forbidden.title": "Toegang geweigerd",
"sharePage.error.notFound.subtitle": "Dit onderwerp bestaat niet of is verwijderd.",
diff --git a/locales/pl-PL/chat.json b/locales/pl-PL/chat.json
index 355687186aa..cc529be9d88 100644
--- a/locales/pl-PL/chat.json
+++ b/locales/pl-PL/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Uwzględnij rolę wiadomości",
"shareModal.withSystemRole": "Uwzględnij profil agenta",
"sharePage.actions.tryItYourself": "Wypróbuj sam",
- "sharePage.artifact.share": "Udostępnij",
"sharePage.error.forbidden.subtitle": "To udostępnienie jest prywatne i niedostępne.",
"sharePage.error.forbidden.title": "Brak dostępu",
"sharePage.error.notFound.subtitle": "Ten temat nie istnieje lub został usunięty.",
diff --git a/locales/pt-BR/chat.json b/locales/pt-BR/chat.json
index e995e38eab7..d496a314939 100644
--- a/locales/pt-BR/chat.json
+++ b/locales/pt-BR/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Incluir Papel da Mensagem",
"shareModal.withSystemRole": "Incluir Perfil do Agente",
"sharePage.actions.tryItYourself": "Experimente você mesmo",
- "sharePage.artifact.share": "Compartilhar",
"sharePage.error.forbidden.subtitle": "Este compartilhamento é privado e não está acessível.",
"sharePage.error.forbidden.title": "Acesso Negado",
"sharePage.error.notFound.subtitle": "Este tópico não existe ou foi removido.",
diff --git a/locales/ru-RU/chat.json b/locales/ru-RU/chat.json
index 8c902f93890..a38f4afeedf 100644
--- a/locales/ru-RU/chat.json
+++ b/locales/ru-RU/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Включить роль сообщений",
"shareModal.withSystemRole": "Включить профиль агента",
"sharePage.actions.tryItYourself": "Попробуйте сами",
- "sharePage.artifact.share": "Поделиться",
"sharePage.error.forbidden.subtitle": "Этот доступ является приватным и недоступен.",
"sharePage.error.forbidden.title": "Доступ запрещён",
"sharePage.error.notFound.subtitle": "Эта тема не существует или была удалена.",
diff --git a/locales/tr-TR/chat.json b/locales/tr-TR/chat.json
index f4f16d6a6d4..73abf015614 100644
--- a/locales/tr-TR/chat.json
+++ b/locales/tr-TR/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Mesaj Rolünü Dahil Et",
"shareModal.withSystemRole": "Ajan Profilini Dahil Et",
"sharePage.actions.tryItYourself": "Kendin dene",
- "sharePage.artifact.share": "Paylaş",
"sharePage.error.forbidden.subtitle": "Bu paylaşım gizlidir ve erişilemez.",
"sharePage.error.forbidden.title": "Erişim Reddedildi",
"sharePage.error.notFound.subtitle": "Bu konu mevcut değil veya kaldırılmış.",
diff --git a/locales/vi-VN/chat.json b/locales/vi-VN/chat.json
index 0cc3ebfd7a3..1d78938ec52 100644
--- a/locales/vi-VN/chat.json
+++ b/locales/vi-VN/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "Bao gồm vai trò tin nhắn",
"shareModal.withSystemRole": "Bao gồm hồ sơ tác nhân",
"sharePage.actions.tryItYourself": "Tự mình thử",
- "sharePage.artifact.share": "Chia sẻ",
"sharePage.error.forbidden.subtitle": "Chia sẻ này là riêng tư và không thể truy cập.",
"sharePage.error.forbidden.title": "Từ chối truy cập",
"sharePage.error.notFound.subtitle": "Chủ đề này không tồn tại hoặc đã bị xóa.",
diff --git a/locales/zh-CN/chat.json b/locales/zh-CN/chat.json
index c99fd412c20..392430a4556 100644
--- a/locales/zh-CN/chat.json
+++ b/locales/zh-CN/chat.json
@@ -1641,7 +1641,6 @@
"shareModal.withRole": "包含消息角色",
"shareModal.withSystemRole": "包含助理档案",
"sharePage.actions.tryItYourself": "做同款",
- "sharePage.artifact.share": "分享",
"sharePage.error.forbidden.subtitle": "此分享为私密状态,无法访问。",
"sharePage.error.forbidden.title": "无权访问",
"sharePage.error.notFound.subtitle": "该话题不存在或已被删除。",
diff --git a/locales/zh-TW/chat.json b/locales/zh-TW/chat.json
index d019ad05ff5..739728e5f5d 100644
--- a/locales/zh-TW/chat.json
+++ b/locales/zh-TW/chat.json
@@ -1588,7 +1588,6 @@
"shareModal.withRole": "包含訊息角色",
"shareModal.withSystemRole": "包含助手角色設定",
"sharePage.actions.tryItYourself": "自己試試看",
- "sharePage.artifact.share": "分享",
"sharePage.error.forbidden.subtitle": "此分享為私人內容,無法存取。",
"sharePage.error.forbidden.title": "拒絕存取",
"sharePage.error.notFound.subtitle": "此主題不存在或已被移除。",
diff --git a/packages/locales/src/default/chat.ts b/packages/locales/src/default/chat.ts
index f6318c10193..a75f0282fa8 100644
--- a/packages/locales/src/default/chat.ts
+++ b/packages/locales/src/default/chat.ts
@@ -1508,7 +1508,6 @@ export default {
'sharePage.explain.prompt':
'Take a look at this conversation. Briefly tell me what it is about and what is worth noticing:\n{{url}}',
'sharePage.actions.tryItYourself': 'Try it yourself',
- 'sharePage.artifact.share': 'Share',
'sharePage.error.forbidden.subtitle': 'This share is private and not accessible.',
'sharePage.error.forbidden.title': 'Access Denied',
'sharePage.error.notFound.subtitle': 'This topic does not exist or has been removed.',
diff --git a/src/business/client/features/PageShare/PublishedShell.tsx b/src/business/client/features/PageShare/PublishedShell.tsx
index be6e53bede6..8c59c50d1b7 100644
--- a/src/business/client/features/PageShare/PublishedShell.tsx
+++ b/src/business/client/features/PageShare/PublishedShell.tsx
@@ -4,7 +4,6 @@ import { type ReactNode } from 'react';
interface PublishedShellProps {
children: ReactNode;
data?: SharedDocumentData;
- error?: unknown;
}
export default function PublishedShell({ children }: PublishedShellProps) {
diff --git a/src/business/client/features/ShareChrome/index.tsx b/src/business/client/features/ShareChrome/index.tsx
new file mode 100644
index 00000000000..ed25232dbb0
--- /dev/null
+++ b/src/business/client/features/ShareChrome/index.tsx
@@ -0,0 +1,11 @@
+'use client';
+
+import { type ReactNode } from 'react';
+
+export const ShareLogoLink = ({ children }: { children: ReactNode }) => (
+ <a href={'/'} style={{ color: 'inherit', display: 'flex' }}>
+ {children}
+ </a>
+);
+
+export const ShareHeaderMenu = () => null;
diff --git a/src/business/client/features/ShareShell/index.tsx b/src/business/client/features/ShareShell/index.tsx
index a954115f8e6..a2eb22ac60a 100644
--- a/src/business/client/features/ShareShell/index.tsx
+++ b/src/business/client/features/ShareShell/index.tsx
@@ -3,30 +3,6 @@
import { Flexbox } from '@lobehub/ui';
import { Text } from '@lobehub/ui/base-ui';
import { type ReactNode } from 'react';
-import { Link } from 'react-router';
-
-import { ProductLogo } from '@/components/Branding';
-import Loading from '@/components/Loading/BrandTextLoading';
-import ShareErrorView from '@/features/Share/ErrorView';
-
-export interface ShareShellShareInfo {
- avatar?: ReactNode;
- editUrl?: string;
- isOwner?: boolean;
- openUrl?: string;
-}
-
-export interface ShareShellProps {
- actions?: ReactNode;
- aside?: ReactNode;
- children?: ReactNode;
- /** Centered reading-column width; enables a header that floats in its side gutters. */
- contentWidth?: number;
- error?: unknown;
- loading?: boolean;
- share?: ShareShellShareInfo;
- title?: string | null;
-}
export interface ShareHeroProps {
avatar?: ReactNode;
@@ -35,7 +11,7 @@ export interface ShareHeroProps {
}
export const ShareHero = ({ avatar, byline, title }: ShareHeroProps) => (
- <Flexbox gap={8} paddingBlock={'24px 16px'} paddingInline={24}>
+ <Flexbox gap={8} paddingBlock={'calc(24px + var(--share-header-overlap, 0px)) 16px'}>
{avatar}
{title && (
<Text as={'h1'} fontSize={24} style={{ margin: 0 }} weight={700}>
@@ -49,26 +25,3 @@ export const ShareHero = ({ avatar, byline, title }: ShareHeroProps) => (
)}
</Flexbox>
);
-
-export default function ShareShell({ actions, aside, children, error, loading }: ShareShellProps) {
- let body = children;
- if (error) body = <ShareErrorView error={error} />;
- else if (loading) body = <Loading debugId="share shell" />;
-
- return (
- <Flexbox height={'100%'} width={'100%'}>
- <Flexbox horizontal align={'center'} justify={'space-between'} padding={12}>
- <Link style={{ color: 'inherit' }} to="/">
- <ProductLogo size={32} />
- </Link>
- {!error && !loading && actions}
- </Flexbox>
- <Flexbox horizontal flex={1} style={{ overflow: 'hidden' }}>
- <Flexbox flex={1} style={{ overflow: 'hidden' }}>
- {body}
- </Flexbox>
- {aside}
- </Flexbox>
- </Flexbox>
- );
-}