chatluna-plugin-onebot-sandbox 1.2.6 → 1.2.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/client/index.ts +3 -0
- package/client/locales/en.yml +2 -0
- package/client/locales/zh.yml +2 -0
- package/client/mcp/credential-manager.tsx +3 -6
- package/client/plugin-config-notice.tsx +26 -0
- package/client/records/record-layout.tsx +3 -6
- package/client/workspace/overlay-host.tsx +3 -6
- package/dist/.vite/manifest.json +12 -2
- package/dist/app-CNldCALP.js +85 -0
- package/dist/client.js +1 -1
- package/dist/i18n-ConiNer6.js +1 -0
- package/dist/revisions.json +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/app-CmsXGEJ1.js +0 -85
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
|
}
|
package/client/locales/en.yml
CHANGED
|
@@ -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"
|
package/client/locales/zh.yml
CHANGED
|
@@ -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: "资料"
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
Badge,
|
|
13
13
|
Button,
|
|
14
14
|
Checkbox,
|
|
15
|
+
copyText,
|
|
15
16
|
Dialog,
|
|
16
17
|
DialogContent,
|
|
17
18
|
DialogDescription,
|
|
@@ -111,12 +112,8 @@ export function TestCredentialManager() {
|
|
|
111
112
|
}
|
|
112
113
|
|
|
113
114
|
const copy = async (token: string) => {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
toast.success(t('sandbox.credential.copied'))
|
|
117
|
-
} catch {
|
|
118
|
-
toast.error(t('sandbox.credential.copyFailed'))
|
|
119
|
-
}
|
|
115
|
+
if (await copyText(token)) toast.success(t('sandbox.credential.copied'))
|
|
116
|
+
else toast.error(t('sandbox.credential.copyFailed'))
|
|
120
117
|
}
|
|
121
118
|
|
|
122
119
|
// 退场动画期间沿用最后一份内容,标题、Token 区与输入框不在淡出时变成空态。
|
|
@@ -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
|
+
}
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
Badge,
|
|
24
24
|
Button,
|
|
25
25
|
cn,
|
|
26
|
+
copyText,
|
|
26
27
|
Popover,
|
|
27
28
|
PopoverContent,
|
|
28
29
|
PopoverTrigger,
|
|
@@ -343,12 +344,8 @@ export function JsonBlock({ value }: { value: unknown }) {
|
|
|
343
344
|
return () => clearTimeout(timer)
|
|
344
345
|
}, [copied])
|
|
345
346
|
const copy = async () => {
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
setCopied(true)
|
|
349
|
-
} catch {
|
|
350
|
-
toast.error(t('sandbox.records.copyFailed'))
|
|
351
|
-
}
|
|
347
|
+
if (await copyText(text)) setCopied(true)
|
|
348
|
+
else toast.error(t('sandbox.records.copyFailed'))
|
|
352
349
|
}
|
|
353
350
|
return (
|
|
354
351
|
<div className="sandbox-record-code">
|
|
@@ -3,6 +3,7 @@ import { createPortal } from 'react-dom'
|
|
|
3
3
|
import { CheckIcon, CopyIcon, XIcon } from 'lucide-react'
|
|
4
4
|
import {
|
|
5
5
|
Button,
|
|
6
|
+
copyText,
|
|
6
7
|
Dialog,
|
|
7
8
|
DialogContent,
|
|
8
9
|
DialogDescription,
|
|
@@ -293,12 +294,8 @@ function CopyIdButton({ value }: { value: string }) {
|
|
|
293
294
|
return () => clearTimeout(timer)
|
|
294
295
|
}, [copied])
|
|
295
296
|
const copy = async () => {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
setCopied(true)
|
|
299
|
-
} catch {
|
|
300
|
-
toast.error(t('sandbox.records.copyFailed'))
|
|
301
|
-
}
|
|
297
|
+
if (await copyText(value)) setCopied(true)
|
|
298
|
+
else toast.error(t('sandbox.records.copyFailed'))
|
|
302
299
|
}
|
|
303
300
|
return (
|
|
304
301
|
<Button variant="ghost" size="icon-xs" aria-label={t(copied ? 'sandbox.profile.copied' : 'sandbox.profile.copyId')} onClick={() => void copy()}>
|
package/dist/.vite/manifest.json
CHANGED
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
+
"_i18n-ConiNer6.js": {
|
|
3
|
+
"file": "i18n-ConiNer6.js",
|
|
4
|
+
"name": "i18n"
|
|
5
|
+
},
|
|
2
6
|
"client/app.tsx": {
|
|
3
|
-
"file": "app-
|
|
7
|
+
"file": "app-CNldCALP.js",
|
|
4
8
|
"name": "app",
|
|
5
9
|
"src": "client/app.tsx",
|
|
6
|
-
"isDynamicEntry": true
|
|
10
|
+
"isDynamicEntry": true,
|
|
11
|
+
"imports": [
|
|
12
|
+
"_i18n-ConiNer6.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-ConiNer6.js"
|
|
22
|
+
],
|
|
13
23
|
"dynamicImports": [
|
|
14
24
|
"client/app.tsx"
|
|
15
25
|
]
|