uilint-react 0.2.137 → 0.2.138
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/DevTool.d.ts.map +1 -1
- package/dist/SchemaPanel-0lLkqa2L.js +893 -0
- package/dist/SchemaPanel-0lLkqa2L.js.map +1 -0
- package/dist/components/ui-lint/index.d.ts +1 -2
- package/dist/components/ui-lint/index.d.ts.map +1 -1
- package/dist/components/ui-lint/types.d.ts +10 -45
- package/dist/components/ui-lint/types.d.ts.map +1 -1
- package/dist/consistency/highlights.d.ts.map +1 -1
- package/dist/core/plugin-system/adapter.d.ts +24 -0
- package/dist/core/plugin-system/adapter.d.ts.map +1 -0
- package/dist/core/plugin-system/index.d.ts +2 -1
- package/dist/core/plugin-system/index.d.ts.map +1 -1
- package/dist/core/plugin-system/loader.d.ts +22 -2
- package/dist/core/plugin-system/loader.d.ts.map +1 -1
- package/dist/core/plugin-system/types.d.ts +1 -7
- package/dist/core/plugin-system/types.d.ts.map +1 -1
- package/dist/core/services/websocket.d.ts +2 -1
- package/dist/core/services/websocket.d.ts.map +1 -1
- package/dist/core/store/composed-store.d.ts +5 -5
- package/dist/core/store/composed-store.d.ts.map +1 -1
- package/dist/core/store/core-slice.d.ts +36 -0
- package/dist/core/store/core-slice.d.ts.map +1 -1
- package/dist/devtools.js +116 -116
- package/dist/devtools.js.map +1 -1
- package/dist/index-Cc4gwBce.js +18605 -0
- package/dist/index-Cc4gwBce.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -18890
- package/dist/index.js.map +1 -1
- package/dist/plugins/eslint/panels/RulePanel.d.ts.map +1 -1
- package/dist/plugins/eslint/tile-provider.d.ts +2 -1
- package/dist/plugins/eslint/tile-provider.d.ts.map +1 -1
- package/dist/ui/UILint.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/CommandPalette.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/EmptyState.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/ExpandableTile.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/ExpandableTileGrid.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/ExpandedTileHeader.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/OnboardingState.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/RuleToggleBar.d.ts +3 -0
- package/dist/ui/components/CommandPalette/RuleToggleBar.d.ts.map +1 -0
- package/dist/ui/components/CommandPalette/index.d.ts +2 -2
- package/dist/ui/components/CommandPalette/index.d.ts.map +1 -1
- package/dist/ui/components/CommandPalette/layout/index.d.ts +4 -6
- package/dist/ui/components/CommandPalette/layout/index.d.ts.map +1 -1
- package/dist/ui/components/HeatmapOverlay.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/ExpandableContainer.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/ExpandableTileGrid.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/Tile.d.ts +6 -8
- package/dist/ui/components/HierarchicalTiles/Tile.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/TileGrid.d.ts +6 -5
- package/dist/ui/components/HierarchicalTiles/TileGrid.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/TileHeader.d.ts +7 -6
- package/dist/ui/components/HierarchicalTiles/TileHeader.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/layout/mosaic-layout.d.ts +9 -3
- package/dist/ui/components/HierarchicalTiles/layout/mosaic-layout.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/layout/types.d.ts +4 -0
- package/dist/ui/components/HierarchicalTiles/layout/types.d.ts.map +1 -1
- package/dist/ui/components/HierarchicalTiles/types.d.ts +2 -3
- package/dist/ui/components/HierarchicalTiles/types.d.ts.map +1 -1
- package/dist/ui/components/Inspector/Breadcrumbs.d.ts +3 -1
- package/dist/ui/components/Inspector/Breadcrumbs.d.ts.map +1 -1
- package/dist/ui/components/Inspector/CollapsedIssueIndicator.d.ts.map +1 -1
- package/dist/ui/components/Inspector/ElementDetail.d.ts.map +1 -1
- package/dist/ui/components/Inspector/FileNodeAdapter.d.ts +2 -1
- package/dist/ui/components/Inspector/FileNodeAdapter.d.ts.map +1 -1
- package/dist/ui/components/Inspector/InspectorSidebar.d.ts.map +1 -1
- package/dist/ui/components/Inspector/IssueDetail.d.ts.map +1 -1
- package/dist/ui/components/Inspector/IssuesList.d.ts.map +1 -1
- package/dist/ui/components/Inspector/RuleHeader.d.ts +6 -1
- package/dist/ui/components/Inspector/RuleHeader.d.ts.map +1 -1
- package/dist/ui/components/Inspector/RuleNodeAdapter.d.ts.map +1 -1
- package/dist/ui/components/Inspector/SourceViewer.d.ts.map +1 -1
- package/dist/ui/components/InspectorToggle.d.ts.map +1 -1
- package/dist/ui/components/PluginToolbar.d.ts +6 -0
- package/dist/ui/components/PluginToolbar.d.ts.map +1 -0
- package/dist/ui/components/Popover.d.ts.map +1 -1
- package/dist/ui/components/RegionSelector.d.ts.map +1 -1
- package/dist/ui/components/Schema/SchemaPanel.d.ts +20 -0
- package/dist/ui/components/Schema/SchemaPanel.d.ts.map +1 -0
- package/dist/ui/components/Schema/binding-utils.d.ts +49 -0
- package/dist/ui/components/Schema/binding-utils.d.ts.map +1 -0
- package/dist/ui/components/Schema/icon-map.d.ts +16 -0
- package/dist/ui/components/Schema/icon-map.d.ts.map +1 -0
- package/dist/ui/components/Schema/index.d.ts +10 -0
- package/dist/ui/components/Schema/index.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ActionsSection.d.ts +13 -0
- package/dist/ui/components/Schema/sections/ActionsSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/BadgeSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/BadgeSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/CardSection.d.ts +13 -0
- package/dist/ui/components/Schema/sections/CardSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/CodeComparisonSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/CodeComparisonSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/CodeViewerSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/CodeViewerSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ConditionalSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/ConditionalSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/DividerSection.d.ts +10 -0
- package/dist/ui/components/Schema/sections/DividerSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/HeaderSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/HeaderSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ImageSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/ImageSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ListSection.d.ts +14 -0
- package/dist/ui/components/Schema/sections/ListSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/ProgressSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/ProgressSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/TextSection.d.ts +12 -0
- package/dist/ui/components/Schema/sections/TextSection.d.ts.map +1 -0
- package/dist/ui/components/Schema/sections/index.d.ts +18 -0
- package/dist/ui/components/Schema/sections/index.d.ts.map +1 -0
- package/dist/ui/components/badge.d.ts.map +1 -1
- package/dist/ui/components/bottom-sheet.d.ts.map +1 -1
- package/dist/ui/components/button.d.ts.map +1 -1
- package/dist/ui/hooks/useTileItems.d.ts.map +1 -1
- package/dist/ui/types.d.ts +1 -1
- package/package.json +14 -4
- package/dist/index-L3Zm-CoX.js +0 -513
- package/dist/index-L3Zm-CoX.js.map +0 -1
- package/dist/plugins/semantic/commands.d.ts +0 -6
- package/dist/plugins/semantic/commands.d.ts.map +0 -1
- package/dist/plugins/semantic/index.d.ts +0 -15
- package/dist/plugins/semantic/index.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/DuplicateSimilarityBadge.d.ts +0 -21
- package/dist/plugins/semantic/panels/DuplicateSimilarityBadge.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/DuplicatesInspectorPanel.d.ts +0 -8
- package/dist/plugins/semantic/panels/DuplicatesInspectorPanel.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/ScrollableCodeSection.d.ts +0 -27
- package/dist/plugins/semantic/panels/ScrollableCodeSection.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/index.d.ts +0 -11
- package/dist/plugins/semantic/panels/index.d.ts.map +0 -1
- package/dist/plugins/semantic/panels/useDiffHighlights.d.ts +0 -45
- package/dist/plugins/semantic/panels/useDiffHighlights.d.ts.map +0 -1
- package/dist/plugins/semantic/slice.d.ts +0 -52
- package/dist/plugins/semantic/slice.d.ts.map +0 -1
- package/dist/plugins/semantic/types.d.ts +0 -121
- package/dist/plugins/semantic/types.d.ts.map +0 -1
- package/dist/plugins/vision/commands.d.ts +0 -6
- package/dist/plugins/vision/commands.d.ts.map +0 -1
- package/dist/plugins/vision/index.d.ts +0 -12
- package/dist/plugins/vision/index.d.ts.map +0 -1
- package/dist/plugins/vision/slice.d.ts +0 -123
- package/dist/plugins/vision/slice.d.ts.map +0 -1
- package/dist/plugins/vision/types.d.ts +0 -169
- package/dist/plugins/vision/types.d.ts.map +0 -1
- package/dist/scanner/vision-capture.d.ts +0 -131
- package/dist/scanner/vision-capture.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/Tile.d.ts +0 -18
- package/dist/ui/components/CommandPalette/Tile.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/TileGrid.d.ts +0 -20
- package/dist/ui/components/CommandPalette/TileGrid.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/layout/expanded-layout.d.ts +0 -43
- package/dist/ui/components/CommandPalette/layout/expanded-layout.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/layout/mosaic-layout.d.ts +0 -89
- package/dist/ui/components/CommandPalette/layout/mosaic-layout.d.ts.map +0 -1
- package/dist/ui/components/CommandPalette/layout/types.d.ts +0 -67
- package/dist/ui/components/CommandPalette/layout/types.d.ts.map +0 -1
|
@@ -0,0 +1,893 @@
|
|
|
1
|
+
import { g as j, j as t, C as H, a as L, B as v, b as I, c as M, d as V, e as $, f as A } from "./index-Cc4gwBce.js";
|
|
2
|
+
import { isExpressionBinding as D, isDataBinding as k, isConditionalValue as R } from "uilint-core";
|
|
3
|
+
import b from "react";
|
|
4
|
+
function S(e, r) {
|
|
5
|
+
const n = r.split(".");
|
|
6
|
+
let i = e;
|
|
7
|
+
for (const o of n) {
|
|
8
|
+
if (i == null)
|
|
9
|
+
return;
|
|
10
|
+
if (typeof i == "object")
|
|
11
|
+
i = i[o];
|
|
12
|
+
else
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
return i;
|
|
16
|
+
}
|
|
17
|
+
function u(e, r) {
|
|
18
|
+
const n = e.binding;
|
|
19
|
+
let i = S(r.data, n);
|
|
20
|
+
return i === void 0 && (i = S(r.state, n)), i === void 0 && (i = S(r.computed, n)), i;
|
|
21
|
+
}
|
|
22
|
+
function T(e, r) {
|
|
23
|
+
const n = e.expression, i = {
|
|
24
|
+
...r.data,
|
|
25
|
+
...r.state,
|
|
26
|
+
...r.computed
|
|
27
|
+
};
|
|
28
|
+
try {
|
|
29
|
+
const o = Object.keys(i), a = Object.values(i);
|
|
30
|
+
return new Function(...o, `return (${n});`)(...a);
|
|
31
|
+
} catch (o) {
|
|
32
|
+
console.warn(`[SchemaRenderer] Failed to evaluate expression: ${n}`, o);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function f(e, r) {
|
|
37
|
+
return k(e) ? u(e, r) : e;
|
|
38
|
+
}
|
|
39
|
+
function P(e, r) {
|
|
40
|
+
return u(e.condition, r) ? e.true : e.false;
|
|
41
|
+
}
|
|
42
|
+
function z(e, r) {
|
|
43
|
+
return R(e) ? P(e, r) : k(e) ? u(e, r) : e;
|
|
44
|
+
}
|
|
45
|
+
function C(e, r) {
|
|
46
|
+
return D(e) ? !!T(e, r) : !!u(e, r);
|
|
47
|
+
}
|
|
48
|
+
function B(e, r, n) {
|
|
49
|
+
const i = { ...e };
|
|
50
|
+
if (r)
|
|
51
|
+
for (const [o, a] of Object.entries(r))
|
|
52
|
+
i[o] = u({ binding: a }, n);
|
|
53
|
+
return i;
|
|
54
|
+
}
|
|
55
|
+
function E({ section: e, ctx: r }) {
|
|
56
|
+
const n = f(e.text, r), i = f(e.subtitle, r), o = e.icon ? j(e.icon) : null, a = {
|
|
57
|
+
display: "flex",
|
|
58
|
+
alignItems: "flex-start",
|
|
59
|
+
gap: "0.5rem",
|
|
60
|
+
marginBottom: "0.75rem",
|
|
61
|
+
...e.sticky && {
|
|
62
|
+
position: "sticky",
|
|
63
|
+
top: 0,
|
|
64
|
+
backgroundColor: "var(--uilint-surface)",
|
|
65
|
+
padding: "0.5rem 0",
|
|
66
|
+
zIndex: 10
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return /* @__PURE__ */ t.jsxs("div", { style: a, children: [
|
|
70
|
+
o && /* @__PURE__ */ t.jsx("span", { style: { color: "var(--uilint-text-muted)", flexShrink: 0, marginTop: "0.125rem" }, children: /* @__PURE__ */ t.jsx(o, { size: 16 }) }),
|
|
71
|
+
/* @__PURE__ */ t.jsxs("div", { children: [
|
|
72
|
+
/* @__PURE__ */ t.jsx(
|
|
73
|
+
"h3",
|
|
74
|
+
{
|
|
75
|
+
style: {
|
|
76
|
+
margin: 0,
|
|
77
|
+
fontSize: "0.875rem",
|
|
78
|
+
fontWeight: 600,
|
|
79
|
+
color: "var(--uilint-text-primary)"
|
|
80
|
+
},
|
|
81
|
+
children: String(n ?? "")
|
|
82
|
+
}
|
|
83
|
+
),
|
|
84
|
+
i && /* @__PURE__ */ t.jsx(
|
|
85
|
+
"p",
|
|
86
|
+
{
|
|
87
|
+
style: {
|
|
88
|
+
margin: "0.25rem 0 0 0",
|
|
89
|
+
fontSize: "0.75rem",
|
|
90
|
+
color: "var(--uilint-text-muted)"
|
|
91
|
+
},
|
|
92
|
+
children: String(i)
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
] })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
function N({
|
|
99
|
+
code: e,
|
|
100
|
+
startLine: r = 1,
|
|
101
|
+
highlightLines: n,
|
|
102
|
+
maxHeight: i
|
|
103
|
+
}) {
|
|
104
|
+
const o = e.split(`
|
|
105
|
+
`), a = new Set(n || []);
|
|
106
|
+
return /* @__PURE__ */ t.jsx(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
style: {
|
|
110
|
+
fontFamily: "monospace",
|
|
111
|
+
fontSize: "0.75rem",
|
|
112
|
+
backgroundColor: "var(--uilint-surface)",
|
|
113
|
+
borderRadius: "4px",
|
|
114
|
+
border: "1px solid var(--uilint-border)",
|
|
115
|
+
overflow: "auto",
|
|
116
|
+
maxHeight: i || 200
|
|
117
|
+
},
|
|
118
|
+
children: o.map((s, c) => {
|
|
119
|
+
const m = r + c, d = a.has(m);
|
|
120
|
+
return /* @__PURE__ */ t.jsxs(
|
|
121
|
+
"div",
|
|
122
|
+
{
|
|
123
|
+
style: {
|
|
124
|
+
display: "flex",
|
|
125
|
+
backgroundColor: d ? "rgba(var(--uilint-accent-rgb), 0.15)" : "transparent"
|
|
126
|
+
},
|
|
127
|
+
children: [
|
|
128
|
+
/* @__PURE__ */ t.jsx(
|
|
129
|
+
"span",
|
|
130
|
+
{
|
|
131
|
+
style: {
|
|
132
|
+
width: "3rem",
|
|
133
|
+
paddingRight: "0.5rem",
|
|
134
|
+
textAlign: "right",
|
|
135
|
+
color: "var(--uilint-text-muted)",
|
|
136
|
+
userSelect: "none",
|
|
137
|
+
flexShrink: 0,
|
|
138
|
+
borderRight: "1px solid var(--uilint-border)"
|
|
139
|
+
},
|
|
140
|
+
children: m
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
/* @__PURE__ */ t.jsx(
|
|
144
|
+
"pre",
|
|
145
|
+
{
|
|
146
|
+
style: {
|
|
147
|
+
margin: 0,
|
|
148
|
+
padding: "0 0.5rem",
|
|
149
|
+
whiteSpace: "pre-wrap",
|
|
150
|
+
wordBreak: "break-all",
|
|
151
|
+
flex: 1
|
|
152
|
+
},
|
|
153
|
+
children: s || " "
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
]
|
|
157
|
+
},
|
|
158
|
+
c
|
|
159
|
+
);
|
|
160
|
+
})
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function w({
|
|
165
|
+
section: e,
|
|
166
|
+
ctx: r,
|
|
167
|
+
onAction: n,
|
|
168
|
+
onFetch: i
|
|
169
|
+
}) {
|
|
170
|
+
const [o, a] = b.useState(null), [s, c] = b.useState(!1), m = e.code;
|
|
171
|
+
b.useEffect(() => {
|
|
172
|
+
if (k(m)) {
|
|
173
|
+
const l = u(m, r);
|
|
174
|
+
a(typeof l == "string" ? l : null);
|
|
175
|
+
} else if ("fetch" in m && i) {
|
|
176
|
+
c(!0);
|
|
177
|
+
const l = m.fetch, p = {};
|
|
178
|
+
l.params.filePath && (p.filePath = u(l.params.filePath, r)), l.params.line && (p.line = u(l.params.line, r)), l.params.contextAbove !== void 0 && (p.contextAbove = l.params.contextAbove), l.params.contextBelow !== void 0 && (p.contextBelow = l.params.contextBelow), i(l.type, p).then((x) => {
|
|
179
|
+
a(typeof x == "string" ? x : JSON.stringify(x, null, 2));
|
|
180
|
+
}).catch((x) => {
|
|
181
|
+
console.error("[CodeViewerSection] Fetch failed:", x), a(`// Error loading code: ${x.message}`);
|
|
182
|
+
}).finally(() => {
|
|
183
|
+
c(!1);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}, [m, r, i]);
|
|
187
|
+
const d = f(e.startLine, r), h = e.highlightLines ? u(e.highlightLines, r) : void 0, y = e.icon ? j(e.icon) : null, g = e.onNavigate ? () => {
|
|
188
|
+
const l = B(
|
|
189
|
+
e.onNavigate.payload,
|
|
190
|
+
e.onNavigate.payloadBindings,
|
|
191
|
+
r
|
|
192
|
+
);
|
|
193
|
+
n(e.onNavigate.type, l);
|
|
194
|
+
} : void 0;
|
|
195
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { marginBottom: "0.75rem" }, children: [
|
|
196
|
+
e.label && /* @__PURE__ */ t.jsxs(
|
|
197
|
+
"div",
|
|
198
|
+
{
|
|
199
|
+
style: {
|
|
200
|
+
display: "flex",
|
|
201
|
+
alignItems: "center",
|
|
202
|
+
justifyContent: "space-between",
|
|
203
|
+
marginBottom: "0.5rem"
|
|
204
|
+
},
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "0.375rem" }, children: [
|
|
207
|
+
y && /* @__PURE__ */ t.jsx("span", { style: { color: "var(--uilint-text-muted)" }, children: /* @__PURE__ */ t.jsx(y, { size: 14 }) }),
|
|
208
|
+
/* @__PURE__ */ t.jsx(
|
|
209
|
+
"span",
|
|
210
|
+
{
|
|
211
|
+
style: {
|
|
212
|
+
fontSize: "0.75rem",
|
|
213
|
+
fontWeight: 500,
|
|
214
|
+
color: "var(--uilint-text-secondary)"
|
|
215
|
+
},
|
|
216
|
+
children: e.label
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
] }),
|
|
220
|
+
g && /* @__PURE__ */ t.jsx(
|
|
221
|
+
"button",
|
|
222
|
+
{
|
|
223
|
+
onClick: g,
|
|
224
|
+
style: {
|
|
225
|
+
background: "none",
|
|
226
|
+
border: "none",
|
|
227
|
+
padding: "0.25rem",
|
|
228
|
+
cursor: "pointer",
|
|
229
|
+
color: "var(--uilint-accent)",
|
|
230
|
+
fontSize: "0.75rem"
|
|
231
|
+
},
|
|
232
|
+
children: "Open in editor"
|
|
233
|
+
}
|
|
234
|
+
)
|
|
235
|
+
]
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
s ? /* @__PURE__ */ t.jsx(
|
|
239
|
+
"div",
|
|
240
|
+
{
|
|
241
|
+
style: {
|
|
242
|
+
padding: "1rem",
|
|
243
|
+
textAlign: "center",
|
|
244
|
+
color: "var(--uilint-text-muted)",
|
|
245
|
+
fontSize: "0.75rem",
|
|
246
|
+
backgroundColor: "var(--uilint-surface)",
|
|
247
|
+
borderRadius: "4px",
|
|
248
|
+
border: "1px solid var(--uilint-border)"
|
|
249
|
+
},
|
|
250
|
+
children: "Loading code..."
|
|
251
|
+
}
|
|
252
|
+
) : o ? /* @__PURE__ */ t.jsx(
|
|
253
|
+
N,
|
|
254
|
+
{
|
|
255
|
+
code: o,
|
|
256
|
+
startLine: typeof d == "number" ? d : 1,
|
|
257
|
+
highlightLines: h,
|
|
258
|
+
maxHeight: e.maxHeight
|
|
259
|
+
}
|
|
260
|
+
) : /* @__PURE__ */ t.jsx(
|
|
261
|
+
"div",
|
|
262
|
+
{
|
|
263
|
+
style: {
|
|
264
|
+
padding: "1rem",
|
|
265
|
+
textAlign: "center",
|
|
266
|
+
color: "var(--uilint-text-muted)",
|
|
267
|
+
fontSize: "0.75rem",
|
|
268
|
+
backgroundColor: "var(--uilint-surface)",
|
|
269
|
+
borderRadius: "4px",
|
|
270
|
+
border: "1px solid var(--uilint-border)"
|
|
271
|
+
},
|
|
272
|
+
children: "No code available"
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
] });
|
|
276
|
+
}
|
|
277
|
+
function W({
|
|
278
|
+
section: e,
|
|
279
|
+
ctx: r,
|
|
280
|
+
onAction: n,
|
|
281
|
+
onFetch: i
|
|
282
|
+
}) {
|
|
283
|
+
const a = e.mode === "stacked" ? {
|
|
284
|
+
display: "flex",
|
|
285
|
+
flexDirection: "column",
|
|
286
|
+
gap: "1rem",
|
|
287
|
+
marginBottom: "0.75rem"
|
|
288
|
+
} : {
|
|
289
|
+
display: "grid",
|
|
290
|
+
gridTemplateColumns: "1fr 1fr",
|
|
291
|
+
gap: "1rem",
|
|
292
|
+
marginBottom: "0.75rem"
|
|
293
|
+
}, s = {
|
|
294
|
+
type: "code-viewer",
|
|
295
|
+
label: e.source.label,
|
|
296
|
+
icon: e.source.icon,
|
|
297
|
+
code: e.source.code,
|
|
298
|
+
location: e.source.location,
|
|
299
|
+
diffHighlighting: e.computeDiff,
|
|
300
|
+
maxHeight: e.maxHeight
|
|
301
|
+
}, c = {
|
|
302
|
+
type: "code-viewer",
|
|
303
|
+
label: e.target.label,
|
|
304
|
+
icon: e.target.icon,
|
|
305
|
+
code: e.target.code,
|
|
306
|
+
location: e.target.location,
|
|
307
|
+
diffHighlighting: e.computeDiff,
|
|
308
|
+
maxHeight: e.maxHeight
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ t.jsxs("div", { style: a, children: [
|
|
311
|
+
/* @__PURE__ */ t.jsx(
|
|
312
|
+
w,
|
|
313
|
+
{
|
|
314
|
+
section: s,
|
|
315
|
+
ctx: r,
|
|
316
|
+
onAction: n,
|
|
317
|
+
onFetch: i
|
|
318
|
+
}
|
|
319
|
+
),
|
|
320
|
+
/* @__PURE__ */ t.jsx(
|
|
321
|
+
w,
|
|
322
|
+
{
|
|
323
|
+
section: c,
|
|
324
|
+
ctx: r,
|
|
325
|
+
onAction: n,
|
|
326
|
+
onFetch: i
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
] });
|
|
330
|
+
}
|
|
331
|
+
function O(e) {
|
|
332
|
+
return e >= 85 ? "error" : e >= 70 ? "warning" : "info";
|
|
333
|
+
}
|
|
334
|
+
function F(e) {
|
|
335
|
+
return e >= 90 ? "Very High" : e >= 75 ? "High" : e >= 60 ? "Moderate" : "Low";
|
|
336
|
+
}
|
|
337
|
+
function _({ section: e, ctx: r }) {
|
|
338
|
+
const n = u(e.value, r), i = e.centered ? { display: "flex", justifyContent: "center", marginBottom: "0.75rem" } : { marginBottom: "0.75rem" };
|
|
339
|
+
switch (e.variant) {
|
|
340
|
+
case "similarity": {
|
|
341
|
+
const a = Math.round((typeof n == "number" ? n : 0) * 100), s = O(a), c = F(a);
|
|
342
|
+
return /* @__PURE__ */ t.jsx("div", { style: i, children: /* @__PURE__ */ t.jsxs(v, { variant: s, children: [
|
|
343
|
+
a,
|
|
344
|
+
"% Match - ",
|
|
345
|
+
c
|
|
346
|
+
] }) });
|
|
347
|
+
}
|
|
348
|
+
case "severity": {
|
|
349
|
+
const o = String(n || "info"), s = {
|
|
350
|
+
error: "error",
|
|
351
|
+
warning: "warning",
|
|
352
|
+
info: "info",
|
|
353
|
+
success: "success"
|
|
354
|
+
}[o] || "info";
|
|
355
|
+
return /* @__PURE__ */ t.jsx("div", { style: i, children: /* @__PURE__ */ t.jsxs(v, { variant: s, children: [
|
|
356
|
+
e.label ? `${e.label}: ` : "",
|
|
357
|
+
o
|
|
358
|
+
] }) });
|
|
359
|
+
}
|
|
360
|
+
case "status": {
|
|
361
|
+
const o = String(n || "unknown"), s = {
|
|
362
|
+
ready: "success",
|
|
363
|
+
indexing: "info",
|
|
364
|
+
error: "error",
|
|
365
|
+
idle: "info",
|
|
366
|
+
loading: "info"
|
|
367
|
+
}[o] || "info";
|
|
368
|
+
return /* @__PURE__ */ t.jsx("div", { style: i, children: /* @__PURE__ */ t.jsxs(v, { variant: s, children: [
|
|
369
|
+
e.label ? `${e.label}: ` : "",
|
|
370
|
+
o
|
|
371
|
+
] }) });
|
|
372
|
+
}
|
|
373
|
+
case "category": {
|
|
374
|
+
const o = String(n || "");
|
|
375
|
+
return /* @__PURE__ */ t.jsx("div", { style: i, children: /* @__PURE__ */ t.jsx(L, { children: o }) });
|
|
376
|
+
}
|
|
377
|
+
case "count": {
|
|
378
|
+
const o = typeof n == "number" ? n : 0;
|
|
379
|
+
return /* @__PURE__ */ t.jsxs("div", { style: i, children: [
|
|
380
|
+
e.label && /* @__PURE__ */ t.jsxs("span", { style: { marginRight: "0.5rem", fontSize: "0.75rem", color: "var(--uilint-text-muted)" }, children: [
|
|
381
|
+
e.label,
|
|
382
|
+
":"
|
|
383
|
+
] }),
|
|
384
|
+
/* @__PURE__ */ t.jsx(H, { count: o })
|
|
385
|
+
] });
|
|
386
|
+
}
|
|
387
|
+
default:
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function J(e) {
|
|
392
|
+
const r = {
|
|
393
|
+
marginBottom: "0.5rem",
|
|
394
|
+
lineHeight: 1.5
|
|
395
|
+
};
|
|
396
|
+
switch (e) {
|
|
397
|
+
case "caption":
|
|
398
|
+
return {
|
|
399
|
+
...r,
|
|
400
|
+
fontSize: "0.75rem",
|
|
401
|
+
color: "var(--uilint-text-muted)"
|
|
402
|
+
};
|
|
403
|
+
case "muted":
|
|
404
|
+
return {
|
|
405
|
+
...r,
|
|
406
|
+
fontSize: "0.875rem",
|
|
407
|
+
color: "var(--uilint-text-muted)"
|
|
408
|
+
};
|
|
409
|
+
case "error":
|
|
410
|
+
return {
|
|
411
|
+
...r,
|
|
412
|
+
fontSize: "0.875rem",
|
|
413
|
+
color: "var(--uilint-error)"
|
|
414
|
+
};
|
|
415
|
+
case "success":
|
|
416
|
+
return {
|
|
417
|
+
...r,
|
|
418
|
+
fontSize: "0.875rem",
|
|
419
|
+
color: "var(--uilint-success)"
|
|
420
|
+
};
|
|
421
|
+
default:
|
|
422
|
+
return {
|
|
423
|
+
...r,
|
|
424
|
+
fontSize: "0.875rem",
|
|
425
|
+
color: "var(--uilint-text-primary)"
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
function U({ section: e, ctx: r }) {
|
|
430
|
+
const n = f(e.content, r);
|
|
431
|
+
if (n == null)
|
|
432
|
+
return null;
|
|
433
|
+
const i = J(e.variant);
|
|
434
|
+
return /* @__PURE__ */ t.jsx("p", { style: i, children: String(n) });
|
|
435
|
+
}
|
|
436
|
+
function q(e) {
|
|
437
|
+
switch (e) {
|
|
438
|
+
case "primary":
|
|
439
|
+
return "default";
|
|
440
|
+
case "secondary":
|
|
441
|
+
return "outline";
|
|
442
|
+
case "ghost":
|
|
443
|
+
return "ghost";
|
|
444
|
+
case "danger":
|
|
445
|
+
return "destructive";
|
|
446
|
+
default:
|
|
447
|
+
return "default";
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
function G({
|
|
451
|
+
button: e,
|
|
452
|
+
ctx: r,
|
|
453
|
+
onAction: n
|
|
454
|
+
}) {
|
|
455
|
+
if (e.visible && !!!u(e.visible, r))
|
|
456
|
+
return null;
|
|
457
|
+
const i = e.disabled ? !!u(e.disabled, r) : !1;
|
|
458
|
+
let o;
|
|
459
|
+
R(e.label), o = String(z(e.label, r) ?? "");
|
|
460
|
+
const a = e.icon ? j(e.icon) : null, s = () => {
|
|
461
|
+
const c = B(
|
|
462
|
+
e.action.payload,
|
|
463
|
+
e.action.payloadBindings,
|
|
464
|
+
r
|
|
465
|
+
);
|
|
466
|
+
n(e.action.type, c);
|
|
467
|
+
};
|
|
468
|
+
return /* @__PURE__ */ t.jsxs(
|
|
469
|
+
I,
|
|
470
|
+
{
|
|
471
|
+
variant: q(e.variant),
|
|
472
|
+
size: "sm",
|
|
473
|
+
disabled: i,
|
|
474
|
+
onClick: s,
|
|
475
|
+
children: [
|
|
476
|
+
a && /* @__PURE__ */ t.jsx(a, { size: 14, style: { marginRight: "0.25rem" } }),
|
|
477
|
+
o
|
|
478
|
+
]
|
|
479
|
+
}
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
function K({ section: e, ctx: r, onAction: n }) {
|
|
483
|
+
const i = e.direction !== "column";
|
|
484
|
+
return /* @__PURE__ */ t.jsx(
|
|
485
|
+
"div",
|
|
486
|
+
{
|
|
487
|
+
style: {
|
|
488
|
+
display: "flex",
|
|
489
|
+
flexDirection: i ? "row" : "column",
|
|
490
|
+
gap: "0.5rem",
|
|
491
|
+
marginBottom: "0.75rem",
|
|
492
|
+
...i && { flexWrap: "wrap" }
|
|
493
|
+
},
|
|
494
|
+
children: e.actions.map((o) => /* @__PURE__ */ t.jsx(
|
|
495
|
+
G,
|
|
496
|
+
{
|
|
497
|
+
button: o,
|
|
498
|
+
ctx: r,
|
|
499
|
+
onAction: n
|
|
500
|
+
},
|
|
501
|
+
o.id
|
|
502
|
+
))
|
|
503
|
+
}
|
|
504
|
+
);
|
|
505
|
+
}
|
|
506
|
+
function Q(e) {
|
|
507
|
+
switch (e) {
|
|
508
|
+
case "small":
|
|
509
|
+
return "0.5rem 0";
|
|
510
|
+
case "large":
|
|
511
|
+
return "1.5rem 0";
|
|
512
|
+
default:
|
|
513
|
+
return "1rem 0";
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function X({ section: e }) {
|
|
517
|
+
const r = Q(e.spacing);
|
|
518
|
+
return /* @__PURE__ */ t.jsx(
|
|
519
|
+
"hr",
|
|
520
|
+
{
|
|
521
|
+
style: {
|
|
522
|
+
margin: r,
|
|
523
|
+
border: "none",
|
|
524
|
+
borderTop: "1px solid var(--uilint-border)"
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
);
|
|
528
|
+
}
|
|
529
|
+
function Y({
|
|
530
|
+
section: e,
|
|
531
|
+
ctx: r,
|
|
532
|
+
renderSection: n
|
|
533
|
+
}) {
|
|
534
|
+
const o = C(e.condition, r) ? e.then : e.else;
|
|
535
|
+
return !o || o.length === 0 ? null : /* @__PURE__ */ t.jsx(t.Fragment, { children: o.map((a, s) => /* @__PURE__ */ t.jsx(b.Fragment, { children: n(a, s) }, s)) });
|
|
536
|
+
}
|
|
537
|
+
function Z({ section: e, ctx: r, renderSection: n }) {
|
|
538
|
+
const i = u(e.items, r);
|
|
539
|
+
return !Array.isArray(i) || i.length === 0 ? e.emptyMessage ? /* @__PURE__ */ t.jsx(
|
|
540
|
+
"div",
|
|
541
|
+
{
|
|
542
|
+
style: {
|
|
543
|
+
padding: "1rem",
|
|
544
|
+
textAlign: "center",
|
|
545
|
+
color: "var(--uilint-text-muted)",
|
|
546
|
+
fontSize: "0.875rem"
|
|
547
|
+
},
|
|
548
|
+
children: e.emptyMessage
|
|
549
|
+
}
|
|
550
|
+
) : null : /* @__PURE__ */ t.jsx("div", { style: { marginBottom: "0.75rem" }, children: i.map((o, a) => {
|
|
551
|
+
const s = {
|
|
552
|
+
...r,
|
|
553
|
+
data: {
|
|
554
|
+
...r.data,
|
|
555
|
+
item: o,
|
|
556
|
+
itemIndex: a
|
|
557
|
+
}
|
|
558
|
+
};
|
|
559
|
+
return /* @__PURE__ */ t.jsx("div", { style: { marginBottom: "0.5rem" }, children: e.itemLayout.map(
|
|
560
|
+
(c, m) => n(c, m, s)
|
|
561
|
+
) }, a);
|
|
562
|
+
}) });
|
|
563
|
+
}
|
|
564
|
+
function ee({ section: e, ctx: r }) {
|
|
565
|
+
const n = u(e.src, r), i = e.highlightRegion ? u(e.highlightRegion, r) : void 0;
|
|
566
|
+
return !n || typeof n != "string" ? null : /* @__PURE__ */ t.jsxs(
|
|
567
|
+
"div",
|
|
568
|
+
{
|
|
569
|
+
style: {
|
|
570
|
+
position: "relative",
|
|
571
|
+
marginBottom: "0.75rem",
|
|
572
|
+
maxHeight: e.maxHeight,
|
|
573
|
+
overflow: "hidden"
|
|
574
|
+
},
|
|
575
|
+
children: [
|
|
576
|
+
/* @__PURE__ */ t.jsx(
|
|
577
|
+
"img",
|
|
578
|
+
{
|
|
579
|
+
src: n,
|
|
580
|
+
alt: e.alt || "Image",
|
|
581
|
+
style: {
|
|
582
|
+
width: "100%",
|
|
583
|
+
height: "auto",
|
|
584
|
+
maxHeight: e.maxHeight,
|
|
585
|
+
objectFit: "contain",
|
|
586
|
+
borderRadius: "4px",
|
|
587
|
+
border: "1px solid var(--uilint-border)"
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
),
|
|
591
|
+
i && /* @__PURE__ */ t.jsx(
|
|
592
|
+
"div",
|
|
593
|
+
{
|
|
594
|
+
style: {
|
|
595
|
+
position: "absolute",
|
|
596
|
+
left: `${i.x}px`,
|
|
597
|
+
top: `${i.y}px`,
|
|
598
|
+
width: `${i.width}px`,
|
|
599
|
+
height: `${i.height}px`,
|
|
600
|
+
border: "2px solid var(--uilint-accent)",
|
|
601
|
+
borderRadius: "4px",
|
|
602
|
+
backgroundColor: "rgba(var(--uilint-accent-rgb), 0.1)",
|
|
603
|
+
pointerEvents: "none"
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
)
|
|
607
|
+
]
|
|
608
|
+
}
|
|
609
|
+
);
|
|
610
|
+
}
|
|
611
|
+
function te({ section: e, ctx: r, onAction: n }) {
|
|
612
|
+
const i = f(e.title, r), o = f(e.subtitle, r), a = e.thumbnail ? u(e.thumbnail, r) : void 0, s = e.badge ? u(e.badge.value, r) : void 0, c = e.onClick ? () => {
|
|
613
|
+
const d = B(
|
|
614
|
+
e.onClick.payload,
|
|
615
|
+
e.onClick.payloadBindings,
|
|
616
|
+
r
|
|
617
|
+
);
|
|
618
|
+
n(e.onClick.type, d);
|
|
619
|
+
} : void 0, m = {
|
|
620
|
+
marginBottom: "0.5rem",
|
|
621
|
+
...c && { cursor: "pointer" }
|
|
622
|
+
};
|
|
623
|
+
return /* @__PURE__ */ t.jsx(
|
|
624
|
+
M,
|
|
625
|
+
{
|
|
626
|
+
style: m,
|
|
627
|
+
onClick: c,
|
|
628
|
+
role: c ? "button" : void 0,
|
|
629
|
+
tabIndex: c ? 0 : void 0,
|
|
630
|
+
children: /* @__PURE__ */ t.jsxs("div", { style: { display: "flex", alignItems: "flex-start", gap: "0.75rem" }, children: [
|
|
631
|
+
typeof a == "string" && a && /* @__PURE__ */ t.jsx(
|
|
632
|
+
"img",
|
|
633
|
+
{
|
|
634
|
+
src: a,
|
|
635
|
+
alt: "",
|
|
636
|
+
style: {
|
|
637
|
+
width: "48px",
|
|
638
|
+
height: "48px",
|
|
639
|
+
borderRadius: "4px",
|
|
640
|
+
objectFit: "cover",
|
|
641
|
+
flexShrink: 0
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
),
|
|
645
|
+
/* @__PURE__ */ t.jsx("div", { style: { flex: 1, minWidth: 0 }, children: /* @__PURE__ */ t.jsxs(V, { style: { padding: "0.75rem 0.75rem 0" }, children: [
|
|
646
|
+
/* @__PURE__ */ t.jsxs("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "flex-start" }, children: [
|
|
647
|
+
/* @__PURE__ */ t.jsx($, { style: { fontSize: "0.875rem", marginBottom: 0 }, children: String(i ?? "") }),
|
|
648
|
+
e.badge && s !== void 0 && /* @__PURE__ */ t.jsxs(v, { variant: e.badge.variant === "severity" ? "warning" : "info", children: [
|
|
649
|
+
e.badge.label ? `${e.badge.label}: ` : "",
|
|
650
|
+
String(s)
|
|
651
|
+
] })
|
|
652
|
+
] }),
|
|
653
|
+
o && /* @__PURE__ */ t.jsx(A, { style: { fontSize: "0.75rem", marginTop: "0.25rem" }, children: String(o) })
|
|
654
|
+
] }) })
|
|
655
|
+
] })
|
|
656
|
+
}
|
|
657
|
+
);
|
|
658
|
+
}
|
|
659
|
+
function re({ section: e, ctx: r }) {
|
|
660
|
+
const n = f(e.value, r), i = f(e.label, r), o = typeof n == "number" ? Math.min(100, Math.max(0, n)) : 0;
|
|
661
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { marginBottom: "0.75rem" }, children: [
|
|
662
|
+
i && /* @__PURE__ */ t.jsx(
|
|
663
|
+
"div",
|
|
664
|
+
{
|
|
665
|
+
style: {
|
|
666
|
+
fontSize: "0.75rem",
|
|
667
|
+
color: "var(--uilint-text-muted)",
|
|
668
|
+
marginBottom: "0.25rem"
|
|
669
|
+
},
|
|
670
|
+
children: String(i)
|
|
671
|
+
}
|
|
672
|
+
),
|
|
673
|
+
/* @__PURE__ */ t.jsx(
|
|
674
|
+
"div",
|
|
675
|
+
{
|
|
676
|
+
style: {
|
|
677
|
+
height: "6px",
|
|
678
|
+
backgroundColor: "var(--uilint-surface)",
|
|
679
|
+
borderRadius: "3px",
|
|
680
|
+
overflow: "hidden"
|
|
681
|
+
},
|
|
682
|
+
children: e.indeterminate ? /* @__PURE__ */ t.jsx(
|
|
683
|
+
"div",
|
|
684
|
+
{
|
|
685
|
+
style: {
|
|
686
|
+
height: "100%",
|
|
687
|
+
width: "30%",
|
|
688
|
+
backgroundColor: "var(--uilint-accent)",
|
|
689
|
+
borderRadius: "3px",
|
|
690
|
+
animation: "progress-indeterminate 1.5s infinite linear"
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
) : /* @__PURE__ */ t.jsx(
|
|
694
|
+
"div",
|
|
695
|
+
{
|
|
696
|
+
style: {
|
|
697
|
+
height: "100%",
|
|
698
|
+
width: `${o}%`,
|
|
699
|
+
backgroundColor: "var(--uilint-accent)",
|
|
700
|
+
borderRadius: "3px",
|
|
701
|
+
transition: "width 0.3s ease"
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
)
|
|
705
|
+
}
|
|
706
|
+
),
|
|
707
|
+
!e.indeterminate && typeof n == "number" && /* @__PURE__ */ t.jsxs(
|
|
708
|
+
"div",
|
|
709
|
+
{
|
|
710
|
+
style: {
|
|
711
|
+
fontSize: "0.75rem",
|
|
712
|
+
color: "var(--uilint-text-muted)",
|
|
713
|
+
marginTop: "0.25rem",
|
|
714
|
+
textAlign: "right"
|
|
715
|
+
},
|
|
716
|
+
children: [
|
|
717
|
+
o,
|
|
718
|
+
"%"
|
|
719
|
+
]
|
|
720
|
+
}
|
|
721
|
+
)
|
|
722
|
+
] });
|
|
723
|
+
}
|
|
724
|
+
function ae({
|
|
725
|
+
panel: e,
|
|
726
|
+
data: r,
|
|
727
|
+
state: n,
|
|
728
|
+
computed: i = {},
|
|
729
|
+
onAction: o,
|
|
730
|
+
onFetch: a
|
|
731
|
+
}) {
|
|
732
|
+
const s = {
|
|
733
|
+
data: r,
|
|
734
|
+
state: n,
|
|
735
|
+
computed: i
|
|
736
|
+
};
|
|
737
|
+
if (e.loading && C(e.loading.when, s))
|
|
738
|
+
return /* @__PURE__ */ t.jsxs(
|
|
739
|
+
"div",
|
|
740
|
+
{
|
|
741
|
+
style: {
|
|
742
|
+
padding: "2rem",
|
|
743
|
+
textAlign: "center",
|
|
744
|
+
color: "var(--uilint-text-muted)"
|
|
745
|
+
},
|
|
746
|
+
children: [
|
|
747
|
+
/* @__PURE__ */ t.jsx(
|
|
748
|
+
"div",
|
|
749
|
+
{
|
|
750
|
+
style: {
|
|
751
|
+
marginBottom: "0.5rem",
|
|
752
|
+
animation: "spin 1s linear infinite"
|
|
753
|
+
},
|
|
754
|
+
children: /* @__PURE__ */ t.jsx("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ t.jsx(
|
|
755
|
+
"circle",
|
|
756
|
+
{
|
|
757
|
+
cx: "12",
|
|
758
|
+
cy: "12",
|
|
759
|
+
r: "10",
|
|
760
|
+
stroke: "currentColor",
|
|
761
|
+
strokeWidth: "2",
|
|
762
|
+
strokeDasharray: "31.4",
|
|
763
|
+
strokeLinecap: "round"
|
|
764
|
+
}
|
|
765
|
+
) })
|
|
766
|
+
}
|
|
767
|
+
),
|
|
768
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: "0.875rem" }, children: e.loading.message || "Loading..." }),
|
|
769
|
+
e.loading.submessage && /* @__PURE__ */ t.jsx("div", { style: { fontSize: "0.75rem", marginTop: "0.25rem" }, children: e.loading.submessage })
|
|
770
|
+
]
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
if (e.empty && C(e.empty.when, s)) {
|
|
774
|
+
const h = e.empty.icon ? j(e.empty.icon) : null;
|
|
775
|
+
return /* @__PURE__ */ t.jsxs(
|
|
776
|
+
"div",
|
|
777
|
+
{
|
|
778
|
+
style: {
|
|
779
|
+
padding: "2rem",
|
|
780
|
+
textAlign: "center",
|
|
781
|
+
color: "var(--uilint-text-muted)"
|
|
782
|
+
},
|
|
783
|
+
children: [
|
|
784
|
+
h && /* @__PURE__ */ t.jsx("div", { style: { marginBottom: "0.5rem" }, children: /* @__PURE__ */ t.jsx(h, { size: 32, strokeWidth: 1.5 }) }),
|
|
785
|
+
/* @__PURE__ */ t.jsx("div", { style: { fontSize: "0.875rem" }, children: e.empty.message }),
|
|
786
|
+
e.empty.submessage && /* @__PURE__ */ t.jsx("div", { style: { fontSize: "0.75rem", marginTop: "0.25rem" }, children: e.empty.submessage })
|
|
787
|
+
]
|
|
788
|
+
}
|
|
789
|
+
);
|
|
790
|
+
}
|
|
791
|
+
const c = (d, h, y) => {
|
|
792
|
+
const g = y || s, l = `section-${h}`;
|
|
793
|
+
switch (d.type) {
|
|
794
|
+
case "header":
|
|
795
|
+
return /* @__PURE__ */ t.jsx(E, { section: d, ctx: g }, l);
|
|
796
|
+
case "code-viewer":
|
|
797
|
+
return /* @__PURE__ */ t.jsx(
|
|
798
|
+
w,
|
|
799
|
+
{
|
|
800
|
+
section: d,
|
|
801
|
+
ctx: g,
|
|
802
|
+
onAction: o,
|
|
803
|
+
onFetch: a
|
|
804
|
+
},
|
|
805
|
+
l
|
|
806
|
+
);
|
|
807
|
+
case "code-comparison":
|
|
808
|
+
return /* @__PURE__ */ t.jsx(
|
|
809
|
+
W,
|
|
810
|
+
{
|
|
811
|
+
section: d,
|
|
812
|
+
ctx: g,
|
|
813
|
+
onAction: o,
|
|
814
|
+
onFetch: a
|
|
815
|
+
},
|
|
816
|
+
l
|
|
817
|
+
);
|
|
818
|
+
case "badge":
|
|
819
|
+
return /* @__PURE__ */ t.jsx(_, { section: d, ctx: g }, l);
|
|
820
|
+
case "text":
|
|
821
|
+
return /* @__PURE__ */ t.jsx(U, { section: d, ctx: g }, l);
|
|
822
|
+
case "actions":
|
|
823
|
+
return /* @__PURE__ */ t.jsx(
|
|
824
|
+
K,
|
|
825
|
+
{
|
|
826
|
+
section: d,
|
|
827
|
+
ctx: g,
|
|
828
|
+
onAction: o
|
|
829
|
+
},
|
|
830
|
+
l
|
|
831
|
+
);
|
|
832
|
+
case "divider":
|
|
833
|
+
return /* @__PURE__ */ t.jsx(X, { section: d }, l);
|
|
834
|
+
case "conditional":
|
|
835
|
+
return /* @__PURE__ */ t.jsx(
|
|
836
|
+
Y,
|
|
837
|
+
{
|
|
838
|
+
section: d,
|
|
839
|
+
ctx: g,
|
|
840
|
+
renderSection: c
|
|
841
|
+
},
|
|
842
|
+
l
|
|
843
|
+
);
|
|
844
|
+
case "list":
|
|
845
|
+
return /* @__PURE__ */ t.jsx(
|
|
846
|
+
Z,
|
|
847
|
+
{
|
|
848
|
+
section: d,
|
|
849
|
+
ctx: g,
|
|
850
|
+
renderSection: c
|
|
851
|
+
},
|
|
852
|
+
l
|
|
853
|
+
);
|
|
854
|
+
case "image":
|
|
855
|
+
return /* @__PURE__ */ t.jsx(ee, { section: d, ctx: g }, l);
|
|
856
|
+
case "card":
|
|
857
|
+
return /* @__PURE__ */ t.jsx(
|
|
858
|
+
te,
|
|
859
|
+
{
|
|
860
|
+
section: d,
|
|
861
|
+
ctx: g,
|
|
862
|
+
onAction: o
|
|
863
|
+
},
|
|
864
|
+
l
|
|
865
|
+
);
|
|
866
|
+
case "progress":
|
|
867
|
+
return /* @__PURE__ */ t.jsx(re, { section: d, ctx: g }, l);
|
|
868
|
+
default:
|
|
869
|
+
return console.warn(
|
|
870
|
+
`[SchemaPanel] Unknown section type: ${d.type}`
|
|
871
|
+
), null;
|
|
872
|
+
}
|
|
873
|
+
}, m = f(e.title, s);
|
|
874
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { padding: "1rem" }, children: [
|
|
875
|
+
m && /* @__PURE__ */ t.jsx(
|
|
876
|
+
"h2",
|
|
877
|
+
{
|
|
878
|
+
style: {
|
|
879
|
+
margin: "0 0 1rem 0",
|
|
880
|
+
fontSize: "1rem",
|
|
881
|
+
fontWeight: 600,
|
|
882
|
+
color: "var(--uilint-text-primary)"
|
|
883
|
+
},
|
|
884
|
+
children: String(m)
|
|
885
|
+
}
|
|
886
|
+
),
|
|
887
|
+
e.layout.map((d, h) => c(d, h))
|
|
888
|
+
] });
|
|
889
|
+
}
|
|
890
|
+
export {
|
|
891
|
+
ae as SchemaPanel
|
|
892
|
+
};
|
|
893
|
+
//# sourceMappingURL=SchemaPanel-0lLkqa2L.js.map
|