@eworkbase/sdk 0.4.0 → 0.4.2
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/ui/execution-log.js +5 -8
- package/dist/ui/theme.css +2 -5
- package/package.json +1 -1
package/dist/ui/execution-log.js
CHANGED
|
@@ -107,11 +107,11 @@ function normalizeLogStatus(status) {
|
|
|
107
107
|
return status;
|
|
108
108
|
}
|
|
109
109
|
function shortenLogTitle(title) {
|
|
110
|
-
|
|
110
|
+
let text = title.trim();
|
|
111
111
|
const file = /^(?:Read file|List files in) ['"](.+)['"]$/i.exec(text);
|
|
112
|
-
if (file)
|
|
113
|
-
if (/^Search for ['"]/i.test(text))
|
|
114
|
-
if (/^(?:python\d*|node|bash|sh|zsh)\s/i.test(text))
|
|
112
|
+
if (file) text = (/^Read/i.test(text) ? "读取文件:" : "列出文件:") + file[1].split(/[\\/]/).filter(Boolean).at(-1);
|
|
113
|
+
if (/^Search for ['"]/i.test(text)) text = text.replace(/^Search for\s+/i, "搜索内容:");
|
|
114
|
+
if (/^(?:python\d*|node|bash|sh|zsh)\s/i.test(text)) text = "执行命令:" + text;
|
|
115
115
|
const firstLine = text.split(/\r?\n/, 1)[0];
|
|
116
116
|
return firstLine.length > LOG_TITLE_LIMIT ? firstLine.slice(0, LOG_TITLE_LIMIT) + "…" : firstLine || "执行记录";
|
|
117
117
|
}
|
|
@@ -405,10 +405,7 @@ const LogItem = memo(function LogItem({ item, isCompact, onOpenLog }) {
|
|
|
405
405
|
}, anchor)) : null, !isCompact && item.kind === "activity" && hasDetails ? /* @__PURE__ */ jsxs("details", {
|
|
406
406
|
className: "workbase-log-operation",
|
|
407
407
|
open: needsAttention,
|
|
408
|
-
children: [/* @__PURE__ */
|
|
409
|
-
className: "workbase-log-chevron",
|
|
410
|
-
"aria-hidden": "true"
|
|
411
|
-
})] }), body]
|
|
408
|
+
children: [/* @__PURE__ */ jsx("summary", { children: heading }), body]
|
|
412
409
|
}) : /* @__PURE__ */ jsxs(Fragment, { children: [heading, !isCompact ? body : null] })]
|
|
413
410
|
})]
|
|
414
411
|
});
|
package/dist/ui/theme.css
CHANGED
|
@@ -264,12 +264,9 @@
|
|
|
264
264
|
.workbase-log-content :is(th, td) { padding: 6px 10px; border-bottom: 1px solid var(--color-border); text-align: left; }
|
|
265
265
|
.workbase-log-details { margin-top: 10px; }
|
|
266
266
|
.workbase-log-details summary { width: fit-content; cursor: pointer; color: var(--color-muted); font-size: 12px; }
|
|
267
|
-
.workbase-log-operation > summary {
|
|
268
|
-
.workbase-log-operation
|
|
269
|
-
.workbase-log-operation .workbase-log-heading { flex: 1; margin: 0; }
|
|
267
|
+
.workbase-log-operation > summary { min-height: 28px; cursor: pointer; border-radius: 4px; }
|
|
268
|
+
.workbase-log-operation .workbase-log-heading { display: inline-flex; width: calc(100% - 1.25em); margin: 0; vertical-align: middle; }
|
|
270
269
|
.workbase-log-operation[open] > summary { margin-bottom: 12px; }
|
|
271
|
-
.workbase-log-chevron { width: 6px; height: 6px; margin-right: 4px; flex-shrink: 0; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; color: var(--color-muted); transform: rotate(-45deg); }
|
|
272
|
-
.workbase-log-operation[open] > summary .workbase-log-chevron { transform: rotate(45deg); }
|
|
273
270
|
.workbase-log-operation summary:hover { color: var(--color-brand); }
|
|
274
271
|
.workbase-execution-log summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 4px; }
|
|
275
272
|
.workbase-execution-log ::selection { background: var(--color-brand-weak); color: var(--color-foreground); }
|