@jetcrab/pi-desk-sdk 1.1.21 → 1.1.23-dev
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/capabilities.d.ts +11 -0
- package/dist/capabilities.js +3 -1
- package/dist/host-runtime/base.js +30 -12
- package/dist/react-ui.js +21 -3
- package/package.json +1 -1
package/dist/react-ui.js
CHANGED
|
@@ -18,7 +18,25 @@ const PLUGIN_UI_STYLES = `
|
|
|
18
18
|
.pi-desk-ui-tab:hover{background:color-mix(in oklab,var(--foreground) 8%,transparent);color:var(--foreground)}
|
|
19
19
|
.pi-desk-ui-tab[data-active="true"]{border-bottom-color:var(--foreground);color:var(--foreground)}.pi-desk-ui-tab:focus-visible{outline:2px solid var(--pi-desk-plugin-ring,var(--ring));outline-offset:2px}.pi-desk-ui-tab:disabled{cursor:not-allowed;opacity:.5}
|
|
20
20
|
.pi-desk-ui-key-values{display:grid;min-width:0;gap:.5rem;margin:0}.pi-desk-ui-key-value{display:grid;min-width:0;grid-template-columns:minmax(5rem,auto) minmax(0,1fr) auto;align-items:start;gap:.3rem .65rem}.pi-desk-ui-key-value-label{color:var(--pi-desk-plugin-muted-foreground,var(--muted-foreground));font-size:.75rem;line-height:1.45}.pi-desk-ui-key-value-value{min-width:0;margin:0;font-size:.875rem;line-height:1.5;overflow-wrap:anywhere}.pi-desk-ui-key-value-action{display:flex;align-items:center}.pi-desk-ui-key-values-compact{gap:.35rem}.pi-desk-ui-key-values-compact .pi-desk-ui-key-value{grid-template-columns:minmax(3.5rem,auto) minmax(0,1fr) auto;gap:.2rem .5rem}.pi-desk-ui-key-values-compact .pi-desk-ui-key-value-label{font-size:.75rem}.pi-desk-ui-key-values-stacked .pi-desk-ui-key-value{grid-template-columns:minmax(0,1fr);gap:.1rem}.pi-desk-ui-key-values-stacked .pi-desk-ui-key-value-action{justify-self:start}
|
|
21
|
-
.pi-desk-ui-loading{display:flex;min-height:
|
|
21
|
+
.pi-desk-ui-loading{display:flex;min-width:0;min-height:10rem;flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:.75rem;padding:2rem 1rem;color:var(--pi-desk-plugin-muted-foreground,var(--muted-foreground));font-size:.875rem;line-height:1.5;text-align:center}.pi-desk-ui-loading .pi-desk-ui-spinner{width:1.5rem;height:1.5rem;flex:none}.pi-desk-ui-loading-label{min-width:0;overflow-wrap:anywhere}.pi-desk-ui-loading-error{display:grid;gap:.6rem}
|
|
22
|
+
.pi-desk-ui-spinner circle {
|
|
23
|
+
opacity: .15;
|
|
24
|
+
transform: scale(.6);
|
|
25
|
+
animation: pi-desk-ui-matrix 1.2s ease-in-out infinite;
|
|
26
|
+
transform-box: fill-box;
|
|
27
|
+
transform-origin: center;
|
|
28
|
+
}
|
|
29
|
+
.pi-desk-ui-spinner circle:nth-child(2), .pi-desk-ui-spinner circle:nth-child(4) { animation-delay: .1s; }
|
|
30
|
+
.pi-desk-ui-spinner circle:nth-child(3), .pi-desk-ui-spinner circle:nth-child(5), .pi-desk-ui-spinner circle:nth-child(7) { animation-delay: .2s; }
|
|
31
|
+
.pi-desk-ui-spinner circle:nth-child(6), .pi-desk-ui-spinner circle:nth-child(8) { animation-delay: .3s; }
|
|
32
|
+
.pi-desk-ui-spinner circle:nth-child(9) { animation-delay: .4s; }
|
|
33
|
+
@keyframes pi-desk-ui-matrix {
|
|
34
|
+
0%, 60%, 100% { opacity: .15; transform: scale(.6); }
|
|
35
|
+
30% { opacity: 1; transform: scale(1); }
|
|
36
|
+
}
|
|
37
|
+
@media (prefers-reduced-motion: reduce) {
|
|
38
|
+
.pi-desk-ui-spinner circle { animation: none; opacity: 1; transform: none; }
|
|
39
|
+
}
|
|
22
40
|
.pi-desk-ui-split{display:grid;grid-template-columns:minmax(11rem,13.5rem) minmax(0,1fr);gap:1rem;align-items:start}
|
|
23
41
|
.pi-desk-ui-navigation,.pi-desk-ui-content{min-width:0;min-height:0}.pi-desk-ui-navigation{overflow:hidden}
|
|
24
42
|
.pi-desk-ui-list{display:grid;gap:.375rem;min-width:0}.pi-desk-ui-list-compact{gap:.25rem}
|
|
@@ -206,7 +224,7 @@ export function PluginKeyValueItem({ label, value, action, className, ...props }
|
|
|
206
224
|
return (_jsxs("div", { ...props, className: classNames('pi-desk-ui-key-value', className), children: [_jsx("dt", { className: "pi-desk-ui-key-value-label", children: label }), _jsx("dd", { className: "pi-desk-ui-key-value-value", children: value }), action ? _jsx("div", { className: "pi-desk-ui-key-value-action", children: action }) : null] }));
|
|
207
225
|
}
|
|
208
226
|
export function PluginSpinner({ className }) {
|
|
209
|
-
return (
|
|
227
|
+
return (_jsxs("svg", { viewBox: "0 0 25 25", width: "1rem", height: "1rem", fill: "currentColor", stroke: "none", role: "status", "aria-label": "\u6B63\u5728\u52A0\u8F7D", className: classNames('pi-desk-ui-spinner', className), children: [_jsx("circle", { cx: "2.5", cy: "2.5", r: "2.5" }), _jsx("circle", { cx: "12.5", cy: "2.5", r: "2.5" }), _jsx("circle", { cx: "22.5", cy: "2.5", r: "2.5" }), _jsx("circle", { cx: "2.5", cy: "12.5", r: "2.5" }), _jsx("circle", { cx: "12.5", cy: "12.5", r: "2.5" }), _jsx("circle", { cx: "22.5", cy: "12.5", r: "2.5" }), _jsx("circle", { cx: "2.5", cy: "22.5", r: "2.5" }), _jsx("circle", { cx: "12.5", cy: "22.5", r: "2.5" }), _jsx("circle", { cx: "22.5", cy: "22.5", r: "2.5" })] }));
|
|
210
228
|
}
|
|
211
229
|
export function PluginLoadingState({ loading, error, loadingLabel = '正在加载…', retryLabel = '重新加载', onRetry, className, children }) {
|
|
212
230
|
if (error) {
|
|
@@ -214,7 +232,7 @@ export function PluginLoadingState({ loading, error, loadingLabel = '正在加
|
|
|
214
232
|
return (_jsxs("div", { className: classNames('pi-desk-ui-loading-error', className), children: [_jsx(PluginAlert, { tone: "error", density: "compact", children: message }), onRetry ? (_jsx(PluginActionRow, { children: _jsx(PluginButton, { size: "sm", variant: "primary", onClick: onRetry, children: retryLabel }) })) : null] }));
|
|
215
233
|
}
|
|
216
234
|
if (loading) {
|
|
217
|
-
return (_jsxs("div", { className: classNames('pi-desk-ui-loading', className), role: "status", children: [_jsx(PluginSpinner, {}), _jsx("span", { children: loadingLabel })] }));
|
|
235
|
+
return (_jsxs("div", { className: classNames('pi-desk-ui-loading', className), role: "status", children: [_jsx("span", { "aria-hidden": "true", style: { display: 'flex' }, children: _jsx(PluginSpinner, {}) }), _jsx("span", { className: "pi-desk-ui-loading-label", children: loadingLabel })] }));
|
|
218
236
|
}
|
|
219
237
|
return _jsx(_Fragment, { children: children });
|
|
220
238
|
}
|
package/package.json
CHANGED