feat(shell): 一级导航(52px 纯图标)+ 插件整页 + 快捷键弹窗分区罗列(v3.25.59)
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m5s
Verify (Gitea) / gate (build · unit · facts) (push) Failing after 1m5s
This commit is contained in:
1 parent
6db5a143a8
commit
7b2f07bdad
37 files changed
+676
-177
No files matched your search
@@ -0,0 +1,52 @@
|
||||
/* ui-plugin-page.js —— 插件整页(v3.25.59)
|
||||
*
|
||||
* 用户裁定:一级导航主组的「插件」图标进入**整页**,内容与「设置 → 插件管理」一致。
|
||||
*
|
||||
* 为什么单独成文件而不是塞进 ui-settings-modal.js:
|
||||
* 后者已接近「单组件行数棘轮」上限,再放一个页面组件会直接打红。
|
||||
* 这里只做「页面壳 + 把插件管理块渲染出来」,数据由宿主经 props 注入。
|
||||
*/
|
||||
;(function (global) {
|
||||
'use strict'
|
||||
const React = global.React || {}
|
||||
const el = (type, prop, ...children) => React.createElement(type, prop, ...children)
|
||||
|
||||
function IWBUIPluginPage (props) {
|
||||
const I = props.I
|
||||
const [rev, setRev] = React.useState(0)
|
||||
const [busy, setBusy] = React.useState('')
|
||||
const [msg, setMsg] = React.useState(null)
|
||||
const PluginHost = props.PluginHost
|
||||
const S = props.Sections || ((typeof window !== 'undefined') ? window.IWBUISettingsSections : null)
|
||||
const items = React.useMemo(
|
||||
() => ((PluginHost && typeof PluginHost.list === 'function') ? PluginHost.list() : []),
|
||||
[rev, PluginHost]
|
||||
)
|
||||
const body = S ? S.renderPluginsTab({
|
||||
PluginHost,
|
||||
pluginBusy: busy,
|
||||
pluginItems: items,
|
||||
setMsg: setMsg,
|
||||
setPluginBusy: setBusy,
|
||||
setPluginsRev: setRev,
|
||||
setTab: function () {},
|
||||
wEnsurePluginLoaded: props.wEnsurePluginLoaded,
|
||||
wRuntimePlugins: props.wRuntimePlugins || [],
|
||||
}) : el('div', { className: 'iwb-hint' }, '插件模块未就绪')
|
||||
|
||||
return el('div', { className: 'iwb-plugin-page' },
|
||||
el('div', { className: 'iwb-plugin-page-head' },
|
||||
el('button', { className: 'iwb-btn iwb-btn-sm', onClick: () => { if (props.onBack) props.onBack() } },
|
||||
I ? I('chevronLeft') : null, '返回画布'),
|
||||
el('span', { className: 'iwb-plugin-page-title' }, '插件'),
|
||||
el('span', { className: 'iwb-plugin-page-sub' }, '管理与市场(与「设置 → 插件管理」同一份数据)'),
|
||||
),
|
||||
el('div', { className: 'iwb-plugin-page-body' },
|
||||
body,
|
||||
msg ? el('div', { className: 'iwb-status-' + (msg.type === 'err' ? 'err' : 'ok') }, msg.text) : null,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
global.IWBUIPluginPage = IWBUIPluginPage
|
||||
})(typeof window !== 'undefined' ? window : globalThis)
|
||||
Reference in new issue
Block a user