@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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 5.8.11
4
+
5
+ ### Patch Changes
6
+
7
+ - f631db2: add version plugin
8
+ - Updated dependencies [f631db2]
9
+ - @bbki.ng/ui@0.2.22
10
+
3
11
  ## 5.8.10
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.8.10",
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.21"
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 = [hashStr];
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, hashStr, textEffects]);
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-center justify-center p-8">
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();
@@ -75,7 +75,7 @@ class XwyPlugin extends BBPlugin {
75
75
  private promptToOpen = () => {
76
76
  const notificationService = this._serviceRegistry?.get('notification');
77
77
  notificationService?.notify({
78
- message: '安装成功.',
78
+ message: '小乌鸦安装成功.',
79
79
  action: XwyLink,
80
80
  });
81
81
  };
@@ -19,6 +19,7 @@ export type PluginID =
19
19
  | 'sticker'
20
20
  | 'xwy'
21
21
  | 'extra-cd'
22
+ | 'version'
22
23
  | 'extra-entry'
23
24
  | 'store'
24
25
  | 'now'