@lobehub/lobehub 2.0.0-next.342 → 2.0.0-next.343

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/changelog/v1.json +12 -0
  3. package/package.json +1 -1
  4. package/packages/database/src/models/__tests__/userMemories.test.ts +62 -5
  5. package/packages/database/src/models/agentCronJob.ts +9 -9
  6. package/packages/database/src/models/userMemory/__tests__/identity.test.ts +5 -5
  7. package/packages/database/src/models/userMemory/experience.ts +91 -1
  8. package/packages/database/src/models/userMemory/identity.ts +93 -2
  9. package/packages/database/src/models/userMemory/model.ts +27 -8
  10. package/packages/types/src/userMemory/experience.ts +25 -0
  11. package/packages/types/src/userMemory/identity.ts +27 -0
  12. package/packages/types/src/userMemory/index.ts +1 -0
  13. package/packages/types/src/userMemory/shared.ts +30 -0
  14. package/src/app/[variants]/(main)/group/profile/features/Header/index.tsx +3 -4
  15. package/src/app/[variants]/(main)/home/features/InputArea/SkillInstallBanner.tsx +7 -8
  16. package/src/app/[variants]/(main)/memory/(home)/features/Persona/PersonaDetail.tsx +58 -0
  17. package/src/app/[variants]/(main)/memory/(home)/features/Persona/PersonaHeader.tsx +22 -0
  18. package/src/app/[variants]/(main)/memory/(home)/features/Persona/PersonaSummary.tsx +43 -0
  19. package/src/app/[variants]/(main)/memory/(home)/features/Persona/index.tsx +53 -0
  20. package/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx +2 -2
  21. package/src/app/[variants]/(main)/memory/(home)/index.tsx +15 -3
  22. package/src/app/[variants]/(main)/memory/experiences/features/List/GridView/ExperienceCard.tsx +3 -3
  23. package/src/app/[variants]/(main)/memory/experiences/features/List/GridView/index.tsx +3 -3
  24. package/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/ExperienceCard.tsx +3 -3
  25. package/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/index.tsx +3 -3
  26. package/src/app/[variants]/(main)/memory/features/SourceLink.tsx +2 -11
  27. package/src/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard.tsx +2 -9
  28. package/src/app/[variants]/(main)/memory/identities/features/IdentityRightPanel.tsx +1 -1
  29. package/src/app/[variants]/(main)/memory/identities/features/List/GridView/IdentityCard.tsx +5 -4
  30. package/src/app/[variants]/(main)/memory/identities/features/List/GridView/index.tsx +3 -3
  31. package/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/IdentityCard.tsx +6 -6
  32. package/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/index.tsx +6 -4
  33. package/src/app/[variants]/(main)/settings/profile/index.tsx +8 -8
  34. package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +0 -1
  35. package/src/app/[variants]/(main)/settings/skill/features/Actions.tsx +0 -1
  36. package/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx +9 -10
  37. package/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx +9 -10
  38. package/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx +4 -5
  39. package/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx +4 -5
  40. package/src/app/[variants]/share/t/[id]/SharedMessageList.tsx +1 -4
  41. package/src/app/[variants]/share/t/[id]/_layout/index.tsx +47 -121
  42. package/src/app/[variants]/share/t/[id]/_layout/style.ts +59 -0
  43. package/src/app/[variants]/share/t/[id]/features/Portal/index.tsx +4 -5
  44. package/src/app/[variants]/share/t/[id]/index.tsx +30 -37
  45. package/src/components/404/index.tsx +15 -9
  46. package/src/components/DragUpload/index.tsx +15 -16
  47. package/src/features/EditorCanvas/DocumentIdMode.tsx +1 -2
  48. package/src/features/IntegrationDetailModal/index.tsx +11 -12
  49. package/src/features/ResourceManager/index.tsx +13 -6
  50. package/src/features/ShareModal/ShareImage/Preview.tsx +19 -28
  51. package/src/features/ShareModal/ShareImage/style.ts +4 -2
  52. package/src/features/ShareModal/index.tsx +5 -1
  53. package/src/features/ShareModal/style.ts +1 -0
  54. package/src/features/ShareModal/useContainerStyles.ts +1 -1
  55. package/src/features/SharePopover/index.tsx +16 -9
  56. package/src/features/SharePopover/style.ts +2 -2
  57. package/src/features/SkillStore/CommunityList/Item.tsx +2 -2
  58. package/src/features/SkillStore/LobeHubList/Item.tsx +2 -2
  59. package/src/features/SkillStore/LobeHubList/index.tsx +2 -3
  60. package/src/features/SkillStore/style.ts +4 -4
  61. package/src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx +28 -20
  62. package/src/server/routers/lambda/userMemories.ts +61 -5
  63. package/src/server/routers/lambda/userMemory.ts +5 -1
  64. package/src/services/chat/index.ts +2 -2
  65. package/src/services/userMemory/index.ts +25 -1
  66. package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +0 -1
  67. package/src/store/userMemory/initialState.ts +22 -52
  68. package/src/store/userMemory/slices/context/action.ts +1 -1
  69. package/src/store/userMemory/slices/context/index.ts +1 -0
  70. package/src/store/userMemory/slices/context/initialState.ts +22 -0
  71. package/src/store/userMemory/slices/experience/action.ts +10 -22
  72. package/src/store/userMemory/slices/experience/index.ts +1 -0
  73. package/src/store/userMemory/slices/experience/initialState.ts +22 -0
  74. package/src/store/userMemory/slices/home/action.ts +17 -0
  75. package/src/store/userMemory/slices/identity/action.ts +36 -24
  76. package/src/store/userMemory/slices/identity/initialState.ts +7 -4
  77. package/src/store/userMemory/slices/preference/action.ts +1 -1
  78. package/src/store/userMemory/slices/preference/index.ts +1 -0
  79. package/src/store/userMemory/slices/preference/initialState.ts +22 -0
@@ -1,29 +1,27 @@
1
1
  'use client';
2
2
 
3
- import { Flexbox } from '@lobehub/ui';
3
+ import { Button, Center } from '@lobehub/ui';
4
4
  import { TRPCClientError } from '@trpc/client';
5
- import { Button, Result, Skeleton } from 'antd';
6
- import { createStyles } from 'antd-style';
5
+ import { createStaticStyles } from 'antd-style';
7
6
  import { memo } from 'react';
8
7
  import { useTranslation } from 'react-i18next';
9
8
  import { useParams } from 'react-router-dom';
10
9
  import useSWR from 'swr';
11
10
 
11
+ import NotFound from '@/components/404';
12
+ import Loading from '@/components/Loading/BrandTextLoading';
12
13
  import { lambdaClient } from '@/libs/trpc/client';
13
14
 
14
15
  import SharedMessageList from './SharedMessageList';
15
16
 
16
- const useStyles = createStyles(({ css }) => ({
17
- container: css`
18
- flex: 1;
19
- `,
17
+ const styles = createStaticStyles(({ css }) => ({
20
18
  errorContainer: css`
21
19
  display: flex;
22
20
  flex-direction: column;
23
21
  align-items: center;
24
22
  justify-content: center;
25
23
 
26
- min-height: 400px;
24
+ height: 80vh;
27
25
  padding: 48px;
28
26
 
29
27
  text-align: center;
@@ -31,7 +29,6 @@ const useStyles = createStyles(({ css }) => ({
31
29
  }));
32
30
 
33
31
  const ShareTopicPage = memo(() => {
34
- const { styles } = useStyles();
35
32
  const { t } = useTranslation('chat');
36
33
  const { id } = useParams<{ id: string }>();
37
34
 
@@ -41,12 +38,11 @@ const ShareTopicPage = memo(() => {
41
38
  { revalidateOnFocus: false },
42
39
  );
43
40
 
44
- if (isLoading) {
41
+ if (!error && isLoading) {
45
42
  return (
46
- <Flexbox className={styles.container} gap={16}>
47
- <Skeleton active paragraph={{ rows: 1 }} title={false} />
48
- <Skeleton active paragraph={{ rows: 6 }} />
49
- </Flexbox>
43
+ <Center className={styles.errorContainer}>
44
+ <Loading debugId="share" />
45
+ </Center>
50
46
  );
51
47
  }
52
48
 
@@ -56,56 +52,53 @@ const ShareTopicPage = memo(() => {
56
52
 
57
53
  if (errorCode === 'UNAUTHORIZED') {
58
54
  return (
59
- <Flexbox className={styles.errorContainer}>
60
- <Result
55
+ <Center className={styles.errorContainer}>
56
+ <NotFound
57
+ desc={t('sharePage.error.unauthorized.subtitle')}
61
58
  extra={
62
59
  <Button href="/login" type="primary">
63
60
  {t('sharePage.error.unauthorized.action')}
64
61
  </Button>
65
62
  }
66
- status="403"
67
- subTitle={t('sharePage.error.unauthorized.subtitle')}
63
+ status={''}
68
64
  title={t('sharePage.error.unauthorized.title')}
69
65
  />
70
- </Flexbox>
66
+ </Center>
71
67
  );
72
68
  }
73
69
 
74
70
  if (errorCode === 'FORBIDDEN') {
75
71
  return (
76
- <Flexbox className={styles.errorContainer}>
77
- <Result
78
- status="403"
79
- subTitle={t('sharePage.error.forbidden.subtitle')}
72
+ <Center className={styles.errorContainer}>
73
+ <NotFound
74
+ desc={t('sharePage.error.forbidden.subtitle')}
75
+ status={403}
80
76
  title={t('sharePage.error.forbidden.title')}
81
77
  />
82
- </Flexbox>
78
+ </Center>
83
79
  );
84
80
  }
85
81
 
86
82
  // NOT_FOUND or other errors
87
83
  return (
88
- <Flexbox className={styles.errorContainer}>
89
- <Result
90
- status="404"
91
- subTitle={t('sharePage.error.notFound.subtitle')}
84
+ <Center className={styles.errorContainer}>
85
+ <NotFound
86
+ desc={t('sharePage.error.notFound.subtitle')}
92
87
  title={t('sharePage.error.notFound.title')}
93
88
  />
94
- </Flexbox>
89
+ </Center>
95
90
  );
96
91
  }
97
92
 
98
93
  if (!data) return null;
99
94
 
100
95
  return (
101
- <Flexbox className={styles.container}>
102
- <SharedMessageList
103
- agentId={data.agentId}
104
- groupId={data.groupId}
105
- shareId={data.shareId}
106
- topicId={data.topicId}
107
- />
108
- </Flexbox>
96
+ <SharedMessageList
97
+ agentId={data.agentId}
98
+ groupId={data.groupId}
99
+ shareId={data.shareId}
100
+ topicId={data.topicId}
101
+ />
109
102
  );
110
103
  });
111
104
 
@@ -1,12 +1,17 @@
1
1
  'use client';
2
2
 
3
3
  import { Button, Flexbox, FluentEmoji } from '@lobehub/ui';
4
- import { memo } from 'react';
4
+ import { ReactNode, memo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import { MAX_WIDTH } from '@/const/layoutTokens';
8
8
 
9
- const NotFound = memo(() => {
9
+ const NotFound = memo<{
10
+ desc?: string;
11
+ extra?: ReactNode;
12
+ status?: number | string;
13
+ title?: string;
14
+ }>(({ extra, status = 404, title, desc }) => {
10
15
  const { t } = useTranslation('error');
11
16
  return (
12
17
  <Flexbox align={'center'} justify={'center'} style={{ minHeight: '100%', width: '100%' }}>
@@ -21,20 +26,21 @@ const NotFound = memo(() => {
21
26
  zIndex: 0,
22
27
  }}
23
28
  >
24
- 404
29
+ {status}
25
30
  </h1>
26
31
  <FluentEmoji emoji={'👀'} size={64} />
27
32
  <h2 style={{ fontWeight: 'bold', marginTop: '1em', textAlign: 'center' }}>
28
- {t('notFound.title')}
33
+ {title || t('notFound.title')}
29
34
  </h2>
30
35
  <div style={{ lineHeight: '1.8', marginBottom: '2em', textAlign: 'center' }}>
31
- <div>{t('notFound.desc')}</div>
36
+ <div>{desc || t('notFound.desc')}</div>
32
37
  <div style={{ marginTop: '0.5em' }}>{t('notFound.check')}</div>
33
38
  </div>
34
-
35
- <Button onClick={() => (window.location.href = '/')} type={'primary'}>
36
- {t('notFound.backHome')}
37
- </Button>
39
+ {extra || (
40
+ <Button onClick={() => (window.location.href = '/')} type={'primary'}>
41
+ {t('notFound.backHome')}
42
+ </Button>
43
+ )}
38
44
  </Flexbox>
39
45
  );
40
46
  });
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-undef */
2
2
  import { Center, Flexbox, Icon } from '@lobehub/ui';
3
- import { createStyles } from 'antd-style';
3
+ import { createStaticStyles } from 'antd-style';
4
4
  import { FileImage, FileText, FileUpIcon } from 'lucide-react';
5
5
  import { memo } from 'react';
6
6
  import { createPortal } from 'react-dom';
@@ -11,22 +11,22 @@ import { getContainer, useDragUpload } from './useDragUpload';
11
11
  const BLOCK_SIZE = 64;
12
12
  const ICON_SIZE = { size: 36, strokeWidth: 1.5 };
13
13
 
14
- const useStyles = createStyles(({ css, token }) => {
14
+ const styles = createStaticStyles(({ css, cssVar }) => {
15
15
  return {
16
16
  container: css`
17
17
  width: 320px;
18
18
  height: 200px;
19
- padding: calc(${token.borderRadiusLG}px + 4px);
19
+ padding: calc(${cssVar.borderRadiusLG} + 4px);
20
20
  border-radius: 16px;
21
21
 
22
- background: ${token.geekblue};
22
+ background: ${cssVar.geekblue};
23
23
  `,
24
24
  content: css`
25
25
  width: 100%;
26
26
  height: 100%;
27
27
  padding: 16px;
28
28
  border: 1.5px dashed #fff;
29
- border-radius: ${token.borderRadiusLG}px;
29
+ border-radius: ${cssVar.borderRadiusLG};
30
30
  `,
31
31
  desc: css`
32
32
  font-size: 14px;
@@ -34,24 +34,24 @@ const useStyles = createStyles(({ css, token }) => {
34
34
  color: #fff;
35
35
  `,
36
36
  icon: css`
37
- border-radius: ${token.borderRadiusLG}px;
38
- color: color-mix(in srgb, ${token.geekblue} 95%, black);
39
- background: color-mix(in srgb, ${token.geekblue} 38%, white);
37
+ border-radius: ${cssVar.borderRadiusLG};
38
+ color: color-mix(in srgb, ${cssVar.geekblue} 95%, black);
39
+ background: color-mix(in srgb, ${cssVar.geekblue} 38%, white);
40
40
  `,
41
41
  iconGroup: css`
42
42
  margin-block-start: -44px;
43
43
  `,
44
44
  iconLeft: css`
45
45
  transform: rotateZ(-20deg) translateX(10px);
46
- border-radius: ${token.borderRadiusLG}px;
47
- color: color-mix(in srgb, ${token.geekblue} 95%, black);
48
- background: color-mix(in srgb, ${token.geekblue} 68%, white);
46
+ border-radius: ${cssVar.borderRadiusLG};
47
+ color: color-mix(in srgb, ${cssVar.geekblue} 95%, black);
48
+ background: color-mix(in srgb, ${cssVar.geekblue} 68%, white);
49
49
  `,
50
50
  iconRight: css`
51
51
  transform: rotateZ(20deg) translateX(-10px);
52
- border-radius: ${token.borderRadiusLG}px;
53
- color: color-mix(in srgb, ${token.geekblue} 95%, black);
54
- background: color-mix(in srgb, ${token.geekblue} 68%, white);
52
+ border-radius: ${cssVar.borderRadiusLG};
53
+ color: color-mix(in srgb, ${cssVar.geekblue} 95%, black);
54
+ background: color-mix(in srgb, ${cssVar.geekblue} 68%, white);
55
55
  `,
56
56
  title: css`
57
57
  font-size: 20px;
@@ -66,7 +66,7 @@ const useStyles = createStyles(({ css, token }) => {
66
66
  width: 100%;
67
67
  height: 100%;
68
68
 
69
- background: ${token.colorBgMask};
69
+ background: ${cssVar.colorBgMask};
70
70
 
71
71
  transition: all 0.3s ease-in-out;
72
72
  `,
@@ -80,7 +80,6 @@ interface DragUploadProps {
80
80
 
81
81
  const DragUpload = memo<DragUploadProps>(({ enabledFiles = true, onUploadFiles }) => {
82
82
  const { t } = useTranslation('components');
83
- const { styles } = useStyles();
84
83
 
85
84
  const isDragging = useDragUpload(onUploadFiles);
86
85
 
@@ -1,8 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { type IEditor } from '@lobehub/editor';
4
- import { Alert } from '@lobehub/ui';
5
- import { Skeleton } from 'antd';
4
+ import { Alert, Skeleton } from '@lobehub/ui';
6
5
  import { memo } from 'react';
7
6
  import { useTranslation } from 'react-i18next';
8
7
  import { createStoreUpdater } from 'zustand-utils';
@@ -8,7 +8,7 @@ import {
8
8
  } from '@lobechat/const';
9
9
  import { Flexbox, Icon, Image, Modal, Tag, Text, Typography } from '@lobehub/ui';
10
10
  import { Button, Divider } from 'antd';
11
- import { createStyles, cssVar } from 'antd-style';
11
+ import { createStaticStyles, cssVar } from 'antd-style';
12
12
  import { ExternalLink, Loader2, SquareArrowOutUpRight } from 'lucide-react';
13
13
  import { memo, useMemo } from 'react';
14
14
  import { useTranslation } from 'react-i18next';
@@ -18,7 +18,7 @@ import { klavisStoreSelectors, lobehubSkillStoreSelectors } from '@/store/tool/s
18
18
  import { KlavisServerStatus } from '@/store/tool/slices/klavisStore';
19
19
  import { LobehubSkillStatus } from '@/store/tool/slices/lobehubSkillStore/types';
20
20
 
21
- const useStyles = createStyles(({ css, token }) => ({
21
+ const styles = createStaticStyles(({ css, cssVar }) => ({
22
22
  authorLink: css`
23
23
  cursor: pointer;
24
24
 
@@ -26,7 +26,7 @@ const useStyles = createStyles(({ css, token }) => ({
26
26
  gap: 4px;
27
27
  align-items: center;
28
28
 
29
- color: ${token.colorPrimary};
29
+ color: ${cssVar.colorPrimary};
30
30
 
31
31
  &:hover {
32
32
  text-decoration: underline;
@@ -39,7 +39,7 @@ const useStyles = createStyles(({ css, token }) => ({
39
39
  `,
40
40
  detailLabel: css`
41
41
  font-size: 12px;
42
- color: ${token.colorTextTertiary};
42
+ color: ${cssVar.colorTextTertiary};
43
43
  `,
44
44
  header: css`
45
45
  display: flex;
@@ -49,7 +49,7 @@ const useStyles = createStyles(({ css, token }) => ({
49
49
  padding: 16px;
50
50
  border-radius: 12px;
51
51
 
52
- background: ${token.colorFillTertiary};
52
+ background: ${cssVar.colorFillTertiary};
53
53
  `,
54
54
  icon: css`
55
55
  display: flex;
@@ -61,25 +61,25 @@ const useStyles = createStyles(({ css, token }) => ({
61
61
  height: 56px;
62
62
  border-radius: 12px;
63
63
 
64
- background: ${token.colorBgContainer};
64
+ background: ${cssVar.colorBgContainer};
65
65
  `,
66
66
  introduction: css`
67
67
  font-size: 14px;
68
68
  line-height: 1.8;
69
- color: ${token.colorText};
69
+ color: ${cssVar.colorText};
70
70
  `,
71
71
  sectionTitle: css`
72
72
  font-size: 14px;
73
73
  font-weight: 600;
74
- color: ${token.colorText};
74
+ color: ${cssVar.colorText};
75
75
  `,
76
76
  title: css`
77
77
  font-size: 18px;
78
78
  font-weight: 600;
79
- color: ${token.colorText};
79
+ color: ${cssVar.colorText};
80
80
  `,
81
81
  toolTag: css`
82
- font-family: ${token.fontFamilyCode};
82
+ font-family: ${cssVar.fontFamilyCode};
83
83
  font-size: 12px;
84
84
  `,
85
85
  toolsContainer: css`
@@ -90,7 +90,7 @@ const useStyles = createStyles(({ css, token }) => ({
90
90
  trustWarning: css`
91
91
  font-size: 12px;
92
92
  line-height: 1.6;
93
- color: ${token.colorTextTertiary};
93
+ color: ${cssVar.colorTextTertiary};
94
94
  `,
95
95
  }));
96
96
 
@@ -107,7 +107,6 @@ export interface IntegrationDetailModalProps {
107
107
 
108
108
  const IntegrationDetailModal = memo<IntegrationDetailModalProps>(
109
109
  ({ open, onClose, type, identifier, isConnecting, onConnect }) => {
110
- const { styles } = useStyles();
111
110
  const { t } = useTranslation(['plugin', 'setting']);
112
111
 
113
112
  // Get static config based on type
@@ -2,8 +2,8 @@
2
2
 
3
3
  import { BRANDING_NAME } from '@lobechat/business-const';
4
4
  import { Flexbox } from '@lobehub/ui';
5
- import { createStyles, cssVar } from 'antd-style';
6
- import { memo, useEffect } from 'react';
5
+ import { createStaticStyles, useTheme } from 'antd-style';
6
+ import { memo, useEffect, useMemo } from 'react';
7
7
  import { useSearchParams } from 'react-router-dom';
8
8
 
9
9
  import { useResourceManagerStore } from '@/app/[variants]/(main)/resource/features/store';
@@ -19,7 +19,7 @@ import UploadDock from './components/UploadDock';
19
19
 
20
20
  const ChunkDrawer = dynamic(() => import('./components/ChunkDrawer'), { ssr: false });
21
21
 
22
- const useStyles = createStyles(({ css, token }) => {
22
+ const styles = createStaticStyles(({ css, cssVar }) => {
23
23
  return {
24
24
  container: css`
25
25
  position: relative;
@@ -33,7 +33,7 @@ const useStyles = createStyles(({ css, token }) => {
33
33
  width: 100%;
34
34
  height: 100%;
35
35
 
36
- background-color: ${token.colorBgContainerSecondary};
36
+ background-color: var(--editor-overlay-bg, ${cssVar.colorBgContainer});
37
37
  `,
38
38
  pageEditorOverlay: css`
39
39
  position: absolute;
@@ -56,7 +56,7 @@ export type ResouceManagerMode = 'editor' | 'explorer' | 'page';
56
56
  * Business component, no need be reusable.
57
57
  */
58
58
  const ResourceManager = memo(() => {
59
- const { styles } = useStyles();
59
+ const theme = useTheme();
60
60
  const [, setSearchParams] = useSearchParams();
61
61
  const [mode, currentViewItemId, libraryId, setMode, setCurrentViewItemId] =
62
62
  useResourceManagerStore((s) => [
@@ -69,6 +69,13 @@ const ResourceManager = memo(() => {
69
69
 
70
70
  const currentDocument = useFileStore(documentSelectors.getDocumentById(currentViewItemId));
71
71
 
72
+ const cssVariables = useMemo<Record<string, string>>(
73
+ () => ({
74
+ '--editor-overlay-bg': theme.colorBgContainerSecondary,
75
+ }),
76
+ [theme.colorBgContainerSecondary],
77
+ );
78
+
72
79
  // Fetch specific document when switching to page mode if not already loaded
73
80
  useEffect(() => {
74
81
  if (mode === 'page' && currentViewItemId && !currentDocument) {
@@ -98,7 +105,7 @@ const ResourceManager = memo(() => {
98
105
 
99
106
  return (
100
107
  <>
101
- <Flexbox className={styles.container} height={'100%'}>
108
+ <Flexbox className={styles.container} height={'100%'} style={cssVariables}>
102
109
  {/* Explorer is always rendered to preserve its state */}
103
110
  <Explorer />
104
111
 
@@ -1,9 +1,7 @@
1
1
  import { ModelTag } from '@lobehub/icons';
2
- import { Avatar, Flexbox, Markdown } from '@lobehub/ui';
3
- import { ChatHeaderTitle } from '@lobehub/ui/chat';
2
+ import { Avatar, Flexbox, Markdown, Text } from '@lobehub/ui';
4
3
  import { cx } from 'antd-style';
5
4
  import { memo } from 'react';
6
- import { useTranslation } from 'react-i18next';
7
5
 
8
6
  import { ProductLogo } from '@/components/Branding';
9
7
  import PluginTag from '@/features/PluginTag';
@@ -19,21 +17,17 @@ import { type FieldType } from './type';
19
17
 
20
18
  const Preview = memo<FieldType & { title?: string }>(
21
19
  ({ title, withSystemRole, withBackground, withFooter, widthMode }) => {
22
- const [model, plugins, systemRole, isInbox, description, avatar, backgroundColor] =
23
- useAgentStore((s) => [
24
- agentSelectors.currentAgentModel(s),
25
- agentSelectors.displayableAgentPlugins(s),
26
- agentSelectors.currentAgentSystemRole(s),
27
- builtinAgentSelectors.isInboxAgent(s),
28
- agentSelectors.currentAgentDescription(s),
29
- agentSelectors.currentAgentAvatar(s),
30
- agentSelectors.currentAgentBackgroundColor(s),
31
- ]);
32
-
33
- const { t } = useTranslation('chat');
20
+ const [model, plugins, systemRole, isInbox, avatar, backgroundColor] = useAgentStore((s) => [
21
+ agentSelectors.currentAgentModel(s),
22
+ agentSelectors.displayableAgentPlugins(s),
23
+ agentSelectors.currentAgentSystemRole(s),
24
+ builtinAgentSelectors.isInboxAgent(s),
25
+ agentSelectors.currentAgentDescription(s),
26
+ agentSelectors.currentAgentAvatar(s),
27
+ agentSelectors.currentAgentBackgroundColor(s),
28
+ ]);
34
29
 
35
30
  const displayTitle = isInbox ? 'Lobe AI' : title;
36
- const displayDesc = isInbox ? t('inbox.desc') : description;
37
31
 
38
32
  return (
39
33
  <div
@@ -50,24 +44,21 @@ const Preview = memo<FieldType & { title?: string }>(
50
44
  gap={16}
51
45
  >
52
46
  <div className={styles.header}>
53
- <Flexbox align={'flex-start'} gap={12} horizontal>
47
+ <Flexbox align={'center'} gap={12} horizontal>
54
48
  <Avatar
55
49
  avatar={avatar}
56
50
  background={backgroundColor}
57
51
  shape={'square'}
58
- size={40}
52
+ size={28}
59
53
  title={title}
60
54
  />
61
- <ChatHeaderTitle
62
- desc={displayDesc}
63
- tag={
64
- <Flexbox gap={4} horizontal>
65
- <ModelTag model={model} />
66
- {plugins?.length > 0 && <PluginTag plugins={plugins} />}
67
- </Flexbox>
68
- }
69
- title={displayTitle}
70
- />
55
+ <Text fontSize={16} strong>
56
+ {displayTitle}
57
+ </Text>
58
+ <Flexbox gap={4} horizontal>
59
+ <ModelTag model={model} />
60
+ {plugins?.length > 0 && <PluginTag plugins={plugins} />}
61
+ </Flexbox>
71
62
  </Flexbox>
72
63
  {withSystemRole && systemRole && (
73
64
  <div className={styles.role}>
@@ -12,7 +12,7 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
12
12
  background-size: 120% 120%;
13
13
  `,
14
14
  container: css`
15
- background: ${cssVar.colorBgLayout};
15
+ background: ${cssVar.colorBgContainer};
16
16
  `,
17
17
  container_withBackground_true: css`
18
18
  overflow: hidden;
@@ -25,8 +25,10 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
25
25
  `,
26
26
  header: css`
27
27
  margin-block-end: -24px;
28
- padding: 16px;
28
+ padding-block: 16px;
29
+ padding-inline: 24px;
29
30
  border-block-end: 1px solid ${cssVar.colorBorder};
31
+
30
32
  background: ${cssVar.colorBgContainer};
31
33
  `,
32
34
  role: css`
@@ -60,7 +60,11 @@ const ShareModal = memo<ModalProps>(({ onCancel, open }) => {
60
60
  title={t('share', { ns: 'common' })}
61
61
  width={'min(90vw, 1024px)'}
62
62
  >
63
- <Flexbox gap={isMobile ? 8 : 24} style={{ overflow: 'hidden', position: 'relative' }}>
63
+ <Flexbox
64
+ gap={isMobile ? 8 : 24}
65
+ height={'100%'}
66
+ style={{ overflow: 'hidden', position: 'relative' }}
67
+ >
64
68
  <Segmented
65
69
  block
66
70
  onChange={(value) => setTab(value as Tab)}
@@ -5,6 +5,7 @@ export { styles as containerStyles } from './useContainerStyles';
5
5
 
6
6
  export const styles = createStaticStyles(({ css, cssVar }) => ({
7
7
  body: css`
8
+ height: 100%;
8
9
  ${responsive.sm} {
9
10
  padding-block-end: 68px;
10
11
  }
@@ -14,7 +14,7 @@ export const styles = createStaticStyles(({ css, cssVar }) => ({
14
14
  border: 1px solid ${cssVar.colorBorder};
15
15
  border-radius: ${cssVar.borderRadiusLG};
16
16
 
17
- background: ${cssVar.colorBgLayout};
17
+ background: ${cssVar.colorBgContainer};
18
18
 
19
19
  /* stylelint-disable selector-class-pattern */
20
20
  .react-pdf__Document *,
@@ -1,7 +1,15 @@
1
1
  'use client';
2
2
 
3
- import { Button, Flexbox, Popover, copyToClipboard, usePopoverContext } from '@lobehub/ui';
4
- import { App, Divider, Select, Skeleton, Typography } from 'antd';
3
+ import {
4
+ Button,
5
+ Flexbox,
6
+ Popover,
7
+ Skeleton,
8
+ Text,
9
+ copyToClipboard,
10
+ usePopoverContext,
11
+ } from '@lobehub/ui';
12
+ import { App, Divider, Select } from 'antd';
5
13
  import { ExternalLinkIcon, LinkIcon, LockIcon } from 'lucide-react';
6
14
  import { type ReactNode, memo, useCallback, useEffect, useRef, useState } from 'react';
7
15
  import { useTranslation } from 'react-i18next';
@@ -12,7 +20,7 @@ import { useIsMobile } from '@/hooks/useIsMobile';
12
20
  import { topicService } from '@/services/topic';
13
21
  import { useChatStore } from '@/store/chat';
14
22
 
15
- import { useStyles } from './style';
23
+ import { styles } from './style';
16
24
 
17
25
  type Visibility = 'private' | 'link';
18
26
 
@@ -23,7 +31,6 @@ interface SharePopoverContentProps {
23
31
  const SharePopoverContent = memo<SharePopoverContentProps>(({ onOpenModal }) => {
24
32
  const { t } = useTranslation('chat');
25
33
  const { message, modal } = App.useApp();
26
- const { styles } = useStyles();
27
34
  const [updating, setUpdating] = useState(false);
28
35
  const { close } = usePopoverContext();
29
36
  const containerRef = useRef<HTMLDivElement>(null);
@@ -103,7 +110,7 @@ const SharePopoverContent = memo<SharePopoverContentProps>(({ onOpenModal }) =>
103
110
  if (isLoading || !shareInfo) {
104
111
  return (
105
112
  <Flexbox className={styles.container} gap={16}>
106
- <Typography.Text strong>{t('share', { ns: 'common' })}</Typography.Text>
113
+ <Text strong>{t('share', { ns: 'common' })}</Text>
107
114
  <Skeleton active paragraph={{ rows: 2 }} />
108
115
  </Flexbox>
109
116
  );
@@ -135,10 +142,10 @@ const SharePopoverContent = memo<SharePopoverContentProps>(({ onOpenModal }) =>
135
142
 
136
143
  return (
137
144
  <Flexbox className={styles.container} gap={12} ref={containerRef}>
138
- <Typography.Text strong>{t('shareModal.popover.title')}</Typography.Text>
145
+ <Text strong>{t('shareModal.popover.title')}</Text>
139
146
 
140
147
  <Flexbox gap={4}>
141
- <Typography.Text type="secondary">{t('shareModal.popover.visibility')}</Typography.Text>
148
+ <Text type="secondary">{t('shareModal.popover.visibility')}</Text>
142
149
  <Select
143
150
  disabled={updating}
144
151
  getPopupContainer={() => containerRef.current || document.body}
@@ -164,9 +171,9 @@ const SharePopoverContent = memo<SharePopoverContentProps>(({ onOpenModal }) =>
164
171
  />
165
172
  </Flexbox>
166
173
 
167
- <Typography.Text className={styles.hint} type="secondary">
174
+ <Text className={styles.hint} type="secondary">
168
175
  {getVisibilityHint()}
169
- </Typography.Text>
176
+ </Text>
170
177
 
171
178
  <Divider style={{ margin: '4px 0' }} />
172
179
 
@@ -1,6 +1,6 @@
1
- import { createStyles } from 'antd-style';
1
+ import { createStaticStyles } from 'antd-style';
2
2
 
3
- export const useStyles = createStyles(({ css }) => ({
3
+ export const styles = createStaticStyles(({ css }) => ({
4
4
  container: css`
5
5
  padding: 16px;
6
6
  `,
@@ -17,10 +17,10 @@ import { useToolStore } from '@/store/tool';
17
17
  import { mcpStoreSelectors, pluginSelectors } from '@/store/tool/selectors';
18
18
  import { type DiscoverMcpItem } from '@/types/discover';
19
19
 
20
- import { useItemStyles } from '../style';
20
+ import { itemStyles } from '../style';
21
21
 
22
22
  const Item = memo<DiscoverMcpItem>(({ name, description, icon, identifier }) => {
23
- const { styles } = useItemStyles();
23
+ const styles = itemStyles;
24
24
  const { t } = useTranslation('plugin');
25
25
  const { modal } = App.useApp();
26
26
  const [detailOpen, setDetailOpen] = useState(false);