@bbki.ng/site 1.1.24 → 1.1.26

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,9 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 1.1.26
4
+
5
+ ## 1.1.25
6
+
3
7
  ## 1.1.24
4
8
 
5
9
  ## 1.1.23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "1.1.24",
3
+ "version": "1.1.26",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -16,7 +16,7 @@
16
16
  "url": "git+https://github.com/bbbottle/bbki.ng.git"
17
17
  },
18
18
  "dependencies": {
19
- "@bbki.ng/components": "workspace:2.1.42",
19
+ "@bbki.ng/components": "workspace:2.1.43",
20
20
  "@supabase/supabase-js": "^1.30.6",
21
21
  "classnames": "2.3.1",
22
22
  "react": "^18.0.0",
@@ -28,7 +28,7 @@
28
28
  "swr": "^1.2.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@bbki.ng/stylebase": "workspace:0.0.21",
31
+ "@bbki.ng/stylebase": "workspace:0.0.22",
32
32
  "@mdx-js/mdx": "2.0.0-next.9",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "@mdx-js/rollup": "3.0.0",
@@ -0,0 +1,8 @@
1
+ export default () => {
2
+ // @ts-ignore
3
+ const appVer = GLOBAL_BBKING_VERSION;
4
+ const tagUrl = `https://github.com/bbbottle/bottle/releases/tag/@bbki.ng/site@${appVer}`;
5
+ console.log(appVer, tagUrl);
6
+
7
+ return null;
8
+ };
@@ -1,4 +1,3 @@
1
- import React from "react";
2
1
  import { useNavigate } from "react-router-dom";
3
2
  import { useHotkeys } from "react-hotkeys-hook";
4
3
  import { GITHUB_REPO_ADDRESS, ROUTES } from "@/constants";
@@ -14,6 +13,7 @@ enum HotKeys {
14
13
  b = "b",
15
14
  h = "h",
16
15
  s = "s",
16
+ l = "l",
17
17
  T = "shift+t",
18
18
  }
19
19
 
@@ -22,6 +22,7 @@ const KEY_ROUTES = [
22
22
  { key: HotKeys.c, route: ROUTES.CONTENT },
23
23
  { key: HotKeys.h, route: ROUTES.HELP },
24
24
  { key: HotKeys.t, route: ROUTES.TAGS },
25
+ { key: HotKeys.l, route: ROUTES.LOGIN },
25
26
  ];
26
27
 
27
28
  export const HotKeyNav = (props: any) => {
@@ -2,6 +2,7 @@ import { toast } from "sonner";
2
2
 
3
3
  // @ts-ignore
4
4
  import { useRegisterSW } from "virtual:pwa-register/react";
5
+ import { useEffect, useState } from "react";
5
6
 
6
7
  export const ReloadPrompt = () => {
7
8
  const {
@@ -16,8 +17,17 @@ export const ReloadPrompt = () => {
16
17
  },
17
18
  });
18
19
 
20
+ const [time, setTime] = useState(new Date());
21
+
22
+ useEffect(() => {
23
+ const interval = setInterval(() => {
24
+ setTime(new Date());
25
+ }, 1000);
26
+
27
+ return () => clearInterval(interval);
28
+ }, []);
29
+
19
30
  if (!needRefresh) {
20
- console.log("无需更新");
21
31
  return null;
22
32
  }
23
33
 
@@ -3,6 +3,7 @@ export const ROUTES = {
3
3
  CONTENT: "/blog",
4
4
  HELP: "/blog/说明书",
5
5
  TAGS: "/tags",
6
+ LOGIN: "/login",
6
7
  BLOG: "/blog",
7
8
  };
8
9
 
package/src/main.tsx CHANGED
@@ -6,6 +6,7 @@ import { ReloadPrompt } from "@/components";
6
6
  import "@bbki.ng/components/style";
7
7
  import App from "./app";
8
8
  import "./main.css";
9
+ import Logger from "@/components/Logger";
9
10
 
10
11
  const container = document.getElementById("root") as Element;
11
12
  const root = createRoot(container);
@@ -15,6 +16,7 @@ root.render(
15
16
  <Router>
16
17
  <App />
17
18
  <Toaster />
19
+ <Logger />
18
20
  <ReloadPrompt />
19
21
  </Router>
20
22
  </React.StrictMode>
@@ -1,28 +1,24 @@
1
1
  import React from "react";
2
2
  import { CenterLinkList } from "@/components";
3
- import { Footer } from "@/components/Footer";
4
3
 
5
4
  export const Cover = (props: { className: string }) => {
6
5
  return (
7
- <div className="w-fit m-auto">
8
- <CenterLinkList
9
- links={[
10
- {
11
- to: "/projects",
12
- name: "cd ./projects",
13
- },
14
- {
15
- to: "/blog",
16
- name: "cd ./blog",
17
- },
18
- {
19
- to: "/now",
20
- name: "cd ./now",
21
- },
22
- ]}
23
- title=" "
24
- />
25
- <Footer />
26
- </div>
6
+ <CenterLinkList
7
+ links={[
8
+ {
9
+ to: "/projects",
10
+ name: "cd ./projects",
11
+ },
12
+ {
13
+ to: "/blog",
14
+ name: "cd ./blog",
15
+ },
16
+ {
17
+ to: "/now",
18
+ name: "cd ./now",
19
+ },
20
+ ]}
21
+ title=" "
22
+ />
27
23
  );
28
24
  };
package/vite.config.js CHANGED
@@ -60,7 +60,7 @@ export default defineConfig({
60
60
  "Logo.svg",
61
61
  ],
62
62
  devOptions: {
63
- enabled: true,
63
+ enabled: false,
64
64
  /* other options */
65
65
  },
66
66
  workbox: {