@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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.4.55
4
+
5
+ ### Patch Changes
6
+
7
+ - e08565d: update nav
8
+ - Updated dependencies [e08565d]
9
+ - @bbki.ng/ui@0.1.29
10
+
3
11
  ## 5.4.54
4
12
 
5
13
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "5.4.54",
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.28"
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 { Button, Article, Link } from '@bbki.ng/ui';
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
- : data.map((p: any) => ({
30
- name: p.title,
31
- to: p.title,
32
- children: p.title,
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 classNames from 'classnames';
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
- {scrolled ? (
83
- <Button
84
- className="mt-16"
85
- transparent={!showScrollBtn}
86
- onClick={() => {
87
- bbMsgHistoryRef.current?.scrollToBottom();
88
- }}
89
- >
90
- <ArrowDownIcon show={showScrollBtn} />
91
- </Button>
92
- ) : null}
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
  };
@@ -0,0 +1,6 @@
1
+ import { Location } from 'react-router-dom';
2
+
3
+ export interface IBlogContext {
4
+ gloalLoading: boolean;
5
+ location: Location;
6
+ }
@@ -1,6 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
-
3
- export type MdxArticle = {
4
- default: FunctionComponent<any>;
5
- meta: any;
6
- };
@@ -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
- }
@@ -1,4 +0,0 @@
1
- export enum cusdisEvent {
2
- COMMENTS_LOADED = 'COMMENTS_LOADED',
3
- COMMENT_SENT = 'COMMENT_SENT',
4
- }
@@ -1,15 +0,0 @@
1
- export enum ossProcessType {
2
- THUMBNAIL = 'thumbnail',
3
- WEBP = 'webp',
4
- NULL = 'null',
5
- oWEBP = 'owebp',
6
- PROG = 'prog',
7
- }
8
-
9
- export interface UploadResult {
10
- name: string;
11
- res: {
12
- status: number;
13
- };
14
- url: string;
15
- }
@@ -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
- }