Compare commits

..

8 Commits

Author SHA1 Message Date
yu.kuai fe60e2924d fix: 发布人员 icon 调整大小 2025-11-05 10:55:26 +08:00
yu.kuai edb7e01085 feat: 历史版本展示 markdown 文本 2025-11-05 10:40:41 +08:00
yu.kuai a4679f0ada feat: 前台支持展示更新人/创建人 2025-11-05 10:40:41 +08:00
yu.kuai 5e93e9da73 feat: 文档显示人员操作记录 2025-11-05 10:40:41 +08:00
xiaomakuaiz d630567a3c
Merge pull request #1463 from guanweiwang/pref/landing
pref: 优化主题
2025-11-04 20:03:09 +08:00
Gavan 20a0a4ded4 style: 样式问题 2025-11-04 19:56:44 +08:00
Gavan 38383b983d pref: 美化样式 2025-11-04 19:46:36 +08:00
Gavan 030a8ac25d pref: 优化主题 2025-11-04 19:13:31 +08:00
8 changed files with 86 additions and 32 deletions

View File

@ -385,14 +385,14 @@ const ThemeWrapper = ({ children }: { children: React.ReactNode }) => {
const { appPreviewData } = useAppSelector(state => state.config);
const theme = useMemo(() => {
const themeName =
appPreviewData?.settings?.web_app_landing_theme?.name || 'blue';
return createTheme(
// @ts-expect-error themeOptions is not typed
{
...themeOptions[0],
palette:
THEME_TO_PALETTE[
appPreviewData?.settings?.web_app_landing_theme?.name || 'blue'
].palette,
THEME_TO_PALETTE[themeName]?.palette || THEME_TO_PALETTE.blue.palette,
},
...themeOptions.slice(1),
);

View File

@ -269,7 +269,9 @@ const ComponentBar = ({
<Stack sx={{ pr: '20px', marginTop: '15px' }}>
<Select
value={
appPreviewData.settings?.web_app_landing_theme?.name || 'blue'
THEME_TO_PALETTE[
appPreviewData.settings?.web_app_landing_theme?.name || 'blue'
]?.value || 'blue'
}
renderValue={value => {
return THEME_TO_PALETTE[value]?.label;

View File

@ -40,6 +40,8 @@ const History = () => {
);
const [characterCount, setCharacterCount] = useState(0);
const [isMarkdown, setIsMarkdown] = useState(false);
const editorRef = useTiptap({
content: '',
editable: false,
@ -49,10 +51,26 @@ const History = () => {
},
});
const editorMdRef = useTiptap({
content: '',
contentType: 'markdown',
editable: false,
immediatelyRender: true,
onUpdate: ({ editor }) => {
setCharacterCount((editor.storage as any).characterCount.characters());
},
});
const getDetail = (v: DomainNodeReleaseListItem) => {
getApiProV1NodeReleaseDetail({ id: v.id!, kb_id: kb_id! }).then(res => {
setCurNode(res);
editorRef.setContent(res.content || '');
if (res.meta?.content_type === 'md') {
setIsMarkdown(true);
editorMdRef.setContent(res.content || '');
} else {
setIsMarkdown(false);
editorRef.setContent(res.content || '');
}
window.scrollTo({ top: 0, behavior: 'smooth' });
});
};
@ -207,7 +225,7 @@ const History = () => {
gap={0.5}
sx={{ cursor: 'pointer' }}
>
<Icon type='icon-tianjiawendang' />
<Icon type='icon-tianjiawendang' sx={{ fontSize: 9 }} />
{curNode.editor_account}
</Stack>
</Tooltip>
@ -249,13 +267,6 @@ const History = () => {
</Box>
</Box>
)}
{/* <EditorThemeProvider
colors={{ light }}
mode='light'
theme={{
components: componentStyleOverrides,
}}
> */}
<Box
sx={{
'.tiptap': {
@ -267,9 +278,12 @@ const History = () => {
},
}}
>
<Editor editor={editorRef.editor} />
{isMarkdown ? (
<Editor editor={editorMdRef.editor} />
) : (
<Editor editor={editorRef.editor} />
)}
</Box>
{/* </EditorThemeProvider> */}
</Box>
)}
</Box>

View File

@ -19,7 +19,9 @@ const HomePage = () => {
cssVariables: {
cssVarPrefix: 'welcome',
},
palette: THEME_TO_PALETTE[themeMode].palette,
palette:
THEME_TO_PALETTE[themeMode]?.palette ||
THEME_TO_PALETTE['blue'].palette,
typography: {
fontFamily: 'var(--font-gilory), PingFang SC, sans-serif',
},

View File

@ -46,11 +46,11 @@ export const THEME_LIST = [
value: 'darkDeepForest',
palette: darkDeepForestPalette,
},
{
label: '深邃黑',
value: 'white',
palette: whitePalette,
},
// {
// label: '深邃黑',
// value: 'white',
// palette: whitePalette,
// },
{
label: '电光蓝',
value: 'electricBlue',

View File

@ -18,9 +18,10 @@ interface BlockGridProps {
}
const StyledBlockGridItem = styled(Stack)(({ theme }) => ({
aspectRatio: '1 / 1',
position: 'relative',
border: `1px solid ${alpha(theme.palette.text.primary, 0.15)}`,
borderRadius: '10px',
padding: theme.spacing(2),
padding: theme.spacing(1),
boxShadow: `0px 5px 20px 0px ${alpha(theme.palette.text.primary, 0.06)}`,
transition: 'all 0.2s ease',
'&:hover': {
@ -44,14 +45,22 @@ export const StyledBlockGridItemImg = styled('img')(({ theme }) => ({
}));
const StyledBlockGridItemTitle = styled('div')(({ theme }) => ({
position: 'absolute',
bottom: '24px',
left: '50%',
maxWidth: 'calc(100% - 24px)',
transform: 'translateX(-50%)',
padding: theme.spacing(0.5, 1),
overflow: 'hidden',
textOverflow: 'ellipsis',
flexShrink: 0,
whiteSpace: 'nowrap',
fontSize: 16,
fontSize: 14,
textAlign: 'center',
fontWeight: 700,
color: theme.palette.text.primary,
color: theme.palette.background.default,
backgroundColor: alpha(theme.palette.text.primary, 0.5),
borderRadius: '6px',
}));
// 单个卡片组件,带动画效果

View File

@ -68,7 +68,7 @@ const StyledSwiperSlideDesc = styled('div')(({ theme }) => ({
fontSize: 14,
fontWeight: 400,
color: theme.palette.background.default,
borderRadius: '12px',
borderRadius: '6px',
overflow: 'hidden',
whiteSpace: 'nowrap',
zIndex: 0,
@ -113,7 +113,7 @@ const StyledTabs = styled(Tabs)(({ theme }) => ({
const StyledTab = styled(Tab)(({ theme }) => ({
minHeight: 'auto',
padding: theme.spacing(1, 2),
borderRadius: '10px',
borderRadius: '6px',
backgroundColor: theme.palette.background.default,
color: theme.palette.text.secondary,
fontSize: 14,

View File

@ -18,8 +18,8 @@ interface ImgTextProps {
const StyledImgTextItem = styled(Stack)(({ theme }) => ({}));
export const StyledImgTextItemImg = styled('img')(({ theme }) => ({
maxWidth: 350,
maxHeight: 350,
maxWidth: '100%',
maxHeight: '100%',
width: '100%',
height: '100%',
objectFit: 'cover',
@ -28,7 +28,7 @@ export const StyledImgTextItemImg = styled('img')(({ theme }) => ({
}));
const StyledImgTextItemTitle = styled('h3')(({ theme }) => ({
fontSize: 20,
fontSize: 24,
fontWeight: 700,
color: theme.palette.text.primary,
}));
@ -73,7 +73,7 @@ const ImgText: React.FC<ImgTextProps> = React.memo(
<StyledTopicBox>
<StyledTopicTitle ref={titleRef}>{title}</StyledTopicTitle>
<StyledImgTextItem
gap={mobile ? 4 : { xs: 4, sm: 6, md: 38 }}
gap={mobile ? 4 : { xs: 4, sm: 6, md: 16 }}
direction={
mobile
? 'column-reverse'
@ -96,9 +96,36 @@ const ImgText: React.FC<ImgTextProps> = React.memo(
gap={1}
sx={{ width: '100%' }}
ref={cardRightRef as React.Ref<HTMLDivElement>}
alignItems={
mobile
? 'flex-start'
: direction === 'row'
? 'flex-start'
: 'flex-end'
}
>
<StyledImgTextItemTitle>{item.name}</StyledImgTextItemTitle>
<StyledImgTextItemSummary>{item.desc}</StyledImgTextItemSummary>
<StyledImgTextItemTitle
sx={{
textAlign: mobile
? 'left'
: direction === 'row'
? 'left'
: 'right',
}}
>
{item.name}
</StyledImgTextItemTitle>
<StyledImgTextItemSummary
sx={{
textAlign: mobile
? 'left'
: direction === 'row'
? 'left'
: 'right',
}}
>
{item.desc}
</StyledImgTextItemSummary>
</Stack>
</StyledImgTextItem>
</StyledTopicBox>