@bbki.ng/site 5.0.6 → 5.1.1

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,15 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.1.1
4
+
5
+ ## 5.1.0
6
+
7
+ ## 5.0.9
8
+
9
+ ## 5.0.8
10
+
11
+ ## 5.0.7
12
+
3
13
  ## 5.0.6
4
14
 
5
15
  ## 5.0.5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "5.0.6",
3
+ "version": "5.1.1",
4
4
  "description": "code behind bbki.ng",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -20,7 +20,7 @@
20
20
  "sonner": "1.4.0",
21
21
  "swr": "^2.2.5",
22
22
  "vaul": "1.1.2",
23
- "@bbki.ng/components": "5.0.3",
23
+ "@bbki.ng/components": "5.1.1",
24
24
  "@bbki.ng/stylebase": "3.0.0"
25
25
  },
26
26
  "devDependencies": {
package/src/blog/app.tsx CHANGED
@@ -25,6 +25,7 @@ import { BBContext } from "@/context/bbcontext";
25
25
  import { useClipboardToPost } from "@/hooks/use_clipboard_to_post";
26
26
  import { useSharedStringToPost } from "@/hooks/use_shared_string_to_post";
27
27
  import { ThreeColLayout, ErrorBoundary } from "@bbki.ng/components";
28
+ import { Version } from "./components/version";
28
29
 
29
30
  const Layout = () => {
30
31
  const { isLoading, isFontLoading } = useContext(GlobalLoadingContext);
@@ -5,7 +5,5 @@ export default () => {
5
5
 
6
6
  console.log(appVer, tagUrl);
7
7
 
8
- console.log("test update");
9
-
10
8
  return null;
11
9
  };
@@ -0,0 +1,14 @@
1
+ import { Tag } from "@bbki.ng/components";
2
+ import React from "react";
3
+
4
+ export const Version = ({ className }: { className?: string }) => {
5
+ // @ts-ignore
6
+ const appVer = GLOBAL_BBKING_VERSION;
7
+ const tagUrl = `https://github.com/bbbottle/bottle/releases/tag/@bbki.ng/site@${appVer}`;
8
+
9
+ return (
10
+ <Tag to={tagUrl} external prefix="v" className={className}>
11
+ {appVer}
12
+ </Tag>
13
+ );
14
+ };
@@ -31,7 +31,7 @@ export { MySuspense } from "./my_suspense";
31
31
 
32
32
  export const CenterLinkList = (props: any) => {
33
33
  return (
34
- <div className="flex justify-center relative p-16">
34
+ <div className="flex justify-center relative p-16 h-full">
35
35
  <LinkList {...props} />
36
36
  <BlurCover status={props.loading ? "show" : "silent"} />
37
37
  </div>
@@ -1,3 +1,4 @@
1
+ import { useEffect } from "react";
1
2
  import { toast } from "sonner";
2
3
 
3
4
  // @ts-ignore
@@ -19,32 +20,32 @@ export const ReloadPrompt = () => {
19
20
  },
20
21
  });
21
22
 
22
- if (!needRefresh) {
23
- return null;
24
- }
25
-
26
- toast("", {
27
- description: "发现新版本,是否更新?",
28
- duration: 10000,
29
- position: "bottom-right",
30
- actionButtonStyle: {
31
- backgroundColor: "#fff",
32
- color: "rgb(37,99,235)",
33
- },
34
- action: {
35
- label: "是",
36
- onClick: () => {
37
- updateServiceWorker(false).then(() => {
38
- // @ts-ignore
39
- toast("", {
40
- description: `已更新`,
41
- position: "bottom-right",
42
- });
43
- setNeedRefresh(false);
44
- });
45
- },
46
- },
47
- });
23
+ useEffect(() => {
24
+ if (needRefresh) {
25
+ toast("", {
26
+ description: "发现新版本,是否更新?",
27
+ duration: 10000,
28
+ position: "bottom-right",
29
+ actionButtonStyle: {
30
+ backgroundColor: "#fff",
31
+ color: "rgb(37,99,235)",
32
+ },
33
+ action: {
34
+ label: "是",
35
+ onClick: () => {
36
+ updateServiceWorker(false).then(() => {
37
+ // @ts-ignore
38
+ toast("", {
39
+ description: `已更新`,
40
+ position: "bottom-right",
41
+ });
42
+ setNeedRefresh(false);
43
+ });
44
+ },
45
+ },
46
+ });
47
+ }
48
+ }, [needRefresh]);
48
49
 
49
50
  return null;
50
51
  };
@@ -3,7 +3,6 @@ import { createRoot } from "react-dom/client";
3
3
  import { Toaster } from "sonner";
4
4
  import { BrowserRouter as Router } from "react-router-dom";
5
5
  import { ReloadPrompt } from "@/components";
6
- // import "@bbki.ng/components/style";
7
6
  import App from "./app";
8
7
  import "./main.css";
9
8
  import Logger from "@/components/Logger";
@@ -16,7 +15,7 @@ export const RenderBlogInto = (ele: Element) => {
16
15
  <App />
17
16
  <Toaster />
18
17
  <Logger />
19
- {/*<ReloadPrompt />*/}
18
+ <ReloadPrompt />
20
19
  </Router>
21
20
  </React.StrictMode>
22
21
  );
@@ -2,6 +2,7 @@ import React, { useContext } from "react";
2
2
  import { CenterLinkList } from "@/components";
3
3
  import { EffectLayer } from "@/components/effect-layer/EffectLayer";
4
4
  import { GlobalRoutesContext } from "@/context/global_routes_provider";
5
+ import { Version } from "@/components/version";
5
6
 
6
7
  export const Cover = (props: { className?: string }) => {
7
8
  const globalRouteCtx = useContext(GlobalRoutesContext);
@@ -11,6 +12,7 @@ export const Cover = (props: { className?: string }) => {
11
12
  return (
12
13
  <>
13
14
  <CenterLinkList
15
+ spaceBetween
14
16
  className="select-none"
15
17
  links={[
16
18
  // {
@@ -24,6 +26,7 @@ export const Cover = (props: { className?: string }) => {
24
26
  ...pluginEntry,
25
27
  ]}
26
28
  title=""
29
+ footer={<Version className="" />}
27
30
  />
28
31
  </>
29
32
  );
@@ -20,7 +20,6 @@ const ArticleMap: TArticleMap = {};
20
20
 
21
21
  MdxArticleList.forEach((article: unknown) => {
22
22
  const { meta, default: component } = article as MdxArticle;
23
- console.log(meta);
24
23
  const dateStr = meta.created_at
25
24
  ? meta.created_at.toISOString().split("T")[0]
26
25
  : "";
@@ -56,8 +55,6 @@ export default () => {
56
55
 
57
56
  const date = posts.created_at ? posts.created_at.split("T")[0] : "";
58
57
 
59
- console.log("posts", posts);
60
-
61
58
  return (
62
59
  <DropZone onDrop={reader} disabled={!isKing}>
63
60
  <ArticlePage title={title} date={date}>
package/vite.config.js CHANGED
@@ -70,7 +70,7 @@ export default defineConfig({
70
70
  "Logo.svg",
71
71
  ],
72
72
  devOptions: {
73
- enabled: false,
73
+ enabled: true,
74
74
  },
75
75
  workbox: {
76
76
  cleanupOutdatedCaches: true,