@iquji-web/web-component 0.1.10 → 0.1.12
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/diagnostic.d.ts +55 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +846 -44
- package/dist/log-viewer.d.ts +38 -0
- package/dist/styles.css +579 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4749,26 +4749,823 @@ function IqujiEmojiPicker({ value, options, onChange, label, searchLabel, emptyL
|
|
|
4749
4749
|
})
|
|
4750
4750
|
});
|
|
4751
4751
|
}
|
|
4752
|
+
// src/log-viewer.tsx
|
|
4753
|
+
import {
|
|
4754
|
+
useMemo as useMemo9,
|
|
4755
|
+
useRef as useRef15,
|
|
4756
|
+
useState as useState17
|
|
4757
|
+
} from "react";
|
|
4758
|
+
import { IqujiIcon as IqujiIcon16 } from "@iquji-web/web-icons";
|
|
4759
|
+
import { jsx as jsx36, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
4760
|
+
var ISO_DATE_PATTERN = /^(\d{4}-\d{2}-\d{2}[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?)\s*/i;
|
|
4761
|
+
var LEVEL_PATTERN = /^(info|information|warn|warning|error|err|failed|debug|trace|fatal)\b\s*/i;
|
|
4762
|
+
function parseLogLine(raw, index) {
|
|
4763
|
+
let text = raw.trim();
|
|
4764
|
+
let timestamp;
|
|
4765
|
+
let level = "info";
|
|
4766
|
+
let source;
|
|
4767
|
+
let phase;
|
|
4768
|
+
const dateMatch = text.match(ISO_DATE_PATTERN);
|
|
4769
|
+
if (dateMatch && dateMatch[1]) {
|
|
4770
|
+
timestamp = dateMatch[1];
|
|
4771
|
+
text = text.slice(dateMatch[0].length).trim();
|
|
4772
|
+
}
|
|
4773
|
+
const levelMatch = text.match(LEVEL_PATTERN);
|
|
4774
|
+
if (levelMatch && levelMatch[1]) {
|
|
4775
|
+
const matched = levelMatch[1].toLowerCase();
|
|
4776
|
+
if (matched === "error" || matched === "err" || matched === "failed" || matched === "fatal") {
|
|
4777
|
+
level = "error";
|
|
4778
|
+
} else if (matched === "warn" || matched === "warning") {
|
|
4779
|
+
level = "warn";
|
|
4780
|
+
} else if (matched === "debug" || matched === "trace") {
|
|
4781
|
+
level = "debug";
|
|
4782
|
+
} else {
|
|
4783
|
+
level = "info";
|
|
4784
|
+
}
|
|
4785
|
+
text = text.slice(levelMatch[0].length).trim();
|
|
4786
|
+
}
|
|
4787
|
+
if (/error|failed|failure|fatal|panic|失败|异常|错误/i.test(text)) {
|
|
4788
|
+
level = "error";
|
|
4789
|
+
} else if (/warn|warning|告警/i.test(text) && level === "info") {
|
|
4790
|
+
level = "warn";
|
|
4791
|
+
}
|
|
4792
|
+
const words = text.split(/\s+/);
|
|
4793
|
+
const firstWord = words[0];
|
|
4794
|
+
const secondWord = words[1];
|
|
4795
|
+
if (words.length >= 3 && firstWord && secondWord && /^[a-z0-9_-]+$/i.test(firstWord) && /^[a-z0-9_-]+$/i.test(secondWord)) {
|
|
4796
|
+
source = firstWord;
|
|
4797
|
+
phase = secondWord;
|
|
4798
|
+
text = words.slice(2).join(" ");
|
|
4799
|
+
}
|
|
4800
|
+
return {
|
|
4801
|
+
id: `parsed-${index}`,
|
|
4802
|
+
timestamp,
|
|
4803
|
+
level,
|
|
4804
|
+
source,
|
|
4805
|
+
phase,
|
|
4806
|
+
message: text || raw
|
|
4807
|
+
};
|
|
4808
|
+
}
|
|
4809
|
+
function normalizeLevel(level) {
|
|
4810
|
+
if (!level)
|
|
4811
|
+
return "info";
|
|
4812
|
+
const lower = level.toLowerCase();
|
|
4813
|
+
if (lower === "error" || lower === "err" || lower === "failed" || lower === "fatal")
|
|
4814
|
+
return "error";
|
|
4815
|
+
if (lower === "warn" || lower === "warning")
|
|
4816
|
+
return "warn";
|
|
4817
|
+
if (lower === "debug" || lower === "trace")
|
|
4818
|
+
return "debug";
|
|
4819
|
+
return "info";
|
|
4820
|
+
}
|
|
4821
|
+
function renderHighlighted(text, query) {
|
|
4822
|
+
if (!query.trim())
|
|
4823
|
+
return text;
|
|
4824
|
+
const parts = text.split(new RegExp(`(${query.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`, "gi"));
|
|
4825
|
+
return parts.map((part, i) => part.toLowerCase() === query.toLowerCase() ? /* @__PURE__ */ jsx36("mark", {
|
|
4826
|
+
className: "iquji-log-viewer__highlight",
|
|
4827
|
+
children: part
|
|
4828
|
+
}, `h-${i}`) : part);
|
|
4829
|
+
}
|
|
4830
|
+
function IqujiLogViewer({
|
|
4831
|
+
actions,
|
|
4832
|
+
className,
|
|
4833
|
+
emptyLabel = "暂无日志记录",
|
|
4834
|
+
label = "日志查看器",
|
|
4835
|
+
loading = false,
|
|
4836
|
+
logs,
|
|
4837
|
+
maxHeight = 380,
|
|
4838
|
+
onCopy,
|
|
4839
|
+
showLineNumbers = true,
|
|
4840
|
+
showTimestamps = true,
|
|
4841
|
+
toolbar = true,
|
|
4842
|
+
wrapLines = false
|
|
4843
|
+
}) {
|
|
4844
|
+
const [search, setSearch] = useState17("");
|
|
4845
|
+
const [levelFilter, setLevelFilter] = useState17("all");
|
|
4846
|
+
const [wrapped, setWrapped] = useState17(wrapLines);
|
|
4847
|
+
const [copied, setCopied] = useState17(false);
|
|
4848
|
+
const scrollRef = useRef15(null);
|
|
4849
|
+
const normalized = useMemo9(() => {
|
|
4850
|
+
return logs.map((item, index) => {
|
|
4851
|
+
if (typeof item === "string") {
|
|
4852
|
+
return parseLogLine(item, index);
|
|
4853
|
+
}
|
|
4854
|
+
return {
|
|
4855
|
+
...item,
|
|
4856
|
+
level: normalizeLevel(item.level)
|
|
4857
|
+
};
|
|
4858
|
+
});
|
|
4859
|
+
}, [logs]);
|
|
4860
|
+
const stats = useMemo9(() => {
|
|
4861
|
+
let errorCount = 0;
|
|
4862
|
+
let warnCount = 0;
|
|
4863
|
+
let infoCount = 0;
|
|
4864
|
+
for (const item of normalized) {
|
|
4865
|
+
if (item.level === "error")
|
|
4866
|
+
errorCount++;
|
|
4867
|
+
else if (item.level === "warn")
|
|
4868
|
+
warnCount++;
|
|
4869
|
+
else
|
|
4870
|
+
infoCount++;
|
|
4871
|
+
}
|
|
4872
|
+
return { errorCount, warnCount, infoCount, total: normalized.length };
|
|
4873
|
+
}, [normalized]);
|
|
4874
|
+
const filtered = useMemo9(() => {
|
|
4875
|
+
return normalized.filter((item) => {
|
|
4876
|
+
if (levelFilter !== "all" && item.level !== levelFilter) {
|
|
4877
|
+
return false;
|
|
4878
|
+
}
|
|
4879
|
+
if (search.trim()) {
|
|
4880
|
+
const query = search.trim().toLowerCase();
|
|
4881
|
+
const inMsg = item.message.toLowerCase().includes(query);
|
|
4882
|
+
const inSource = item.source?.toLowerCase().includes(query) ?? false;
|
|
4883
|
+
const inPhase = item.phase?.toLowerCase().includes(query) ?? false;
|
|
4884
|
+
const inSummary = item.errorSummary?.toLowerCase().includes(query) ?? false;
|
|
4885
|
+
return inMsg || inSource || inPhase || inSummary;
|
|
4886
|
+
}
|
|
4887
|
+
return true;
|
|
4888
|
+
});
|
|
4889
|
+
}, [normalized, levelFilter, search]);
|
|
4890
|
+
const handleCopy = async () => {
|
|
4891
|
+
const textToCopy = filtered.map((item) => [item.timestamp, item.level?.toUpperCase(), item.source, item.phase, item.message].filter(Boolean).join(" ")).join(`
|
|
4892
|
+
`);
|
|
4893
|
+
try {
|
|
4894
|
+
await navigator.clipboard.writeText(textToCopy);
|
|
4895
|
+
setCopied(true);
|
|
4896
|
+
onCopy?.(textToCopy);
|
|
4897
|
+
setTimeout(() => setCopied(false), 2000);
|
|
4898
|
+
} catch {}
|
|
4899
|
+
};
|
|
4900
|
+
const handleScrollBottom = () => {
|
|
4901
|
+
if (scrollRef.current) {
|
|
4902
|
+
scrollRef.current.scrollTop = scrollRef.current.scrollHeight;
|
|
4903
|
+
}
|
|
4904
|
+
};
|
|
4905
|
+
const heightStyle = {
|
|
4906
|
+
maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
|
|
4907
|
+
};
|
|
4908
|
+
return /* @__PURE__ */ jsxs32("div", {
|
|
4909
|
+
"aria-label": label,
|
|
4910
|
+
className: classNames("iquji-log-viewer", className),
|
|
4911
|
+
"data-wrap": wrapped ? "true" : undefined,
|
|
4912
|
+
role: "region",
|
|
4913
|
+
children: [
|
|
4914
|
+
toolbar ? /* @__PURE__ */ jsxs32("div", {
|
|
4915
|
+
className: "iquji-log-viewer__toolbar",
|
|
4916
|
+
children: [
|
|
4917
|
+
/* @__PURE__ */ jsxs32("div", {
|
|
4918
|
+
className: "iquji-log-viewer__toolbar-left",
|
|
4919
|
+
children: [
|
|
4920
|
+
/* @__PURE__ */ jsxs32("div", {
|
|
4921
|
+
className: "iquji-log-viewer__search",
|
|
4922
|
+
children: [
|
|
4923
|
+
/* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
4924
|
+
decorative: true,
|
|
4925
|
+
name: "search",
|
|
4926
|
+
size: 12
|
|
4927
|
+
}),
|
|
4928
|
+
/* @__PURE__ */ jsx36("input", {
|
|
4929
|
+
"aria-label": "搜索日志",
|
|
4930
|
+
className: "iquji-log-viewer__search-input",
|
|
4931
|
+
onChange: (e) => setSearch(e.target.value),
|
|
4932
|
+
placeholder: "搜索日志内容…",
|
|
4933
|
+
type: "text",
|
|
4934
|
+
value: search
|
|
4935
|
+
}),
|
|
4936
|
+
search ? /* @__PURE__ */ jsx36("button", {
|
|
4937
|
+
"aria-label": "清空搜索",
|
|
4938
|
+
className: "iquji-log-viewer__filter-btn",
|
|
4939
|
+
onClick: () => setSearch(""),
|
|
4940
|
+
type: "button",
|
|
4941
|
+
children: /* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
4942
|
+
decorative: true,
|
|
4943
|
+
name: "x-circle",
|
|
4944
|
+
size: 11
|
|
4945
|
+
})
|
|
4946
|
+
}) : null
|
|
4947
|
+
]
|
|
4948
|
+
}),
|
|
4949
|
+
/* @__PURE__ */ jsxs32("div", {
|
|
4950
|
+
className: "iquji-log-viewer__filters",
|
|
4951
|
+
children: [
|
|
4952
|
+
/* @__PURE__ */ jsxs32("button", {
|
|
4953
|
+
className: "iquji-log-viewer__filter-btn",
|
|
4954
|
+
"data-active": levelFilter === "all" ? "true" : undefined,
|
|
4955
|
+
onClick: () => setLevelFilter("all"),
|
|
4956
|
+
type: "button",
|
|
4957
|
+
children: [
|
|
4958
|
+
"全部 (",
|
|
4959
|
+
stats.total,
|
|
4960
|
+
")"
|
|
4961
|
+
]
|
|
4962
|
+
}),
|
|
4963
|
+
/* @__PURE__ */ jsxs32("button", {
|
|
4964
|
+
className: "iquji-log-viewer__filter-btn",
|
|
4965
|
+
"data-active": levelFilter === "error" ? "true" : undefined,
|
|
4966
|
+
"data-tone": "error",
|
|
4967
|
+
onClick: () => setLevelFilter("error"),
|
|
4968
|
+
type: "button",
|
|
4969
|
+
children: [
|
|
4970
|
+
"错误 ",
|
|
4971
|
+
stats.errorCount > 0 ? `(${stats.errorCount})` : ""
|
|
4972
|
+
]
|
|
4973
|
+
}),
|
|
4974
|
+
/* @__PURE__ */ jsxs32("button", {
|
|
4975
|
+
className: "iquji-log-viewer__filter-btn",
|
|
4976
|
+
"data-active": levelFilter === "warn" ? "true" : undefined,
|
|
4977
|
+
onClick: () => setLevelFilter("warn"),
|
|
4978
|
+
type: "button",
|
|
4979
|
+
children: [
|
|
4980
|
+
"警告 ",
|
|
4981
|
+
stats.warnCount > 0 ? `(${stats.warnCount})` : ""
|
|
4982
|
+
]
|
|
4983
|
+
}),
|
|
4984
|
+
/* @__PURE__ */ jsx36("button", {
|
|
4985
|
+
className: "iquji-log-viewer__filter-btn",
|
|
4986
|
+
"data-active": levelFilter === "info" ? "true" : undefined,
|
|
4987
|
+
onClick: () => setLevelFilter("info"),
|
|
4988
|
+
type: "button",
|
|
4989
|
+
children: "信息"
|
|
4990
|
+
})
|
|
4991
|
+
]
|
|
4992
|
+
})
|
|
4993
|
+
]
|
|
4994
|
+
}),
|
|
4995
|
+
/* @__PURE__ */ jsxs32("div", {
|
|
4996
|
+
className: "iquji-log-viewer__toolbar-right",
|
|
4997
|
+
children: [
|
|
4998
|
+
/* @__PURE__ */ jsxs32("button", {
|
|
4999
|
+
"aria-label": wrapped ? "切换为单行横向滚动" : "切换为自动折行",
|
|
5000
|
+
className: "iquji-log-viewer__tool-btn",
|
|
5001
|
+
"data-active": wrapped ? "true" : undefined,
|
|
5002
|
+
onClick: () => setWrapped(!wrapped),
|
|
5003
|
+
title: wrapped ? "单行滚动" : "自动换行",
|
|
5004
|
+
type: "button",
|
|
5005
|
+
children: [
|
|
5006
|
+
/* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
5007
|
+
decorative: true,
|
|
5008
|
+
name: "list-bulleted",
|
|
5009
|
+
size: 12
|
|
5010
|
+
}),
|
|
5011
|
+
/* @__PURE__ */ jsx36("span", {
|
|
5012
|
+
children: wrapped ? "折行" : "展开"
|
|
5013
|
+
})
|
|
5014
|
+
]
|
|
5015
|
+
}),
|
|
5016
|
+
/* @__PURE__ */ jsxs32("button", {
|
|
5017
|
+
"aria-label": "复制当前日志",
|
|
5018
|
+
className: "iquji-log-viewer__tool-btn",
|
|
5019
|
+
disabled: filtered.length === 0,
|
|
5020
|
+
onClick: () => void handleCopy(),
|
|
5021
|
+
type: "button",
|
|
5022
|
+
children: [
|
|
5023
|
+
/* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
5024
|
+
decorative: true,
|
|
5025
|
+
name: copied ? "check" : "copy",
|
|
5026
|
+
size: 12
|
|
5027
|
+
}),
|
|
5028
|
+
/* @__PURE__ */ jsx36("span", {
|
|
5029
|
+
children: copied ? "已复制" : "复制"
|
|
5030
|
+
})
|
|
5031
|
+
]
|
|
5032
|
+
}),
|
|
5033
|
+
actions
|
|
5034
|
+
]
|
|
5035
|
+
})
|
|
5036
|
+
]
|
|
5037
|
+
}) : null,
|
|
5038
|
+
/* @__PURE__ */ jsx36("div", {
|
|
5039
|
+
className: "iquji-log-viewer__scroll",
|
|
5040
|
+
ref: scrollRef,
|
|
5041
|
+
style: heightStyle,
|
|
5042
|
+
children: loading ? /* @__PURE__ */ jsxs32("div", {
|
|
5043
|
+
className: "iquji-log-viewer__loading",
|
|
5044
|
+
children: [
|
|
5045
|
+
/* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
5046
|
+
decorative: true,
|
|
5047
|
+
name: "rotate-ccw",
|
|
5048
|
+
size: 18
|
|
5049
|
+
}),
|
|
5050
|
+
/* @__PURE__ */ jsx36("span", {
|
|
5051
|
+
children: "正在读取日志流…"
|
|
5052
|
+
})
|
|
5053
|
+
]
|
|
5054
|
+
}) : filtered.length === 0 ? /* @__PURE__ */ jsxs32("div", {
|
|
5055
|
+
className: "iquji-log-viewer__empty",
|
|
5056
|
+
children: [
|
|
5057
|
+
/* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
5058
|
+
decorative: true,
|
|
5059
|
+
name: "terminal",
|
|
5060
|
+
size: 20
|
|
5061
|
+
}),
|
|
5062
|
+
/* @__PURE__ */ jsx36("span", {
|
|
5063
|
+
children: search || levelFilter !== "all" ? "未匹配到符合条件的日志" : emptyLabel
|
|
5064
|
+
})
|
|
5065
|
+
]
|
|
5066
|
+
}) : /* @__PURE__ */ jsx36("div", {
|
|
5067
|
+
className: "iquji-log-viewer__lines",
|
|
5068
|
+
children: filtered.map((item, index) => {
|
|
5069
|
+
const level = item.level ?? "info";
|
|
5070
|
+
return /* @__PURE__ */ jsxs32("div", {
|
|
5071
|
+
className: "iquji-log-viewer__line",
|
|
5072
|
+
"data-level": level,
|
|
5073
|
+
children: [
|
|
5074
|
+
showLineNumbers ? /* @__PURE__ */ jsx36("span", {
|
|
5075
|
+
className: "iquji-log-viewer__num",
|
|
5076
|
+
children: index + 1
|
|
5077
|
+
}) : null,
|
|
5078
|
+
showTimestamps && item.timestamp ? /* @__PURE__ */ jsx36("span", {
|
|
5079
|
+
className: "iquji-log-viewer__time",
|
|
5080
|
+
children: item.timestamp
|
|
5081
|
+
}) : null,
|
|
5082
|
+
/* @__PURE__ */ jsx36("span", {
|
|
5083
|
+
className: "iquji-log-viewer__level",
|
|
5084
|
+
"data-level": level,
|
|
5085
|
+
children: level.toUpperCase()
|
|
5086
|
+
}),
|
|
5087
|
+
item.source || item.phase ? /* @__PURE__ */ jsx36("span", {
|
|
5088
|
+
className: "iquji-log-viewer__tag",
|
|
5089
|
+
children: [item.source, item.phase].filter(Boolean).join(" ")
|
|
5090
|
+
}) : null,
|
|
5091
|
+
/* @__PURE__ */ jsxs32("span", {
|
|
5092
|
+
className: "iquji-log-viewer__msg",
|
|
5093
|
+
children: [
|
|
5094
|
+
renderHighlighted(item.message, search),
|
|
5095
|
+
item.errorSummary ? /* @__PURE__ */ jsxs32("span", {
|
|
5096
|
+
className: "iquji-log-viewer__summary",
|
|
5097
|
+
children: [
|
|
5098
|
+
" — ",
|
|
5099
|
+
item.errorSummary
|
|
5100
|
+
]
|
|
5101
|
+
}) : null
|
|
5102
|
+
]
|
|
5103
|
+
})
|
|
5104
|
+
]
|
|
5105
|
+
}, item.id ?? `log-${index}`);
|
|
5106
|
+
})
|
|
5107
|
+
})
|
|
5108
|
+
}),
|
|
5109
|
+
/* @__PURE__ */ jsxs32("div", {
|
|
5110
|
+
className: "iquji-log-viewer__status",
|
|
5111
|
+
children: [
|
|
5112
|
+
/* @__PURE__ */ jsxs32("div", {
|
|
5113
|
+
children: [
|
|
5114
|
+
search ? /* @__PURE__ */ jsxs32("span", {
|
|
5115
|
+
children: [
|
|
5116
|
+
"已过滤: ",
|
|
5117
|
+
filtered.length,
|
|
5118
|
+
" / 共 ",
|
|
5119
|
+
normalized.length,
|
|
5120
|
+
" 条"
|
|
5121
|
+
]
|
|
5122
|
+
}) : /* @__PURE__ */ jsxs32("span", {
|
|
5123
|
+
children: [
|
|
5124
|
+
"共 ",
|
|
5125
|
+
normalized.length,
|
|
5126
|
+
" 条日志"
|
|
5127
|
+
]
|
|
5128
|
+
}),
|
|
5129
|
+
stats.errorCount > 0 && levelFilter !== "error" ? /* @__PURE__ */ jsxs32("span", {
|
|
5130
|
+
style: { marginLeft: 8, color: "#f87171" },
|
|
5131
|
+
children: [
|
|
5132
|
+
"· ",
|
|
5133
|
+
stats.errorCount,
|
|
5134
|
+
" 处错误"
|
|
5135
|
+
]
|
|
5136
|
+
}) : null
|
|
5137
|
+
]
|
|
5138
|
+
}),
|
|
5139
|
+
/* @__PURE__ */ jsxs32("button", {
|
|
5140
|
+
"aria-label": "滚动到底部",
|
|
5141
|
+
className: "iquji-log-viewer__filter-btn",
|
|
5142
|
+
onClick: handleScrollBottom,
|
|
5143
|
+
type: "button",
|
|
5144
|
+
children: [
|
|
5145
|
+
/* @__PURE__ */ jsx36(IqujiIcon16, {
|
|
5146
|
+
decorative: true,
|
|
5147
|
+
name: "arrow-down",
|
|
5148
|
+
size: 11
|
|
5149
|
+
}),
|
|
5150
|
+
/* @__PURE__ */ jsx36("span", {
|
|
5151
|
+
children: "底部"
|
|
5152
|
+
})
|
|
5153
|
+
]
|
|
5154
|
+
})
|
|
5155
|
+
]
|
|
5156
|
+
})
|
|
5157
|
+
]
|
|
5158
|
+
});
|
|
5159
|
+
}
|
|
5160
|
+
// src/diagnostic.tsx
|
|
5161
|
+
import { useMemo as useMemo10, useState as useState18 } from "react";
|
|
5162
|
+
import { IqujiIcon as IqujiIcon17 } from "@iquji-web/web-icons";
|
|
5163
|
+
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5164
|
+
function IqujiDiagnosticBanner({
|
|
5165
|
+
action,
|
|
5166
|
+
className,
|
|
5167
|
+
description,
|
|
5168
|
+
errorCode,
|
|
5169
|
+
title,
|
|
5170
|
+
tone = "danger"
|
|
5171
|
+
}) {
|
|
5172
|
+
const [copiedCode, setCopiedCode] = useState18(false);
|
|
5173
|
+
const iconName = tone === "success" ? "check-circle" : tone === "warning" || tone === "danger" ? "circle-alert" : "circle-info";
|
|
5174
|
+
const handleCopyCode = async (code) => {
|
|
5175
|
+
try {
|
|
5176
|
+
await navigator.clipboard.writeText(code);
|
|
5177
|
+
setCopiedCode(true);
|
|
5178
|
+
setTimeout(() => setCopiedCode(false), 2000);
|
|
5179
|
+
} catch {}
|
|
5180
|
+
};
|
|
5181
|
+
return /* @__PURE__ */ jsxs33("div", {
|
|
5182
|
+
className: classNames("iquji-diagnostic-banner", className),
|
|
5183
|
+
"data-tone": tone,
|
|
5184
|
+
role: "alert",
|
|
5185
|
+
children: [
|
|
5186
|
+
/* @__PURE__ */ jsxs33("div", {
|
|
5187
|
+
className: "iquji-diagnostic-banner__header",
|
|
5188
|
+
children: [
|
|
5189
|
+
/* @__PURE__ */ jsxs33("div", {
|
|
5190
|
+
className: "iquji-diagnostic-banner__lead",
|
|
5191
|
+
children: [
|
|
5192
|
+
/* @__PURE__ */ jsx37("span", {
|
|
5193
|
+
className: "iquji-diagnostic-banner__icon",
|
|
5194
|
+
children: /* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5195
|
+
decorative: true,
|
|
5196
|
+
name: iconName,
|
|
5197
|
+
size: 15
|
|
5198
|
+
})
|
|
5199
|
+
}),
|
|
5200
|
+
/* @__PURE__ */ jsx37("h4", {
|
|
5201
|
+
className: "iquji-diagnostic-banner__title",
|
|
5202
|
+
children: title
|
|
5203
|
+
})
|
|
5204
|
+
]
|
|
5205
|
+
}),
|
|
5206
|
+
errorCode ? /* @__PURE__ */ jsxs33("button", {
|
|
5207
|
+
"aria-label": `复制错误码: ${errorCode}`,
|
|
5208
|
+
className: "iquji-diagnostic-banner__code",
|
|
5209
|
+
onClick: () => void handleCopyCode(errorCode),
|
|
5210
|
+
title: "点击复制错误代码",
|
|
5211
|
+
type: "button",
|
|
5212
|
+
children: [
|
|
5213
|
+
/* @__PURE__ */ jsx37("code", {
|
|
5214
|
+
children: errorCode
|
|
5215
|
+
}),
|
|
5216
|
+
/* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5217
|
+
decorative: true,
|
|
5218
|
+
name: copiedCode ? "check" : "copy",
|
|
5219
|
+
size: 11
|
|
5220
|
+
})
|
|
5221
|
+
]
|
|
5222
|
+
}) : null
|
|
5223
|
+
]
|
|
5224
|
+
}),
|
|
5225
|
+
description ? /* @__PURE__ */ jsx37("div", {
|
|
5226
|
+
className: "iquji-diagnostic-banner__desc",
|
|
5227
|
+
children: description
|
|
5228
|
+
}) : null,
|
|
5229
|
+
action ? /* @__PURE__ */ jsx37("div", {
|
|
5230
|
+
className: "iquji-diagnostic-banner__action",
|
|
5231
|
+
children: action
|
|
5232
|
+
}) : null
|
|
5233
|
+
]
|
|
5234
|
+
});
|
|
5235
|
+
}
|
|
5236
|
+
function IqujiDiagnosticPanel({
|
|
5237
|
+
action,
|
|
5238
|
+
className,
|
|
5239
|
+
errorCode,
|
|
5240
|
+
errorMessage,
|
|
5241
|
+
errorTitle = "操作未完成",
|
|
5242
|
+
hideMeta = false,
|
|
5243
|
+
logs = [],
|
|
5244
|
+
logsError,
|
|
5245
|
+
logsLoading = false,
|
|
5246
|
+
maxHeight = 380,
|
|
5247
|
+
onRefreshLogs,
|
|
5248
|
+
status,
|
|
5249
|
+
taskId
|
|
5250
|
+
}) {
|
|
5251
|
+
const [copiedTaskId, setCopiedTaskId] = useState18(false);
|
|
5252
|
+
const statusTone = status === "failed" || status === "error" ? "danger" : status === "running" || status === "queued" ? "info" : status === "succeeded" || status === "success" ? "success" : "neutral";
|
|
5253
|
+
const handleCopyTaskId = async (id) => {
|
|
5254
|
+
try {
|
|
5255
|
+
await navigator.clipboard.writeText(id);
|
|
5256
|
+
setCopiedTaskId(true);
|
|
5257
|
+
setTimeout(() => setCopiedTaskId(false), 2000);
|
|
5258
|
+
} catch {}
|
|
5259
|
+
};
|
|
5260
|
+
return /* @__PURE__ */ jsxs33("div", {
|
|
5261
|
+
className: classNames("iquji-diagnostic-dialog-body", className),
|
|
5262
|
+
children: [
|
|
5263
|
+
!hideMeta && (action || taskId || status) ? /* @__PURE__ */ jsxs33("div", {
|
|
5264
|
+
className: "iquji-diagnostic-meta",
|
|
5265
|
+
children: [
|
|
5266
|
+
action ? /* @__PURE__ */ jsx37("span", {
|
|
5267
|
+
className: "iquji-diagnostic-meta__item",
|
|
5268
|
+
children: /* @__PURE__ */ jsx37("span", {
|
|
5269
|
+
children: action
|
|
5270
|
+
})
|
|
5271
|
+
}) : null,
|
|
5272
|
+
taskId ? /* @__PURE__ */ jsxs33("span", {
|
|
5273
|
+
className: "iquji-diagnostic-meta__item",
|
|
5274
|
+
children: [
|
|
5275
|
+
/* @__PURE__ */ jsx37("code", {
|
|
5276
|
+
children: taskId
|
|
5277
|
+
}),
|
|
5278
|
+
/* @__PURE__ */ jsx37("button", {
|
|
5279
|
+
"aria-label": `复制任务ID: ${taskId}`,
|
|
5280
|
+
className: "iquji-diagnostic-meta__btn",
|
|
5281
|
+
onClick: () => void handleCopyTaskId(taskId),
|
|
5282
|
+
title: "复制任务 ID",
|
|
5283
|
+
type: "button",
|
|
5284
|
+
children: /* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5285
|
+
decorative: true,
|
|
5286
|
+
name: copiedTaskId ? "check" : "copy",
|
|
5287
|
+
size: 11
|
|
5288
|
+
})
|
|
5289
|
+
})
|
|
5290
|
+
]
|
|
5291
|
+
}) : null,
|
|
5292
|
+
status ? /* @__PURE__ */ jsx37(IqujiBadge, {
|
|
5293
|
+
tone: statusTone,
|
|
5294
|
+
children: status === "failed" || status === "error" ? "失败" : status === "running" ? "执行中" : status === "queued" ? "队列中" : status === "succeeded" || status === "success" ? "成功" : status
|
|
5295
|
+
}) : null
|
|
5296
|
+
]
|
|
5297
|
+
}) : null,
|
|
5298
|
+
errorMessage || errorCode ? /* @__PURE__ */ jsx37(IqujiDiagnosticBanner, {
|
|
5299
|
+
description: errorMessage,
|
|
5300
|
+
errorCode,
|
|
5301
|
+
title: errorTitle,
|
|
5302
|
+
tone: "danger"
|
|
5303
|
+
}) : null,
|
|
5304
|
+
logsError ? /* @__PURE__ */ jsx37(IqujiDiagnosticBanner, {
|
|
5305
|
+
action: onRefreshLogs ? /* @__PURE__ */ jsx37(IqujiButton, {
|
|
5306
|
+
compact: true,
|
|
5307
|
+
onClick: onRefreshLogs,
|
|
5308
|
+
variant: "secondary",
|
|
5309
|
+
children: "重新读取"
|
|
5310
|
+
}) : null,
|
|
5311
|
+
description: logsError,
|
|
5312
|
+
title: "诊断日志读取失败",
|
|
5313
|
+
tone: "danger"
|
|
5314
|
+
}) : null,
|
|
5315
|
+
/* @__PURE__ */ jsx37(IqujiLogViewer, {
|
|
5316
|
+
actions: onRefreshLogs ? /* @__PURE__ */ jsxs33("button", {
|
|
5317
|
+
"aria-label": "刷新日志",
|
|
5318
|
+
className: "iquji-log-viewer__tool-btn",
|
|
5319
|
+
disabled: logsLoading,
|
|
5320
|
+
onClick: onRefreshLogs,
|
|
5321
|
+
title: "刷新日志",
|
|
5322
|
+
type: "button",
|
|
5323
|
+
children: [
|
|
5324
|
+
/* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5325
|
+
decorative: true,
|
|
5326
|
+
name: "rotate-ccw",
|
|
5327
|
+
size: 11
|
|
5328
|
+
}),
|
|
5329
|
+
/* @__PURE__ */ jsx37("span", {
|
|
5330
|
+
children: logsLoading ? "刷新中…" : "刷新"
|
|
5331
|
+
})
|
|
5332
|
+
]
|
|
5333
|
+
}) : null,
|
|
5334
|
+
emptyLabel: "此操作没有详细日志。旧版本未记录的失败原因需要重新探测或重试后查看。",
|
|
5335
|
+
label: "操作诊断日志",
|
|
5336
|
+
loading: logsLoading,
|
|
5337
|
+
logs,
|
|
5338
|
+
maxHeight
|
|
5339
|
+
})
|
|
5340
|
+
]
|
|
5341
|
+
});
|
|
5342
|
+
}
|
|
5343
|
+
function IqujiDiagnosticDialog({
|
|
5344
|
+
action,
|
|
5345
|
+
closeLabel = "关闭操作诊断日志",
|
|
5346
|
+
diagnosticText,
|
|
5347
|
+
errorCode,
|
|
5348
|
+
errorMessage,
|
|
5349
|
+
errorTitle = "操作未完成",
|
|
5350
|
+
logs = [],
|
|
5351
|
+
logsError,
|
|
5352
|
+
logsLoading = false,
|
|
5353
|
+
onOpenChange,
|
|
5354
|
+
onRefreshLogs,
|
|
5355
|
+
open,
|
|
5356
|
+
size: size2 = "lg",
|
|
5357
|
+
status,
|
|
5358
|
+
taskId,
|
|
5359
|
+
title = "操作诊断日志",
|
|
5360
|
+
...dialogProps
|
|
5361
|
+
}) {
|
|
5362
|
+
const [copiedDiagnostic, setCopiedDiagnostic] = useState18(false);
|
|
5363
|
+
const [copiedTaskId, setCopiedTaskId] = useState18(false);
|
|
5364
|
+
const fullDiagnosticReport = useMemo10(() => {
|
|
5365
|
+
if (diagnosticText)
|
|
5366
|
+
return diagnosticText;
|
|
5367
|
+
const lines = ["### 操作诊断报告"];
|
|
5368
|
+
if (taskId)
|
|
5369
|
+
lines.push(`- **任务 ID**: \`${taskId}\``);
|
|
5370
|
+
if (action)
|
|
5371
|
+
lines.push(`- **动作**: \`${action}\``);
|
|
5372
|
+
if (status)
|
|
5373
|
+
lines.push(`- **状态**: ${status}`);
|
|
5374
|
+
if (errorCode)
|
|
5375
|
+
lines.push(`- **错误代码**: \`${errorCode}\``);
|
|
5376
|
+
if (errorMessage)
|
|
5377
|
+
lines.push(`- **错误说明**: ${errorMessage}`);
|
|
5378
|
+
lines.push("", "### 详细日志");
|
|
5379
|
+
if (logs.length === 0) {
|
|
5380
|
+
lines.push("*(无详细日志)*");
|
|
5381
|
+
} else {
|
|
5382
|
+
lines.push("```");
|
|
5383
|
+
for (const log of logs) {
|
|
5384
|
+
if (typeof log === "string") {
|
|
5385
|
+
lines.push(log);
|
|
5386
|
+
} else {
|
|
5387
|
+
lines.push([
|
|
5388
|
+
log.timestamp,
|
|
5389
|
+
log.level?.toUpperCase(),
|
|
5390
|
+
log.source,
|
|
5391
|
+
log.phase,
|
|
5392
|
+
log.message
|
|
5393
|
+
].filter(Boolean).join(" "));
|
|
5394
|
+
}
|
|
5395
|
+
}
|
|
5396
|
+
lines.push("```");
|
|
5397
|
+
}
|
|
5398
|
+
return lines.join(`
|
|
5399
|
+
`);
|
|
5400
|
+
}, [action, diagnosticText, errorCode, errorMessage, logs, status, taskId]);
|
|
5401
|
+
const handleCopyDiagnostic = async () => {
|
|
5402
|
+
try {
|
|
5403
|
+
await navigator.clipboard.writeText(fullDiagnosticReport);
|
|
5404
|
+
setCopiedDiagnostic(true);
|
|
5405
|
+
setTimeout(() => setCopiedDiagnostic(false), 2500);
|
|
5406
|
+
} catch {}
|
|
5407
|
+
};
|
|
5408
|
+
const handleCopyTaskId = async (id) => {
|
|
5409
|
+
try {
|
|
5410
|
+
await navigator.clipboard.writeText(id);
|
|
5411
|
+
setCopiedTaskId(true);
|
|
5412
|
+
setTimeout(() => setCopiedTaskId(false), 2000);
|
|
5413
|
+
} catch {}
|
|
5414
|
+
};
|
|
5415
|
+
const statusTone = status === "failed" || status === "error" ? "danger" : status === "running" || status === "queued" ? "info" : status === "succeeded" || status === "success" ? "success" : "neutral";
|
|
5416
|
+
const statusText = status === "failed" || status === "error" ? "操作失败" : status === "running" ? "执行中" : status === "queued" ? "排队中" : status === "succeeded" || status === "success" ? "执行成功" : status;
|
|
5417
|
+
const headingNode = /* @__PURE__ */ jsxs33("div", {
|
|
5418
|
+
className: "iquji-diagnostic-dialog-header",
|
|
5419
|
+
children: [
|
|
5420
|
+
/* @__PURE__ */ jsxs33("div", {
|
|
5421
|
+
className: "iquji-diagnostic-dialog-header__lead",
|
|
5422
|
+
children: [
|
|
5423
|
+
/* @__PURE__ */ jsx37("span", {
|
|
5424
|
+
className: "iquji-diagnostic-dialog-header__title",
|
|
5425
|
+
children: title
|
|
5426
|
+
}),
|
|
5427
|
+
status ? /* @__PURE__ */ jsxs33("span", {
|
|
5428
|
+
className: "iquji-diagnostic-dialog-header__badge",
|
|
5429
|
+
"data-tone": statusTone,
|
|
5430
|
+
children: [
|
|
5431
|
+
/* @__PURE__ */ jsx37("span", {
|
|
5432
|
+
className: "iquji-diagnostic-dialog-header__badge-dot"
|
|
5433
|
+
}),
|
|
5434
|
+
/* @__PURE__ */ jsx37("span", {
|
|
5435
|
+
children: statusText
|
|
5436
|
+
})
|
|
5437
|
+
]
|
|
5438
|
+
}) : null
|
|
5439
|
+
]
|
|
5440
|
+
}),
|
|
5441
|
+
action || taskId ? /* @__PURE__ */ jsxs33("div", {
|
|
5442
|
+
className: "iquji-diagnostic-dialog-header__meta",
|
|
5443
|
+
children: [
|
|
5444
|
+
action ? /* @__PURE__ */ jsx37("span", {
|
|
5445
|
+
className: "iquji-diagnostic-dialog-header__action",
|
|
5446
|
+
children: action
|
|
5447
|
+
}) : null,
|
|
5448
|
+
action && taskId ? /* @__PURE__ */ jsx37("span", {
|
|
5449
|
+
className: "iquji-diagnostic-dialog-header__sep",
|
|
5450
|
+
children: "·"
|
|
5451
|
+
}) : null,
|
|
5452
|
+
taskId ? /* @__PURE__ */ jsxs33("span", {
|
|
5453
|
+
className: "iquji-diagnostic-dialog-header__task",
|
|
5454
|
+
children: [
|
|
5455
|
+
/* @__PURE__ */ jsx37("code", {
|
|
5456
|
+
children: taskId
|
|
5457
|
+
}),
|
|
5458
|
+
/* @__PURE__ */ jsx37("button", {
|
|
5459
|
+
"aria-label": `复制任务 ID: ${taskId}`,
|
|
5460
|
+
className: "iquji-diagnostic-dialog-header__copy-btn",
|
|
5461
|
+
onClick: () => void handleCopyTaskId(taskId),
|
|
5462
|
+
title: "复制任务 ID",
|
|
5463
|
+
type: "button",
|
|
5464
|
+
children: /* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5465
|
+
decorative: true,
|
|
5466
|
+
name: copiedTaskId ? "check" : "copy",
|
|
5467
|
+
size: 11
|
|
5468
|
+
})
|
|
5469
|
+
})
|
|
5470
|
+
]
|
|
5471
|
+
}) : null
|
|
5472
|
+
]
|
|
5473
|
+
}) : null
|
|
5474
|
+
]
|
|
5475
|
+
});
|
|
5476
|
+
return /* @__PURE__ */ jsx37(IqujiDialog, {
|
|
5477
|
+
...dialogProps,
|
|
5478
|
+
actions: /* @__PURE__ */ jsxs33("div", {
|
|
5479
|
+
className: "iquji-diagnostic-dialog__footer",
|
|
5480
|
+
children: [
|
|
5481
|
+
/* @__PURE__ */ jsx37("div", {
|
|
5482
|
+
className: "iquji-diagnostic-dialog__footer-hint",
|
|
5483
|
+
children: logs.length > 0 ? /* @__PURE__ */ jsxs33("span", {
|
|
5484
|
+
className: "iquji-diagnostic-dialog__footer-count",
|
|
5485
|
+
children: [
|
|
5486
|
+
"已记录 ",
|
|
5487
|
+
logs.length,
|
|
5488
|
+
" 条日志"
|
|
5489
|
+
]
|
|
5490
|
+
}) : null
|
|
5491
|
+
}),
|
|
5492
|
+
/* @__PURE__ */ jsxs33("div", {
|
|
5493
|
+
className: "iquji-diagnostic-dialog__footer-actions",
|
|
5494
|
+
children: [
|
|
5495
|
+
onRefreshLogs ? /* @__PURE__ */ jsx37(IqujiButton, {
|
|
5496
|
+
className: "iquji-diagnostic-dialog__refresh-btn",
|
|
5497
|
+
disabled: logsLoading,
|
|
5498
|
+
iconStart: /* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5499
|
+
decorative: true,
|
|
5500
|
+
name: "rotate-ccw",
|
|
5501
|
+
size: 13
|
|
5502
|
+
}),
|
|
5503
|
+
loading: logsLoading,
|
|
5504
|
+
onClick: onRefreshLogs,
|
|
5505
|
+
variant: "secondary",
|
|
5506
|
+
children: "刷新日志"
|
|
5507
|
+
}) : null,
|
|
5508
|
+
/* @__PURE__ */ jsx37(IqujiButton, {
|
|
5509
|
+
className: "iquji-diagnostic-dialog__copy-btn",
|
|
5510
|
+
iconStart: /* @__PURE__ */ jsx37(IqujiIcon17, {
|
|
5511
|
+
decorative: true,
|
|
5512
|
+
name: copiedDiagnostic ? "check" : "copy",
|
|
5513
|
+
size: 13
|
|
5514
|
+
}),
|
|
5515
|
+
onClick: () => void handleCopyDiagnostic(),
|
|
5516
|
+
variant: "secondary",
|
|
5517
|
+
children: copiedDiagnostic ? "已复制诊断信息" : "复制诊断信息"
|
|
5518
|
+
}),
|
|
5519
|
+
/* @__PURE__ */ jsx37(IqujiButton, {
|
|
5520
|
+
onClick: () => onOpenChange?.(false),
|
|
5521
|
+
variant: "ghost",
|
|
5522
|
+
children: "关闭"
|
|
5523
|
+
})
|
|
5524
|
+
]
|
|
5525
|
+
})
|
|
5526
|
+
]
|
|
5527
|
+
}),
|
|
5528
|
+
closeLabel,
|
|
5529
|
+
heading: headingNode,
|
|
5530
|
+
onOpenChange,
|
|
5531
|
+
open,
|
|
5532
|
+
size: size2,
|
|
5533
|
+
title,
|
|
5534
|
+
children: /* @__PURE__ */ jsx37(IqujiDiagnosticPanel, {
|
|
5535
|
+
action,
|
|
5536
|
+
errorCode,
|
|
5537
|
+
errorMessage,
|
|
5538
|
+
errorTitle,
|
|
5539
|
+
hideMeta: true,
|
|
5540
|
+
logs,
|
|
5541
|
+
logsError,
|
|
5542
|
+
logsLoading,
|
|
5543
|
+
onRefreshLogs,
|
|
5544
|
+
status,
|
|
5545
|
+
taskId
|
|
5546
|
+
})
|
|
5547
|
+
});
|
|
5548
|
+
}
|
|
4752
5549
|
|
|
4753
5550
|
// src/index.tsx
|
|
4754
|
-
import { jsx as
|
|
5551
|
+
import { jsx as jsx38, jsxs as jsxs34, Fragment as Fragment9 } from "react/jsx-runtime";
|
|
4755
5552
|
var renderNavigationItem = (item) => {
|
|
4756
|
-
const content = /* @__PURE__ */
|
|
5553
|
+
const content = /* @__PURE__ */ jsxs34(Fragment9, {
|
|
4757
5554
|
children: [
|
|
4758
5555
|
item.icon,
|
|
4759
|
-
/* @__PURE__ */
|
|
5556
|
+
/* @__PURE__ */ jsx38("span", {
|
|
4760
5557
|
children: item.label
|
|
4761
5558
|
})
|
|
4762
5559
|
]
|
|
4763
5560
|
});
|
|
4764
|
-
return item.disabled || !item.href ? /* @__PURE__ */
|
|
5561
|
+
return item.disabled || !item.href ? /* @__PURE__ */ jsx38("button", {
|
|
4765
5562
|
"aria-label": item.label,
|
|
4766
5563
|
className: "iquji-app-shell__navigation-item",
|
|
4767
5564
|
"data-disabled": "true",
|
|
4768
5565
|
disabled: true,
|
|
4769
5566
|
type: "button",
|
|
4770
5567
|
children: content
|
|
4771
|
-
}, item.id) : /* @__PURE__ */
|
|
5568
|
+
}, item.id) : /* @__PURE__ */ jsx38("a", {
|
|
4772
5569
|
"aria-label": item.label,
|
|
4773
5570
|
"aria-current": item.active ? "page" : undefined,
|
|
4774
5571
|
className: "iquji-app-shell__navigation-item",
|
|
@@ -4790,29 +5587,29 @@ function AppShell({
|
|
|
4790
5587
|
mainId = "iquji-main-content",
|
|
4791
5588
|
skipLinkLabel
|
|
4792
5589
|
}) {
|
|
4793
|
-
return /* @__PURE__ */
|
|
5590
|
+
return /* @__PURE__ */ jsxs34("div", {
|
|
4794
5591
|
className: "iquji-app-shell",
|
|
4795
5592
|
children: [
|
|
4796
|
-
skipLinkLabel ? /* @__PURE__ */
|
|
5593
|
+
skipLinkLabel ? /* @__PURE__ */ jsx38("a", {
|
|
4797
5594
|
className: "iquji-skip-link",
|
|
4798
5595
|
href: `#${mainId}`,
|
|
4799
5596
|
children: skipLinkLabel
|
|
4800
5597
|
}) : null,
|
|
4801
|
-
/* @__PURE__ */
|
|
5598
|
+
/* @__PURE__ */ jsxs34("aside", {
|
|
4802
5599
|
className: "iquji-app-shell__sidebar",
|
|
4803
5600
|
children: [
|
|
4804
|
-
/* @__PURE__ */
|
|
5601
|
+
/* @__PURE__ */ jsx38("div", {
|
|
4805
5602
|
className: "iquji-app-shell__brand",
|
|
4806
5603
|
children: brand
|
|
4807
5604
|
}),
|
|
4808
|
-
/* @__PURE__ */
|
|
5605
|
+
/* @__PURE__ */ jsx38("nav", {
|
|
4809
5606
|
"aria-label": navigationLabel,
|
|
4810
5607
|
className: "iquji-app-shell__navigation",
|
|
4811
|
-
children: navigationGroups?.length ? navigationGroups.map((group) => /* @__PURE__ */
|
|
5608
|
+
children: navigationGroups?.length ? navigationGroups.map((group) => /* @__PURE__ */ jsxs34("section", {
|
|
4812
5609
|
"aria-labelledby": `${group.id}-navigation-heading`,
|
|
4813
5610
|
className: "iquji-app-shell__navigation-group",
|
|
4814
5611
|
children: [
|
|
4815
|
-
/* @__PURE__ */
|
|
5612
|
+
/* @__PURE__ */ jsx38("h2", {
|
|
4816
5613
|
className: "iquji-app-shell__navigation-heading",
|
|
4817
5614
|
id: `${group.id}-navigation-heading`,
|
|
4818
5615
|
children: group.label
|
|
@@ -4823,14 +5620,14 @@ function AppShell({
|
|
|
4823
5620
|
})
|
|
4824
5621
|
]
|
|
4825
5622
|
}),
|
|
4826
|
-
/* @__PURE__ */
|
|
5623
|
+
/* @__PURE__ */ jsxs34("div", {
|
|
4827
5624
|
className: "iquji-app-shell__workspace",
|
|
4828
5625
|
children: [
|
|
4829
|
-
/* @__PURE__ */
|
|
5626
|
+
/* @__PURE__ */ jsx38("header", {
|
|
4830
5627
|
className: "iquji-app-shell__header",
|
|
4831
5628
|
children: header
|
|
4832
5629
|
}),
|
|
4833
|
-
/* @__PURE__ */
|
|
5630
|
+
/* @__PURE__ */ jsx38("main", {
|
|
4834
5631
|
className: "iquji-app-shell__main",
|
|
4835
5632
|
id: mainId,
|
|
4836
5633
|
tabIndex: -1,
|
|
@@ -4858,7 +5655,7 @@ var IconButton = forwardRef3(function IconButton2({
|
|
|
4858
5655
|
compact ? "iquji-icon-button--compact" : null,
|
|
4859
5656
|
className
|
|
4860
5657
|
].filter(Boolean).join(" ");
|
|
4861
|
-
return /* @__PURE__ */
|
|
5658
|
+
return /* @__PURE__ */ jsx38("button", {
|
|
4862
5659
|
...buttonProps,
|
|
4863
5660
|
"aria-busy": loading || undefined,
|
|
4864
5661
|
"aria-label": label,
|
|
@@ -4867,10 +5664,10 @@ var IconButton = forwardRef3(function IconButton2({
|
|
|
4867
5664
|
ref,
|
|
4868
5665
|
title: label,
|
|
4869
5666
|
type,
|
|
4870
|
-
children: loading ? /* @__PURE__ */
|
|
5667
|
+
children: loading ? /* @__PURE__ */ jsx38("span", {
|
|
4871
5668
|
"aria-hidden": "true",
|
|
4872
5669
|
className: "iquji-button__spinner"
|
|
4873
|
-
}) : /* @__PURE__ */
|
|
5670
|
+
}) : /* @__PURE__ */ jsx38("span", {
|
|
4874
5671
|
"aria-hidden": "true",
|
|
4875
5672
|
className: "iquji-icon-button__icon",
|
|
4876
5673
|
children: icon
|
|
@@ -4883,7 +5680,7 @@ function StatusBadge({
|
|
|
4883
5680
|
...props
|
|
4884
5681
|
}) {
|
|
4885
5682
|
const names = ["iquji-status-badge", className].filter(Boolean).join(" ");
|
|
4886
|
-
return /* @__PURE__ */
|
|
5683
|
+
return /* @__PURE__ */ jsx38("span", {
|
|
4887
5684
|
className: names,
|
|
4888
5685
|
"data-tone": tone,
|
|
4889
5686
|
...props
|
|
@@ -4911,11 +5708,11 @@ var IqujiButton = forwardRef3(function IqujiButton2({
|
|
|
4911
5708
|
allowLabelWrap ? "iquji-button--allow-label-wrap" : null,
|
|
4912
5709
|
className
|
|
4913
5710
|
].filter(Boolean).join(" ");
|
|
4914
|
-
const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */
|
|
5711
|
+
const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx38("span", {
|
|
4915
5712
|
className: "iquji-button__label",
|
|
4916
5713
|
children
|
|
4917
5714
|
}) : children;
|
|
4918
|
-
return /* @__PURE__ */
|
|
5715
|
+
return /* @__PURE__ */ jsxs34("button", {
|
|
4919
5716
|
...buttonProps,
|
|
4920
5717
|
"aria-busy": loading || undefined,
|
|
4921
5718
|
className: names,
|
|
@@ -4923,16 +5720,16 @@ var IqujiButton = forwardRef3(function IqujiButton2({
|
|
|
4923
5720
|
ref,
|
|
4924
5721
|
type,
|
|
4925
5722
|
children: [
|
|
4926
|
-
loading ? /* @__PURE__ */
|
|
5723
|
+
loading ? /* @__PURE__ */ jsx38("span", {
|
|
4927
5724
|
className: "iquji-button__spinner",
|
|
4928
5725
|
"aria-hidden": "true"
|
|
4929
|
-
}) : iconStart ? /* @__PURE__ */
|
|
5726
|
+
}) : iconStart ? /* @__PURE__ */ jsx38("span", {
|
|
4930
5727
|
className: "iquji-button__icon",
|
|
4931
5728
|
"aria-hidden": "true",
|
|
4932
5729
|
children: iconStart
|
|
4933
5730
|
}) : null,
|
|
4934
5731
|
content,
|
|
4935
|
-
!loading && iconEnd ? /* @__PURE__ */
|
|
5732
|
+
!loading && iconEnd ? /* @__PURE__ */ jsx38("span", {
|
|
4936
5733
|
className: "iquji-button__icon",
|
|
4937
5734
|
"aria-hidden": "true",
|
|
4938
5735
|
children: iconEnd
|
|
@@ -4966,11 +5763,11 @@ function IqujiButtonLink({
|
|
|
4966
5763
|
allowLabelWrap ? "iquji-button-link--allow-label-wrap" : null,
|
|
4967
5764
|
className
|
|
4968
5765
|
].filter(Boolean).join(" ");
|
|
4969
|
-
const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */
|
|
5766
|
+
const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx38("span", {
|
|
4970
5767
|
className: "iquji-button__label",
|
|
4971
5768
|
children
|
|
4972
5769
|
}) : children;
|
|
4973
|
-
return /* @__PURE__ */
|
|
5770
|
+
return /* @__PURE__ */ jsxs34("a", {
|
|
4974
5771
|
...anchorProps,
|
|
4975
5772
|
"aria-busy": loading || undefined,
|
|
4976
5773
|
"aria-disabled": blocked || undefined,
|
|
@@ -4988,16 +5785,16 @@ function IqujiButtonLink({
|
|
|
4988
5785
|
},
|
|
4989
5786
|
tabIndex: blocked ? -1 : tabIndex,
|
|
4990
5787
|
children: [
|
|
4991
|
-
loading ? /* @__PURE__ */
|
|
5788
|
+
loading ? /* @__PURE__ */ jsx38("span", {
|
|
4992
5789
|
className: "iquji-button__spinner",
|
|
4993
5790
|
"aria-hidden": "true"
|
|
4994
|
-
}) : iconStart ? /* @__PURE__ */
|
|
5791
|
+
}) : iconStart ? /* @__PURE__ */ jsx38("span", {
|
|
4995
5792
|
className: "iquji-button__icon",
|
|
4996
5793
|
"aria-hidden": "true",
|
|
4997
5794
|
children: iconStart
|
|
4998
5795
|
}) : null,
|
|
4999
5796
|
content,
|
|
5000
|
-
!loading && iconEnd ? /* @__PURE__ */
|
|
5797
|
+
!loading && iconEnd ? /* @__PURE__ */ jsx38("span", {
|
|
5001
5798
|
className: "iquji-button__icon",
|
|
5002
5799
|
"aria-hidden": "true",
|
|
5003
5800
|
children: iconEnd
|
|
@@ -5012,11 +5809,11 @@ function IqujiPanel({
|
|
|
5012
5809
|
...sectionProps
|
|
5013
5810
|
}) {
|
|
5014
5811
|
const names = ["iquji-panel", className].filter(Boolean).join(" ");
|
|
5015
|
-
return /* @__PURE__ */
|
|
5812
|
+
return /* @__PURE__ */ jsxs34("section", {
|
|
5016
5813
|
className: names,
|
|
5017
5814
|
...sectionProps,
|
|
5018
5815
|
children: [
|
|
5019
|
-
header ? /* @__PURE__ */
|
|
5816
|
+
header ? /* @__PURE__ */ jsx38("header", {
|
|
5020
5817
|
className: "iquji-panel__header",
|
|
5021
5818
|
children: header
|
|
5022
5819
|
}) : null,
|
|
@@ -5033,20 +5830,20 @@ function IqujiPageHeading({
|
|
|
5033
5830
|
titleId
|
|
5034
5831
|
}) {
|
|
5035
5832
|
const names = ["iquji-page-heading", className].filter(Boolean).join(" ");
|
|
5036
|
-
return /* @__PURE__ */
|
|
5833
|
+
return /* @__PURE__ */ jsxs34("div", {
|
|
5037
5834
|
className: names,
|
|
5038
5835
|
children: [
|
|
5039
|
-
/* @__PURE__ */
|
|
5836
|
+
/* @__PURE__ */ jsxs34("div", {
|
|
5040
5837
|
children: [
|
|
5041
|
-
kicker ? /* @__PURE__ */
|
|
5838
|
+
kicker ? /* @__PURE__ */ jsx38("p", {
|
|
5042
5839
|
className: "iquji-page-heading__kicker",
|
|
5043
5840
|
children: kicker
|
|
5044
5841
|
}) : null,
|
|
5045
|
-
/* @__PURE__ */
|
|
5842
|
+
/* @__PURE__ */ jsx38("h1", {
|
|
5046
5843
|
id: titleId,
|
|
5047
5844
|
children: title
|
|
5048
5845
|
}),
|
|
5049
|
-
summary ? /* @__PURE__ */
|
|
5846
|
+
summary ? /* @__PURE__ */ jsx38("p", {
|
|
5050
5847
|
className: "iquji-page-heading__summary",
|
|
5051
5848
|
children: summary
|
|
5052
5849
|
}) : null
|
|
@@ -5067,24 +5864,24 @@ function IqujiEmptyState({
|
|
|
5067
5864
|
...sectionProps
|
|
5068
5865
|
}) {
|
|
5069
5866
|
const names = ["iquji-empty-state", className].filter(Boolean).join(" ");
|
|
5070
|
-
return /* @__PURE__ */
|
|
5867
|
+
return /* @__PURE__ */ jsxs34("section", {
|
|
5071
5868
|
className: names,
|
|
5072
5869
|
...sectionProps,
|
|
5073
5870
|
children: [
|
|
5074
|
-
icon ? /* @__PURE__ */
|
|
5871
|
+
icon ? /* @__PURE__ */ jsx38("span", {
|
|
5075
5872
|
className: "iquji-empty-state__icon",
|
|
5076
5873
|
"aria-hidden": "true",
|
|
5077
5874
|
children: icon
|
|
5078
5875
|
}) : null,
|
|
5079
|
-
title ? /* @__PURE__ */
|
|
5876
|
+
title ? /* @__PURE__ */ jsx38("h2", {
|
|
5080
5877
|
id: titleId,
|
|
5081
5878
|
children: title
|
|
5082
5879
|
}) : null,
|
|
5083
|
-
body ? /* @__PURE__ */
|
|
5880
|
+
body ? /* @__PURE__ */ jsx38("p", {
|
|
5084
5881
|
children: body
|
|
5085
5882
|
}) : null,
|
|
5086
5883
|
children,
|
|
5087
|
-
action ? /* @__PURE__ */
|
|
5884
|
+
action ? /* @__PURE__ */ jsx38("div", {
|
|
5088
5885
|
className: "iquji-empty-state__action",
|
|
5089
5886
|
children: action
|
|
5090
5887
|
}) : null
|
|
@@ -5097,18 +5894,18 @@ function IqujiLoadingState({
|
|
|
5097
5894
|
...divProps
|
|
5098
5895
|
}) {
|
|
5099
5896
|
const names = ["iquji-loading-state", className].filter(Boolean).join(" ");
|
|
5100
|
-
return /* @__PURE__ */
|
|
5897
|
+
return /* @__PURE__ */ jsxs34("div", {
|
|
5101
5898
|
"aria-busy": "true",
|
|
5102
5899
|
"aria-live": "polite",
|
|
5103
5900
|
className: names,
|
|
5104
5901
|
role: "status",
|
|
5105
5902
|
...divProps,
|
|
5106
5903
|
children: [
|
|
5107
|
-
/* @__PURE__ */
|
|
5904
|
+
/* @__PURE__ */ jsx38("span", {
|
|
5108
5905
|
className: "iquji-loading-state__spinner",
|
|
5109
5906
|
"aria-hidden": "true"
|
|
5110
5907
|
}),
|
|
5111
|
-
/* @__PURE__ */
|
|
5908
|
+
/* @__PURE__ */ jsx38("span", {
|
|
5112
5909
|
children: label
|
|
5113
5910
|
})
|
|
5114
5911
|
]
|
|
@@ -5117,6 +5914,7 @@ function IqujiLoadingState({
|
|
|
5117
5914
|
export {
|
|
5118
5915
|
useIqujiOverlayContainer,
|
|
5119
5916
|
useIqujiNotification,
|
|
5917
|
+
parseLogLine,
|
|
5120
5918
|
parseCalendarDate,
|
|
5121
5919
|
normalizeIqujiColor,
|
|
5122
5920
|
formatCalendarDate,
|
|
@@ -5153,6 +5951,7 @@ export {
|
|
|
5153
5951
|
IqujiOverlayProvider,
|
|
5154
5952
|
IqujiNotificationProvider,
|
|
5155
5953
|
IqujiMultiSelect,
|
|
5954
|
+
IqujiLogViewer,
|
|
5156
5955
|
IqujiLoadingState,
|
|
5157
5956
|
IqujiInput,
|
|
5158
5957
|
IqujiFormSteps,
|
|
@@ -5163,6 +5962,9 @@ export {
|
|
|
5163
5962
|
IqujiDropdownMenu,
|
|
5164
5963
|
IqujiDrawer,
|
|
5165
5964
|
IqujiDialog,
|
|
5965
|
+
IqujiDiagnosticPanel,
|
|
5966
|
+
IqujiDiagnosticDialog,
|
|
5967
|
+
IqujiDiagnosticBanner,
|
|
5166
5968
|
IqujiDesktopTitleBar,
|
|
5167
5969
|
IqujiDesktopTabStrip,
|
|
5168
5970
|
IqujiDesktopShell,
|