@bbki.ng/site 5.8.10 → 5.8.11
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/plugins/blog/index.ts +1 -1
- package/src/plugins/fx/components/index.tsx +3 -3
- package/src/plugins/store/components/storePage.tsx +1 -1
- package/src/plugins/version/index.ts +28 -0
- package/src/plugins/xwy/index.ts +1 -1
- package/src/types/plugin.ts +1 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/site",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.11",
|
|
4
4
|
"description": "code behind bbki.ng",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"react-router-dom": "6",
|
|
16
16
|
"sonner": "^2.0.7",
|
|
17
17
|
"swr": "^2.2.5",
|
|
18
|
-
"@bbki.ng/ui": "0.2.
|
|
18
|
+
"@bbki.ng/ui": "0.2.22"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@eslint/compat": "^1.0.0",
|
|
@@ -59,7 +59,7 @@ export class BlogPlugin extends BBPlugin {
|
|
|
59
59
|
private promptToOpen = () => {
|
|
60
60
|
const notificationService = this._serviceRegistry?.get('notification');
|
|
61
61
|
notificationService?.notify({
|
|
62
|
-
message: '
|
|
62
|
+
message: '博客安装成功.',
|
|
63
63
|
action: BlogLink,
|
|
64
64
|
});
|
|
65
65
|
};
|
|
@@ -22,14 +22,14 @@ const useLoadingState = () => {
|
|
|
22
22
|
|
|
23
23
|
export const FxCom = (_: IComPropsRegisteredToSlot) => {
|
|
24
24
|
const ctx = FxContext.useCtx();
|
|
25
|
-
const hashStr = ctx.versionHash;
|
|
25
|
+
// const hashStr = ctx.versionHash;
|
|
26
26
|
const deviceId = ctx.deviceId;
|
|
27
27
|
const isLoading = useLoadingState();
|
|
28
28
|
|
|
29
29
|
const textEffects = useTextEffects();
|
|
30
30
|
|
|
31
31
|
const effects: Effect[] = useMemo(() => {
|
|
32
|
-
const wmLines = [
|
|
32
|
+
const wmLines = [];
|
|
33
33
|
if (deviceId) wmLines.push(deviceId);
|
|
34
34
|
|
|
35
35
|
return [
|
|
@@ -39,7 +39,7 @@ export const FxCom = (_: IComPropsRegisteredToSlot) => {
|
|
|
39
39
|
watermark({ lines: wmLines }),
|
|
40
40
|
...textEffects,
|
|
41
41
|
];
|
|
42
|
-
}, [isLoading, deviceId,
|
|
42
|
+
}, [isLoading, deviceId, textEffects]);
|
|
43
43
|
|
|
44
44
|
return <EffectLayer effects={effects} />;
|
|
45
45
|
};
|
|
@@ -17,7 +17,7 @@ const EmptyState = () => (
|
|
|
17
17
|
|
|
18
18
|
// 错误状态展示
|
|
19
19
|
const ErrorState = ({ error, onRetry }: { error: Error; onRetry: () => void }) => (
|
|
20
|
-
<div className="flex flex-col items-
|
|
20
|
+
<div className="flex flex-col items-start justify-center p-8">
|
|
21
21
|
<p className="text-content-danger text-sm mb-4">加载失败: {error.message}</p>
|
|
22
22
|
<Button onClick={onRetry} size="sm">
|
|
23
23
|
重试
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BBPlugin } from '#/core/plugin-system/bbplugin';
|
|
2
|
+
import { IHostContext } from '#/types/hostApi';
|
|
3
|
+
import { PluginID } from '#/types/plugin';
|
|
4
|
+
|
|
5
|
+
export class VersionPlugin extends BBPlugin {
|
|
6
|
+
id: PluginID = 'version';
|
|
7
|
+
|
|
8
|
+
private _clear = () => {};
|
|
9
|
+
|
|
10
|
+
override onInstall?: ((ctx: IHostContext) => void | Promise<void>) | undefined = async ctx => {
|
|
11
|
+
const fxService = ctx.service.get('fx:service');
|
|
12
|
+
|
|
13
|
+
const hash = await ctx.service.get('core:baseService')?.getVersionHash();
|
|
14
|
+
|
|
15
|
+
this._clear = fxService.drawText({
|
|
16
|
+
text: `version: ${hash}`,
|
|
17
|
+
color: '#f8babc',
|
|
18
|
+
y: window.innerHeight - 50,
|
|
19
|
+
x: 16,
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
override onDestroy?: (() => void) | undefined = () => {
|
|
24
|
+
this._clear?.();
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default new VersionPlugin();
|
package/src/plugins/xwy/index.ts
CHANGED