@pi-harness/client-web 0.1.3 → 0.1.4
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/dist/react-room.d.ts.map +1 -1
- package/dist/react-room.js +3 -3
- package/dist/react-room.js.map +1 -1
- package/package.json +1 -1
package/dist/react-room.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-room.d.ts","sourceRoot":"","sources":["../src/react-room.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAaf,MAAM,mBAAmB,CAAC;AAa3B,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"react-room.d.ts","sourceRoot":"","sources":["../src/react-room.tsx"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,SAAS,EAaf,MAAM,mBAAmB,CAAC;AAa3B,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAgnLnD,wBAAgB,eAAe,CAAC,EAAE,GAAuB,EAAE,UAAU,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,SAAS,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,2CAqlDhH"}
|
package/dist/react-room.js
CHANGED
|
@@ -1103,7 +1103,7 @@ function Plugins({ plugins, panels, catalog, onMarketplace, onOpenDetail, onToml
|
|
|
1103
1103
|
const categoryLabel = metadata?.category.label ?? plugin.category?.label;
|
|
1104
1104
|
const capabilityLabel = capability(plugin.name);
|
|
1105
1105
|
const pluginTitle = metadata?.name ?? displayPluginName(plugin.name);
|
|
1106
|
-
return (_jsxs("article", { className: "plugin-card", children: [_jsxs("div", { className: "plugin-card-head", children: [_jsx("span", { className: "plugin-icon", children: "\u25C8" }), _jsx("div", { className: "plugin-copy", children: _jsxs("div", { className: "plugin-heading", children: [_jsxs("div", { className: "plugin-title", children: [_jsx("strong", { children: pluginTitle }), _jsx("span", { className: `plugin-state ${plugin.enabled ? "active" : ""}`, children: plugin.enabled ? "运行中" : "已停用" }), categoryLabel && _jsx("span", { className: "capability", children: categoryLabel }), categoryLabel !== capabilityLabel && _jsx("span", { className: "capability", children: capabilityLabel })] }), _jsx("div", { className: "plugin-actions", children: plugin.removable ? (_jsxs(_Fragment, { children: [_jsx("button", { "aria-label": `${plugin.enabled ? "停用" : "启用"} ${pluginTitle}`, "aria-pressed": plugin.enabled, className: "plugin-switch-button", disabled: busyPlugin !== undefined, onClick: () => void runPluginAction(plugin, (item) => onToggle(item)), type: "button", children: _jsx("span", { "aria-hidden": "true", className: `switch ${plugin.enabled ? "on" : ""}`, children: _jsx("i", {}) }) }), _jsx("button", { className: "plugin-uninstall", disabled: busyPlugin !== undefined, onClick: () => {
|
|
1106
|
+
return (_jsxs("article", { className: "catalog-card plugin-card", children: [_jsxs("div", { className: "plugin-card-head", children: [_jsx("span", { className: "plugin-icon", children: "\u25C8" }), _jsx("div", { className: "plugin-copy", children: _jsxs("div", { className: "plugin-heading", children: [_jsxs("div", { className: "plugin-title", children: [_jsx("strong", { children: pluginTitle }), _jsx("span", { className: `plugin-state ${plugin.enabled ? "active" : ""}`, children: plugin.enabled ? "运行中" : "已停用" }), categoryLabel && _jsx("span", { className: "capability", children: categoryLabel }), categoryLabel !== capabilityLabel && _jsx("span", { className: "capability", children: capabilityLabel })] }), _jsx("div", { className: "plugin-actions", children: plugin.removable ? (_jsxs(_Fragment, { children: [_jsx("button", { "aria-label": `${plugin.enabled ? "停用" : "启用"} ${pluginTitle}`, "aria-pressed": plugin.enabled, className: "plugin-switch-button", disabled: busyPlugin !== undefined, onClick: () => void runPluginAction(plugin, (item) => onToggle(item)), type: "button", children: _jsx("span", { "aria-hidden": "true", className: `switch ${plugin.enabled ? "on" : ""}`, children: _jsx("i", {}) }) }), _jsx("button", { className: "plugin-uninstall", disabled: busyPlugin !== undefined, onClick: () => {
|
|
1107
1107
|
setPluginError("");
|
|
1108
1108
|
setPendingUninstall(plugin);
|
|
1109
1109
|
}, type: "button", children: "\u5378\u8F7D" })] })) : (_jsx("span", { className: `switch ${plugin.enabled ? "on" : ""}`, children: _jsx("i", {}) })) })] }) })] }), _jsxs("div", { className: "plugin-card-body", children: [_jsx("code", { className: "plugin-package", children: plugin.name }), _jsx("p", { className: "plugin-description", children: plugin.enabled ? "由当前运行时加载并启用,能力与 hook 已注册。" : "由当前运行时加载但已停用。" }), _jsxs("div", { className: "hook-list", children: [_jsx("span", { children: "loader" }), _jsx("span", { children: plugin.state === "active" ? "active" : `state:${plugin.state}` })] })] }), _jsxs("footer", { className: "plugin-card-footer", children: [_jsx("a", { className: "plugin-detail-link", href: installedPluginDetailPath(plugin.name), onClick: (event) => {
|
|
@@ -1140,7 +1140,7 @@ function InstalledPluginDetail({ plugin, panel, metadata, onBack, onToggle, onUn
|
|
|
1140
1140
|
return (_jsxs("section", { className: "marketplace-page flex min-w-0 flex-1 flex-col", children: [_jsxs("div", { className: "min-h-0 flex-1 overflow-auto", children: [_jsxs("div", { className: "subnav plugin-detail-subnav", children: [_jsx("a", { href: "?page=plugins", onClick: (event) => {
|
|
1141
1141
|
event.preventDefault();
|
|
1142
1142
|
onBack();
|
|
1143
|
-
}, children: "\u2190 \u5DF2\u5B89\u88C5\u63D2\u4EF6" }), _jsx("span", { children: "\u63D2\u4EF6\u8BE6\u60C5" })] }), _jsxs("div", { className: "plugin-detail-content", children: [_jsxs("header", { className: "border-b border-[#e3e7ee] pb-7", children: [_jsxs("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [_jsx("span", { className: `rounded px-2 py-1 font-mono text-[10px] ${plugin.enabled ? "bg-[#e6faed] text-[#14733f]" : "bg-[#eef0f3] text-[#687381]"}`, children: plugin.enabled ? "运行中" : "已停用" }), _jsx("span", { className: "rounded bg-[#f2edff] px-2 py-1 text-[10px] text-[#6d4bc3]", children: plugin.category?.label ?? "运行时插件" }), _jsx("span", { className: "rounded bg-[#e4edfd] px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: capability(plugin.name) })] }), _jsxs("div", { className: "flex flex-wrap items-end justify-between gap-5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "mb-2 font-mono text-[11px] uppercase tracking-[0.14em] text-[#687381]", children: "PLUGIN DETAIL" }), _jsx("h1", { className: "text-3xl font-semibold tracking-[-0.03em] text-[#20252b]", children: title }), _jsxs("code", { className: "mt-3 block break-all text-[12px] text-[#687381]", children: [plugin.name, metadata ? ` · v${metadata.version}` : ""] })] }), plugin.removable ? (_jsxs("div", { className: "plugin-detail-actions", children: [_jsx("button", { className: "plugin-detail-action", disabled: busyAction !== undefined, onClick: () => void run("toggle", () => onToggle(plugin)), type: "button", children: busyAction === "toggle" ? "处理中…" : plugin.enabled ? "停用插件" : "启用插件" }), _jsx("button", { className: "plugin-detail-action danger", disabled: busyAction !== undefined, onClick: () => {
|
|
1143
|
+
}, children: "\u2190 \u5DF2\u5B89\u88C5\u63D2\u4EF6" }), _jsx("span", { children: "\u63D2\u4EF6\u8BE6\u60C5" })] }), _jsxs("div", { className: "plugin-detail-content", children: [_jsxs("header", { className: "border-b border-[#e3e7ee] pb-7", children: [_jsxs("div", { className: "mb-4 flex flex-wrap items-center gap-2", children: [_jsx("span", { className: `rounded px-2 py-1 font-mono text-[10px] ${plugin.enabled ? "bg-[#e6faed] text-[#14733f]" : "bg-[#eef0f3] text-[#687381]"}`, children: plugin.enabled ? "运行中" : "已停用" }), _jsx("span", { className: "rounded bg-[#f2edff] px-2 py-1 text-[10px] text-[#6d4bc3]", children: metadata?.category.label ?? plugin.category?.label ?? "运行时插件" }), _jsx("span", { className: "rounded bg-[#e4edfd] px-2 py-1 font-mono text-[10px] text-[#3565c5]", children: capability(plugin.name) })] }), _jsxs("div", { className: "flex flex-wrap items-end justify-between gap-5", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("p", { className: "mb-2 font-mono text-[11px] uppercase tracking-[0.14em] text-[#687381]", children: "PLUGIN DETAIL" }), _jsx("h1", { className: "text-3xl font-semibold tracking-[-0.03em] text-[#20252b]", children: title }), _jsxs("code", { className: "mt-3 block break-all text-[12px] text-[#687381]", children: [plugin.name, metadata ? ` · v${metadata.version}` : ""] })] }), plugin.removable ? (_jsxs("div", { className: "plugin-detail-actions", children: [_jsx("button", { className: "plugin-detail-action", disabled: busyAction !== undefined, onClick: () => void run("toggle", () => onToggle(plugin)), type: "button", children: busyAction === "toggle" ? "处理中…" : plugin.enabled ? "停用插件" : "启用插件" }), _jsx("button", { className: "plugin-detail-action danger", disabled: busyAction !== undefined, onClick: () => {
|
|
1144
1144
|
setError("");
|
|
1145
1145
|
setConfirmUninstall(true);
|
|
1146
1146
|
}, type: "button", children: "\u5378\u8F7D\u63D2\u4EF6" })] })) : (_jsx("span", { className: "rounded-full bg-[#eef0f3] px-3 py-1.5 text-[11px] text-[#687381]", children: "\u5185\u7F6E\u7EC4\u4EF6" }))] }), _jsx("p", { className: "mt-5 max-w-3xl text-[14px] leading-7 text-[#59636e]", children: metadata?.description ?? (plugin.enabled ? "由当前运行时加载并启用,能力与 hook 已注册。" : "插件保留在运行配置中,但当前处于停用状态。") }), error && (_jsxs("p", { className: "mt-3 text-[12px] text-[#b42318]", role: "alert", children: ["\u64CD\u4F5C\u5931\u8D25\uFF1A", error] }))] }), _jsxs("div", { className: "grid gap-4 py-6 lg:grid-cols-[minmax(0,1fr)_280px]", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u63D2\u4EF6\u80FD\u529B" }), _jsx("div", { className: "mt-4 flex flex-wrap gap-2", children: (metadata?.capabilities.length ? metadata.capabilities : [capability(plugin.name)]).map((item) => (_jsx("span", { className: "rounded-md bg-[#f1f4f9] px-2 py-1 font-mono text-[11px] text-[#61666b]", children: item }, item))) })] }), metadata?.hooks.length ? (_jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u6269\u5C55\u70B9" }), _jsx("div", { className: "mt-4 space-y-2", children: metadata.hooks.map((item) => (_jsx("div", { className: "rounded-md bg-[#f8f9fb] px-3 py-2 font-mono text-[11px] text-[#61666b]", children: item }, item))) })] })) : null, _jsxs("section", { className: "rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsxs("div", { className: "mb-4 flex items-center justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u5B9E\u65F6\u8BE6\u60C5" }), _jsx("p", { className: "mt-1 text-[12px] text-[#687381]", children: "\u5F53\u524D\u672C\u673A\u4F1A\u8BDD\u4E2D\u7684\u63D2\u4EF6\u8FD0\u884C\u72B6\u6001\u3002" })] }), _jsx("span", { className: "font-mono text-[10px] uppercase tracking-[0.1em] text-[#687381]", children: "LIVE" })] }), panel ? _jsx(PluginPanelCard, { inline: true, panel: panel }) : _jsx("div", { className: "empty-state", children: "\u8FD9\u4E2A\u63D2\u4EF6\u6682\u672A\u63D0\u4F9B\u5B9E\u65F6\u9762\u677F\u3002" })] })] }), _jsxs("aside", { className: "h-fit rounded-[10px] border border-[#e3e7ee] bg-white p-5", children: [_jsx("h2", { className: "text-[13px] font-semibold text-[#20252b]", children: "\u63D2\u4EF6\u4FE1\u606F" }), _jsxs("dl", { className: "mt-4 divide-y divide-[#eef0f3] text-[12px]", children: [_jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u8FD0\u884C\u72B6\u6001" }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: plugin.state })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u914D\u7F6E\u6807\u8BC6" }), _jsx("dd", { className: "max-w-[150px] break-all text-right font-mono text-[#3b424b]", children: plugin.id })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u5206\u7C7B" }), _jsx("dd", { className: "text-right text-[#3b424b]", children: plugin.category?.label ?? "运行时插件" })] }), _jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u7BA1\u7406\u65B9\u5F0F" }), _jsx("dd", { className: "text-right text-[#3b424b]", children: plugin.removable ? "可配置" : "随运行时加载" })] }), metadata ? (_jsxs("div", { className: "flex justify-between gap-4 py-3", children: [_jsx("dt", { className: "text-[#687381]", children: "\u7248\u672C" }), _jsx("dd", { className: "font-mono text-[#3b424b]", children: metadata.version })] })) : null] }), metadata ? (_jsx("a", { className: "mt-4 block border-t border-[#eef0f3] pt-4 text-[12px] text-[#3565c5]", href: metadata.repository, rel: "noreferrer", target: "_blank", children: "\u67E5\u770B\u6E90\u7801 \u2197" })) : null] })] })] })] }), confirmUninstall ? (_jsx(PluginUninstallDialog, { busy: busyAction === "uninstall", error: error, onCancel: () => setConfirmUninstall(false), onConfirm: () => void run("uninstall", () => onUninstall(plugin)).then((completed) => {
|
|
@@ -1175,7 +1175,7 @@ function Marketplace({ plugins, capabilities, categories, total, page, hasNext,
|
|
|
1175
1175
|
}, children: "\u67E5\u770B\u8FD0\u884C\u914D\u7F6E" })] }), _jsxs("div", { className: "marketplace-toolbar", children: [_jsx("input", { className: "marketplace-search", "aria-label": "\u641C\u7D22\u63D2\u4EF6", onChange: (event) => onQueryChange(event.target.value), placeholder: "\u641C\u7D22\u540D\u79F0\u3001\u5305\u540D\u3001\u80FD\u529B\u2026", value: query }), _jsxs("select", { className: "marketplace-filter", "aria-label": "\u6309\u80FD\u529B\u7B5B\u9009", onChange: (event) => onCapabilityChange(event.target.value), value: capabilityFilter, children: [_jsx("option", { value: "", children: "\u5168\u90E8\u80FD\u529B" }), capabilities.map((item) => (_jsx("option", { value: item, children: item }, item)))] }), _jsxs("span", { className: "marketplace-count", children: [total, " \u4E2A\u5DF2\u5BA1\u6838\u6761\u76EE \u00B7 \u63A8\u8350\u6392\u5E8F"] })] }), _jsx("nav", { "aria-label": "\u63D2\u4EF6\u5206\u7C7B", className: "marketplace-categories", children: categoryTabs.map((category) => {
|
|
1176
1176
|
const active = categoryFilter === category.id;
|
|
1177
1177
|
return (_jsxs("button", { "aria-pressed": active, className: `marketplace-category ${active ? "active" : ""}`, onClick: () => onCategoryChange(category.id), type: "button", children: [_jsx("span", { children: category.label }), _jsx("span", { className: active ? "font-mono text-[10px] text-[#3565c5]" : "font-mono text-[10px] text-[#687381]", children: category.count })] }, category.id || "all"));
|
|
1178
|
-
}) }), _jsxs("div", { className: "marketplace-scroll", children: [_jsxs("div", { className: "marketplace-grid", children: [plugins.map((plugin) => (_jsxs("article", { className: "marketplace-card", children: [_jsxs("div", { className: "flex items-start gap-2.5", children: [_jsx("div", { className: "marketplace-card-mark", children: "\u25C8" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [_jsx("strong", { className: "marketplace-title", children: plugin.name }), _jsx("span", { className: plugin.status === "verified"
|
|
1178
|
+
}) }), _jsxs("div", { className: "marketplace-scroll", children: [_jsxs("div", { className: "marketplace-grid", children: [plugins.map((plugin) => (_jsxs("article", { className: "catalog-card marketplace-card", children: [_jsxs("div", { className: "flex items-start gap-2.5", children: [_jsx("div", { className: "marketplace-card-mark", children: "\u25C8" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [_jsx("strong", { className: "marketplace-title", children: plugin.name }), _jsx("span", { className: plugin.status === "verified"
|
|
1179
1179
|
? "rounded bg-[#e6faed] px-1.5 py-px font-mono text-[10px] text-[#14733f]"
|
|
1180
1180
|
: "rounded bg-[#fff5e7] px-1.5 py-px font-mono text-[10px] text-[#9a6700]", children: plugin.status === "verified" ? "已验证" : "实验性" }), _jsx("span", { className: plugin.source === "official"
|
|
1181
1181
|
? "rounded bg-[#e4edfd] px-1.5 py-px font-mono text-[10px] text-[#3565c5]"
|