@spzxg/cli-ui 0.6.17 → 0.6.18
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/CHANGELOG.md +12 -4
- package/README.md +20 -11
- package/dist/{cli-ui-embed-REq-GvM7.js → cli-ui-embed-Dsw7A8BQ.js} +2705 -2702
- package/dist/{cli-ui-index-p_XTnmsN.js → cli-ui-index-CHFgaDHY.js} +2 -2
- package/dist/{cli-ui-jszip.min-0mqaiYeK.js → cli-ui-jszip.min-DDRprLiN.js} +1 -1
- package/dist/{cli-ui-jszip.min-CJa9yrKW.js → cli-ui-jszip.min-Dw9DMuD5.js} +2 -2
- package/dist/{cli-ui-xlsx-BPL7P3mE.js → cli-ui-xlsx-BUG2_Azh.js} +1 -1
- package/dist/cli-ui.js +1 -1
- package/package.json +1 -1
- package/src/board/CliBoard.tsx +3 -3
- package/src/ui/Markdown.tsx +9 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as ms, a as vs } from "./cli-ui-embed-
|
|
2
|
-
import { r as ys } from "./cli-ui-jszip.min-
|
|
1
|
+
import { g as ms, a as vs } from "./cli-ui-embed-Dsw7A8BQ.js";
|
|
2
|
+
import { r as ys } from "./cli-ui-jszip.min-DDRprLiN.js";
|
|
3
3
|
function gs(e, t) {
|
|
4
4
|
for (var n = 0; n < t.length; n++) {
|
|
5
5
|
const r = t[n];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as bt } from "./cli-ui-embed-
|
|
1
|
+
import { c as bt } from "./cli-ui-embed-Dsw7A8BQ.js";
|
|
2
2
|
function vt(yt) {
|
|
3
3
|
throw new Error('Could not dynamically require "' + yt + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
|
|
4
4
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a } from "./cli-ui-embed-
|
|
2
|
-
import { r as p } from "./cli-ui-jszip.min-
|
|
1
|
+
import { a } from "./cli-ui-embed-Dsw7A8BQ.js";
|
|
2
|
+
import { r as p } from "./cli-ui-jszip.min-DDRprLiN.js";
|
|
3
3
|
function f(t, n) {
|
|
4
4
|
for (var o = 0; o < n.length; o++) {
|
|
5
5
|
const e = n[o];
|
|
@@ -28,7 +28,7 @@ function v(e) {
|
|
|
28
28
|
}
|
|
29
29
|
async function R(e) {
|
|
30
30
|
var E;
|
|
31
|
-
const t = await import("./cli-ui-jszip.min-
|
|
31
|
+
const t = await import("./cli-ui-jszip.min-Dw9DMuD5.js").then((s) => s.j), o = await (t.default ?? t).loadAsync(e), m = async (s) => {
|
|
32
32
|
const a = o.file(s);
|
|
33
33
|
return a ? a.async("string") : null;
|
|
34
34
|
}, S = await m("xl/workbook.xml");
|
package/dist/cli-ui.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as a, b as i, d as r, e as t, f as o, h as C, i as l, j as n, k as m, m as d, l as u, n as w, o as B, p as f } from "./cli-ui-embed-
|
|
1
|
+
import { C as a, b as i, d as r, e as t, f as o, h as C, i as l, j as n, k as m, m as d, l as u, n as w, o as B, p as f } from "./cli-ui-embed-Dsw7A8BQ.js";
|
|
2
2
|
export {
|
|
3
3
|
a as CliBoard,
|
|
4
4
|
i as CliBrowserView,
|
package/package.json
CHANGED
package/src/board/CliBoard.tsx
CHANGED
|
@@ -264,8 +264,8 @@ function BoardInner({ jobId: jobIdProp, taskId: taskIdProp, tabs, availableTabs,
|
|
|
264
264
|
for (const child of box.children) ro.observe(child);
|
|
265
265
|
return () => ro.disconnect();
|
|
266
266
|
}, [collapsed, visible, inlineLayout?.tabsHost, revealTab, shownTabs.length]);
|
|
267
|
-
//
|
|
268
|
-
useEffect(() => { if (storageId && restored.current === storageId) saveTabs(storageId, files.map((f) => f.path), activeTab, history); }, [storageId, files, activeTab, history]);
|
|
267
|
+
// 记下开着的文件页签和当前页签(刷新页面后恢复)。恢复之前或未派发尚无可用模块时不写,免得用空的盖掉上次的。
|
|
268
|
+
useEffect(() => { if (storageId && restored.current === storageId && (activeTab || info?.dispatched !== false)) saveTabs(storageId, files.map((f) => f.path), activeTab, history); }, [storageId, files, activeTab, history, info?.dispatched]);
|
|
269
269
|
// 引用到对话:和对话在同一个 Provider 里时缺省开。
|
|
270
270
|
useEffect(()=>{
|
|
271
271
|
if(!watchFiles||!jobId||!backend||!info?.dispatched||info.files===false)return;
|
|
@@ -428,11 +428,11 @@ function BoardInner({ jobId: jobIdProp, taskId: taskIdProp, tabs, availableTabs,
|
|
|
428
428
|
useEffect(() => () => { if (jobId) store.reportBoard(jobId, null, owner); }, [store, jobId, owner]);
|
|
429
429
|
|
|
430
430
|
const body = () => {
|
|
431
|
-
if (!activeTab) return <div className="cli-board-empty">看板模块已全部关闭。通过右上角“管理看板模块”重新打开。</div>;
|
|
432
431
|
if (!backend) return <div className="tc-note">当前后端不支持看板(需要任务中心提供 /api/jobs/:id/board)。</div>;
|
|
433
432
|
if (!jobId) return <div className="tc-note">选择或开始一个对话后,这里显示它的文件、改动和浏览器。</div>;
|
|
434
433
|
if (!info) return <div className="tc-note">{infoError ? <>读取看板失败:{infoError} <button className="cli-fv-btn" onClick={refreshAll}>重试</button></> : "读取中…"}</div>;
|
|
435
434
|
if (!info.dispatched) return <div className="tc-note">任务还没开始执行({info.detail ?? "等待分配执行节点"})。开始后这里会显示工作区文件。</div>;
|
|
435
|
+
if (!activeTab) return <div className="cli-board-empty">看板模块已全部关闭。通过右上角“管理看板模块”重新打开。</div>;
|
|
436
436
|
if (!visible) return null;
|
|
437
437
|
if (activeTab === "changes") return <ChangesPane key={jobId} backend={backend} jobId={jobId} refreshKey={tick} settled={settled + manual} edits={edits} onOpen={(p) => openPath(p)} />;
|
|
438
438
|
if (activeTab === "browser") {
|
package/src/ui/Markdown.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { memo, useContext, type ComponentProps, type MouseEvent, type ReactNode } from "react";
|
|
1
|
+
import { createContext, memo, useContext, type ComponentProps, type MouseEvent, type ReactNode } from "react";
|
|
2
2
|
import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
|
|
3
3
|
import remarkGfm from "remark-gfm";
|
|
4
4
|
import rehypeHighlight from "rehype-highlight";
|
|
@@ -50,12 +50,18 @@ export interface MarkdownLinks {
|
|
|
50
50
|
* 只高亮写明语言的代码块(自动识别在流式输出时很耗),并 memo,文字没变的消息重渲染时跳过整个解析。
|
|
51
51
|
* 长得像文件路径的行内代码(report.md、src/a.ts:12)按本地文件链接处理。
|
|
52
52
|
*/
|
|
53
|
+
const InLinkContext = createContext(false);
|
|
54
|
+
|
|
53
55
|
export function createMarkdown({ Link, Image }: MarkdownLinks) {
|
|
56
|
+
function Anchor({ children, ...props }: ComponentProps<"a">) {
|
|
57
|
+
return <InLinkContext.Provider value={true}><Link {...props}>{children}</Link></InLinkContext.Provider>;
|
|
58
|
+
}
|
|
54
59
|
function Code({ children, ...props }: ComponentProps<"code">) {
|
|
55
|
-
const
|
|
60
|
+
const inLink = useContext(InLinkContext);
|
|
61
|
+
const path = inLink ? null : inlineFilePath(children);
|
|
56
62
|
return path ? <Link href={path}><code {...props}>{children}</code></Link> : <code {...props}>{children}</code>;
|
|
57
63
|
}
|
|
58
|
-
const components = { a:
|
|
64
|
+
const components = { a: Anchor, img: Image, code: Code };
|
|
59
65
|
return memo(function Markdown({ children, highlight = true }: { children: string; highlight?: boolean }) {
|
|
60
66
|
return (
|
|
61
67
|
<div className="md">
|