@bbki.ng/site 5.4.54 → 5.4.55
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.
- package/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/src/blog/components/article/index.tsx +1 -2
- package/src/blog/hooks/use_blog_context.ts +14 -0
- package/src/blog/hooks/use_posts.ts +12 -5
- package/src/blog/pages/streaming/index.tsx +13 -12
- package/src/blog/types/blog-context.ts +6 -0
- package/src/blog/types/articles.ts +0 -6
- package/src/blog/types/color.ts +0 -21
- package/src/blog/types/cusdis.ts +0 -4
- package/src/blog/types/oss.ts +0 -15
- package/src/blog/types/photo.ts +0 -17
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/site",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.55",
|
|
4
4
|
"description": "code behind bbki.ng",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react-dom": "^18.0.0",
|
|
15
15
|
"react-router-dom": "6",
|
|
16
16
|
"swr": "^2.2.5",
|
|
17
|
-
"@bbki.ng/ui": "0.1.
|
|
17
|
+
"@bbki.ng/ui": "0.1.29"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@eslint/compat": "^1.0.0",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React, { ReactElement } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { ROUTES } from '@/constants';
|
|
2
|
+
import { Article, Link } from '@bbki.ng/ui';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import { useNavigate } from 'react-router-dom';
|
|
6
5
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GlobalLoadingContext } from '@/context/global_loading_state_provider';
|
|
2
|
+
import { IBlogContext } from '@/types/blog-context';
|
|
3
|
+
import { useContext } from 'react';
|
|
4
|
+
import { useLocation } from 'react-router-dom';
|
|
5
|
+
|
|
6
|
+
export const useBlogContext = (): IBlogContext => {
|
|
7
|
+
const globalLoading = useContext(GlobalLoadingContext);
|
|
8
|
+
const location = useLocation();
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
gloalLoading: globalLoading.isLoading,
|
|
12
|
+
location,
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -26,11 +26,18 @@ export const usePosts = (name: string = '', suspense?: boolean) => {
|
|
|
26
26
|
const titleList =
|
|
27
27
|
isLoading || error || !data
|
|
28
28
|
? []
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
: [
|
|
30
|
+
...data.map((p: any) => ({
|
|
31
|
+
name: p.title,
|
|
32
|
+
to: p.title,
|
|
33
|
+
children: p.title,
|
|
34
|
+
})),
|
|
35
|
+
{
|
|
36
|
+
name: 'cd ~',
|
|
37
|
+
to: '/',
|
|
38
|
+
children: 'cd ~',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
34
41
|
|
|
35
42
|
useEffect(() => {
|
|
36
43
|
setIsLoading(isLoading);
|
|
@@ -3,8 +3,9 @@ import { useStreaming, StreamingItem } from '@/hooks/use_streaming';
|
|
|
3
3
|
import { formatStreamingData } from '@/utils/streaming';
|
|
4
4
|
import { Button, Panel } from '@bbki.ng/ui';
|
|
5
5
|
import { useScrollBtnVisibility } from './useScrollBtnVisibility';
|
|
6
|
-
import
|
|
6
|
+
import { Link } from '@bbki.ng/ui';
|
|
7
7
|
import { ArrowDownIcon } from './arrow-down';
|
|
8
|
+
import classNames from 'classnames';
|
|
8
9
|
|
|
9
10
|
// Extend JSX IntrinsicElements for the web component
|
|
10
11
|
declare global {
|
|
@@ -79,17 +80,17 @@ const Streaming = () => {
|
|
|
79
80
|
{formattedData}
|
|
80
81
|
</bb-msg-history>
|
|
81
82
|
</Panel>
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
<Link
|
|
84
|
+
className={classNames('w-fit relative opacity-0 transition-all duration-300 mt-16', {
|
|
85
|
+
'opacity-100': scrolled,
|
|
86
|
+
'opacity-0': showScrollBtn,
|
|
87
|
+
'pointer-events-none': showScrollBtn || !scrolled,
|
|
88
|
+
})}
|
|
89
|
+
to="/"
|
|
90
|
+
style={{ left: -4 }}
|
|
91
|
+
>
|
|
92
|
+
cd ..
|
|
93
|
+
</Link>
|
|
93
94
|
</>
|
|
94
95
|
);
|
|
95
96
|
};
|
package/src/blog/types/color.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export enum TextColors {
|
|
2
|
-
GRAY = 'text-gray-400',
|
|
3
|
-
RED = 'text-red-500',
|
|
4
|
-
BLUE = 'text-blue-600',
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export enum BgColors {
|
|
8
|
-
WHITE_GRAY = 'bg-gray-50',
|
|
9
|
-
LIGHT_GRAY = 'bg-gray-100',
|
|
10
|
-
GRAY = 'bg-gray-400',
|
|
11
|
-
RED = 'bg-red-500',
|
|
12
|
-
BLUE = 'bg-blue-600',
|
|
13
|
-
LIGHT_BLUE = 'bg-blue-300',
|
|
14
|
-
WHITE_BLUE = 'bg-blue-100',
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export enum HoveredTextColors {
|
|
18
|
-
GRAY = 'hover:bg-gray-100',
|
|
19
|
-
RED = 'hover:bg-red-100',
|
|
20
|
-
BLUR = 'hover:bg-blue-100',
|
|
21
|
-
}
|
package/src/blog/types/cusdis.ts
DELETED
package/src/blog/types/oss.ts
DELETED
package/src/blog/types/photo.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ossProcessType } from '@/types/oss';
|
|
2
|
-
|
|
3
|
-
export interface Photo {
|
|
4
|
-
src: string;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
processType?: ossProcessType;
|
|
8
|
-
avgColor?: string;
|
|
9
|
-
thumbnailSrc?: string;
|
|
10
|
-
renderedWidth?: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export interface PhotoProject {
|
|
14
|
-
name: string;
|
|
15
|
-
description?: string;
|
|
16
|
-
images: Photo[];
|
|
17
|
-
}
|