@iquji-web/web-component 0.1.9 → 0.1.11

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/README.md CHANGED
@@ -107,6 +107,8 @@ export function Example() {
107
107
 
108
108
  `IqujiTour` 沿用 `IqujiOverlayProvider` 和抽屉的浮层范围。每一步以 `target` 返回实际 DOM 元素,组件跟踪挂载、滚动和尺寸变化并避让窗口边缘。目标尚未出现时保留当前说明与退出入口,调用方负责等待目标和业务数据就绪。后开的模态窗口接管交互时,教程暂时隐藏,窗口关闭后恢复当前步骤。
109
109
 
110
+ 普通目标优先在可用方向显示说明卡。目标四周都无法容纳说明卡时,卡片收进视口并隐藏指示箭头,完整保留说明、退出与操作入口;窗口尺寸或说明内容变化后重新计算位置。
111
+
110
112
  ```tsx
111
113
  const name = useRef<HTMLInputElement>(null);
112
114
  const [guiding, setGuiding] = useState(true);
@@ -0,0 +1,53 @@
1
+ import { type ReactNode } from "react";
2
+ import { type IqujiTone } from "./feedback.js";
3
+ import { type IqujiLogEntry } from "./log-viewer.js";
4
+ import { type IqujiDialogProps } from "./overlays.js";
5
+ export type IqujiDiagnosticBannerProps = {
6
+ title: ReactNode;
7
+ description?: ReactNode | undefined;
8
+ errorCode?: string | undefined;
9
+ tone?: IqujiTone | undefined;
10
+ action?: ReactNode | undefined;
11
+ className?: string | undefined;
12
+ };
13
+ export declare function IqujiDiagnosticBanner({ action, className, description, errorCode, title, tone, }: IqujiDiagnosticBannerProps): import("react/jsx-runtime").JSX.Element;
14
+ export type IqujiDiagnosticPanelProps = {
15
+ /** 操作标识,如 "install_docker_swarm" */
16
+ action?: string | undefined;
17
+ /** 任务 ID,如 "task_fbf71b2ef4727e1e36d09a7db5ba9abd" */
18
+ taskId?: string | undefined;
19
+ /** 状态文本:"failed" | "running" | "succeeded" | "cancelled" 等 */
20
+ status?: string | undefined;
21
+ /** 失败标题,默认 "操作未完成" */
22
+ errorTitle?: ReactNode | undefined;
23
+ /** 失败原因/详细说明 */
24
+ errorMessage?: ReactNode | undefined;
25
+ /** 错误代码,如 "SWARM_WORKER_JOIN_FAILED" */
26
+ errorCode?: string | undefined;
27
+ /** 日志数据列表,支持字符串数组或结构化日志对象 */
28
+ logs?: ReadonlyArray<IqujiLogEntry | string> | undefined;
29
+ /** 日志是否加载中 */
30
+ logsLoading?: boolean | undefined;
31
+ /** 日志读取错误信息(若有) */
32
+ logsError?: ReactNode | undefined;
33
+ /** 刷新日志回调 */
34
+ onRefreshLogs?: (() => void) | undefined;
35
+ /** 最大高度,默认 360px */
36
+ maxHeight?: number | string | undefined;
37
+ className?: string | undefined;
38
+ };
39
+ export declare function IqujiDiagnosticPanel({ action, className, errorCode, errorMessage, errorTitle, logs, logsError, logsLoading, maxHeight, onRefreshLogs, status, taskId, }: IqujiDiagnosticPanelProps): import("react/jsx-runtime").JSX.Element;
40
+ export type IqujiDiagnosticDialogProps = Omit<IqujiDialogProps, "actions" | "children"> & {
41
+ action?: string | undefined;
42
+ taskId?: string | undefined;
43
+ status?: string | undefined;
44
+ errorTitle?: ReactNode | undefined;
45
+ errorMessage?: ReactNode | undefined;
46
+ errorCode?: string | undefined;
47
+ logs?: ReadonlyArray<IqujiLogEntry | string> | undefined;
48
+ logsLoading?: boolean | undefined;
49
+ logsError?: ReactNode | undefined;
50
+ onRefreshLogs?: (() => void) | undefined;
51
+ diagnosticText?: string | undefined;
52
+ };
53
+ export declare function IqujiDiagnosticDialog({ action, closeLabel, diagnosticText, errorCode, errorMessage, errorTitle, logs, logsError, logsLoading, onOpenChange, onRefreshLogs, open, size, status, taskId, title, ...dialogProps }: IqujiDiagnosticDialogProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -138,3 +138,5 @@ export * from "./tooltip.js";
138
138
  export * from "./tour.js";
139
139
  export * from "./workbench.js";
140
140
  export * from "./emoji-picker.js";
141
+ export * from "./log-viewer.js";
142
+ export * from "./diagnostic.js";