@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/dist/index.js CHANGED
@@ -4109,8 +4109,10 @@ import { Popover } from "@base-ui/react/popover";
4109
4109
  import { IqujiIcon as IqujiIcon15 } from "@iquji-web/web-icons";
4110
4110
  import {
4111
4111
  useEffect as useEffect7,
4112
+ useLayoutEffect,
4112
4113
  useMemo as useMemo7,
4113
- useRef as useRef12
4114
+ useRef as useRef12,
4115
+ useState as useState14
4114
4116
  } from "react";
4115
4117
 
4116
4118
  // src/tour-target.ts
@@ -4213,9 +4215,23 @@ function IqujiTour({
4213
4215
  const topContainer = useIqujiNotificationContainer();
4214
4216
  const active = open && (!topContainer || container === topContainer);
4215
4217
  const target = useTourTarget(active, step.id, step.target);
4216
- const card = useRef12(null);
4218
+ const [card, setCard] = useState14(null);
4219
+ const [cardSize, setCardSize] = useState14({ width: 0, height: 0 });
4220
+ useLayoutEffect(() => {
4221
+ if (!card)
4222
+ return;
4223
+ const measure = () => {
4224
+ const { width, height } = card.getBoundingClientRect();
4225
+ setCardSize((current) => current.width === width && current.height === height ? current : { width, height });
4226
+ };
4227
+ measure();
4228
+ const resize = new ResizeObserver(measure);
4229
+ resize.observe(card);
4230
+ return () => resize.disconnect();
4231
+ }, [card]);
4232
+ const constrainToViewport = !target.rect || cardSize.width > 0 && cardSize.height > 0 && target.rect.top < cardSize.height + 32 && target.height - target.rect.bottom < cardSize.height + 32 && target.rect.left < cardSize.width + 32 && target.width - target.rect.right < cardSize.width + 32;
4217
4233
  const close = () => {
4218
- if (card.current?.contains(document.activeElement)) {
4234
+ if (card?.contains(document.activeElement)) {
4219
4235
  const selector = "input, textarea, select, button, a[href], [tabindex]";
4220
4236
  const field = target.element?.matches(selector) ? target.element : target.element?.querySelector(selector);
4221
4237
  field?.focus({ preventScroll: true });
@@ -4291,9 +4307,10 @@ function IqujiTour({
4291
4307
  align: "center",
4292
4308
  sideOffset: 16,
4293
4309
  collisionPadding: 16,
4310
+ sticky: constrainToViewport,
4294
4311
  className: "iquji-tour__positioner",
4295
4312
  children: /* @__PURE__ */ jsxs29(Popover.Popup, {
4296
- ref: card,
4313
+ ref: setCard,
4297
4314
  initialFocus: false,
4298
4315
  finalFocus: false,
4299
4316
  className: "iquji-tour__card",
@@ -4340,7 +4357,7 @@ function IqujiTour({
4340
4357
  })
4341
4358
  ]
4342
4359
  }),
4343
- hole && /* @__PURE__ */ jsx33(Popover.Arrow, {
4360
+ hole && !constrainToViewport && /* @__PURE__ */ jsx33(Popover.Arrow, {
4344
4361
  className: "iquji-tour__arrow"
4345
4362
  })
4346
4363
  ]
@@ -4354,9 +4371,9 @@ function IqujiTour({
4354
4371
  // src/workbench.tsx
4355
4372
  import {
4356
4373
  useId as useId15,
4357
- useLayoutEffect,
4374
+ useLayoutEffect as useLayoutEffect2,
4358
4375
  useRef as useRef13,
4359
- useState as useState14
4376
+ useState as useState15
4360
4377
  } from "react";
4361
4378
  import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
4362
4379
  var DEFAULT_LEFT_WIDTH = 240;
@@ -4412,13 +4429,13 @@ function IqujiWorkbenchLayout({
4412
4429
  const rightRef = useRef13(null);
4413
4430
  const previousGeometry = useRef13(null);
4414
4431
  const dragRef = useRef13(null);
4415
- const [resizing, setResizing] = useState14(null);
4432
+ const [resizing, setResizing] = useState15(null);
4416
4433
  const leftBounds = widthBounds(leftMinWidth ?? DEFAULT_LEFT_MIN, leftMaxWidth ?? DEFAULT_LEFT_MAX);
4417
4434
  const rightBounds = widthBounds(rightMinWidth ?? DEFAULT_RIGHT_MIN, rightMaxWidth ?? DEFAULT_RIGHT_MAX);
4418
4435
  const leftDefault = clampWidth(numberOr(defaultLeftWidth, DEFAULT_LEFT_WIDTH), leftBounds.min, leftBounds.max);
4419
4436
  const rightDefault = clampWidth(numberOr(defaultRightWidth, DEFAULT_RIGHT_WIDTH), rightBounds.min, rightBounds.max);
4420
- const [internalLeftWidth, setInternalLeftWidth] = useState14(leftDefault);
4421
- const [internalRightWidth, setInternalRightWidth] = useState14(rightDefault);
4437
+ const [internalLeftWidth, setInternalLeftWidth] = useState15(leftDefault);
4438
+ const [internalRightWidth, setInternalRightWidth] = useState15(rightDefault);
4422
4439
  const leftValue = clampWidth(numberOr(leftWidth, internalLeftWidth), leftBounds.min, leftBounds.max);
4423
4440
  const rightValue = clampWidth(numberOr(rightWidth, internalRightWidth), rightBounds.min, rightBounds.max);
4424
4441
  const centerMin = Math.max(1, Math.round(numberOr(centerMinWidth, DEFAULT_CENTER_MIN)));
@@ -4426,7 +4443,7 @@ function IqujiWorkbenchLayout({
4426
4443
  const hasRight = right !== undefined && right !== null;
4427
4444
  const leftVisible = hasLeft && !leftCollapsed;
4428
4445
  const rightVisible = hasRight && !rightCollapsed;
4429
- useLayoutEffect(() => {
4446
+ useLayoutEffect2(() => {
4430
4447
  if (!onLayoutChange) {
4431
4448
  previousGeometry.current = null;
4432
4449
  return;
@@ -4606,11 +4623,11 @@ function IqujiWorkbenchLayout({
4606
4623
  });
4607
4624
  }
4608
4625
  // src/emoji-picker.tsx
4609
- import { useId as useId16, useMemo as useMemo8, useRef as useRef14, useState as useState15 } from "react";
4626
+ import { useId as useId16, useMemo as useMemo8, useRef as useRef14, useState as useState16 } from "react";
4610
4627
  import { jsx as jsx35, jsxs as jsxs31 } from "react/jsx-runtime";
4611
4628
  function IqujiEmojiPicker({ value, options, onChange, label, searchLabel, emptyLabel, clearLabel, allLabel, disabled, variant = "primary" }) {
4612
- const [open, setOpen] = useState15(false), [search, setSearch] = useState15("");
4613
- const [category, setCategory] = useState15(null), [active, setActive] = useState15(0);
4629
+ const [open, setOpen] = useState16(false), [search, setSearch] = useState16("");
4630
+ const [category, setCategory] = useState16(null), [active, setActive] = useState16(0);
4614
4631
  const id = useId16(), buttons = useRef14(new Map);
4615
4632
  const categories = useMemo8(() => [...new Set(options.flatMap((option) => option.category ? [option.category] : []))], [options]);
4616
4633
  const filtered = useMemo8(() => options.filter((option) => (!category || option.category === category) && `${option.label} ${option.keywords ?? ""} ${option.value}`.toLocaleLowerCase().includes(search.trim().toLocaleLowerCase())), [options, search, category]);
@@ -4732,26 +4749,716 @@ function IqujiEmojiPicker({ value, options, onChange, label, searchLabel, emptyL
4732
4749
  })
4733
4750
  });
4734
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, Fragment as Fragment9 } 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: 16
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("p", {
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
+ logs = [],
5243
+ logsError,
5244
+ logsLoading = false,
5245
+ maxHeight = 360,
5246
+ onRefreshLogs,
5247
+ status,
5248
+ taskId
5249
+ }) {
5250
+ const [copiedTaskId, setCopiedTaskId] = useState18(false);
5251
+ const statusTone = status === "failed" || status === "error" ? "danger" : status === "running" || status === "queued" ? "info" : status === "succeeded" || status === "success" ? "success" : "neutral";
5252
+ const handleCopyTaskId = async (id) => {
5253
+ try {
5254
+ await navigator.clipboard.writeText(id);
5255
+ setCopiedTaskId(true);
5256
+ setTimeout(() => setCopiedTaskId(false), 2000);
5257
+ } catch {}
5258
+ };
5259
+ return /* @__PURE__ */ jsxs33("div", {
5260
+ className: classNames("iquji-diagnostic-dialog-body", className),
5261
+ children: [
5262
+ action || taskId || status ? /* @__PURE__ */ jsxs33("div", {
5263
+ className: "iquji-diagnostic-meta",
5264
+ children: [
5265
+ action ? /* @__PURE__ */ jsx37("span", {
5266
+ className: "iquji-diagnostic-meta__item",
5267
+ children: /* @__PURE__ */ jsx37("span", {
5268
+ children: action
5269
+ })
5270
+ }) : null,
5271
+ taskId ? /* @__PURE__ */ jsxs33("span", {
5272
+ className: "iquji-diagnostic-meta__item",
5273
+ children: [
5274
+ /* @__PURE__ */ jsx37("code", {
5275
+ children: taskId
5276
+ }),
5277
+ /* @__PURE__ */ jsx37("button", {
5278
+ "aria-label": `复制任务ID: ${taskId}`,
5279
+ className: "iquji-diagnostic-meta__btn",
5280
+ onClick: () => void handleCopyTaskId(taskId),
5281
+ title: "复制任务 ID",
5282
+ type: "button",
5283
+ children: /* @__PURE__ */ jsx37(IqujiIcon17, {
5284
+ decorative: true,
5285
+ name: copiedTaskId ? "check" : "copy",
5286
+ size: 11
5287
+ })
5288
+ })
5289
+ ]
5290
+ }) : null,
5291
+ status ? /* @__PURE__ */ jsx37(IqujiBadge, {
5292
+ tone: statusTone,
5293
+ children: status === "failed" ? "失败" : status === "running" ? "执行中" : status === "queued" ? "队列中" : status === "succeeded" ? "成功" : status
5294
+ }) : null
5295
+ ]
5296
+ }) : null,
5297
+ errorMessage || errorCode ? /* @__PURE__ */ jsx37(IqujiDiagnosticBanner, {
5298
+ description: errorMessage,
5299
+ errorCode,
5300
+ title: errorTitle,
5301
+ tone: "danger"
5302
+ }) : null,
5303
+ logsError ? /* @__PURE__ */ jsx37(IqujiDiagnosticBanner, {
5304
+ action: onRefreshLogs ? /* @__PURE__ */ jsx37(IqujiButton, {
5305
+ compact: true,
5306
+ onClick: onRefreshLogs,
5307
+ variant: "secondary",
5308
+ children: "重新读取"
5309
+ }) : null,
5310
+ description: logsError,
5311
+ title: "诊断日志读取失败",
5312
+ tone: "danger"
5313
+ }) : null,
5314
+ /* @__PURE__ */ jsx37(IqujiLogViewer, {
5315
+ actions: onRefreshLogs ? /* @__PURE__ */ jsxs33("button", {
5316
+ "aria-label": "刷新日志",
5317
+ className: "iquji-log-viewer__tool-btn",
5318
+ disabled: logsLoading,
5319
+ onClick: onRefreshLogs,
5320
+ title: "刷新日志",
5321
+ type: "button",
5322
+ children: [
5323
+ /* @__PURE__ */ jsx37(IqujiIcon17, {
5324
+ decorative: true,
5325
+ name: "rotate-ccw",
5326
+ size: 11
5327
+ }),
5328
+ /* @__PURE__ */ jsx37("span", {
5329
+ children: logsLoading ? "刷新中…" : "刷新"
5330
+ })
5331
+ ]
5332
+ }) : null,
5333
+ emptyLabel: "此操作没有详细日志。旧版本未记录的失败原因需要重新探测或重试后查看。",
5334
+ label: "操作诊断日志",
5335
+ loading: logsLoading,
5336
+ logs,
5337
+ maxHeight
5338
+ })
5339
+ ]
5340
+ });
5341
+ }
5342
+ function IqujiDiagnosticDialog({
5343
+ action,
5344
+ closeLabel = "关闭操作诊断日志",
5345
+ diagnosticText,
5346
+ errorCode,
5347
+ errorMessage,
5348
+ errorTitle = "操作未完成",
5349
+ logs = [],
5350
+ logsError,
5351
+ logsLoading = false,
5352
+ onOpenChange,
5353
+ onRefreshLogs,
5354
+ open,
5355
+ size: size2 = "lg",
5356
+ status,
5357
+ taskId,
5358
+ title = "操作诊断日志",
5359
+ ...dialogProps
5360
+ }) {
5361
+ const [copiedDiagnostic, setCopiedDiagnostic] = useState18(false);
5362
+ const fullDiagnosticReport = useMemo10(() => {
5363
+ if (diagnosticText)
5364
+ return diagnosticText;
5365
+ const lines = ["### 操作诊断报告"];
5366
+ if (taskId)
5367
+ lines.push(`- **任务 ID**: \`${taskId}\``);
5368
+ if (action)
5369
+ lines.push(`- **动作**: \`${action}\``);
5370
+ if (status)
5371
+ lines.push(`- **状态**: ${status}`);
5372
+ if (errorCode)
5373
+ lines.push(`- **错误代码**: \`${errorCode}\``);
5374
+ if (errorMessage)
5375
+ lines.push(`- **错误说明**: ${errorMessage}`);
5376
+ lines.push("", "### 详细日志");
5377
+ if (logs.length === 0) {
5378
+ lines.push("*(无详细日志)*");
5379
+ } else {
5380
+ lines.push("```");
5381
+ for (const log of logs) {
5382
+ if (typeof log === "string") {
5383
+ lines.push(log);
5384
+ } else {
5385
+ lines.push([log.timestamp, log.level?.toUpperCase(), log.source, log.phase, log.message].filter(Boolean).join(" "));
5386
+ }
5387
+ }
5388
+ lines.push("```");
5389
+ }
5390
+ return lines.join(`
5391
+ `);
5392
+ }, [action, diagnosticText, errorCode, errorMessage, logs, status, taskId]);
5393
+ const handleCopyDiagnostic = async () => {
5394
+ try {
5395
+ await navigator.clipboard.writeText(fullDiagnosticReport);
5396
+ setCopiedDiagnostic(true);
5397
+ setTimeout(() => setCopiedDiagnostic(false), 2500);
5398
+ } catch {}
5399
+ };
5400
+ return /* @__PURE__ */ jsx37(IqujiDialog, {
5401
+ ...dialogProps,
5402
+ actions: /* @__PURE__ */ jsxs33(Fragment9, {
5403
+ children: [
5404
+ onRefreshLogs ? /* @__PURE__ */ jsx37(IqujiButton, {
5405
+ loading: logsLoading,
5406
+ onClick: onRefreshLogs,
5407
+ variant: "secondary",
5408
+ children: "刷新日志"
5409
+ }) : null,
5410
+ /* @__PURE__ */ jsx37(IqujiButton, {
5411
+ onClick: () => void handleCopyDiagnostic(),
5412
+ variant: "primary",
5413
+ children: copiedDiagnostic ? "✓ 诊断信息已复制" : "复制诊断信息"
5414
+ }),
5415
+ /* @__PURE__ */ jsx37(IqujiButton, {
5416
+ onClick: () => onOpenChange?.(false),
5417
+ variant: "ghost",
5418
+ children: "关闭"
5419
+ })
5420
+ ]
5421
+ }),
5422
+ closeLabel,
5423
+ description: action && taskId ? `${action} · ${taskId}` : dialogProps.description,
5424
+ onOpenChange,
5425
+ open,
5426
+ size: size2,
5427
+ title,
5428
+ children: /* @__PURE__ */ jsx37(IqujiDiagnosticPanel, {
5429
+ action,
5430
+ errorCode,
5431
+ errorMessage,
5432
+ errorTitle,
5433
+ logs,
5434
+ logsError,
5435
+ logsLoading,
5436
+ onRefreshLogs,
5437
+ status,
5438
+ taskId
5439
+ })
5440
+ });
5441
+ }
4735
5442
 
4736
5443
  // src/index.tsx
4737
- import { jsx as jsx36, jsxs as jsxs32, Fragment as Fragment9 } from "react/jsx-runtime";
5444
+ import { jsx as jsx38, jsxs as jsxs34, Fragment as Fragment10 } from "react/jsx-runtime";
4738
5445
  var renderNavigationItem = (item) => {
4739
- const content = /* @__PURE__ */ jsxs32(Fragment9, {
5446
+ const content = /* @__PURE__ */ jsxs34(Fragment10, {
4740
5447
  children: [
4741
5448
  item.icon,
4742
- /* @__PURE__ */ jsx36("span", {
5449
+ /* @__PURE__ */ jsx38("span", {
4743
5450
  children: item.label
4744
5451
  })
4745
5452
  ]
4746
5453
  });
4747
- return item.disabled || !item.href ? /* @__PURE__ */ jsx36("button", {
5454
+ return item.disabled || !item.href ? /* @__PURE__ */ jsx38("button", {
4748
5455
  "aria-label": item.label,
4749
5456
  className: "iquji-app-shell__navigation-item",
4750
5457
  "data-disabled": "true",
4751
5458
  disabled: true,
4752
5459
  type: "button",
4753
5460
  children: content
4754
- }, item.id) : /* @__PURE__ */ jsx36("a", {
5461
+ }, item.id) : /* @__PURE__ */ jsx38("a", {
4755
5462
  "aria-label": item.label,
4756
5463
  "aria-current": item.active ? "page" : undefined,
4757
5464
  className: "iquji-app-shell__navigation-item",
@@ -4773,29 +5480,29 @@ function AppShell({
4773
5480
  mainId = "iquji-main-content",
4774
5481
  skipLinkLabel
4775
5482
  }) {
4776
- return /* @__PURE__ */ jsxs32("div", {
5483
+ return /* @__PURE__ */ jsxs34("div", {
4777
5484
  className: "iquji-app-shell",
4778
5485
  children: [
4779
- skipLinkLabel ? /* @__PURE__ */ jsx36("a", {
5486
+ skipLinkLabel ? /* @__PURE__ */ jsx38("a", {
4780
5487
  className: "iquji-skip-link",
4781
5488
  href: `#${mainId}`,
4782
5489
  children: skipLinkLabel
4783
5490
  }) : null,
4784
- /* @__PURE__ */ jsxs32("aside", {
5491
+ /* @__PURE__ */ jsxs34("aside", {
4785
5492
  className: "iquji-app-shell__sidebar",
4786
5493
  children: [
4787
- /* @__PURE__ */ jsx36("div", {
5494
+ /* @__PURE__ */ jsx38("div", {
4788
5495
  className: "iquji-app-shell__brand",
4789
5496
  children: brand
4790
5497
  }),
4791
- /* @__PURE__ */ jsx36("nav", {
5498
+ /* @__PURE__ */ jsx38("nav", {
4792
5499
  "aria-label": navigationLabel,
4793
5500
  className: "iquji-app-shell__navigation",
4794
- children: navigationGroups?.length ? navigationGroups.map((group) => /* @__PURE__ */ jsxs32("section", {
5501
+ children: navigationGroups?.length ? navigationGroups.map((group) => /* @__PURE__ */ jsxs34("section", {
4795
5502
  "aria-labelledby": `${group.id}-navigation-heading`,
4796
5503
  className: "iquji-app-shell__navigation-group",
4797
5504
  children: [
4798
- /* @__PURE__ */ jsx36("h2", {
5505
+ /* @__PURE__ */ jsx38("h2", {
4799
5506
  className: "iquji-app-shell__navigation-heading",
4800
5507
  id: `${group.id}-navigation-heading`,
4801
5508
  children: group.label
@@ -4806,14 +5513,14 @@ function AppShell({
4806
5513
  })
4807
5514
  ]
4808
5515
  }),
4809
- /* @__PURE__ */ jsxs32("div", {
5516
+ /* @__PURE__ */ jsxs34("div", {
4810
5517
  className: "iquji-app-shell__workspace",
4811
5518
  children: [
4812
- /* @__PURE__ */ jsx36("header", {
5519
+ /* @__PURE__ */ jsx38("header", {
4813
5520
  className: "iquji-app-shell__header",
4814
5521
  children: header
4815
5522
  }),
4816
- /* @__PURE__ */ jsx36("main", {
5523
+ /* @__PURE__ */ jsx38("main", {
4817
5524
  className: "iquji-app-shell__main",
4818
5525
  id: mainId,
4819
5526
  tabIndex: -1,
@@ -4841,7 +5548,7 @@ var IconButton = forwardRef3(function IconButton2({
4841
5548
  compact ? "iquji-icon-button--compact" : null,
4842
5549
  className
4843
5550
  ].filter(Boolean).join(" ");
4844
- return /* @__PURE__ */ jsx36("button", {
5551
+ return /* @__PURE__ */ jsx38("button", {
4845
5552
  ...buttonProps,
4846
5553
  "aria-busy": loading || undefined,
4847
5554
  "aria-label": label,
@@ -4850,10 +5557,10 @@ var IconButton = forwardRef3(function IconButton2({
4850
5557
  ref,
4851
5558
  title: label,
4852
5559
  type,
4853
- children: loading ? /* @__PURE__ */ jsx36("span", {
5560
+ children: loading ? /* @__PURE__ */ jsx38("span", {
4854
5561
  "aria-hidden": "true",
4855
5562
  className: "iquji-button__spinner"
4856
- }) : /* @__PURE__ */ jsx36("span", {
5563
+ }) : /* @__PURE__ */ jsx38("span", {
4857
5564
  "aria-hidden": "true",
4858
5565
  className: "iquji-icon-button__icon",
4859
5566
  children: icon
@@ -4866,7 +5573,7 @@ function StatusBadge({
4866
5573
  ...props
4867
5574
  }) {
4868
5575
  const names = ["iquji-status-badge", className].filter(Boolean).join(" ");
4869
- return /* @__PURE__ */ jsx36("span", {
5576
+ return /* @__PURE__ */ jsx38("span", {
4870
5577
  className: names,
4871
5578
  "data-tone": tone,
4872
5579
  ...props
@@ -4894,11 +5601,11 @@ var IqujiButton = forwardRef3(function IqujiButton2({
4894
5601
  allowLabelWrap ? "iquji-button--allow-label-wrap" : null,
4895
5602
  className
4896
5603
  ].filter(Boolean).join(" ");
4897
- const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx36("span", {
5604
+ const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx38("span", {
4898
5605
  className: "iquji-button__label",
4899
5606
  children
4900
5607
  }) : children;
4901
- return /* @__PURE__ */ jsxs32("button", {
5608
+ return /* @__PURE__ */ jsxs34("button", {
4902
5609
  ...buttonProps,
4903
5610
  "aria-busy": loading || undefined,
4904
5611
  className: names,
@@ -4906,16 +5613,16 @@ var IqujiButton = forwardRef3(function IqujiButton2({
4906
5613
  ref,
4907
5614
  type,
4908
5615
  children: [
4909
- loading ? /* @__PURE__ */ jsx36("span", {
5616
+ loading ? /* @__PURE__ */ jsx38("span", {
4910
5617
  className: "iquji-button__spinner",
4911
5618
  "aria-hidden": "true"
4912
- }) : iconStart ? /* @__PURE__ */ jsx36("span", {
5619
+ }) : iconStart ? /* @__PURE__ */ jsx38("span", {
4913
5620
  className: "iquji-button__icon",
4914
5621
  "aria-hidden": "true",
4915
5622
  children: iconStart
4916
5623
  }) : null,
4917
5624
  content,
4918
- !loading && iconEnd ? /* @__PURE__ */ jsx36("span", {
5625
+ !loading && iconEnd ? /* @__PURE__ */ jsx38("span", {
4919
5626
  className: "iquji-button__icon",
4920
5627
  "aria-hidden": "true",
4921
5628
  children: iconEnd
@@ -4949,11 +5656,11 @@ function IqujiButtonLink({
4949
5656
  allowLabelWrap ? "iquji-button-link--allow-label-wrap" : null,
4950
5657
  className
4951
5658
  ].filter(Boolean).join(" ");
4952
- const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx36("span", {
5659
+ const content = typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx38("span", {
4953
5660
  className: "iquji-button__label",
4954
5661
  children
4955
5662
  }) : children;
4956
- return /* @__PURE__ */ jsxs32("a", {
5663
+ return /* @__PURE__ */ jsxs34("a", {
4957
5664
  ...anchorProps,
4958
5665
  "aria-busy": loading || undefined,
4959
5666
  "aria-disabled": blocked || undefined,
@@ -4971,16 +5678,16 @@ function IqujiButtonLink({
4971
5678
  },
4972
5679
  tabIndex: blocked ? -1 : tabIndex,
4973
5680
  children: [
4974
- loading ? /* @__PURE__ */ jsx36("span", {
5681
+ loading ? /* @__PURE__ */ jsx38("span", {
4975
5682
  className: "iquji-button__spinner",
4976
5683
  "aria-hidden": "true"
4977
- }) : iconStart ? /* @__PURE__ */ jsx36("span", {
5684
+ }) : iconStart ? /* @__PURE__ */ jsx38("span", {
4978
5685
  className: "iquji-button__icon",
4979
5686
  "aria-hidden": "true",
4980
5687
  children: iconStart
4981
5688
  }) : null,
4982
5689
  content,
4983
- !loading && iconEnd ? /* @__PURE__ */ jsx36("span", {
5690
+ !loading && iconEnd ? /* @__PURE__ */ jsx38("span", {
4984
5691
  className: "iquji-button__icon",
4985
5692
  "aria-hidden": "true",
4986
5693
  children: iconEnd
@@ -4995,11 +5702,11 @@ function IqujiPanel({
4995
5702
  ...sectionProps
4996
5703
  }) {
4997
5704
  const names = ["iquji-panel", className].filter(Boolean).join(" ");
4998
- return /* @__PURE__ */ jsxs32("section", {
5705
+ return /* @__PURE__ */ jsxs34("section", {
4999
5706
  className: names,
5000
5707
  ...sectionProps,
5001
5708
  children: [
5002
- header ? /* @__PURE__ */ jsx36("header", {
5709
+ header ? /* @__PURE__ */ jsx38("header", {
5003
5710
  className: "iquji-panel__header",
5004
5711
  children: header
5005
5712
  }) : null,
@@ -5016,20 +5723,20 @@ function IqujiPageHeading({
5016
5723
  titleId
5017
5724
  }) {
5018
5725
  const names = ["iquji-page-heading", className].filter(Boolean).join(" ");
5019
- return /* @__PURE__ */ jsxs32("div", {
5726
+ return /* @__PURE__ */ jsxs34("div", {
5020
5727
  className: names,
5021
5728
  children: [
5022
- /* @__PURE__ */ jsxs32("div", {
5729
+ /* @__PURE__ */ jsxs34("div", {
5023
5730
  children: [
5024
- kicker ? /* @__PURE__ */ jsx36("p", {
5731
+ kicker ? /* @__PURE__ */ jsx38("p", {
5025
5732
  className: "iquji-page-heading__kicker",
5026
5733
  children: kicker
5027
5734
  }) : null,
5028
- /* @__PURE__ */ jsx36("h1", {
5735
+ /* @__PURE__ */ jsx38("h1", {
5029
5736
  id: titleId,
5030
5737
  children: title
5031
5738
  }),
5032
- summary ? /* @__PURE__ */ jsx36("p", {
5739
+ summary ? /* @__PURE__ */ jsx38("p", {
5033
5740
  className: "iquji-page-heading__summary",
5034
5741
  children: summary
5035
5742
  }) : null
@@ -5050,24 +5757,24 @@ function IqujiEmptyState({
5050
5757
  ...sectionProps
5051
5758
  }) {
5052
5759
  const names = ["iquji-empty-state", className].filter(Boolean).join(" ");
5053
- return /* @__PURE__ */ jsxs32("section", {
5760
+ return /* @__PURE__ */ jsxs34("section", {
5054
5761
  className: names,
5055
5762
  ...sectionProps,
5056
5763
  children: [
5057
- icon ? /* @__PURE__ */ jsx36("span", {
5764
+ icon ? /* @__PURE__ */ jsx38("span", {
5058
5765
  className: "iquji-empty-state__icon",
5059
5766
  "aria-hidden": "true",
5060
5767
  children: icon
5061
5768
  }) : null,
5062
- title ? /* @__PURE__ */ jsx36("h2", {
5769
+ title ? /* @__PURE__ */ jsx38("h2", {
5063
5770
  id: titleId,
5064
5771
  children: title
5065
5772
  }) : null,
5066
- body ? /* @__PURE__ */ jsx36("p", {
5773
+ body ? /* @__PURE__ */ jsx38("p", {
5067
5774
  children: body
5068
5775
  }) : null,
5069
5776
  children,
5070
- action ? /* @__PURE__ */ jsx36("div", {
5777
+ action ? /* @__PURE__ */ jsx38("div", {
5071
5778
  className: "iquji-empty-state__action",
5072
5779
  children: action
5073
5780
  }) : null
@@ -5080,18 +5787,18 @@ function IqujiLoadingState({
5080
5787
  ...divProps
5081
5788
  }) {
5082
5789
  const names = ["iquji-loading-state", className].filter(Boolean).join(" ");
5083
- return /* @__PURE__ */ jsxs32("div", {
5790
+ return /* @__PURE__ */ jsxs34("div", {
5084
5791
  "aria-busy": "true",
5085
5792
  "aria-live": "polite",
5086
5793
  className: names,
5087
5794
  role: "status",
5088
5795
  ...divProps,
5089
5796
  children: [
5090
- /* @__PURE__ */ jsx36("span", {
5797
+ /* @__PURE__ */ jsx38("span", {
5091
5798
  className: "iquji-loading-state__spinner",
5092
5799
  "aria-hidden": "true"
5093
5800
  }),
5094
- /* @__PURE__ */ jsx36("span", {
5801
+ /* @__PURE__ */ jsx38("span", {
5095
5802
  children: label
5096
5803
  })
5097
5804
  ]
@@ -5100,6 +5807,7 @@ function IqujiLoadingState({
5100
5807
  export {
5101
5808
  useIqujiOverlayContainer,
5102
5809
  useIqujiNotification,
5810
+ parseLogLine,
5103
5811
  parseCalendarDate,
5104
5812
  normalizeIqujiColor,
5105
5813
  formatCalendarDate,
@@ -5136,6 +5844,7 @@ export {
5136
5844
  IqujiOverlayProvider,
5137
5845
  IqujiNotificationProvider,
5138
5846
  IqujiMultiSelect,
5847
+ IqujiLogViewer,
5139
5848
  IqujiLoadingState,
5140
5849
  IqujiInput,
5141
5850
  IqujiFormSteps,
@@ -5146,6 +5855,9 @@ export {
5146
5855
  IqujiDropdownMenu,
5147
5856
  IqujiDrawer,
5148
5857
  IqujiDialog,
5858
+ IqujiDiagnosticPanel,
5859
+ IqujiDiagnosticDialog,
5860
+ IqujiDiagnosticBanner,
5149
5861
  IqujiDesktopTitleBar,
5150
5862
  IqujiDesktopTabStrip,
5151
5863
  IqujiDesktopShell,