chatluna-plugin-onebot-sandbox 1.2.6 → 1.2.7

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/client/index.ts CHANGED
@@ -2,6 +2,8 @@ import type { Context } from 'cordis'
2
2
  import zh from './locales/zh.yml'
3
3
  import en from './locales/en.yml'
4
4
  import './nav-badge.css'
5
+ import { name } from '../package.json'
6
+ import { PluginConfigNotice } from './plugin-config-notice'
5
7
 
6
8
  export default function apply(ctx: Context) {
7
9
  ctx.locale.register('onebot-sandbox', { zh, en })
@@ -15,4 +17,5 @@ export default function apply(ctx: Context) {
15
17
  group: 'chat',
16
18
  groupOrder: 20,
17
19
  })
20
+ ctx.slots.register('plugin.config', { id: 'onebot-sandbox-settings', plugin: name, order: -1 }, PluginConfigNotice)
18
21
  }
@@ -372,6 +372,8 @@ sandbox.notice.join: "{name} requested to join"
372
372
  sandbox.notice.label: "Notifications"
373
373
  sandbox.notice.labelCount: "Notifications ({count})"
374
374
  sandbox.notice.reject: "Reject"
375
+ sandbox.pluginConfig.description: "Plugin settings are edited on the Settings page of the OneBot sandbox"
376
+ sandbox.pluginConfig.open: "Open sandbox settings"
375
377
  sandbox.profile.copied: "ID copied"
376
378
  sandbox.profile.copyId: "Copy ID"
377
379
  sandbox.profile.title: "Profile"
@@ -372,6 +372,8 @@ sandbox.notice.join: "{name} 申请加入群聊"
372
372
  sandbox.notice.label: "通知"
373
373
  sandbox.notice.labelCount: "通知({count})"
374
374
  sandbox.notice.reject: "拒绝"
375
+ sandbox.pluginConfig.description: "插件设置在 OneBot 沙盒的「设置」页编辑"
376
+ sandbox.pluginConfig.open: "打开沙盒设置"
375
377
  sandbox.profile.copied: "已复制号码"
376
378
  sandbox.profile.copyId: "复制号码"
377
379
  sandbox.profile.title: "资料"
@@ -0,0 +1,26 @@
1
+ import { SettingsIcon } from 'lucide-react'
2
+ import { useNavigate } from 'react-router'
3
+ import { Button, Item, ItemActions, ItemContent, ItemDescription } from '@chatluna/ui-kit'
4
+ import { useT } from './i18n'
5
+
6
+ /**
7
+ * v2 插件页「设置」标签里的提示:插件的配置全在沙盒设置页编辑,交给插件页的 `Config` 字段全部 hidden,
8
+ * 宿主的 SchemaForm 对没有可见字段的对象整块不渲染(连同 description),所以提示经 `plugin.config` 槽位单独挂上。
9
+ */
10
+ export function PluginConfigNotice() {
11
+ const t = useT()
12
+ const navigate = useNavigate()
13
+ return (
14
+ <Item variant="outline" size="sm" className="text-sm leading-5">
15
+ <ItemContent>
16
+ <ItemDescription>{t('sandbox.pluginConfig.description')}</ItemDescription>
17
+ </ItemContent>
18
+ <ItemActions>
19
+ <Button size="sm" variant="outline" onClick={() => navigate('/onebot-sandbox/settings')}>
20
+ <SettingsIcon />
21
+ {t('sandbox.pluginConfig.open')}
22
+ </Button>
23
+ </ItemActions>
24
+ </Item>
25
+ )
26
+ }
@@ -1,15 +1,25 @@
1
1
  {
2
+ "_i18n-BeNV36zL.js": {
3
+ "file": "i18n-BeNV36zL.js",
4
+ "name": "i18n"
5
+ },
2
6
  "client/app.tsx": {
3
- "file": "app-CmsXGEJ1.js",
7
+ "file": "app-Cr5eX7UP.js",
4
8
  "name": "app",
5
9
  "src": "client/app.tsx",
6
- "isDynamicEntry": true
10
+ "isDynamicEntry": true,
11
+ "imports": [
12
+ "_i18n-BeNV36zL.js"
13
+ ]
7
14
  },
8
15
  "client/index.ts": {
9
16
  "file": "client.js",
10
17
  "name": "index",
11
18
  "src": "client/index.ts",
12
19
  "isEntry": true,
20
+ "imports": [
21
+ "_i18n-BeNV36zL.js"
22
+ ],
13
23
  "dynamicImports": [
14
24
  "client/app.tsx"
15
25
  ]