@bbki.ng/site 2.0.7 → 2.0.8
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 +2 -0
- package/package.json +1 -1
- package/src/blog/components/app_ctx_menu/LoginMenuItem.tsx +39 -24
- package/src/blog/components/app_ctx_menu/ViewSourceMenuItem.tsx +12 -8
- package/src/blog/components/app_ctx_menu/index.tsx +4 -9
- package/src/blog/components/plugin/PluginsMenuItem.tsx +15 -9
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -18,29 +18,29 @@ export const LoginMenuItem = () => {
|
|
|
18
18
|
|
|
19
19
|
if (sess?.user != null) {
|
|
20
20
|
return (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
21
|
+
<ContextMenuItem
|
|
22
|
+
inset
|
|
23
|
+
onClick={() => {
|
|
24
|
+
confirm("确定退出登录吗?", () => {
|
|
25
|
+
supabase.auth.signOut().then(() => {
|
|
26
|
+
toast.success("已退出登录", {
|
|
27
|
+
position: "bottom-right",
|
|
29
28
|
});
|
|
30
|
-
})
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
{sess?.user?.user_metadata && (
|
|
34
|
+
<img
|
|
35
|
+
src={sess?.user?.user_metadata.avatar_url}
|
|
36
|
+
alt="avatar"
|
|
37
|
+
style={{ width: 16, height: 16 }}
|
|
38
|
+
className="rounded-full mr-8"
|
|
39
|
+
crossOrigin="anonymous"
|
|
40
|
+
/>
|
|
41
|
+
)}
|
|
42
|
+
{sess?.user?.email ?? ""}
|
|
43
|
+
</ContextMenuItem>
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -49,10 +49,25 @@ export const LoginMenuItem = () => {
|
|
|
49
49
|
onClick={() => {
|
|
50
50
|
nav("/login");
|
|
51
51
|
}}
|
|
52
|
-
inset
|
|
53
52
|
>
|
|
53
|
+
<svg
|
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
55
|
+
width="16"
|
|
56
|
+
height="16"
|
|
57
|
+
viewBox="0 0 24 24"
|
|
58
|
+
fill="none"
|
|
59
|
+
stroke="currentColor"
|
|
60
|
+
strokeWidth="2"
|
|
61
|
+
strokeLinecap="round"
|
|
62
|
+
strokeLinejoin="round"
|
|
63
|
+
className="feather feather-log-in mr-8"
|
|
64
|
+
>
|
|
65
|
+
<path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path>
|
|
66
|
+
<polyline points="10 17 15 12 10 7"></polyline>
|
|
67
|
+
<line x1="15" y1="12" x2="3" y2="12"></line>
|
|
68
|
+
</svg>
|
|
54
69
|
login
|
|
55
|
-
<ContextMenuShortcut>l</ContextMenuShortcut>
|
|
70
|
+
<ContextMenuShortcut className="mr-1">l</ContextMenuShortcut>
|
|
56
71
|
</ContextMenuItem>
|
|
57
72
|
);
|
|
58
73
|
};
|
|
@@ -13,18 +13,22 @@ export const ViewSourceMenuItem = () => {
|
|
|
13
13
|
}}
|
|
14
14
|
>
|
|
15
15
|
<svg
|
|
16
|
-
|
|
17
|
-
aria-hidden="true"
|
|
18
|
-
viewBox="0 0 16 16"
|
|
19
|
-
version="1.1"
|
|
16
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
17
|
width="16"
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
height="16"
|
|
19
|
+
viewBox="0 0 24 24"
|
|
20
|
+
fill="none"
|
|
21
|
+
stroke="currentColor"
|
|
22
|
+
strokeWidth="2"
|
|
23
|
+
strokeLinecap="round"
|
|
24
|
+
strokeLinejoin="round"
|
|
25
|
+
className="feather feather-code mr-8"
|
|
23
26
|
>
|
|
24
|
-
<
|
|
27
|
+
<polyline points="16 18 22 12 16 6"></polyline>
|
|
28
|
+
<polyline points="8 6 2 12 8 18"></polyline>
|
|
25
29
|
</svg>
|
|
26
30
|
v{appVer}
|
|
27
|
-
<ContextMenuShortcut>s</ContextMenuShortcut>
|
|
31
|
+
<ContextMenuShortcut className="mr-1">s</ContextMenuShortcut>
|
|
28
32
|
</ContextMenuItem>
|
|
29
33
|
);
|
|
30
34
|
};
|
|
@@ -19,15 +19,15 @@ export const AppCtxMenu = (props: { children: ReactElement }) => {
|
|
|
19
19
|
|
|
20
20
|
const showEntry = () => {
|
|
21
21
|
setShowPluginEntry(true);
|
|
22
|
-
}
|
|
22
|
+
};
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
PluginManager.addEventListener(PluginEvent.INIT, showEntry);
|
|
26
26
|
|
|
27
27
|
return () => {
|
|
28
28
|
PluginManager.removeEventListener(PluginEvent.INIT, showEntry);
|
|
29
|
-
}
|
|
30
|
-
}, [])
|
|
29
|
+
};
|
|
30
|
+
}, []);
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<ContextMenu>
|
|
@@ -35,12 +35,7 @@ export const AppCtxMenu = (props: { children: ReactElement }) => {
|
|
|
35
35
|
<ContextMenuContent className="w-256">
|
|
36
36
|
<LoginMenuItem />
|
|
37
37
|
<ViewSourceMenuItem />
|
|
38
|
-
{showPluginEntry &&
|
|
39
|
-
<>
|
|
40
|
-
<ContextMenuSeparator />
|
|
41
|
-
<PluginsMenuItem />
|
|
42
|
-
</>
|
|
43
|
-
)}
|
|
38
|
+
{showPluginEntry && <PluginsMenuItem />}
|
|
44
39
|
</ContextMenuContent>
|
|
45
40
|
</ContextMenu>
|
|
46
41
|
);
|
|
@@ -18,7 +18,7 @@ export const PluginsMenuItem = () => {
|
|
|
18
18
|
}, []);
|
|
19
19
|
return (
|
|
20
20
|
<ContextMenuSub>
|
|
21
|
-
<ContextMenuSubTrigger
|
|
21
|
+
<ContextMenuSubTrigger>
|
|
22
22
|
<svg
|
|
23
23
|
xmlns="http://www.w3.org/2000/svg"
|
|
24
24
|
width="16"
|
|
@@ -28,14 +28,20 @@ export const PluginsMenuItem = () => {
|
|
|
28
28
|
stroke="currentColor"
|
|
29
29
|
strokeWidth="2"
|
|
30
30
|
strokeLinecap="round"
|
|
31
|
-
|
|
32
|
-
className="
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
stroke-linejoin="round"
|
|
32
|
+
className="feather feather-cpu mr-8"
|
|
33
|
+
>
|
|
34
|
+
<rect x="4" y="4" width="16" height="16" rx="2" ry="2"></rect>
|
|
35
|
+
<rect x="9" y="9" width="6" height="6"></rect>
|
|
36
|
+
<line x1="9" y1="1" x2="9" y2="4"></line>
|
|
37
|
+
<line x1="15" y1="1" x2="15" y2="4"></line>
|
|
38
|
+
<line x1="9" y1="20" x2="9" y2="23"></line>
|
|
39
|
+
<line x1="15" y1="20" x2="15" y2="23"></line>
|
|
40
|
+
<line x1="20" y1="9" x2="23" y2="9"></line>
|
|
41
|
+
<line x1="20" y1="14" x2="23" y2="14"></line>
|
|
42
|
+
<line x1="1" y1="9" x2="4" y2="9"></line>
|
|
43
|
+
<line x1="1" y1="14" x2="4" y2="14"></line>
|
|
44
|
+
</svg>
|
|
39
45
|
Plugins
|
|
40
46
|
</ContextMenuSubTrigger>
|
|
41
47
|
<ContextMenuSubContent className="w-48">
|