@flytedan/flytebot-design-system 0.63.0 → 0.65.0
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.cjs +1175 -1162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -2
- package/dist/index.d.ts +25 -2
- package/dist/index.js +809 -798
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components.css +26 -0
package/dist/index.js
CHANGED
|
@@ -2779,11 +2779,13 @@ function DonutChart({
|
|
|
2779
2779
|
// src/components/data/BarList.tsx
|
|
2780
2780
|
import * as React25 from "react";
|
|
2781
2781
|
import { jsx as jsx40, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
2782
|
+
var wholePercent = (share) => formatPercent(Math.round(share * 100));
|
|
2782
2783
|
function BarList({
|
|
2783
2784
|
rows,
|
|
2784
2785
|
label,
|
|
2785
2786
|
valueFormat = formatCompact,
|
|
2786
2787
|
total,
|
|
2788
|
+
shareFormat = wholePercent,
|
|
2787
2789
|
sort = true,
|
|
2788
2790
|
maxRows,
|
|
2789
2791
|
barHeight = 10,
|
|
@@ -2812,9 +2814,9 @@ function BarList({
|
|
|
2812
2814
|
/* @__PURE__ */ jsx40("ol", { className: "fd-barlist-list", "aria-label": label, children: ordered.map((r, i) => {
|
|
2813
2815
|
const value = Number(r.value) || 0;
|
|
2814
2816
|
const barPct = Math.max(0, Math.min(100, value / maxValue * 100));
|
|
2815
|
-
const
|
|
2817
|
+
const share = effectiveTotal ? value / effectiveTotal : 0;
|
|
2816
2818
|
const color = chartColor(i, r.color);
|
|
2817
|
-
const detail = `${r.label} \u2014 ${valueFormat(value)} (${
|
|
2819
|
+
const detail = `${r.label} \u2014 ${valueFormat(value)} (${shareFormat(share)})`;
|
|
2818
2820
|
return /* @__PURE__ */ jsx40("li", { className: "fd-barlist-row", children: /* @__PURE__ */ jsx40(Tooltip, { label: detail, children: /* @__PURE__ */ jsxs31("button", { type: "button", className: "fd-barlist-btn", children: [
|
|
2819
2821
|
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-label", title: truncationTitle(r.label), children: r.label }),
|
|
2820
2822
|
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-track", style: { height: barHeight }, children: /* @__PURE__ */ jsxs31("svg", { viewBox: "0 0 100 10", preserveAspectRatio: "none", role: "img", "aria-label": detail, children: [
|
|
@@ -2822,7 +2824,7 @@ function BarList({
|
|
|
2822
2824
|
/* @__PURE__ */ jsx40("rect", { x: 0, y: 0, width: barPct, height: 10, rx: 3, fill: color })
|
|
2823
2825
|
] }) }),
|
|
2824
2826
|
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-value fd-tabular", children: valueFormat(value) }),
|
|
2825
|
-
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-pct fd-tabular", children:
|
|
2827
|
+
/* @__PURE__ */ jsx40("span", { className: "fd-barlist-pct fd-tabular", children: shareFormat(share) })
|
|
2826
2828
|
] }) }) }, r.id);
|
|
2827
2829
|
}) }),
|
|
2828
2830
|
/* @__PURE__ */ jsx40(
|
|
@@ -2832,8 +2834,8 @@ function BarList({
|
|
|
2832
2834
|
columns: ["", "Value", "Percent"],
|
|
2833
2835
|
rows: ordered.map((r) => {
|
|
2834
2836
|
const value = Number(r.value) || 0;
|
|
2835
|
-
const
|
|
2836
|
-
return [r.label, valueFormat(value),
|
|
2837
|
+
const share = effectiveTotal ? value / effectiveTotal : 0;
|
|
2838
|
+
return [r.label, valueFormat(value), shareFormat(share)];
|
|
2837
2839
|
})
|
|
2838
2840
|
}
|
|
2839
2841
|
)
|
|
@@ -4806,8 +4808,14 @@ function FilterBar({ fields = [], filters, onFilterChange, onFilterRemove, align
|
|
|
4806
4808
|
] });
|
|
4807
4809
|
}
|
|
4808
4810
|
|
|
4811
|
+
// src/components/data/StatGrid.tsx
|
|
4812
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
4813
|
+
function StatGrid({ columns, className = "", children, ...rest }) {
|
|
4814
|
+
return /* @__PURE__ */ jsx51("div", { className: ["fd-stat-grid", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ jsx51("div", { className: "fd-stat-grid-tiles", "data-columns": columns, children }) });
|
|
4815
|
+
}
|
|
4816
|
+
|
|
4809
4817
|
// src/components/data/StatTile.tsx
|
|
4810
|
-
import { jsx as
|
|
4818
|
+
import { jsx as jsx52, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
4811
4819
|
function isZeroDelta(delta) {
|
|
4812
4820
|
if (!delta) return false;
|
|
4813
4821
|
const match = delta.match(/[\d.]+/);
|
|
@@ -4819,16 +4827,16 @@ function StatTile({ label, value, sub, delta, invert = false, loading = false, c
|
|
|
4819
4827
|
const isGood = invert ? isDecrease : !isDecrease;
|
|
4820
4828
|
const deltaToneClass = isZero ? "fd-stat-delta-neutral" : isGood ? "fd-stat-delta-up" : "fd-stat-delta-down";
|
|
4821
4829
|
return /* @__PURE__ */ jsxs42("div", { className: ["fd-stat", compact3 ? "fd-stat-compact" : "", className].filter(Boolean).join(" "), ...rest, children: [
|
|
4822
|
-
loading ? /* @__PURE__ */
|
|
4823
|
-
/* @__PURE__ */
|
|
4830
|
+
loading ? /* @__PURE__ */ jsx52("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: compact3 ? 20 : 28, width: "62%" } }) : /* @__PURE__ */ jsxs42("span", { className: "fd-stat-top", children: [
|
|
4831
|
+
/* @__PURE__ */ jsx52("span", { className: "fd-stat-figure", children: value }),
|
|
4824
4832
|
delta ? /* @__PURE__ */ jsxs42("span", { className: "fd-stat-delta " + deltaToneClass, children: [
|
|
4825
|
-
/* @__PURE__ */
|
|
4833
|
+
/* @__PURE__ */ jsx52("i", { className: "ph ph-" + (isZero ? "minus" : "arrow-" + (isDecrease ? "down" : "up") + "-right"), "aria-hidden": "true" }),
|
|
4826
4834
|
" ",
|
|
4827
4835
|
delta
|
|
4828
4836
|
] }) : null
|
|
4829
4837
|
] }),
|
|
4830
|
-
!loading && sub ? /* @__PURE__ */
|
|
4831
|
-
loading ? /* @__PURE__ */
|
|
4838
|
+
!loading && sub ? /* @__PURE__ */ jsx52("span", { className: "fd-stat-sub", children: sub }) : null,
|
|
4839
|
+
loading ? /* @__PURE__ */ jsx52("span", { className: "fd-skel fd-skel-text", style: { display: "block", height: 10, width: "40%", marginTop: 8 } }) : /* @__PURE__ */ jsx52("span", { className: "fd-stat-label", style: { display: "block" }, children: label })
|
|
4832
4840
|
] });
|
|
4833
4841
|
}
|
|
4834
4842
|
|
|
@@ -4889,7 +4897,7 @@ function useCopyToClipboard() {
|
|
|
4889
4897
|
}
|
|
4890
4898
|
|
|
4891
4899
|
// src/components/data/CodeBlock.tsx
|
|
4892
|
-
import { Fragment as Fragment8, jsx as
|
|
4900
|
+
import { Fragment as Fragment8, jsx as jsx53, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
4893
4901
|
var JS_KW = /^(?:const|let|var|function|return|if|else|for|while|do|new|class|extends|import|from|export|default|await|async|try|catch|finally|throw|typeof|instanceof|of|in|switch|case|break|continue|delete|void|yield|static|get|set|this|super|interface|type|enum|implements|public|private|protected|readonly|abstract|as|satisfies|declare|namespace)$/;
|
|
4894
4902
|
var RULES = {
|
|
4895
4903
|
js: [
|
|
@@ -5045,7 +5053,7 @@ function tokenize(src, lang) {
|
|
|
5045
5053
|
}
|
|
5046
5054
|
function Highlighted({ code, lang }) {
|
|
5047
5055
|
const toks = React34.useMemo(() => tokenize(code, lang), [code, lang]);
|
|
5048
|
-
return /* @__PURE__ */
|
|
5056
|
+
return /* @__PURE__ */ jsx53(Fragment8, { children: toks.map((tk, i) => tk.c ? /* @__PURE__ */ jsx53("span", { className: "tok-" + tk.c, children: tk.t }, i) : tk.t) });
|
|
5049
5057
|
}
|
|
5050
5058
|
function CodeBlock({
|
|
5051
5059
|
code = "",
|
|
@@ -5067,22 +5075,22 @@ function CodeBlock({
|
|
|
5067
5075
|
const shown = foldable && !open2 ? lines.slice(0, collapseAfter).join("\n") : body;
|
|
5068
5076
|
return /* @__PURE__ */ jsxs43("div", { className: ["fd-code", wrap ? "is-wrap" : "", className].filter(Boolean).join(" "), children: [
|
|
5069
5077
|
/* @__PURE__ */ jsxs43("div", { className: "fd-code-head", children: [
|
|
5070
|
-
filename ? /* @__PURE__ */
|
|
5071
|
-
/* @__PURE__ */
|
|
5072
|
-
/* @__PURE__ */
|
|
5078
|
+
filename ? /* @__PURE__ */ jsx53("span", { className: "fd-code-file", children: filename }) : null,
|
|
5079
|
+
/* @__PURE__ */ jsx53("span", { className: "fd-code-lang", children: languageLabel(language) }),
|
|
5080
|
+
/* @__PURE__ */ jsx53("span", { className: "fd-code-spacer" }),
|
|
5073
5081
|
actions,
|
|
5074
|
-
/* @__PURE__ */
|
|
5082
|
+
/* @__PURE__ */ jsx53("button", { type: "button", className: "fd-code-act", onClick: () => setWrap((v) => !v), "aria-pressed": wrap, title: wrap ? "No wrap" : "Soft wrap", children: /* @__PURE__ */ jsx53("i", { className: "ph ph-text-" + (wrap ? "columns" : "align-left"), "aria-hidden": "true" }) }),
|
|
5075
5083
|
copyable ? /* @__PURE__ */ jsxs43("button", { type: "button", className: "fd-code-act" + (copied ? " is-done" : ""), onClick: () => copy(body), children: [
|
|
5076
|
-
/* @__PURE__ */
|
|
5077
|
-
/* @__PURE__ */
|
|
5084
|
+
/* @__PURE__ */ jsx53("i", { className: "ph ph-" + (copied ? "check" : "copy"), "aria-hidden": "true" }),
|
|
5085
|
+
/* @__PURE__ */ jsx53("span", { children: copied ? "Copied" : "Copy" })
|
|
5078
5086
|
] }) : null
|
|
5079
5087
|
] }),
|
|
5080
5088
|
/* @__PURE__ */ jsxs43("div", { className: "fd-code-body", children: [
|
|
5081
|
-
lineNumbers2 ? /* @__PURE__ */
|
|
5082
|
-
/* @__PURE__ */
|
|
5089
|
+
lineNumbers2 ? /* @__PURE__ */ jsx53("pre", { className: "fd-code-gutter", "aria-hidden": "true", children: shown.split("\n").map((_, i) => i + 1 + "\n").join("") }) : null,
|
|
5090
|
+
/* @__PURE__ */ jsx53("pre", { className: "fd-code-pre", tabIndex: 0, children: /* @__PURE__ */ jsx53("code", { children: /* @__PURE__ */ jsx53(Highlighted, { code: shown, lang: language }) }) })
|
|
5083
5091
|
] }),
|
|
5084
5092
|
foldable ? /* @__PURE__ */ jsxs43("button", { type: "button", className: "fd-code-fold", onClick: () => setOpen((v) => !v), "aria-expanded": open2, children: [
|
|
5085
|
-
/* @__PURE__ */
|
|
5093
|
+
/* @__PURE__ */ jsx53("i", { className: "ph ph-caret-" + (open2 ? "up" : "down"), "aria-hidden": "true" }),
|
|
5086
5094
|
open2 ? "Collapse" : "Show all " + lines.length + " lines"
|
|
5087
5095
|
] }) : null
|
|
5088
5096
|
] });
|
|
@@ -5104,8 +5112,8 @@ function DiffBlock({ diff = "", filename, collapseAfter = 34, className = "" })
|
|
|
5104
5112
|
const rows = foldable && !open2 ? all.slice(0, collapseAfter) : all;
|
|
5105
5113
|
return /* @__PURE__ */ jsxs43("div", { className: ["fd-code", "fd-diff", className].filter(Boolean).join(" "), children: [
|
|
5106
5114
|
/* @__PURE__ */ jsxs43("div", { className: "fd-code-head", children: [
|
|
5107
|
-
/* @__PURE__ */
|
|
5108
|
-
filename ? /* @__PURE__ */
|
|
5115
|
+
/* @__PURE__ */ jsx53("i", { className: "ph ph-git-diff fd-code-icon", "aria-hidden": "true" }),
|
|
5116
|
+
filename ? /* @__PURE__ */ jsx53("span", { className: "fd-code-file", children: filename }) : /* @__PURE__ */ jsx53("span", { className: "fd-code-lang", children: "Diff" }),
|
|
5109
5117
|
/* @__PURE__ */ jsxs43("span", { className: "fd-diff-stat fd-tabular", children: [
|
|
5110
5118
|
/* @__PURE__ */ jsxs43("span", { className: "is-add", children: [
|
|
5111
5119
|
"+",
|
|
@@ -5116,18 +5124,18 @@ function DiffBlock({ diff = "", filename, collapseAfter = 34, className = "" })
|
|
|
5116
5124
|
dels
|
|
5117
5125
|
] })
|
|
5118
5126
|
] }),
|
|
5119
|
-
/* @__PURE__ */
|
|
5127
|
+
/* @__PURE__ */ jsx53("span", { className: "fd-code-spacer" }),
|
|
5120
5128
|
/* @__PURE__ */ jsxs43("button", { type: "button", className: "fd-code-act" + (copied ? " is-done" : ""), onClick: () => copy(raw), children: [
|
|
5121
|
-
/* @__PURE__ */
|
|
5122
|
-
/* @__PURE__ */
|
|
5129
|
+
/* @__PURE__ */ jsx53("i", { className: "ph ph-" + (copied ? "check" : "copy"), "aria-hidden": "true" }),
|
|
5130
|
+
/* @__PURE__ */ jsx53("span", { children: copied ? "Copied" : "Copy" })
|
|
5123
5131
|
] })
|
|
5124
5132
|
] }),
|
|
5125
|
-
/* @__PURE__ */
|
|
5126
|
-
/* @__PURE__ */
|
|
5127
|
-
/* @__PURE__ */
|
|
5133
|
+
/* @__PURE__ */ jsx53("div", { className: "fd-diff-body", children: rows.map((r, i) => /* @__PURE__ */ jsxs43("div", { className: "fd-diff-line is-" + r.k, children: [
|
|
5134
|
+
/* @__PURE__ */ jsx53("span", { className: "fd-diff-mark", "aria-hidden": "true", children: r.k === "add" ? "+" : r.k === "del" ? "\u2212" : "" }),
|
|
5135
|
+
/* @__PURE__ */ jsx53("code", { children: r.k === "add" || r.k === "del" ? r.line.slice(1) : r.line })
|
|
5128
5136
|
] }, i)) }),
|
|
5129
5137
|
foldable ? /* @__PURE__ */ jsxs43("button", { type: "button", className: "fd-code-fold", onClick: () => setOpen((v) => !v), "aria-expanded": open2, children: [
|
|
5130
|
-
/* @__PURE__ */
|
|
5138
|
+
/* @__PURE__ */ jsx53("i", { className: "ph ph-caret-" + (open2 ? "up" : "down"), "aria-hidden": "true" }),
|
|
5131
5139
|
open2 ? "Collapse" : "Show all " + all.length + " lines"
|
|
5132
5140
|
] }) : null
|
|
5133
5141
|
] });
|
|
@@ -5135,7 +5143,7 @@ function DiffBlock({ diff = "", filename, collapseAfter = 34, className = "" })
|
|
|
5135
5143
|
|
|
5136
5144
|
// src/components/data/Markdown.tsx
|
|
5137
5145
|
import * as React35 from "react";
|
|
5138
|
-
import { jsx as
|
|
5146
|
+
import { jsx as jsx54, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
5139
5147
|
var SAFE = /^(?:https?:|mailto:|tel:|#|\/|\.{1,2}\/)/i;
|
|
5140
5148
|
var safeHref = (h) => SAFE.test(String(h || "").trim()) ? String(h).trim() : null;
|
|
5141
5149
|
var INLINE = [
|
|
@@ -5165,22 +5173,22 @@ function inlineNodes(src, ctx, keyBase) {
|
|
|
5165
5173
|
const { kind, m } = best;
|
|
5166
5174
|
if (m.index > 0) out.push(rest.slice(0, m.index));
|
|
5167
5175
|
const g = (i) => m[i];
|
|
5168
|
-
if (kind === "code") out.push(/* @__PURE__ */
|
|
5176
|
+
if (kind === "code") out.push(/* @__PURE__ */ jsx54("code", { className: "fd-md-code", children: g(1) }, key()));
|
|
5169
5177
|
else if (kind === "image") {
|
|
5170
5178
|
const src2 = safeHref(g(2));
|
|
5171
|
-
out.push(ctx.allowImages && src2 ? /* @__PURE__ */
|
|
5179
|
+
out.push(ctx.allowImages && src2 ? /* @__PURE__ */ jsx54("img", { className: "fd-md-img", src: src2, alt: g(1) || "", title: g(3) || void 0, loading: "lazy" }, key()) : /* @__PURE__ */ jsx54("span", { className: "fd-md-imgalt", children: g(1) || "image" }, key()));
|
|
5172
5180
|
} else if (kind === "link") {
|
|
5173
5181
|
const href = safeHref(g(2));
|
|
5174
|
-
out.push(href ? /* @__PURE__ */
|
|
5182
|
+
out.push(href ? /* @__PURE__ */ jsx54("a", { href, title: g(3) || void 0, target: /^https?:/i.test(href) ? "_blank" : void 0, rel: "noopener noreferrer", onClick: ctx.onLinkClick, children: inlineNodes(g(1), ctx, key()) }, key()) : /* @__PURE__ */ jsx54("span", { children: g(1) }, key()));
|
|
5175
5183
|
} else if (kind === "cite") {
|
|
5176
|
-
out.push(ctx.renderCitation ? /* @__PURE__ */
|
|
5177
|
-
} else if (kind === "strongem") out.push(/* @__PURE__ */
|
|
5178
|
-
else if (kind === "strong") out.push(/* @__PURE__ */
|
|
5179
|
-
else if (kind === "em") out.push(/* @__PURE__ */
|
|
5180
|
-
else if (kind === "del") out.push(/* @__PURE__ */
|
|
5184
|
+
out.push(ctx.renderCitation ? /* @__PURE__ */ jsx54(React35.Fragment, { children: ctx.renderCitation(g(1)) }, key()) : /* @__PURE__ */ jsx54("sup", { className: "fd-md-cite", children: g(1) }, key()));
|
|
5185
|
+
} else if (kind === "strongem") out.push(/* @__PURE__ */ jsx54("strong", { children: /* @__PURE__ */ jsx54("em", { children: inlineNodes(g(1), ctx, key()) }) }, key()));
|
|
5186
|
+
else if (kind === "strong") out.push(/* @__PURE__ */ jsx54("strong", { children: inlineNodes(g(1) || g(2), ctx, key()) }, key()));
|
|
5187
|
+
else if (kind === "em") out.push(/* @__PURE__ */ jsx54("em", { children: inlineNodes(g(1) || g(2), ctx, key()) }, key()));
|
|
5188
|
+
else if (kind === "del") out.push(/* @__PURE__ */ jsx54("del", { children: inlineNodes(g(1), ctx, key()) }, key()));
|
|
5181
5189
|
else if (kind === "autolink" || kind === "bare") {
|
|
5182
5190
|
const href = safeHref(g(1));
|
|
5183
|
-
out.push(href ? /* @__PURE__ */
|
|
5191
|
+
out.push(href ? /* @__PURE__ */ jsx54("a", { href, target: "_blank", rel: "noopener noreferrer", onClick: ctx.onLinkClick, children: g(1).replace(/^mailto:/, "") }, key()) : g(1));
|
|
5184
5192
|
}
|
|
5185
5193
|
rest = rest.slice(m.index + m[0].length);
|
|
5186
5194
|
}
|
|
@@ -5298,33 +5306,33 @@ function renderBlocks(blocks, ctx, path) {
|
|
|
5298
5306
|
const k = path + "-" + i;
|
|
5299
5307
|
switch (b.t) {
|
|
5300
5308
|
case "code": {
|
|
5301
|
-
if ((b.lang || "").toLowerCase() === "diff") return /* @__PURE__ */
|
|
5302
|
-
return /* @__PURE__ */
|
|
5309
|
+
if ((b.lang || "").toLowerCase() === "diff") return /* @__PURE__ */ jsx54(DiffBlock, { diff: b.code, filename: b.file || void 0 }, k);
|
|
5310
|
+
return /* @__PURE__ */ jsx54(CodeBlock, { code: b.code, language: b.lang, filename: b.file || void 0, ...ctx.codeProps || {} }, k);
|
|
5303
5311
|
}
|
|
5304
5312
|
case "h": {
|
|
5305
5313
|
const lvl = Math.min(6, Math.max(1, b.level + (ctx.headingOffset || 0)));
|
|
5306
5314
|
const Tag2 = "h" + lvl;
|
|
5307
|
-
return /* @__PURE__ */
|
|
5315
|
+
return /* @__PURE__ */ jsx54(Tag2, { className: "fd-md-h fd-md-h" + lvl, children: inlineNodes(b.text, ctx, k) }, k);
|
|
5308
5316
|
}
|
|
5309
5317
|
case "hr":
|
|
5310
|
-
return /* @__PURE__ */
|
|
5318
|
+
return /* @__PURE__ */ jsx54("hr", { className: "fd-md-hr" }, k);
|
|
5311
5319
|
case "quote":
|
|
5312
|
-
return /* @__PURE__ */
|
|
5320
|
+
return /* @__PURE__ */ jsx54("blockquote", { className: "fd-md-quote", children: renderBlocks(b.children, ctx, k) }, k);
|
|
5313
5321
|
case "list": {
|
|
5314
5322
|
const Tag2 = b.ordered ? "ol" : "ul";
|
|
5315
5323
|
const isTask = b.items.some((it) => it.checked != null);
|
|
5316
|
-
return /* @__PURE__ */
|
|
5317
|
-
it.checked != null ? /* @__PURE__ */
|
|
5318
|
-
/* @__PURE__ */
|
|
5324
|
+
return /* @__PURE__ */ jsx54(Tag2, { className: "fd-md-list" + (isTask ? " is-task" : ""), start: b.ordered && b.start !== 1 ? b.start : void 0, children: b.items.map((it, j) => /* @__PURE__ */ jsxs44("li", { className: it.checked != null ? it.checked ? "is-done" : "is-todo" : void 0, children: [
|
|
5325
|
+
it.checked != null ? /* @__PURE__ */ jsx54("span", { className: "fd-md-task", "aria-hidden": "true", children: /* @__PURE__ */ jsx54("i", { className: "ph ph-" + (it.checked ? "check-square" : "square") }) }) : null,
|
|
5326
|
+
/* @__PURE__ */ jsx54("span", { className: "fd-md-li", children: renderBlocks(it.children, ctx, k + "-" + j) })
|
|
5319
5327
|
] }, k + "-" + j)) }, k);
|
|
5320
5328
|
}
|
|
5321
5329
|
case "table":
|
|
5322
|
-
return /* @__PURE__ */
|
|
5323
|
-
/* @__PURE__ */
|
|
5324
|
-
/* @__PURE__ */
|
|
5330
|
+
return /* @__PURE__ */ jsx54("div", { className: "fd-md-tablewrap", children: /* @__PURE__ */ jsxs44("table", { className: "fd-md-table", children: [
|
|
5331
|
+
/* @__PURE__ */ jsx54("thead", { children: /* @__PURE__ */ jsx54("tr", { children: b.head.map((c, j) => /* @__PURE__ */ jsx54("th", { style: { textAlign: b.align[j] || "left" }, children: inlineNodes(c, ctx, k + "h" + j) }, j)) }) }),
|
|
5332
|
+
/* @__PURE__ */ jsx54("tbody", { children: b.rows.map((r, ri) => /* @__PURE__ */ jsx54("tr", { children: b.head.map((_, ci) => /* @__PURE__ */ jsx54("td", { style: { textAlign: b.align[ci] || "left" }, children: inlineNodes(r[ci] || "", ctx, k + ri + "c" + ci) }, ci)) }, ri)) })
|
|
5325
5333
|
] }) }, k);
|
|
5326
5334
|
default:
|
|
5327
|
-
return /* @__PURE__ */
|
|
5335
|
+
return /* @__PURE__ */ jsx54("p", { className: "fd-md-p", children: inlineNodes(b.text, ctx, k) }, k);
|
|
5328
5336
|
}
|
|
5329
5337
|
});
|
|
5330
5338
|
}
|
|
@@ -5339,24 +5347,24 @@ function Markdown({
|
|
|
5339
5347
|
}) {
|
|
5340
5348
|
const ctx = { allowImages, headingOffset, renderCitation, onLinkClick, codeProps };
|
|
5341
5349
|
const blocks = React35.useMemo(() => parseBlocks(source), [source]);
|
|
5342
|
-
return /* @__PURE__ */
|
|
5350
|
+
return /* @__PURE__ */ jsx54("div", { className: ["fd-md", className].filter(Boolean).join(" "), children: renderBlocks(blocks, ctx, "b") });
|
|
5343
5351
|
}
|
|
5344
5352
|
function MarkdownInline({ source = "", className = "", onLinkClick }) {
|
|
5345
|
-
return /* @__PURE__ */
|
|
5353
|
+
return /* @__PURE__ */ jsx54("span", { className: ["fd-md-inline", className].filter(Boolean).join(" "), children: inlineNodes(source, { allowImages: false, onLinkClick }, "i") });
|
|
5346
5354
|
}
|
|
5347
5355
|
function markdownToText(src) {
|
|
5348
5356
|
return String(src == null ? "" : src).replace(/```[\w+#-]*\n?([\s\S]*?)```/g, "$1").replace(/`([^`]+)`/g, "$1").replace(/!\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/\[([^\]]+)\]\([^)]*\)/g, "$1").replace(/^\s{0,3}#{1,6}\s+/gm, "").replace(/\*\*\*([^*]+)\*\*\*|\*\*([^*]+)\*\*|__([^_]+)__/g, "$1$2$3").replace(/(^|\W)[*_]([^*_\n]+)[*_](\W|$)/g, "$1$2$3").replace(/~~([^~]+)~~/g, "$1").replace(/^\s*>\s?/gm, "").trim();
|
|
5349
5357
|
}
|
|
5350
5358
|
|
|
5351
5359
|
// src/components/data/Meter.tsx
|
|
5352
|
-
import { jsx as
|
|
5360
|
+
import { jsx as jsx55, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
5353
5361
|
function Meter({ segments = [], unallocated = 0, height = 8, label, legend = false, className = "" }) {
|
|
5354
5362
|
const total = segments.reduce((s, x) => s + x.value, 0) + unallocated;
|
|
5355
5363
|
const pct = (v) => total ? v / total * 100 : 0;
|
|
5356
5364
|
return /* @__PURE__ */ jsxs45("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 8 }, children: [
|
|
5357
|
-
label ? /* @__PURE__ */
|
|
5365
|
+
label ? /* @__PURE__ */ jsx55("span", { className: "fd-label-lg fd-secondary", children: label }) : null,
|
|
5358
5366
|
/* @__PURE__ */ jsxs45("div", { className: "fd-meterbar", style: { height }, children: [
|
|
5359
|
-
segments.map((s, i) => /* @__PURE__ */
|
|
5367
|
+
segments.map((s, i) => /* @__PURE__ */ jsx55(
|
|
5360
5368
|
"span",
|
|
5361
5369
|
{
|
|
5362
5370
|
className: "fd-meterbar-seg",
|
|
@@ -5365,15 +5373,15 @@ function Meter({ segments = [], unallocated = 0, height = 8, label, legend = fal
|
|
|
5365
5373
|
},
|
|
5366
5374
|
i
|
|
5367
5375
|
)),
|
|
5368
|
-
unallocated > 0 ? /* @__PURE__ */
|
|
5376
|
+
unallocated > 0 ? /* @__PURE__ */ jsx55("span", { className: "fd-meterbar-seg fd-meterbar-unallocated", title: "Unallocated", style: { width: pct(unallocated) + "%" } }) : null
|
|
5369
5377
|
] }),
|
|
5370
5378
|
legend ? /* @__PURE__ */ jsxs45("div", { className: "fd-row", style: { gap: 16, flexWrap: "wrap" }, children: [
|
|
5371
5379
|
segments.map((s, i) => /* @__PURE__ */ jsxs45("span", { className: "fd-row fd-body-sm fd-secondary", style: { gap: 7 }, children: [
|
|
5372
|
-
/* @__PURE__ */
|
|
5380
|
+
/* @__PURE__ */ jsx55("span", { style: { width: 9, height: 9, borderRadius: 2, background: s.color || "var(--chart-" + (i % 8 + 1) + ")" } }),
|
|
5373
5381
|
s.label
|
|
5374
5382
|
] }, i)),
|
|
5375
5383
|
unallocated > 0 ? /* @__PURE__ */ jsxs45("span", { className: "fd-row fd-body-sm fd-secondary", style: { gap: 7 }, children: [
|
|
5376
|
-
/* @__PURE__ */
|
|
5384
|
+
/* @__PURE__ */ jsx55("span", { className: "fd-meterbar-unallocated", style: { width: 9, height: 9, borderRadius: 2 } }),
|
|
5377
5385
|
"Unallocated"
|
|
5378
5386
|
] }) : null
|
|
5379
5387
|
] }) : null
|
|
@@ -5381,7 +5389,7 @@ function Meter({ segments = [], unallocated = 0, height = 8, label, legend = fal
|
|
|
5381
5389
|
}
|
|
5382
5390
|
|
|
5383
5391
|
// src/components/data/Pagination.tsx
|
|
5384
|
-
import { Fragment as Fragment10, jsx as
|
|
5392
|
+
import { Fragment as Fragment10, jsx as jsx56, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
5385
5393
|
var unitPluralRules = new Intl.PluralRules("en-US");
|
|
5386
5394
|
function pluralizeUnit(n, singular, irregularPlural) {
|
|
5387
5395
|
return unitPluralRules.select(n) === "one" ? singular : irregularPlural ?? `${singular}s`;
|
|
@@ -5413,7 +5421,7 @@ function Pagination({
|
|
|
5413
5421
|
else if (nums[nums.length - 1] !== "\u2026") nums.push("\u2026");
|
|
5414
5422
|
}
|
|
5415
5423
|
return /* @__PURE__ */ jsxs46("div", { className: ["fd-pag", className].filter(Boolean).join(" "), ...rest, children: [
|
|
5416
|
-
/* @__PURE__ */
|
|
5424
|
+
/* @__PURE__ */ jsx56("span", { className: "fd-pag-count", children: loading ? /* @__PURE__ */ jsx56("span", { className: "fd-skel fd-skel-text", style: { display: "inline-block", height: 12, width: 108 } }) : total === 0 ? /* @__PURE__ */ jsxs46(Fragment10, { children: [
|
|
5417
5425
|
"No ",
|
|
5418
5426
|
unitLabel
|
|
5419
5427
|
] }) : /* @__PURE__ */ jsxs46(Fragment10, { children: [
|
|
@@ -5428,13 +5436,13 @@ function Pagination({
|
|
|
5428
5436
|
unitLabel
|
|
5429
5437
|
] }) }),
|
|
5430
5438
|
onPageSizeChange ? /* @__PURE__ */ jsxs46("label", { className: "fd-pag-size", children: [
|
|
5431
|
-
/* @__PURE__ */
|
|
5432
|
-
/* @__PURE__ */
|
|
5439
|
+
/* @__PURE__ */ jsx56("span", { children: "Rows" }),
|
|
5440
|
+
/* @__PURE__ */ jsx56("select", { value: pageSize, onChange: (e) => onPageSizeChange(Number(e.target.value)), "aria-label": "Rows per page", children: pageSizes.map((n) => /* @__PURE__ */ jsx56("option", { value: n, children: n }, n)) })
|
|
5433
5441
|
] }) : null,
|
|
5434
5442
|
/* @__PURE__ */ jsxs46("span", { className: "fd-pag-nav", children: [
|
|
5435
|
-
/* @__PURE__ */
|
|
5436
|
-
/* @__PURE__ */
|
|
5437
|
-
nums.map((n, i) => n === "\u2026" ? /* @__PURE__ */
|
|
5443
|
+
/* @__PURE__ */ jsx56("button", { type: "button", onClick: () => go(1), disabled: page <= 1, "aria-label": "First page", children: /* @__PURE__ */ jsx56("i", { className: "ph ph-caret-double-left" }) }),
|
|
5444
|
+
/* @__PURE__ */ jsx56("button", { type: "button", onClick: () => go(page - 1), disabled: page <= 1, "aria-label": "Previous page", children: /* @__PURE__ */ jsx56("i", { className: "ph ph-caret-left" }) }),
|
|
5445
|
+
nums.map((n, i) => n === "\u2026" ? /* @__PURE__ */ jsx56("span", { className: "fd-pag-gap", "aria-hidden": "true", children: "\u2026" }, "e" + i) : /* @__PURE__ */ jsx56(
|
|
5438
5446
|
"button",
|
|
5439
5447
|
{
|
|
5440
5448
|
type: "button",
|
|
@@ -5445,8 +5453,8 @@ function Pagination({
|
|
|
5445
5453
|
},
|
|
5446
5454
|
n
|
|
5447
5455
|
)),
|
|
5448
|
-
/* @__PURE__ */
|
|
5449
|
-
/* @__PURE__ */
|
|
5456
|
+
/* @__PURE__ */ jsx56("button", { type: "button", onClick: () => go(page + 1), disabled: page >= totalPages, "aria-label": "Next page", children: /* @__PURE__ */ jsx56("i", { className: "ph ph-caret-right" }) }),
|
|
5457
|
+
/* @__PURE__ */ jsx56("button", { type: "button", onClick: () => go(totalPages), disabled: page >= totalPages, "aria-label": "Last page", children: /* @__PURE__ */ jsx56("i", { className: "ph ph-caret-double-right" }) })
|
|
5450
5458
|
] })
|
|
5451
5459
|
] });
|
|
5452
5460
|
}
|
|
@@ -5523,7 +5531,7 @@ function RelativeTime({ value, prefix, className = "", refresh: refresh2 = true,
|
|
|
5523
5531
|
|
|
5524
5532
|
// src/components/data/ScoreMeter.tsx
|
|
5525
5533
|
import * as React37 from "react";
|
|
5526
|
-
import { jsx as
|
|
5534
|
+
import { jsx as jsx57, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
5527
5535
|
function ScoreMeter({
|
|
5528
5536
|
score,
|
|
5529
5537
|
segments,
|
|
@@ -5541,11 +5549,11 @@ function ScoreMeter({
|
|
|
5541
5549
|
const ref = React37.useRef(null);
|
|
5542
5550
|
const value = Math.max(0, Math.min(100, Math.round(Number(score) || 0)));
|
|
5543
5551
|
const body = /* @__PURE__ */ jsxs48(React37.Fragment, { children: [
|
|
5544
|
-
/* @__PURE__ */
|
|
5545
|
-
showScore ? /* @__PURE__ */
|
|
5552
|
+
/* @__PURE__ */ jsx57("span", { className: "fd-scoremeter-rail", style: { width }, "aria-hidden": "true", children: /* @__PURE__ */ jsx57(SegmentedMeter, { total: 100, segments, height, showTotal: false, showPercent: false, legend: false }) }),
|
|
5553
|
+
showScore ? /* @__PURE__ */ jsx57("span", { className: "fd-scoremeter-value fd-tabular", "aria-hidden": "true", children: value }) : null
|
|
5546
5554
|
] });
|
|
5547
5555
|
if (!breakdown) {
|
|
5548
|
-
return /* @__PURE__ */
|
|
5556
|
+
return /* @__PURE__ */ jsx57(
|
|
5549
5557
|
"span",
|
|
5550
5558
|
{
|
|
5551
5559
|
className: ["fd-scoremeter", className].filter(Boolean).join(" "),
|
|
@@ -5560,7 +5568,7 @@ function ScoreMeter({
|
|
|
5560
5568
|
);
|
|
5561
5569
|
}
|
|
5562
5570
|
return /* @__PURE__ */ jsxs48(React37.Fragment, { children: [
|
|
5563
|
-
/* @__PURE__ */
|
|
5571
|
+
/* @__PURE__ */ jsx57(
|
|
5564
5572
|
"button",
|
|
5565
5573
|
{
|
|
5566
5574
|
type: "button",
|
|
@@ -5573,7 +5581,7 @@ function ScoreMeter({
|
|
|
5573
5581
|
children: body
|
|
5574
5582
|
}
|
|
5575
5583
|
),
|
|
5576
|
-
/* @__PURE__ */
|
|
5584
|
+
/* @__PURE__ */ jsx57(
|
|
5577
5585
|
Popover,
|
|
5578
5586
|
{
|
|
5579
5587
|
open: open2,
|
|
@@ -5591,14 +5599,14 @@ function ScoreMeter({
|
|
|
5591
5599
|
|
|
5592
5600
|
// src/components/actions/inlinePanel.tsx
|
|
5593
5601
|
import * as React38 from "react";
|
|
5594
|
-
import { jsx as
|
|
5602
|
+
import { jsx as jsx58 } from "react/jsx-runtime";
|
|
5595
5603
|
function useInlinePanel() {
|
|
5596
5604
|
const [open2, setOpen] = React38.useState(false);
|
|
5597
5605
|
const ref = React38.useRef(null);
|
|
5598
5606
|
return { open: open2, setOpen, ref };
|
|
5599
5607
|
}
|
|
5600
5608
|
function InlinePanelSurface({ panel, align = "right", ...popover }) {
|
|
5601
|
-
return /* @__PURE__ */
|
|
5609
|
+
return /* @__PURE__ */ jsx58(
|
|
5602
5610
|
Popover,
|
|
5603
5611
|
{
|
|
5604
5612
|
open: panel.open,
|
|
@@ -5611,7 +5619,7 @@ function InlinePanelSurface({ panel, align = "right", ...popover }) {
|
|
|
5611
5619
|
}
|
|
5612
5620
|
|
|
5613
5621
|
// src/components/data/SortMenu.tsx
|
|
5614
|
-
import { Fragment as Fragment12, jsx as
|
|
5622
|
+
import { Fragment as Fragment12, jsx as jsx59, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
5615
5623
|
var directionWord = (field, dir) => dir === "asc" ? field.numeric ? "lowest first" : "A to Z" : field.numeric ? "highest first" : "Z to A";
|
|
5616
5624
|
function moved(sort, from, to) {
|
|
5617
5625
|
const next = [...sort];
|
|
@@ -5641,7 +5649,7 @@ function SortMenu({
|
|
|
5641
5649
|
const field = fieldOf(entry.key);
|
|
5642
5650
|
return field.label + " " + directionWord(field, entry.dir);
|
|
5643
5651
|
}).join(", then ");
|
|
5644
|
-
const arrow = (field, dir, on, onClick) => /* @__PURE__ */
|
|
5652
|
+
const arrow = (field, dir, on, onClick) => /* @__PURE__ */ jsx59(
|
|
5645
5653
|
"button",
|
|
5646
5654
|
{
|
|
5647
5655
|
type: "button",
|
|
@@ -5660,7 +5668,7 @@ function SortMenu({
|
|
|
5660
5668
|
background: on ? "var(--brand)" : "var(--surface)",
|
|
5661
5669
|
color: on ? "#fff" : "var(--text-muted)"
|
|
5662
5670
|
},
|
|
5663
|
-
children: /* @__PURE__ */
|
|
5671
|
+
children: /* @__PURE__ */ jsx59("i", { className: "ph ph-arrow-" + (dir === "asc" ? "up" : "down"), style: { fontSize: 13 } })
|
|
5664
5672
|
}
|
|
5665
5673
|
);
|
|
5666
5674
|
const rowStyle = (highlight) => ({
|
|
@@ -5678,21 +5686,21 @@ function SortMenu({
|
|
|
5678
5686
|
const singleBody = fields.map((f) => {
|
|
5679
5687
|
const on = !!first && first.key === f.key;
|
|
5680
5688
|
return /* @__PURE__ */ jsxs49("span", { className: "fd-row", style: rowStyle(on), children: [
|
|
5681
|
-
/* @__PURE__ */
|
|
5689
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-body-sm", style: labelStyle(on), children: f.label }),
|
|
5682
5690
|
arrow(f, "asc", on && first.dir === "asc", () => change([{ key: f.key, dir: "asc" }])),
|
|
5683
5691
|
arrow(f, "desc", on && first.dir === "desc", () => change([{ key: f.key, dir: "desc" }]))
|
|
5684
5692
|
] }, f.key);
|
|
5685
5693
|
});
|
|
5686
5694
|
const unused = fields.filter((f) => !active.some((entry) => entry.key === f.key));
|
|
5687
5695
|
const multipleBody = /* @__PURE__ */ jsxs49(Fragment12, { children: [
|
|
5688
|
-
/* @__PURE__ */
|
|
5689
|
-
active.length === 0 ? /* @__PURE__ */
|
|
5696
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-overline fd-muted", style: { padding: "4px 8px 6px" }, children: "Sorted by" }),
|
|
5697
|
+
active.length === 0 ? /* @__PURE__ */ jsx59("span", { className: "fd-body-sm fd-muted", style: { padding: "4px 8px" }, children: "Unsorted" }) : /* @__PURE__ */ jsx59("ol", { className: "fd-stack", style: { gap: 2, margin: 0, padding: 0, listStyle: "none" }, "aria-label": "Sort order", children: active.map((entry, index) => {
|
|
5690
5698
|
const f = fieldOf(entry.key);
|
|
5691
5699
|
const flipped = entry.dir === "asc" ? "desc" : "asc";
|
|
5692
5700
|
return /* @__PURE__ */ jsxs49("li", { className: "fd-row", style: rowStyle(false), children: [
|
|
5693
|
-
/* @__PURE__ */
|
|
5694
|
-
/* @__PURE__ */
|
|
5695
|
-
/* @__PURE__ */
|
|
5701
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-body-sm fd-muted", "aria-hidden": "true", style: { width: 14, flex: "none" }, children: index + 1 }),
|
|
5702
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-body-sm", style: labelStyle(false), children: f.label }),
|
|
5703
|
+
/* @__PURE__ */ jsx59(
|
|
5696
5704
|
IconButton,
|
|
5697
5705
|
{
|
|
5698
5706
|
size: "sm",
|
|
@@ -5702,7 +5710,7 @@ function SortMenu({
|
|
|
5702
5710
|
onClick: () => change(active.map((e) => e.key === entry.key ? { key: e.key, dir: flipped } : e))
|
|
5703
5711
|
}
|
|
5704
5712
|
),
|
|
5705
|
-
/* @__PURE__ */
|
|
5713
|
+
/* @__PURE__ */ jsx59(
|
|
5706
5714
|
IconButton,
|
|
5707
5715
|
{
|
|
5708
5716
|
size: "sm",
|
|
@@ -5712,7 +5720,7 @@ function SortMenu({
|
|
|
5712
5720
|
onClick: () => change(moved(active, index, index - 1))
|
|
5713
5721
|
}
|
|
5714
5722
|
),
|
|
5715
|
-
/* @__PURE__ */
|
|
5723
|
+
/* @__PURE__ */ jsx59(
|
|
5716
5724
|
IconButton,
|
|
5717
5725
|
{
|
|
5718
5726
|
size: "sm",
|
|
@@ -5722,7 +5730,7 @@ function SortMenu({
|
|
|
5722
5730
|
onClick: () => change(moved(active, index, index + 1))
|
|
5723
5731
|
}
|
|
5724
5732
|
),
|
|
5725
|
-
/* @__PURE__ */
|
|
5733
|
+
/* @__PURE__ */ jsx59(
|
|
5726
5734
|
IconButton,
|
|
5727
5735
|
{
|
|
5728
5736
|
size: "sm",
|
|
@@ -5734,9 +5742,9 @@ function SortMenu({
|
|
|
5734
5742
|
] }, entry.key);
|
|
5735
5743
|
}) }),
|
|
5736
5744
|
unused.length > 0 ? /* @__PURE__ */ jsxs49(Fragment12, { children: [
|
|
5737
|
-
/* @__PURE__ */
|
|
5745
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-overline fd-muted", style: { padding: "10px 8px 6px" }, children: "Add a sort" }),
|
|
5738
5746
|
unused.map((f) => /* @__PURE__ */ jsxs49("span", { className: "fd-row", style: rowStyle(false), children: [
|
|
5739
|
-
/* @__PURE__ */
|
|
5747
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-body-sm", style: labelStyle(false), children: f.label }),
|
|
5740
5748
|
arrow(f, "asc", false, () => change([...active, { key: f.key, dir: "asc" }])),
|
|
5741
5749
|
arrow(f, "desc", false, () => change([...active, { key: f.key, dir: "desc" }]))
|
|
5742
5750
|
] }, f.key))
|
|
@@ -5753,12 +5761,12 @@ function SortMenu({
|
|
|
5753
5761
|
onClick: () => setOpen(!open2),
|
|
5754
5762
|
children: [
|
|
5755
5763
|
triggerLabel,
|
|
5756
|
-
/* @__PURE__ */
|
|
5764
|
+
/* @__PURE__ */ jsx59("i", { className: "ph ph-" + (first && first.dir === "asc" ? "arrow-up" : "arrow-down"), style: { fontSize: 12, marginLeft: 6, opacity: 0.75 } })
|
|
5757
5765
|
]
|
|
5758
5766
|
}
|
|
5759
5767
|
),
|
|
5760
|
-
/* @__PURE__ */
|
|
5761
|
-
/* @__PURE__ */
|
|
5768
|
+
/* @__PURE__ */ jsx59(InlinePanelSurface, { panel, align, offset: 6, width: multiple ? 340 : 280, label: "Sort by", children: /* @__PURE__ */ jsx59("span", { className: "fd-stack", style: { gap: 2, padding: 8 }, children: multiple ? multipleBody : /* @__PURE__ */ jsxs49(Fragment12, { children: [
|
|
5769
|
+
/* @__PURE__ */ jsx59("span", { className: "fd-overline fd-muted", style: { padding: "4px 8px 6px" }, children: "Sort by" }),
|
|
5762
5770
|
singleBody
|
|
5763
5771
|
] }) }) })
|
|
5764
5772
|
] });
|
|
@@ -5766,7 +5774,7 @@ function SortMenu({
|
|
|
5766
5774
|
|
|
5767
5775
|
// src/components/data/StepList.tsx
|
|
5768
5776
|
import * as React39 from "react";
|
|
5769
|
-
import { jsx as
|
|
5777
|
+
import { jsx as jsx60, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
5770
5778
|
var KIND_ICON = { tool: "wrench", search: "magnifying-glass", read: "file-text", write: "pencil-simple", reasoning: "brain", run: "terminal", fetch: "cloud-arrow-down" };
|
|
5771
5779
|
function StepList({
|
|
5772
5780
|
steps = [],
|
|
@@ -5794,8 +5802,8 @@ function StepList({
|
|
|
5794
5802
|
};
|
|
5795
5803
|
return /* @__PURE__ */ jsxs50("div", { className: ["fd-steps", dense ? "is-dense" : "", open2 ? "is-open" : "", className].filter(Boolean).join(" "), children: [
|
|
5796
5804
|
/* @__PURE__ */ jsxs50("button", { type: "button", className: "fd-steps-head", onClick: toggle, "aria-expanded": open2, children: [
|
|
5797
|
-
running ? /* @__PURE__ */
|
|
5798
|
-
/* @__PURE__ */
|
|
5805
|
+
running ? /* @__PURE__ */ jsx60("span", { className: "fd-steps-spin", "aria-hidden": "true" }) : /* @__PURE__ */ jsx60("i", { className: "ph ph-" + (failed ? "warning-circle" : "check-circle"), "aria-hidden": "true" }),
|
|
5806
|
+
/* @__PURE__ */ jsx60("span", { className: "fd-steps-title", title: truncationTitle(summary), children: summary }),
|
|
5799
5807
|
/* @__PURE__ */ jsxs50("span", { className: "fd-steps-count fd-tabular", children: [
|
|
5800
5808
|
steps.length,
|
|
5801
5809
|
" step",
|
|
@@ -5806,15 +5814,15 @@ function StepList({
|
|
|
5806
5814
|
" failed"
|
|
5807
5815
|
] }) : null
|
|
5808
5816
|
] }),
|
|
5809
|
-
/* @__PURE__ */
|
|
5817
|
+
/* @__PURE__ */ jsx60("i", { className: "ph ph-caret-" + (open2 ? "up" : "down") + " fd-steps-caret", "aria-hidden": "true" })
|
|
5810
5818
|
] }),
|
|
5811
|
-
open2 ? /* @__PURE__ */
|
|
5819
|
+
open2 ? /* @__PURE__ */ jsx60("ol", { className: "fd-steps-list", children: steps.map((s, i) => {
|
|
5812
5820
|
const id = s.id || i;
|
|
5813
5821
|
const isOpen = !!expanded[id];
|
|
5814
5822
|
const icon = KIND_ICON[s.kind || ""] || "dot-outline";
|
|
5815
5823
|
return /* @__PURE__ */ jsxs50("li", { className: "fd-step is-" + (s.status || "ok"), children: [
|
|
5816
5824
|
/* @__PURE__ */ jsxs50("div", { className: "fd-step-row", children: [
|
|
5817
|
-
/* @__PURE__ */
|
|
5825
|
+
/* @__PURE__ */ jsx60("span", { className: "fd-step-icon", "aria-hidden": "true", children: s.status === "running" ? /* @__PURE__ */ jsx60("span", { className: "fd-steps-spin" }) : /* @__PURE__ */ jsx60("i", { className: "ph ph-" + icon }) }),
|
|
5818
5826
|
s.detail ? /* @__PURE__ */ jsxs50(
|
|
5819
5827
|
"button",
|
|
5820
5828
|
{
|
|
@@ -5823,15 +5831,15 @@ function StepList({
|
|
|
5823
5831
|
"aria-expanded": isOpen,
|
|
5824
5832
|
onClick: () => setExpanded((m) => Object.assign({}, m, { [id]: !isOpen })),
|
|
5825
5833
|
children: [
|
|
5826
|
-
/* @__PURE__ */
|
|
5827
|
-
/* @__PURE__ */
|
|
5834
|
+
/* @__PURE__ */ jsx60("span", { title: truncationTitle(s.label), children: s.label }),
|
|
5835
|
+
/* @__PURE__ */ jsx60("i", { className: "ph ph-caret-" + (isOpen ? "up" : "down"), "aria-hidden": "true" })
|
|
5828
5836
|
]
|
|
5829
5837
|
}
|
|
5830
|
-
) : /* @__PURE__ */
|
|
5831
|
-
s.status === "error" ? /* @__PURE__ */
|
|
5832
|
-
showDurations && s.durationMs ? /* @__PURE__ */
|
|
5838
|
+
) : /* @__PURE__ */ jsx60("span", { className: "fd-step-label is-static", title: truncationTitle(s.label), children: s.label }),
|
|
5839
|
+
s.status === "error" ? /* @__PURE__ */ jsx60("span", { className: "fd-step-badge is-error", children: "failed" }) : null,
|
|
5840
|
+
showDurations && s.durationMs ? /* @__PURE__ */ jsx60("span", { className: "fd-step-dur fd-tabular", children: formatDuration(s.durationMs) }) : null
|
|
5833
5841
|
] }),
|
|
5834
|
-
s.detail && isOpen ? /* @__PURE__ */
|
|
5842
|
+
s.detail && isOpen ? /* @__PURE__ */ jsx60("pre", { className: "fd-step-detail", children: s.detail }) : null
|
|
5835
5843
|
] }, id);
|
|
5836
5844
|
}) }) : null
|
|
5837
5845
|
] });
|
|
@@ -5839,7 +5847,7 @@ function StepList({
|
|
|
5839
5847
|
|
|
5840
5848
|
// src/components/data/VirtualList.tsx
|
|
5841
5849
|
import * as React40 from "react";
|
|
5842
|
-
import { jsx as
|
|
5850
|
+
import { jsx as jsx61, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
5843
5851
|
var VIRTUAL_LIST_BUFFER_ROWS = 20;
|
|
5844
5852
|
var VIRTUAL_LIST_ROW_GAP = 6;
|
|
5845
5853
|
function computeVirtualWindow(opts) {
|
|
@@ -5933,7 +5941,7 @@ function VirtualList({
|
|
|
5933
5941
|
}, [items]);
|
|
5934
5942
|
const gapStyle = { "--fd-vlist-gap": rowGap + "px" };
|
|
5935
5943
|
if (!items.length && !loading && !refreshing && emptyState) {
|
|
5936
|
-
return /* @__PURE__ */
|
|
5944
|
+
return /* @__PURE__ */ jsx61("div", { className: ["fd-vlist-wrap", className].filter(Boolean).join(" "), style: { height, position: "relative", ...style }, children: /* @__PURE__ */ jsx61("div", { className: "fd-vlist fd-scrollbar", style: { height: "100%", overflow: "auto" }, children: emptyState }) });
|
|
5937
5945
|
}
|
|
5938
5946
|
const rows = [];
|
|
5939
5947
|
for (let i = win.startIndex; i <= win.endIndex; i++) {
|
|
@@ -5941,12 +5949,12 @@ function VirtualList({
|
|
|
5941
5949
|
if (item === void 0) continue;
|
|
5942
5950
|
const key = keyOf(item);
|
|
5943
5951
|
rows.push(
|
|
5944
|
-
/* @__PURE__ */
|
|
5952
|
+
/* @__PURE__ */ jsx61(
|
|
5945
5953
|
"div",
|
|
5946
5954
|
{
|
|
5947
5955
|
className: "fd-vlist-row",
|
|
5948
5956
|
style: { height: itemHeight, boxSizing: "border-box", transform: "translateY(" + i * itemHeight + "px)" },
|
|
5949
|
-
children: /* @__PURE__ */
|
|
5957
|
+
children: /* @__PURE__ */ jsx61("div", { className: newKeys.has(key) ? "fd-vlist-row-content fd-vlist-row-enter" : "fd-vlist-row-content", children: renderItem(item, i) })
|
|
5950
5958
|
},
|
|
5951
5959
|
key
|
|
5952
5960
|
)
|
|
@@ -5960,21 +5968,21 @@ function VirtualList({
|
|
|
5960
5968
|
style: { height: "100%", overflowY: "auto", overflowX: "hidden", position: "relative" },
|
|
5961
5969
|
onScroll: (e) => setScrollTop(e.currentTarget.scrollTop),
|
|
5962
5970
|
children: [
|
|
5963
|
-
/* @__PURE__ */
|
|
5964
|
-
loading ? /* @__PURE__ */
|
|
5971
|
+
/* @__PURE__ */ jsx61("div", { style: { height: win.totalHeight, position: "relative" }, children: rows }),
|
|
5972
|
+
loading ? /* @__PURE__ */ jsx61("div", { style: { position: "sticky", bottom: 0, left: 0, right: 0, display: "grid", placeItems: "center", padding: "8px 0", background: "var(--surface)" }, children: /* @__PURE__ */ jsx61("span", { className: "fd-spinner", "aria-hidden": "true" }) }) : null
|
|
5965
5973
|
]
|
|
5966
5974
|
}
|
|
5967
5975
|
),
|
|
5968
|
-
refreshing ? /* @__PURE__ */
|
|
5969
|
-
/* @__PURE__ */
|
|
5970
|
-
/* @__PURE__ */
|
|
5976
|
+
refreshing ? /* @__PURE__ */ jsx61("div", { className: "fd-vlist-refresh-scrim", children: /* @__PURE__ */ jsxs51("div", { className: "fd-vlist-refresh-card", children: [
|
|
5977
|
+
/* @__PURE__ */ jsx61("span", { className: "fd-spinner", "aria-hidden": "true" }),
|
|
5978
|
+
/* @__PURE__ */ jsx61("span", { className: "fd-body-sm", children: refreshingLabel })
|
|
5971
5979
|
] }) }) : null
|
|
5972
5980
|
] });
|
|
5973
5981
|
}
|
|
5974
5982
|
|
|
5975
5983
|
// src/components/data/EntityRow.tsx
|
|
5976
5984
|
import * as React41 from "react";
|
|
5977
|
-
import { jsx as
|
|
5985
|
+
import { jsx as jsx62, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5978
5986
|
var ENTITY_ROW_METRIC_WIDTH = 74;
|
|
5979
5987
|
var METRIC_TONE_COLOR = {
|
|
5980
5988
|
default: "var(--text-2)",
|
|
@@ -5982,16 +5990,16 @@ var METRIC_TONE_COLOR = {
|
|
|
5982
5990
|
danger: "var(--danger-text)"
|
|
5983
5991
|
};
|
|
5984
5992
|
function EntityRowMetrics({ metrics, className = "", style }) {
|
|
5985
|
-
return /* @__PURE__ */
|
|
5993
|
+
return /* @__PURE__ */ jsx62("span", { className: ["fd-erow-metrics", className].filter(Boolean).join(" "), style, children: metrics.map((m, i) => {
|
|
5986
5994
|
const key = m.id || m.label || i;
|
|
5987
5995
|
const className2 = ["fd-erow-metric", m.tone && m.tone !== "default" ? "is-" + m.tone : "", m.tooltip != null ? "is-described" : ""].filter(Boolean).join(" ");
|
|
5988
5996
|
const tone = { color: METRIC_TONE_COLOR[m.tone || "default"] };
|
|
5989
5997
|
const content = /* @__PURE__ */ jsxs52(React41.Fragment, { children: [
|
|
5990
|
-
m.icon ? /* @__PURE__ */
|
|
5991
|
-
/* @__PURE__ */
|
|
5992
|
-
/* @__PURE__ */
|
|
5998
|
+
m.icon ? /* @__PURE__ */ jsx62("i", { className: "ph ph-" + m.icon, "aria-hidden": "true" }) : null,
|
|
5999
|
+
/* @__PURE__ */ jsx62("span", { className: "fd-erow-metric-value fd-tabular", children: m.value }),
|
|
6000
|
+
/* @__PURE__ */ jsx62("span", { className: "fd-sr", children: " " + m.label })
|
|
5993
6001
|
] });
|
|
5994
|
-
return /* @__PURE__ */
|
|
6002
|
+
return /* @__PURE__ */ jsx62("span", { className: "fd-erow-cell", style: { "--erow-metric-w": (m.width || ENTITY_ROW_METRIC_WIDTH) + "px" }, children: m.tooltip == null ? /* @__PURE__ */ jsx62("span", { className: className2, style: tone, title: m.label, children: content }) : /* @__PURE__ */ jsx62(Tooltip, { label: m.tooltip, children: /* @__PURE__ */ jsx62("button", { type: "button", className: className2, style: tone, children: content }) }) }, key);
|
|
5995
6003
|
}) });
|
|
5996
6004
|
}
|
|
5997
6005
|
function EntityRow({
|
|
@@ -6034,33 +6042,33 @@ function EntityRow({
|
|
|
6034
6042
|
// font-size moved to the .fd-erow-grip stylesheet rule, same reason as the
|
|
6035
6043
|
// row's own padding above: .fd-tlist-footer's indent reads it back as
|
|
6036
6044
|
// --erow-grip-size.
|
|
6037
|
-
/* @__PURE__ */
|
|
6045
|
+
/* @__PURE__ */ jsx62("i", { className: "ph ph-dots-six-vertical fd-erow-grip", "aria-hidden": "true", style: { flex: "none", color: "var(--text-muted)" } })
|
|
6038
6046
|
) : null,
|
|
6039
6047
|
/* @__PURE__ */ jsxs52("span", { className: "fd-erow-body", children: [
|
|
6040
6048
|
/* @__PURE__ */ jsxs52("span", { className: "fd-erow-titleline", children: [
|
|
6041
|
-
titleIcon ? /* @__PURE__ */
|
|
6049
|
+
titleIcon ? /* @__PURE__ */ jsx62(Tooltip, { label: titleIcon.tooltip, children: /* @__PURE__ */ jsxs52(
|
|
6042
6050
|
"button",
|
|
6043
6051
|
{
|
|
6044
6052
|
type: "button",
|
|
6045
6053
|
className: ["fd-erow-title-icon", titleIcon.tone ? "is-" + titleIcon.tone : ""].filter(Boolean).join(" "),
|
|
6046
6054
|
children: [
|
|
6047
|
-
/* @__PURE__ */
|
|
6048
|
-
/* @__PURE__ */
|
|
6055
|
+
/* @__PURE__ */ jsx62("i", { className: "ph ph-" + titleIcon.icon, "aria-hidden": "true" }),
|
|
6056
|
+
/* @__PURE__ */ jsx62("span", { className: "fd-erow-title fd-body-sm", children: title })
|
|
6049
6057
|
]
|
|
6050
6058
|
}
|
|
6051
6059
|
) }) : (
|
|
6052
6060
|
// MP-141: dense-row identifier, no Tooltip wrapper in this branch — a native
|
|
6053
6061
|
// `title` is the exposure mechanism, same rule as every other identifier.
|
|
6054
|
-
/* @__PURE__ */
|
|
6062
|
+
/* @__PURE__ */ jsx62("span", { className: "fd-erow-title fd-body-sm", title: truncationTitle(title), children: title })
|
|
6055
6063
|
),
|
|
6056
|
-
meta ? /* @__PURE__ */
|
|
6064
|
+
meta ? /* @__PURE__ */ jsx62("span", { className: "fd-erow-meta", title: truncationTitle(meta), children: meta }) : null
|
|
6057
6065
|
] }),
|
|
6058
6066
|
hasStrip ? /* @__PURE__ */ jsxs52("span", { className: "fd-erow-strip", children: [
|
|
6059
|
-
metrics && metrics.length ? /* @__PURE__ */
|
|
6060
|
-
accessory ? /* @__PURE__ */
|
|
6067
|
+
metrics && metrics.length ? /* @__PURE__ */ jsx62(EntityRowMetrics, { metrics }) : null,
|
|
6068
|
+
accessory ? /* @__PURE__ */ jsx62("span", { className: "fd-erow-accessory", children: accessory }) : null
|
|
6061
6069
|
] }) : null
|
|
6062
6070
|
] }),
|
|
6063
|
-
action ? /* @__PURE__ */
|
|
6071
|
+
action ? /* @__PURE__ */ jsx62(
|
|
6064
6072
|
IconButton,
|
|
6065
6073
|
{
|
|
6066
6074
|
icon: action.icon,
|
|
@@ -6082,7 +6090,7 @@ import * as React42 from "react";
|
|
|
6082
6090
|
import { createPortal as createPortal5 } from "react-dom";
|
|
6083
6091
|
|
|
6084
6092
|
// src/components/forms/Input.tsx
|
|
6085
|
-
import { jsx as
|
|
6093
|
+
import { jsx as jsx63, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
6086
6094
|
function Input({
|
|
6087
6095
|
label,
|
|
6088
6096
|
help,
|
|
@@ -6110,23 +6118,23 @@ function Input({
|
|
|
6110
6118
|
size === "lg" ? "fd-input-lg" : ""
|
|
6111
6119
|
].filter(Boolean).join(" ");
|
|
6112
6120
|
return /* @__PURE__ */ jsxs53("div", { className: ["fd-field", className].filter(Boolean).join(" "), style, children: [
|
|
6113
|
-
label ? /* @__PURE__ */
|
|
6121
|
+
label ? /* @__PURE__ */ jsx63(FieldLabel, { htmlFor: fieldId, required, children: label }) : null,
|
|
6114
6122
|
/* @__PURE__ */ jsxs53("div", { className: box, children: [
|
|
6115
|
-
icon ? /* @__PURE__ */
|
|
6116
|
-
prefix ? /* @__PURE__ */
|
|
6117
|
-
/* @__PURE__ */
|
|
6118
|
-
loading ? /* @__PURE__ */
|
|
6119
|
-
suffix && !loading ? /* @__PURE__ */
|
|
6123
|
+
icon ? /* @__PURE__ */ jsx63("span", { className: "fd-input-icon", children: /* @__PURE__ */ jsx63("i", { className: "ph ph-" + icon, "aria-hidden": "true" }) }) : null,
|
|
6124
|
+
prefix ? /* @__PURE__ */ jsx63("span", { className: "fd-input-affix", children: prefix }) : null,
|
|
6125
|
+
/* @__PURE__ */ jsx63("input", { id: fieldId, disabled, style: inputStyle, "aria-invalid": error ? "true" : void 0, ...rest }),
|
|
6126
|
+
loading ? /* @__PURE__ */ jsx63("span", { className: "fd-spinner", style: { color: "var(--text-muted)" }, "aria-label": "Loading" }) : null,
|
|
6127
|
+
suffix && !loading ? /* @__PURE__ */ jsx63("span", { className: "fd-input-affix", children: suffix }) : null
|
|
6120
6128
|
] }),
|
|
6121
6129
|
error ? /* @__PURE__ */ jsxs53("span", { className: "fd-field-error", children: [
|
|
6122
|
-
/* @__PURE__ */
|
|
6130
|
+
/* @__PURE__ */ jsx63("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
6123
6131
|
error
|
|
6124
|
-
] }) : help ? /* @__PURE__ */
|
|
6132
|
+
] }) : help ? /* @__PURE__ */ jsx63("span", { className: "fd-field-help", children: help }) : null
|
|
6125
6133
|
] });
|
|
6126
6134
|
}
|
|
6127
6135
|
|
|
6128
6136
|
// src/components/forms/SearchField.tsx
|
|
6129
|
-
import { jsx as
|
|
6137
|
+
import { jsx as jsx64 } from "react/jsx-runtime";
|
|
6130
6138
|
function SearchField({
|
|
6131
6139
|
value,
|
|
6132
6140
|
onChange,
|
|
@@ -6141,7 +6149,7 @@ function SearchField({
|
|
|
6141
6149
|
...rest
|
|
6142
6150
|
}) {
|
|
6143
6151
|
const clear = onClear || (() => onChange(""));
|
|
6144
|
-
return /* @__PURE__ */
|
|
6152
|
+
return /* @__PURE__ */ jsx64(
|
|
6145
6153
|
Input,
|
|
6146
6154
|
{
|
|
6147
6155
|
id,
|
|
@@ -6154,14 +6162,14 @@ function SearchField({
|
|
|
6154
6162
|
style,
|
|
6155
6163
|
className,
|
|
6156
6164
|
onChange: (e) => onChange(e.target.value),
|
|
6157
|
-
suffix: value ? /* @__PURE__ */
|
|
6165
|
+
suffix: value ? /* @__PURE__ */ jsx64(
|
|
6158
6166
|
"button",
|
|
6159
6167
|
{
|
|
6160
6168
|
type: "button",
|
|
6161
6169
|
"aria-label": "Clear search",
|
|
6162
6170
|
onClick: clear,
|
|
6163
6171
|
style: { all: "unset", cursor: "pointer", color: "var(--text-muted)", display: "grid", placeItems: "center", padding: 2 },
|
|
6164
|
-
children: /* @__PURE__ */
|
|
6172
|
+
children: /* @__PURE__ */ jsx64("i", { className: "ph ph-x-circle", style: { fontSize: 15 }, "aria-hidden": "true" })
|
|
6165
6173
|
}
|
|
6166
6174
|
) : void 0,
|
|
6167
6175
|
...rest
|
|
@@ -6170,7 +6178,7 @@ function SearchField({
|
|
|
6170
6178
|
}
|
|
6171
6179
|
|
|
6172
6180
|
// src/components/data/TransferList.tsx
|
|
6173
|
-
import { jsx as
|
|
6181
|
+
import { jsx as jsx65, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
6174
6182
|
var emptyHasMore = {};
|
|
6175
6183
|
var DRAG_THRESHOLD_PX = 5;
|
|
6176
6184
|
function TransferList({
|
|
@@ -6295,12 +6303,12 @@ function TransferList({
|
|
|
6295
6303
|
cfg.label,
|
|
6296
6304
|
cfg.total != null ? " (" + cfg.total.toLocaleString() + ")" : ""
|
|
6297
6305
|
] }) : null,
|
|
6298
|
-
cfg.header ? /* @__PURE__ */
|
|
6306
|
+
cfg.header ? /* @__PURE__ */ jsx65("div", { className: "fd-tlist-header", children: cfg.header }) : null,
|
|
6299
6307
|
/* @__PURE__ */ jsxs54("span", { className: "fd-row", style: { gap: 8 }, children: [
|
|
6300
|
-
/* @__PURE__ */
|
|
6301
|
-
/* @__PURE__ */
|
|
6308
|
+
/* @__PURE__ */ jsx65(SearchField, { value: cfg.search, onChange: cfg.onSearchChange, placeholder: "Search", "aria-label": (cfg.label || side) + " search", style: { flex: 1 } }),
|
|
6309
|
+
/* @__PURE__ */ jsx65(SortMenu, { fields: cfg.sortFields, sort: cfg.sort ? [cfg.sort] : [], onSortChange: (next) => next[0] && cfg.onSort(next[0].key, next[0].dir), align: side === "left" ? "left" : "right" })
|
|
6302
6310
|
] }),
|
|
6303
|
-
/* @__PURE__ */
|
|
6311
|
+
/* @__PURE__ */ jsx65(
|
|
6304
6312
|
VirtualList,
|
|
6305
6313
|
{
|
|
6306
6314
|
items: cfg.items,
|
|
@@ -6314,15 +6322,15 @@ function TransferList({
|
|
|
6314
6322
|
firstItemIndex: cfg.firstItemIndex,
|
|
6315
6323
|
totalCount: cfg.totalCount,
|
|
6316
6324
|
onNeedMore: cfg.onNeedMore,
|
|
6317
|
-
emptyState: /* @__PURE__ */
|
|
6325
|
+
emptyState: /* @__PURE__ */ jsx65(EmptyState, { icon: "tray", title: "Nothing here" }),
|
|
6318
6326
|
renderItem: (item) => {
|
|
6319
6327
|
const isBeingDragged = drag != null && drag.from === side && drag.key === keyOf(item);
|
|
6320
6328
|
if (isBeingDragged) {
|
|
6321
|
-
return /* @__PURE__ */
|
|
6329
|
+
return /* @__PURE__ */ jsx65("div", { className: "fd-erow-placeholder", "aria-hidden": "true" });
|
|
6322
6330
|
}
|
|
6323
6331
|
const content = renderRow(item);
|
|
6324
6332
|
const destination = (side === "left" ? right : left).label || "the other list";
|
|
6325
|
-
return /* @__PURE__ */
|
|
6333
|
+
return /* @__PURE__ */ jsx65(
|
|
6326
6334
|
EntityRow,
|
|
6327
6335
|
{
|
|
6328
6336
|
...content,
|
|
@@ -6342,10 +6350,10 @@ function TransferList({
|
|
|
6342
6350
|
}
|
|
6343
6351
|
}
|
|
6344
6352
|
),
|
|
6345
|
-
cfg.footer ? /* @__PURE__ */
|
|
6346
|
-
showOverlay ? /* @__PURE__ */
|
|
6347
|
-
/* @__PURE__ */
|
|
6348
|
-
/* @__PURE__ */
|
|
6353
|
+
cfg.footer ? /* @__PURE__ */ jsx65("div", { className: "fd-tlist-footer", children: cfg.footer }) : null,
|
|
6354
|
+
showOverlay ? /* @__PURE__ */ jsx65("div", { className: "fd-tlist-drop-overlay", "aria-hidden": "true", children: /* @__PURE__ */ jsxs54("span", { className: "fd-tlist-drop-card", children: [
|
|
6355
|
+
/* @__PURE__ */ jsx65("i", { className: "ph ph-tray-arrow-down", style: { fontSize: 18 }, "aria-hidden": "true" }),
|
|
6356
|
+
/* @__PURE__ */ jsx65("span", { className: "fd-body-sm", style: { fontWeight: 600 }, children: cfg.dropLabel || "Drop here" + (cfg.label ? " \u2014 " + cfg.label : "") })
|
|
6349
6357
|
] }) }) : null
|
|
6350
6358
|
]
|
|
6351
6359
|
}
|
|
@@ -6357,7 +6365,7 @@ function TransferList({
|
|
|
6357
6365
|
renderSide("right", right, "left")
|
|
6358
6366
|
] }),
|
|
6359
6367
|
drag ? createPortal5(
|
|
6360
|
-
/* @__PURE__ */
|
|
6368
|
+
/* @__PURE__ */ jsx65(
|
|
6361
6369
|
"div",
|
|
6362
6370
|
{
|
|
6363
6371
|
"aria-hidden": "true",
|
|
@@ -6372,7 +6380,7 @@ function TransferList({
|
|
|
6372
6380
|
pointerEvents: "none",
|
|
6373
6381
|
zIndex: OVERLAY_CEILING
|
|
6374
6382
|
},
|
|
6375
|
-
children: /* @__PURE__ */
|
|
6383
|
+
children: /* @__PURE__ */ jsx65(EntityRow, { ...renderRow(drag.item), draggable: true, className: "fd-erow-dragging" })
|
|
6376
6384
|
}
|
|
6377
6385
|
),
|
|
6378
6386
|
document.body
|
|
@@ -6381,11 +6389,11 @@ function TransferList({
|
|
|
6381
6389
|
}
|
|
6382
6390
|
|
|
6383
6391
|
// src/components/data/FactList.tsx
|
|
6384
|
-
import { jsx as
|
|
6392
|
+
import { jsx as jsx66, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
6385
6393
|
function FactList({ facts = [], className = "", ...rest }) {
|
|
6386
|
-
return /* @__PURE__ */
|
|
6387
|
-
/* @__PURE__ */
|
|
6388
|
-
/* @__PURE__ */
|
|
6394
|
+
return /* @__PURE__ */ jsx66("div", { className: ["fd-facts", className].filter(Boolean).join(" "), ...rest, children: /* @__PURE__ */ jsx66("dl", { className: "fd-facts-grid", children: facts.map((f) => /* @__PURE__ */ jsxs55("div", { className: "fd-fact", children: [
|
|
6395
|
+
/* @__PURE__ */ jsx66("dt", { className: "fd-fact-label", children: f.label }),
|
|
6396
|
+
/* @__PURE__ */ jsx66("dd", { className: "fd-fact-value", children: f.value })
|
|
6389
6397
|
] }, f.label)) }) });
|
|
6390
6398
|
}
|
|
6391
6399
|
|
|
@@ -6475,7 +6483,7 @@ function useUsStateShapes() {
|
|
|
6475
6483
|
}
|
|
6476
6484
|
|
|
6477
6485
|
// src/components/data/USChoropleth.tsx
|
|
6478
|
-
import { jsx as
|
|
6486
|
+
import { jsx as jsx67, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
6479
6487
|
var TABLE_TITLE = "Show as a table";
|
|
6480
6488
|
function legendLabel({ from, to }, formatValue) {
|
|
6481
6489
|
if (from === 0) return `Up to ${formatValue(to)}`;
|
|
@@ -6484,11 +6492,11 @@ function legendLabel({ from, to }, formatValue) {
|
|
|
6484
6492
|
function Legend({ model, formatValue }) {
|
|
6485
6493
|
return /* @__PURE__ */ jsxs56("ul", { className: "fd-uschoro-legend", "aria-label": "Legend", children: [
|
|
6486
6494
|
/* @__PURE__ */ jsxs56("li", { children: [
|
|
6487
|
-
/* @__PURE__ */
|
|
6495
|
+
/* @__PURE__ */ jsx67("span", { className: "fd-uschoro-swatch", "data-step": "none", "aria-hidden": "true" }),
|
|
6488
6496
|
"None"
|
|
6489
6497
|
] }),
|
|
6490
6498
|
legendSteps(model.bounds).map((step) => /* @__PURE__ */ jsxs56("li", { children: [
|
|
6491
|
-
/* @__PURE__ */
|
|
6499
|
+
/* @__PURE__ */ jsx67("span", { className: "fd-uschoro-swatch", "data-step": step.step, "aria-hidden": "true" }),
|
|
6492
6500
|
legendLabel(step, formatValue)
|
|
6493
6501
|
] }, step.step))
|
|
6494
6502
|
] });
|
|
@@ -6516,7 +6524,7 @@ function StateMap({ shapes, model, figures, label, formatReadout }) {
|
|
|
6516
6524
|
const figure = figures.get(shape.code);
|
|
6517
6525
|
const readout = formatReadout(figure);
|
|
6518
6526
|
const binding = tip.bind(shape.code, readout);
|
|
6519
|
-
return /* @__PURE__ */
|
|
6527
|
+
return /* @__PURE__ */ jsx67(
|
|
6520
6528
|
"path",
|
|
6521
6529
|
{
|
|
6522
6530
|
className: "fd-uschoro-state",
|
|
@@ -6535,7 +6543,7 @@ function StateMap({ shapes, model, figures, label, formatReadout }) {
|
|
|
6535
6543
|
shape.code
|
|
6536
6544
|
);
|
|
6537
6545
|
}),
|
|
6538
|
-
active ? /* @__PURE__ */
|
|
6546
|
+
active ? /* @__PURE__ */ jsx67("path", { className: "fd-uschoro-active", d: active.path, "aria-hidden": "true" }) : null
|
|
6539
6547
|
] }),
|
|
6540
6548
|
tip.bubble
|
|
6541
6549
|
] });
|
|
@@ -6546,7 +6554,7 @@ function StateTable({ model, valueLabel, formatValue }) {
|
|
|
6546
6554
|
{ key: "value", label: valueLabel, numeric: true, phone: "secondary", render: (row) => formatValue(row.value) },
|
|
6547
6555
|
{ key: "share", label: "Share of total", numeric: true, phone: "secondary", render: (row) => formatShare(row.share) }
|
|
6548
6556
|
];
|
|
6549
|
-
return /* @__PURE__ */
|
|
6557
|
+
return /* @__PURE__ */ jsx67(Collapsible, { title: TABLE_TITLE, children: /* @__PURE__ */ jsx67(DataTable, { columns, rows: model.rows, rowKey: "code", compact: true }) });
|
|
6550
6558
|
}
|
|
6551
6559
|
function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, topN, total, className = "" }) {
|
|
6552
6560
|
const model = React44.useMemo(() => buildChoroplethModel(values, topN ?? 0, total), [values, topN, total]);
|
|
@@ -6555,37 +6563,38 @@ function USChoropleth({ values, label, valueLabel, formatValue, formatReadout, t
|
|
|
6555
6563
|
return /* @__PURE__ */ jsxs56("div", { className: ["fd-uschoro", className].filter(Boolean).join(" "), children: [
|
|
6556
6564
|
/* @__PURE__ */ jsxs56("div", { className: "fd-uschoro-layout", children: [
|
|
6557
6565
|
/* @__PURE__ */ jsxs56("div", { className: "fd-uschoro-main", children: [
|
|
6558
|
-
/* @__PURE__ */
|
|
6566
|
+
/* @__PURE__ */ jsx67(
|
|
6559
6567
|
LoadingRegion,
|
|
6560
6568
|
{
|
|
6561
6569
|
state: state.status,
|
|
6562
6570
|
label: `${label} loading`,
|
|
6563
6571
|
error: state.status === "error" ? state.message : void 0,
|
|
6564
6572
|
onRetry: retry,
|
|
6565
|
-
skeleton: /* @__PURE__ */
|
|
6566
|
-
children: state.status === "ready" ? /* @__PURE__ */
|
|
6573
|
+
skeleton: /* @__PURE__ */ jsx67("div", { className: "fd-uschoro-skeleton", children: /* @__PURE__ */ jsx67(Skeleton, { h: "100%" }) }),
|
|
6574
|
+
children: state.status === "ready" ? /* @__PURE__ */ jsx67(StateMap, { shapes: state.shapes, model, figures, label, formatReadout }) : null
|
|
6567
6575
|
}
|
|
6568
6576
|
),
|
|
6569
|
-
/* @__PURE__ */
|
|
6577
|
+
/* @__PURE__ */ jsx67(Legend, { model, formatValue })
|
|
6570
6578
|
] }),
|
|
6571
|
-
topN ? /* @__PURE__ */
|
|
6579
|
+
topN ? /* @__PURE__ */ jsx67("div", { className: "fd-uschoro-top", children: /* @__PURE__ */ jsx67(
|
|
6572
6580
|
BarList,
|
|
6573
6581
|
{
|
|
6574
6582
|
label: `Top ${topN} states`,
|
|
6575
6583
|
rows: model.top.map((row) => ({ id: row.code, label: row.name, value: row.value, color: "var(--seq-4)" })),
|
|
6576
6584
|
valueFormat: formatValue,
|
|
6577
6585
|
total: model.total,
|
|
6586
|
+
shareFormat: formatShare,
|
|
6578
6587
|
sort: false
|
|
6579
6588
|
}
|
|
6580
6589
|
) }) : null
|
|
6581
6590
|
] }),
|
|
6582
|
-
/* @__PURE__ */
|
|
6591
|
+
/* @__PURE__ */ jsx67(StateTable, { model, valueLabel, formatValue })
|
|
6583
6592
|
] });
|
|
6584
6593
|
}
|
|
6585
6594
|
|
|
6586
6595
|
// src/components/forms/Checkbox.tsx
|
|
6587
6596
|
import * as React45 from "react";
|
|
6588
|
-
import { jsx as
|
|
6597
|
+
import { jsx as jsx68, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
6589
6598
|
function Checkbox({ label, description, card = false, indeterminate = false, className = "", ...rest }) {
|
|
6590
6599
|
const ref = React45.useRef(null);
|
|
6591
6600
|
React45.useEffect(() => {
|
|
@@ -6593,47 +6602,47 @@ function Checkbox({ label, description, card = false, indeterminate = false, cla
|
|
|
6593
6602
|
}, [indeterminate]);
|
|
6594
6603
|
return /* @__PURE__ */ jsxs57("label", { className: ["fd-choice", card ? "fd-choice-card" : "", className].filter(Boolean).join(" "), children: [
|
|
6595
6604
|
/* @__PURE__ */ jsxs57("span", { className: "fd-choice-input", children: [
|
|
6596
|
-
/* @__PURE__ */
|
|
6597
|
-
/* @__PURE__ */
|
|
6605
|
+
/* @__PURE__ */ jsx68("input", { ref, type: "checkbox", ...rest }),
|
|
6606
|
+
/* @__PURE__ */ jsx68("span", { className: "fd-choice-box", "aria-hidden": "true", children: /* @__PURE__ */ jsx68("i", { className: indeterminate ? "ph ph-minus" : "ph ph-check" }) })
|
|
6598
6607
|
] }),
|
|
6599
6608
|
/* @__PURE__ */ jsxs57("span", { className: "fd-choice-text", children: [
|
|
6600
|
-
/* @__PURE__ */
|
|
6601
|
-
description ? /* @__PURE__ */
|
|
6609
|
+
/* @__PURE__ */ jsx68("span", { className: "fd-choice-title", children: label }),
|
|
6610
|
+
description ? /* @__PURE__ */ jsx68("span", { className: "fd-choice-desc", children: description }) : null
|
|
6602
6611
|
] })
|
|
6603
6612
|
] });
|
|
6604
6613
|
}
|
|
6605
6614
|
|
|
6606
6615
|
// src/components/forms/Radio.tsx
|
|
6607
|
-
import { jsx as
|
|
6616
|
+
import { jsx as jsx69, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
6608
6617
|
function Radio({ label, description, card = false, className = "", ...rest }) {
|
|
6609
6618
|
return /* @__PURE__ */ jsxs58("label", { className: ["fd-choice", card ? "fd-choice-card" : "", className].filter(Boolean).join(" "), children: [
|
|
6610
6619
|
/* @__PURE__ */ jsxs58("span", { className: "fd-choice-input", children: [
|
|
6611
|
-
/* @__PURE__ */
|
|
6612
|
-
/* @__PURE__ */
|
|
6620
|
+
/* @__PURE__ */ jsx69("input", { type: "radio", ...rest }),
|
|
6621
|
+
/* @__PURE__ */ jsx69("span", { className: "fd-choice-box fd-choice-box-round", "aria-hidden": "true", children: /* @__PURE__ */ jsx69("span", { className: "fd-choice-dot" }) })
|
|
6613
6622
|
] }),
|
|
6614
6623
|
/* @__PURE__ */ jsxs58("span", { className: "fd-choice-text", children: [
|
|
6615
|
-
/* @__PURE__ */
|
|
6616
|
-
description ? /* @__PURE__ */
|
|
6624
|
+
/* @__PURE__ */ jsx69("span", { className: "fd-choice-title", children: label }),
|
|
6625
|
+
description ? /* @__PURE__ */ jsx69("span", { className: "fd-choice-desc", children: description }) : null
|
|
6617
6626
|
] })
|
|
6618
6627
|
] });
|
|
6619
6628
|
}
|
|
6620
6629
|
|
|
6621
6630
|
// src/components/forms/Switch.tsx
|
|
6622
|
-
import { jsx as
|
|
6631
|
+
import { jsx as jsx70, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6623
6632
|
function Switch({ label, description, className = "", ...rest }) {
|
|
6624
6633
|
return /* @__PURE__ */ jsxs59("label", { className: ["fd-switch", className].filter(Boolean).join(" "), children: [
|
|
6625
|
-
/* @__PURE__ */
|
|
6626
|
-
/* @__PURE__ */
|
|
6634
|
+
/* @__PURE__ */ jsx70("input", { type: "checkbox", role: "switch", ...rest }),
|
|
6635
|
+
/* @__PURE__ */ jsx70("span", { className: "fd-switch-track", children: /* @__PURE__ */ jsx70("span", { className: "fd-switch-thumb" }) }),
|
|
6627
6636
|
label ? /* @__PURE__ */ jsxs59("span", { className: "fd-choice-text", children: [
|
|
6628
|
-
/* @__PURE__ */
|
|
6629
|
-
description ? /* @__PURE__ */
|
|
6637
|
+
/* @__PURE__ */ jsx70("span", { className: "fd-switch-label", children: label }),
|
|
6638
|
+
description ? /* @__PURE__ */ jsx70("span", { className: "fd-choice-desc", children: description }) : null
|
|
6630
6639
|
] }) : null
|
|
6631
6640
|
] });
|
|
6632
6641
|
}
|
|
6633
6642
|
|
|
6634
6643
|
// src/components/forms/Select.tsx
|
|
6635
6644
|
import * as React46 from "react";
|
|
6636
|
-
import { jsx as
|
|
6645
|
+
import { jsx as jsx71, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6637
6646
|
var norm = (o) => typeof o === "string" ? { value: o, label: o } : o;
|
|
6638
6647
|
function Select({
|
|
6639
6648
|
label,
|
|
@@ -6734,7 +6743,7 @@ function Select({
|
|
|
6734
6743
|
});
|
|
6735
6744
|
const box = ["fd-input", "fd-select", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" ");
|
|
6736
6745
|
return /* @__PURE__ */ jsxs60("div", { className: ["fd-field", "fd-popfield", open2 ? "is-open" : "", className].filter(Boolean).join(" "), style, ref: rootRef, children: [
|
|
6737
|
-
label ? /* @__PURE__ */
|
|
6746
|
+
label ? /* @__PURE__ */ jsx71(FieldLabel, { id: labelId, required, onClick: toggle, children: label }) : /* @__PURE__ */ jsx71(HiddenFieldLabel, { id: labelId, children: hiddenLabel }),
|
|
6738
6747
|
/* @__PURE__ */ jsxs60("div", { className: box, style: { cursor: disabled ? "not-allowed" : "pointer" }, ref: boxRef, children: [
|
|
6739
6748
|
/* @__PURE__ */ jsxs60(
|
|
6740
6749
|
"button",
|
|
@@ -6750,13 +6759,13 @@ function Select({
|
|
|
6750
6759
|
"aria-labelledby": ariaLabelledBy,
|
|
6751
6760
|
style: { all: "unset", flex: 1, minWidth: 0, display: "flex", alignItems: "center", gap: 8, cursor: "inherit", overflow: "hidden" },
|
|
6752
6761
|
children: [
|
|
6753
|
-
selected && selected.icon ? /* @__PURE__ */
|
|
6754
|
-
/* @__PURE__ */
|
|
6755
|
-
multiple && chosen.length > 1 ? /* @__PURE__ */
|
|
6762
|
+
selected && selected.icon ? /* @__PURE__ */ jsx71("i", { className: "ph ph-" + selected.icon, style: { flex: "none", color: "var(--text-2)" } }) : null,
|
|
6763
|
+
/* @__PURE__ */ jsx71("span", { title: truncationTitle(boxText), style: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", color: (multiple ? chosen.length : selected) ? "var(--text)" : "var(--text-muted)" }, children: boxText }),
|
|
6764
|
+
multiple && chosen.length > 1 ? /* @__PURE__ */ jsx71("span", { className: "fd-mono", style: { flex: "none", fontSize: 11, fontWeight: 700, padding: "1px 6px", borderRadius: 99, background: "var(--brand)", color: "#fff" }, children: chosen.length }) : null
|
|
6756
6765
|
]
|
|
6757
6766
|
}
|
|
6758
6767
|
),
|
|
6759
|
-
clearable && (multiple ? chosen.length > 0 : selected) && !loading ? /* @__PURE__ */
|
|
6768
|
+
clearable && (multiple ? chosen.length > 0 : selected) && !loading ? /* @__PURE__ */ jsx71(
|
|
6760
6769
|
"button",
|
|
6761
6770
|
{
|
|
6762
6771
|
type: "button",
|
|
@@ -6766,12 +6775,12 @@ function Select({
|
|
|
6766
6775
|
fire(multiple ? [] : "");
|
|
6767
6776
|
},
|
|
6768
6777
|
style: { all: "unset", cursor: "pointer", color: "var(--text-muted)", display: "grid", placeItems: "center", padding: 2 },
|
|
6769
|
-
children: /* @__PURE__ */
|
|
6778
|
+
children: /* @__PURE__ */ jsx71("i", { className: "ph ph-x-circle", style: { fontSize: 15 } })
|
|
6770
6779
|
}
|
|
6771
6780
|
) : null,
|
|
6772
|
-
loading ? /* @__PURE__ */
|
|
6781
|
+
loading ? /* @__PURE__ */ jsx71("span", { className: "fd-spinner", style: { color: "var(--text-muted)" }, "aria-label": "Loading options" }) : /* @__PURE__ */ jsx71("span", { className: "fd-select-caret", onClick: toggle, children: /* @__PURE__ */ jsx71("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
|
|
6773
6782
|
] }),
|
|
6774
|
-
/* @__PURE__ */
|
|
6783
|
+
/* @__PURE__ */ jsx71(
|
|
6775
6784
|
Popover,
|
|
6776
6785
|
{
|
|
6777
6786
|
open: open2,
|
|
@@ -6785,8 +6794,8 @@ function Select({
|
|
|
6785
6794
|
role: "presentation",
|
|
6786
6795
|
style: { maxWidth: 380 },
|
|
6787
6796
|
header: hasSearch ? /* @__PURE__ */ jsxs60("div", { className: "fd-pop-search", children: [
|
|
6788
|
-
/* @__PURE__ */
|
|
6789
|
-
/* @__PURE__ */
|
|
6797
|
+
/* @__PURE__ */ jsx71("i", { className: "ph ph-magnifying-glass", style: { color: "var(--text-muted)", fontSize: 14 } }),
|
|
6798
|
+
/* @__PURE__ */ jsx71(
|
|
6790
6799
|
"input",
|
|
6791
6800
|
{
|
|
6792
6801
|
autoFocus: true,
|
|
@@ -6799,10 +6808,10 @@ function Select({
|
|
|
6799
6808
|
}
|
|
6800
6809
|
}
|
|
6801
6810
|
),
|
|
6802
|
-
q ? /* @__PURE__ */
|
|
6811
|
+
q ? /* @__PURE__ */ jsx71("span", { className: "fd-body-sm fd-muted", children: visible.length }) : null
|
|
6803
6812
|
] }) : void 0,
|
|
6804
6813
|
footer: multiple ? /* @__PURE__ */ jsxs60(React46.Fragment, { children: [
|
|
6805
|
-
/* @__PURE__ */
|
|
6814
|
+
/* @__PURE__ */ jsx71(
|
|
6806
6815
|
"button",
|
|
6807
6816
|
{
|
|
6808
6817
|
type: "button",
|
|
@@ -6811,13 +6820,13 @@ function Select({
|
|
|
6811
6820
|
children: "Select all"
|
|
6812
6821
|
}
|
|
6813
6822
|
),
|
|
6814
|
-
/* @__PURE__ */
|
|
6823
|
+
/* @__PURE__ */ jsx71("span", { style: { flex: 1 } }),
|
|
6815
6824
|
/* @__PURE__ */ jsxs60("span", { className: "fd-body-sm fd-muted", children: [
|
|
6816
6825
|
vals.length,
|
|
6817
6826
|
" of ",
|
|
6818
6827
|
opts.length
|
|
6819
6828
|
] }),
|
|
6820
|
-
/* @__PURE__ */
|
|
6829
|
+
/* @__PURE__ */ jsx71(
|
|
6821
6830
|
"button",
|
|
6822
6831
|
{
|
|
6823
6832
|
type: "button",
|
|
@@ -6828,12 +6837,12 @@ function Select({
|
|
|
6828
6837
|
}
|
|
6829
6838
|
)
|
|
6830
6839
|
] }) : void 0,
|
|
6831
|
-
children: /* @__PURE__ */
|
|
6840
|
+
children: /* @__PURE__ */ jsx71("div", { className: "fd-pop-list", role: "listbox", "aria-multiselectable": multiple || void 0, ref: listRef, children: visible.length === 0 ? /* @__PURE__ */ jsxs60("div", { className: "fd-pop-empty", children: [
|
|
6832
6841
|
'Nothing matches "',
|
|
6833
6842
|
q,
|
|
6834
6843
|
'".'
|
|
6835
6844
|
] }) : groups.map((grp) => /* @__PURE__ */ jsxs60(React46.Fragment, { children: [
|
|
6836
|
-
grp.g ? /* @__PURE__ */
|
|
6845
|
+
grp.g ? /* @__PURE__ */ jsx71("div", { className: "fd-pop-group", children: grp.g }) : null,
|
|
6837
6846
|
grp.items.map(({ o, i }) => /* @__PURE__ */ jsxs60(
|
|
6838
6847
|
"button",
|
|
6839
6848
|
{
|
|
@@ -6846,14 +6855,14 @@ function Select({
|
|
|
6846
6855
|
onMouseEnter: () => nav.setActive(i),
|
|
6847
6856
|
onClick: () => pick(o),
|
|
6848
6857
|
children: [
|
|
6849
|
-
multiple ? /* @__PURE__ */
|
|
6850
|
-
o.icon ? /* @__PURE__ */
|
|
6858
|
+
multiple ? /* @__PURE__ */ jsx71("span", { "aria-hidden": "true", style: { flex: "none", display: "grid", placeItems: "center", width: 16, height: 16, borderRadius: 4, border: "1.5px solid " + (isOn(o.value) ? "var(--brand)" : "var(--border-strong, var(--border))"), background: isOn(o.value) ? "var(--brand)" : "var(--surface)", color: "#fff" }, children: isOn(o.value) ? /* @__PURE__ */ jsx71("i", { className: "ph ph-check", style: { fontSize: 11 } }) : null }) : null,
|
|
6859
|
+
o.icon ? /* @__PURE__ */ jsx71("span", { className: "fd-opt-icon", children: /* @__PURE__ */ jsx71("i", { className: "ph ph-" + o.icon }) }) : null,
|
|
6851
6860
|
/* @__PURE__ */ jsxs60("span", { style: { flex: 1, minWidth: 0 }, children: [
|
|
6852
|
-
/* @__PURE__ */
|
|
6853
|
-
o.description ? /* @__PURE__ */
|
|
6861
|
+
/* @__PURE__ */ jsx71("span", { className: "fd-opt-label", children: o.label }),
|
|
6862
|
+
o.description ? /* @__PURE__ */ jsx71("span", { className: "fd-opt-desc", children: o.description }) : null
|
|
6854
6863
|
] }),
|
|
6855
|
-
o.meta ? /* @__PURE__ */
|
|
6856
|
-
multiple ? null : /* @__PURE__ */
|
|
6864
|
+
o.meta ? /* @__PURE__ */ jsx71("span", { className: "fd-opt-meta", children: o.meta }) : null,
|
|
6865
|
+
multiple ? null : /* @__PURE__ */ jsx71("span", { className: "fd-opt-check", children: o.value === value ? /* @__PURE__ */ jsx71("i", { className: "ph ph-check" }) : null })
|
|
6857
6866
|
]
|
|
6858
6867
|
},
|
|
6859
6868
|
String(o.value)
|
|
@@ -6862,15 +6871,15 @@ function Select({
|
|
|
6862
6871
|
}
|
|
6863
6872
|
),
|
|
6864
6873
|
error ? /* @__PURE__ */ jsxs60("span", { className: "fd-field-error", children: [
|
|
6865
|
-
/* @__PURE__ */
|
|
6874
|
+
/* @__PURE__ */ jsx71("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
6866
6875
|
error
|
|
6867
|
-
] }) : help ? /* @__PURE__ */
|
|
6876
|
+
] }) : help ? /* @__PURE__ */ jsx71("span", { className: "fd-field-help", children: help }) : null
|
|
6868
6877
|
] });
|
|
6869
6878
|
}
|
|
6870
6879
|
|
|
6871
6880
|
// src/components/forms/TimePicker.tsx
|
|
6872
6881
|
import * as React47 from "react";
|
|
6873
|
-
import { jsx as
|
|
6882
|
+
import { jsx as jsx72, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6874
6883
|
var pad = (n) => String(n).padStart(2, "0");
|
|
6875
6884
|
function ClockFace({ value = "09:00", onChange }) {
|
|
6876
6885
|
let [h24, m] = value.split(":").map(Number);
|
|
@@ -6917,10 +6926,10 @@ function ClockFace({ value = "09:00", onChange }) {
|
|
|
6917
6926
|
const minuteOff = mode2 === "m" && m % 5 !== 0;
|
|
6918
6927
|
return /* @__PURE__ */ jsxs61("div", { style: { padding: "4px 14px 14px" }, children: [
|
|
6919
6928
|
/* @__PURE__ */ jsxs61("div", { className: "fd-clock-digits", children: [
|
|
6920
|
-
/* @__PURE__ */
|
|
6921
|
-
/* @__PURE__ */
|
|
6922
|
-
/* @__PURE__ */
|
|
6923
|
-
/* @__PURE__ */
|
|
6929
|
+
/* @__PURE__ */ jsx72("button", { type: "button", className: "fd-clock-digit" + (mode2 === "h" ? " is-active" : ""), onClick: () => setMode("h"), children: pad(h12) }),
|
|
6930
|
+
/* @__PURE__ */ jsx72("span", { style: { fontSize: 24, fontWeight: 700, color: "var(--text-muted)" }, children: ":" }),
|
|
6931
|
+
/* @__PURE__ */ jsx72("button", { type: "button", className: "fd-clock-digit" + (mode2 === "m" ? " is-active" : ""), onClick: () => setMode("m"), children: pad(m) }),
|
|
6932
|
+
/* @__PURE__ */ jsx72("span", { className: "fd-stack", style: { gap: 3, marginLeft: 8 }, children: ["AM", "PM"].map((ap) => /* @__PURE__ */ jsx72(
|
|
6924
6933
|
"button",
|
|
6925
6934
|
{
|
|
6926
6935
|
type: "button",
|
|
@@ -6932,12 +6941,12 @@ function ClockFace({ value = "09:00", onChange }) {
|
|
|
6932
6941
|
)) })
|
|
6933
6942
|
] }),
|
|
6934
6943
|
/* @__PURE__ */ jsxs61("div", { className: "fd-clock", ref: faceRef, onPointerDown: down, onPointerMove: move, onPointerUp: upH, children: [
|
|
6935
|
-
/* @__PURE__ */
|
|
6936
|
-
/* @__PURE__ */
|
|
6937
|
-
minuteOff ? /* @__PURE__ */
|
|
6944
|
+
/* @__PURE__ */ jsx72("span", { className: "fd-clock-hand", style: { height: NR - (minuteOff ? 14 : 16), transform: "translateX(-50%) rotate(" + handAngle + "deg)", bottom: "50%" } }),
|
|
6945
|
+
/* @__PURE__ */ jsx72("span", { className: "fd-clock-pivot" }),
|
|
6946
|
+
minuteOff ? /* @__PURE__ */ jsx72("span", { style: { position: "absolute", left: "50%", top: "50%", width: 10, height: 10, margin: -5, borderRadius: "50%", border: "2px solid var(--brand)", background: "var(--surface)", transform: "rotate(" + handAngle + "deg) translateY(-" + (NR - 6) + "px)", transformOrigin: "center", pointerEvents: "none" } }) : null,
|
|
6938
6947
|
nums.map((n) => {
|
|
6939
6948
|
const a = angleOf(n) * Math.PI / 180;
|
|
6940
|
-
return /* @__PURE__ */
|
|
6949
|
+
return /* @__PURE__ */ jsx72(
|
|
6941
6950
|
"span",
|
|
6942
6951
|
{
|
|
6943
6952
|
className: "fd-clock-num" + (n === selNum || mode2 === "m" && n === Math.round(m / 5) * 5 % 60 && m % 5 === 0 ? " is-sel" : ""),
|
|
@@ -6948,7 +6957,7 @@ function ClockFace({ value = "09:00", onChange }) {
|
|
|
6948
6957
|
);
|
|
6949
6958
|
})
|
|
6950
6959
|
] }),
|
|
6951
|
-
/* @__PURE__ */
|
|
6960
|
+
/* @__PURE__ */ jsx72("div", { className: "fd-row", style: { justifyContent: "center", gap: 6 }, children: /* @__PURE__ */ jsx72("span", { className: "fd-body-sm fd-muted", children: mode2 === "h" ? "Pick the hour \u2014 drag or tap" : "Now the minutes" }) })
|
|
6952
6961
|
] });
|
|
6953
6962
|
}
|
|
6954
6963
|
function TimePicker({ label, help, error, required = false, disabled = false, value = "", onChange, placeholder = "Pick a time", id, className = "", style }) {
|
|
@@ -6965,10 +6974,10 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
6965
6974
|
if (!disabled) setOpen(!open2);
|
|
6966
6975
|
};
|
|
6967
6976
|
return /* @__PURE__ */ jsxs61("div", { className: ["fd-field", "fd-popfield", open2 ? "is-open" : "", className].filter(Boolean).join(" "), style, ref: rootRef, children: [
|
|
6968
|
-
label ? /* @__PURE__ */
|
|
6977
|
+
label ? /* @__PURE__ */ jsx72(FieldLabel, { id: labelId, required, onClick: toggle, children: label }) : null,
|
|
6969
6978
|
/* @__PURE__ */ jsxs61("div", { className: ["fd-input", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" "), style: { cursor: disabled ? "not-allowed" : "pointer" }, onClick: toggle, ref: boxRef, children: [
|
|
6970
|
-
/* @__PURE__ */
|
|
6971
|
-
/* @__PURE__ */
|
|
6979
|
+
/* @__PURE__ */ jsx72("span", { className: "fd-input-icon", children: /* @__PURE__ */ jsx72("i", { className: "ph ph-clock", "aria-hidden": "true" }) }),
|
|
6980
|
+
/* @__PURE__ */ jsx72(
|
|
6972
6981
|
"button",
|
|
6973
6982
|
{
|
|
6974
6983
|
type: "button",
|
|
@@ -6985,9 +6994,9 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
6985
6994
|
children: disp() || placeholder
|
|
6986
6995
|
}
|
|
6987
6996
|
),
|
|
6988
|
-
/* @__PURE__ */
|
|
6997
|
+
/* @__PURE__ */ jsx72("span", { className: "fd-select-caret", children: /* @__PURE__ */ jsx72("i", { className: "ph ph-caret-down", "aria-hidden": "true" }) })
|
|
6989
6998
|
] }),
|
|
6990
|
-
/* @__PURE__ */
|
|
6999
|
+
/* @__PURE__ */ jsx72(
|
|
6991
7000
|
Popover,
|
|
6992
7001
|
{
|
|
6993
7002
|
open: open2,
|
|
@@ -6999,7 +7008,7 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
6999
7008
|
width: 262,
|
|
7000
7009
|
role: "presentation",
|
|
7001
7010
|
footer: /* @__PURE__ */ jsxs61(React47.Fragment, { children: [
|
|
7002
|
-
/* @__PURE__ */
|
|
7011
|
+
/* @__PURE__ */ jsx72(
|
|
7003
7012
|
"button",
|
|
7004
7013
|
{
|
|
7005
7014
|
type: "button",
|
|
@@ -7012,22 +7021,22 @@ function TimePicker({ label, help, error, required = false, disabled = false, va
|
|
|
7012
7021
|
children: "Now"
|
|
7013
7022
|
}
|
|
7014
7023
|
),
|
|
7015
|
-
/* @__PURE__ */
|
|
7016
|
-
/* @__PURE__ */
|
|
7024
|
+
/* @__PURE__ */ jsx72("span", { style: { flex: 1 } }),
|
|
7025
|
+
/* @__PURE__ */ jsx72("button", { type: "button", className: "fd-btn fd-btn-primary fd-btn-sm", onClick: () => setOpen(false), children: "Done" })
|
|
7017
7026
|
] }),
|
|
7018
|
-
children: /* @__PURE__ */
|
|
7027
|
+
children: /* @__PURE__ */ jsx72(ClockFace, { value: value || "09:00", onChange: (v) => onChange && onChange({ target: { value: v } }) })
|
|
7019
7028
|
}
|
|
7020
7029
|
),
|
|
7021
7030
|
error ? /* @__PURE__ */ jsxs61("span", { className: "fd-field-error", children: [
|
|
7022
|
-
/* @__PURE__ */
|
|
7031
|
+
/* @__PURE__ */ jsx72("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
7023
7032
|
error
|
|
7024
|
-
] }) : help ? /* @__PURE__ */
|
|
7033
|
+
] }) : help ? /* @__PURE__ */ jsx72("span", { className: "fd-field-help", children: help }) : null
|
|
7025
7034
|
] });
|
|
7026
7035
|
}
|
|
7027
7036
|
|
|
7028
7037
|
// src/components/forms/Slider.tsx
|
|
7029
7038
|
import * as React48 from "react";
|
|
7030
|
-
import { jsx as
|
|
7039
|
+
import { jsx as jsx73, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
7031
7040
|
function Slider({
|
|
7032
7041
|
label,
|
|
7033
7042
|
min = 0,
|
|
@@ -7049,13 +7058,13 @@ function Slider({
|
|
|
7049
7058
|
const pct = max === min ? 0 : (v - min) / (max - min) * 100;
|
|
7050
7059
|
return /* @__PURE__ */ jsxs62("div", { className: ["fd-field", className].filter(Boolean).join(" "), children: [
|
|
7051
7060
|
label ? /* @__PURE__ */ jsxs62("div", { className: "fd-row", style: { justifyContent: "space-between", gap: 12 }, children: [
|
|
7052
|
-
/* @__PURE__ */
|
|
7053
|
-
/* @__PURE__ */
|
|
7061
|
+
/* @__PURE__ */ jsx73(FieldLabel, { htmlFor: fieldId, children: label }),
|
|
7062
|
+
/* @__PURE__ */ jsx73("span", { className: "fd-num", style: { color: "var(--text-2)" }, children: format(v) })
|
|
7054
7063
|
] }) : null,
|
|
7055
7064
|
/* @__PURE__ */ jsxs62("div", { className: "fd-slider", children: [
|
|
7056
|
-
/* @__PURE__ */
|
|
7057
|
-
showChip && dragging ? /* @__PURE__ */
|
|
7058
|
-
/* @__PURE__ */
|
|
7065
|
+
/* @__PURE__ */ jsx73("span", { className: "fd-slider-fill", style: { width: pct + "%" } }),
|
|
7066
|
+
showChip && dragging ? /* @__PURE__ */ jsx73("span", { className: "fd-slider-chip", style: { left: pct + "%" }, children: format(v) }) : null,
|
|
7067
|
+
/* @__PURE__ */ jsx73(
|
|
7059
7068
|
"input",
|
|
7060
7069
|
{
|
|
7061
7070
|
id: fieldId,
|
|
@@ -7073,13 +7082,13 @@ function Slider({
|
|
|
7073
7082
|
}
|
|
7074
7083
|
)
|
|
7075
7084
|
] }),
|
|
7076
|
-
help ? /* @__PURE__ */
|
|
7085
|
+
help ? /* @__PURE__ */ jsx73("span", { className: "fd-field-help", children: help }) : null
|
|
7077
7086
|
] });
|
|
7078
7087
|
}
|
|
7079
7088
|
|
|
7080
7089
|
// src/components/forms/RangeSlider.tsx
|
|
7081
7090
|
import * as React49 from "react";
|
|
7082
|
-
import { jsx as
|
|
7091
|
+
import { jsx as jsx74, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
7083
7092
|
function RangeSlider({
|
|
7084
7093
|
label,
|
|
7085
7094
|
min = 0,
|
|
@@ -7136,7 +7145,7 @@ function RangeSlider({
|
|
|
7136
7145
|
};
|
|
7137
7146
|
const thin = S.length > 7 ? Math.ceil(S.length / 5) : 1;
|
|
7138
7147
|
const pair = value || [S[0].value, S[S.length - 1].value];
|
|
7139
|
-
return /* @__PURE__ */
|
|
7148
|
+
return /* @__PURE__ */ jsx74(
|
|
7140
7149
|
RangeSlider,
|
|
7141
7150
|
{
|
|
7142
7151
|
...rest,
|
|
@@ -7186,7 +7195,7 @@ function RangeSlider({
|
|
|
7186
7195
|
const hasLabels = marks.some((m) => m.label);
|
|
7187
7196
|
return /* @__PURE__ */ jsxs63("div", { className: ["fd-field", className].filter(Boolean).join(" "), ...rest, children: [
|
|
7188
7197
|
label ? /* @__PURE__ */ jsxs63("div", { className: "fd-row", style: { justifyContent: "space-between", gap: 12 }, children: [
|
|
7189
|
-
/* @__PURE__ */
|
|
7198
|
+
/* @__PURE__ */ jsx74("span", { className: "fd-field-label", children: label }),
|
|
7190
7199
|
/* @__PURE__ */ jsxs63("span", { className: "fd-num", style: { color: "var(--text-2)" }, children: [
|
|
7191
7200
|
fmt2(a),
|
|
7192
7201
|
" \u2013 ",
|
|
@@ -7194,13 +7203,13 @@ function RangeSlider({
|
|
|
7194
7203
|
] })
|
|
7195
7204
|
] }) : null,
|
|
7196
7205
|
/* @__PURE__ */ jsxs63("div", { className: "fd-range" + (hasLabels ? " has-labels" : ""), onPointerDown: onRailDown, children: [
|
|
7197
|
-
/* @__PURE__ */
|
|
7198
|
-
/* @__PURE__ */
|
|
7206
|
+
/* @__PURE__ */ jsx74("span", { className: "fd-range-rail", ref: railRef }),
|
|
7207
|
+
/* @__PURE__ */ jsx74("span", { className: "fd-range-fill", style: { left: pct(a) + "%", width: pct(b) - pct(a) + "%" } }),
|
|
7199
7208
|
marks.map((m) => /* @__PURE__ */ jsxs63(React49.Fragment, { children: [
|
|
7200
|
-
/* @__PURE__ */
|
|
7201
|
-
m.label ? /* @__PURE__ */
|
|
7209
|
+
/* @__PURE__ */ jsx74("span", { className: "fd-range-mark" + (m.value >= a && m.value <= b ? " is-in" : ""), style: { left: pct(m.value) + "%" } }),
|
|
7210
|
+
m.label ? /* @__PURE__ */ jsx74("span", { className: "fd-range-mark-label", style: { left: pct(m.value) + "%" }, children: m.label }) : null
|
|
7202
7211
|
] }, m.value)),
|
|
7203
|
-
[a, b].map((v, i) => /* @__PURE__ */
|
|
7212
|
+
[a, b].map((v, i) => /* @__PURE__ */ jsx74(
|
|
7204
7213
|
"span",
|
|
7205
7214
|
{
|
|
7206
7215
|
className: "fd-range-thumb" + (drag === i ? " is-drag" : ""),
|
|
@@ -7215,18 +7224,18 @@ function RangeSlider({
|
|
|
7215
7224
|
onKeyDown: key(i),
|
|
7216
7225
|
onFocus: () => setFocus(i),
|
|
7217
7226
|
onBlur: () => setFocus(null),
|
|
7218
|
-
children: /* @__PURE__ */
|
|
7227
|
+
children: /* @__PURE__ */ jsx74("span", { className: "fd-range-chip", style: { opacity: showChip(i) ? 1 : void 0 }, children: fmt2(v) })
|
|
7219
7228
|
},
|
|
7220
7229
|
i
|
|
7221
7230
|
))
|
|
7222
7231
|
] }),
|
|
7223
|
-
help ? /* @__PURE__ */
|
|
7232
|
+
help ? /* @__PURE__ */ jsx74("span", { className: "fd-field-help", children: help }) : null
|
|
7224
7233
|
] });
|
|
7225
7234
|
}
|
|
7226
7235
|
|
|
7227
7236
|
// src/components/forms/Dropzone.tsx
|
|
7228
7237
|
import * as React50 from "react";
|
|
7229
|
-
import { jsx as
|
|
7238
|
+
import { jsx as jsx75, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
7230
7239
|
function Dropzone({
|
|
7231
7240
|
onFiles,
|
|
7232
7241
|
onReject,
|
|
@@ -7282,10 +7291,10 @@ function Dropzone({
|
|
|
7282
7291
|
onDrop: drop,
|
|
7283
7292
|
children: [
|
|
7284
7293
|
children,
|
|
7285
|
-
over ? /* @__PURE__ */
|
|
7286
|
-
/* @__PURE__ */
|
|
7287
|
-
/* @__PURE__ */
|
|
7288
|
-
hint ? /* @__PURE__ */
|
|
7294
|
+
over ? /* @__PURE__ */ jsx75("div", { className: "fd-dropzone-veil", "aria-hidden": "true", children: /* @__PURE__ */ jsxs64("div", { className: "fd-dropzone-card", children: [
|
|
7295
|
+
/* @__PURE__ */ jsx75("i", { className: "ph ph-tray-arrow-down" }),
|
|
7296
|
+
/* @__PURE__ */ jsx75("span", { className: "fd-dropzone-label", children: label }),
|
|
7297
|
+
hint ? /* @__PURE__ */ jsx75("span", { className: "fd-dropzone-hint", children: hint }) : null
|
|
7289
7298
|
] }) }) : null
|
|
7290
7299
|
]
|
|
7291
7300
|
}
|
|
@@ -7305,7 +7314,7 @@ function FilePickButton({
|
|
|
7305
7314
|
}) {
|
|
7306
7315
|
const ref = React50.useRef(null);
|
|
7307
7316
|
return /* @__PURE__ */ jsxs64(React50.Fragment, { children: [
|
|
7308
|
-
/* @__PURE__ */
|
|
7317
|
+
/* @__PURE__ */ jsx75(
|
|
7309
7318
|
"button",
|
|
7310
7319
|
{
|
|
7311
7320
|
type: "button",
|
|
@@ -7314,10 +7323,10 @@ function FilePickButton({
|
|
|
7314
7323
|
"aria-label": label,
|
|
7315
7324
|
title: label,
|
|
7316
7325
|
onClick: () => ref.current && ref.current.click(),
|
|
7317
|
-
children: children != null ? children : /* @__PURE__ */
|
|
7326
|
+
children: children != null ? children : /* @__PURE__ */ jsx75("i", { className: "ph ph-" + icon, "aria-hidden": "true" })
|
|
7318
7327
|
}
|
|
7319
7328
|
),
|
|
7320
|
-
/* @__PURE__ */
|
|
7329
|
+
/* @__PURE__ */ jsx75(
|
|
7321
7330
|
"input",
|
|
7322
7331
|
{
|
|
7323
7332
|
ref,
|
|
@@ -7394,7 +7403,7 @@ function useStagedFiles(upload, opts) {
|
|
|
7394
7403
|
var DropzoneKit = { useStagedFiles };
|
|
7395
7404
|
|
|
7396
7405
|
// src/components/forms/FileGrid.tsx
|
|
7397
|
-
import { jsx as
|
|
7406
|
+
import { jsx as jsx76, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
7398
7407
|
var truncateMiddle = (name, max = 34) => {
|
|
7399
7408
|
if (!name || name.length <= max) return name;
|
|
7400
7409
|
const ext = /\.[A-Za-z0-9]+$/.exec(name);
|
|
@@ -7403,7 +7412,7 @@ var truncateMiddle = (name, max = 34) => {
|
|
|
7403
7412
|
return head + "\u2026" + tail;
|
|
7404
7413
|
};
|
|
7405
7414
|
function Progress({ value }) {
|
|
7406
|
-
return /* @__PURE__ */
|
|
7415
|
+
return /* @__PURE__ */ jsx76("span", { className: "fd-file-prog", role: "progressbar", "aria-valuenow": Math.round(value), "aria-valuemin": 0, "aria-valuemax": 100, children: /* @__PURE__ */ jsx76("span", { className: "fd-file-prog-fill", style: { width: Math.max(4, Math.min(100, value)) + "%" } }) });
|
|
7407
7416
|
}
|
|
7408
7417
|
function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false, className = "" }) {
|
|
7409
7418
|
if (!file) return null;
|
|
@@ -7423,13 +7432,13 @@ function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false,
|
|
|
7423
7432
|
title: file.name + (meta ? " \xB7 " + meta : ""),
|
|
7424
7433
|
children: [
|
|
7425
7434
|
/* @__PURE__ */ jsxs65("span", { className: "fd-file-icon", children: [
|
|
7426
|
-
thumb ? /* @__PURE__ */
|
|
7427
|
-
(file.mime || "").startsWith("video/") ? /* @__PURE__ */
|
|
7435
|
+
thumb ? /* @__PURE__ */ jsx76("img", { src: thumb, alt: "" }) : /* @__PURE__ */ jsx76("i", { className: "ph ph-" + iconForMime(file.mime, file.name), "aria-hidden": "true" }),
|
|
7436
|
+
(file.mime || "").startsWith("video/") ? /* @__PURE__ */ jsx76("i", { className: "ph ph-play fd-file-play", "aria-hidden": "true" }) : null
|
|
7428
7437
|
] }),
|
|
7429
7438
|
/* @__PURE__ */ jsxs65("span", { className: "fd-file-text", children: [
|
|
7430
|
-
/* @__PURE__ */
|
|
7431
|
-
/* @__PURE__ */
|
|
7432
|
-
/* @__PURE__ */
|
|
7439
|
+
/* @__PURE__ */ jsx76("span", { className: "fd-file-name", children: truncateMiddle(file.name, compact3 ? 26 : 40) }),
|
|
7440
|
+
/* @__PURE__ */ jsx76("span", { className: "fd-file-meta", children: file.error ? /* @__PURE__ */ jsxs65("span", { className: "fd-file-err", children: [
|
|
7441
|
+
/* @__PURE__ */ jsx76("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
7433
7442
|
file.error
|
|
7434
7443
|
] }) : uploading ? /* @__PURE__ */ jsxs65("span", { className: "fd-tabular", children: [
|
|
7435
7444
|
Math.round(file.progress),
|
|
@@ -7439,9 +7448,9 @@ function FileChip({ file, onOpen, onRemove, onRetry, compact: compact3 = false,
|
|
|
7439
7448
|
]
|
|
7440
7449
|
}
|
|
7441
7450
|
),
|
|
7442
|
-
uploading ? /* @__PURE__ */
|
|
7443
|
-
file.error && onRetry ? /* @__PURE__ */
|
|
7444
|
-
onRemove ? /* @__PURE__ */
|
|
7451
|
+
uploading ? /* @__PURE__ */ jsx76(Progress, { value: file.progress }) : null,
|
|
7452
|
+
file.error && onRetry ? /* @__PURE__ */ jsx76("button", { type: "button", className: "fd-file-act", onClick: () => onRetry(file), "aria-label": "Retry upload of " + file.name, children: /* @__PURE__ */ jsx76("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }) }) : null,
|
|
7453
|
+
onRemove ? /* @__PURE__ */ jsx76("button", { type: "button", className: "fd-file-act", onClick: () => onRemove(file), "aria-label": "Remove " + file.name, children: /* @__PURE__ */ jsx76("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
7445
7454
|
] });
|
|
7446
7455
|
}
|
|
7447
7456
|
function FileTile({ file, onOpen, onRemove, maxHeight = 200, className = "" }) {
|
|
@@ -7449,19 +7458,19 @@ function FileTile({ file, onOpen, onRemove, maxHeight = 200, className = "" }) {
|
|
|
7449
7458
|
const src = file.thumb && file.thumb.url || file.blobUrl || file.url;
|
|
7450
7459
|
const uploading = file.progress != null && file.progress < 100 && !file.error;
|
|
7451
7460
|
return /* @__PURE__ */ jsxs65("figure", { className: ["fd-tile", uploading ? "is-uploading" : "", file.error ? "is-error" : "", className].filter(Boolean).join(" "), children: [
|
|
7452
|
-
/* @__PURE__ */
|
|
7453
|
-
uploading ? /* @__PURE__ */
|
|
7461
|
+
/* @__PURE__ */ jsx76("button", { type: "button", className: "fd-tile-btn", onClick: onOpen ? () => onOpen(file) : void 0, disabled: !onOpen, children: src ? /* @__PURE__ */ jsx76("img", { src, alt: file.name || "", style: { maxHeight }, loading: "lazy" }) : /* @__PURE__ */ jsx76("span", { className: "fd-tile-fallback", children: /* @__PURE__ */ jsx76("i", { className: "ph ph-" + iconForMime(file.mime, file.name), "aria-hidden": "true" }) }) }),
|
|
7462
|
+
uploading ? /* @__PURE__ */ jsx76(Progress, { value: file.progress }) : null,
|
|
7454
7463
|
file.error ? /* @__PURE__ */ jsxs65("figcaption", { className: "fd-tile-err", children: [
|
|
7455
|
-
/* @__PURE__ */
|
|
7464
|
+
/* @__PURE__ */ jsx76("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
7456
7465
|
file.error
|
|
7457
7466
|
] }) : null,
|
|
7458
|
-
onRemove ? /* @__PURE__ */
|
|
7467
|
+
onRemove ? /* @__PURE__ */ jsx76("button", { type: "button", className: "fd-tile-x", onClick: () => onRemove(file), "aria-label": "Remove " + file.name, children: /* @__PURE__ */ jsx76("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
7459
7468
|
] });
|
|
7460
7469
|
}
|
|
7461
7470
|
function FileStrip({ files = [], size = 68, onOpen, onRemove, onRetry, className = "" }) {
|
|
7462
7471
|
const list = files.filter(Boolean);
|
|
7463
7472
|
if (!list.length) return null;
|
|
7464
|
-
return /* @__PURE__ */
|
|
7473
|
+
return /* @__PURE__ */ jsx76("div", { className: ["fd-filestrip", "fd-scrollbar", className].filter(Boolean).join(" "), style: { "--fd-cell": size + "px" }, children: list.map((f) => /* @__PURE__ */ jsx76(FileCell, { file: f, onOpen, onRemove, onRetry }, f.id || f.name)) });
|
|
7465
7474
|
}
|
|
7466
7475
|
var shortName = (name, keep = 5) => {
|
|
7467
7476
|
const s = String(name || "file");
|
|
@@ -7477,17 +7486,17 @@ function FileCell({ file, onOpen, onRemove, onRetry }) {
|
|
|
7477
7486
|
const label = file.name + (file.size ? " \xB7 " + formatBytes(file.size) : "");
|
|
7478
7487
|
return /* @__PURE__ */ jsxs65("div", { className: ["fd-cell", file.error ? "is-error" : "", uploading ? "is-uploading" : ""].filter(Boolean).join(" "), title: file.error ? file.name + " \u2014 " + file.error : label, children: [
|
|
7479
7488
|
/* @__PURE__ */ jsxs65("button", { type: "button", className: "fd-cell-main", onClick: onOpen ? () => onOpen(file) : void 0, disabled: !onOpen || uploading, "aria-label": "Open " + file.name, children: [
|
|
7480
|
-
thumb ? /* @__PURE__ */
|
|
7481
|
-
/* @__PURE__ */
|
|
7482
|
-
/* @__PURE__ */
|
|
7483
|
-
/* @__PURE__ */
|
|
7489
|
+
thumb ? /* @__PURE__ */ jsx76("img", { src: thumb, alt: "" }) : /* @__PURE__ */ jsxs65("span", { className: "fd-cell-doc", children: [
|
|
7490
|
+
/* @__PURE__ */ jsx76("i", { className: "ph ph-" + iconForMime(file.mime, file.name), "aria-hidden": "true" }),
|
|
7491
|
+
/* @__PURE__ */ jsx76("span", { className: "fd-cell-name", children: shortName(file.name) }),
|
|
7492
|
+
/* @__PURE__ */ jsx76("span", { className: "fd-cell-size", children: file.meta || formatBytes(file.size) })
|
|
7484
7493
|
] }),
|
|
7485
|
-
(file.mime || "").startsWith("video/") ? /* @__PURE__ */
|
|
7494
|
+
(file.mime || "").startsWith("video/") ? /* @__PURE__ */ jsx76("i", { className: "ph ph-play fd-cell-play", "aria-hidden": "true" }) : null
|
|
7486
7495
|
] }),
|
|
7487
|
-
uploading ? /* @__PURE__ */
|
|
7488
|
-
file.error ? /* @__PURE__ */
|
|
7489
|
-
file.error && onRetry ? /* @__PURE__ */
|
|
7490
|
-
onRemove ? /* @__PURE__ */
|
|
7496
|
+
uploading ? /* @__PURE__ */ jsx76(Progress, { value: file.progress }) : null,
|
|
7497
|
+
file.error ? /* @__PURE__ */ jsx76("span", { className: "fd-cell-err", "aria-hidden": "true", children: /* @__PURE__ */ jsx76("i", { className: "ph ph-warning-circle" }) }) : null,
|
|
7498
|
+
file.error && onRetry ? /* @__PURE__ */ jsx76("button", { type: "button", className: "fd-cell-x is-retry", onClick: () => onRetry(file), "aria-label": "Retry upload of " + file.name, children: /* @__PURE__ */ jsx76("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }) }) : null,
|
|
7499
|
+
onRemove ? /* @__PURE__ */ jsx76("button", { type: "button", className: "fd-cell-x", onClick: () => onRemove(file), "aria-label": "Remove " + file.name, children: /* @__PURE__ */ jsx76("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
7491
7500
|
] });
|
|
7492
7501
|
}
|
|
7493
7502
|
function FileGrid({ files = [], onOpen, onRemove, onRetry, tiles = true, maxHeight = 200, compact: compact3 = false, className = "" }) {
|
|
@@ -7496,14 +7505,14 @@ function FileGrid({ files = [], onOpen, onRemove, onRetry, tiles = true, maxHeig
|
|
|
7496
7505
|
const pics = tiles ? list.filter((f) => isImage(f.mime, f.name)) : [];
|
|
7497
7506
|
const rest = list.filter((f) => pics.indexOf(f) === -1);
|
|
7498
7507
|
return /* @__PURE__ */ jsxs65("div", { className: ["fd-filegrid", className].filter(Boolean).join(" "), children: [
|
|
7499
|
-
pics.length ? /* @__PURE__ */
|
|
7500
|
-
rest.length ? /* @__PURE__ */
|
|
7508
|
+
pics.length ? /* @__PURE__ */ jsx76("div", { className: "fd-filegrid-tiles", children: pics.map((f) => /* @__PURE__ */ jsx76(FileTile, { file: f, onOpen, onRemove, maxHeight }, f.id || f.name)) }) : null,
|
|
7509
|
+
rest.length ? /* @__PURE__ */ jsx76("div", { className: "fd-filegrid-chips", children: rest.map((f) => /* @__PURE__ */ jsx76(FileChip, { file: f, onOpen, onRemove, onRetry, compact: compact3 }, f.id || f.name)) }) : null
|
|
7501
7510
|
] });
|
|
7502
7511
|
}
|
|
7503
7512
|
|
|
7504
7513
|
// src/components/forms/MarkdownEditor.tsx
|
|
7505
7514
|
import * as React51 from "react";
|
|
7506
|
-
import { jsx as
|
|
7515
|
+
import { jsx as jsx77, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
7507
7516
|
var isMac = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent || "");
|
|
7508
7517
|
var INLINE_RE = /(\*\*\*[^*\n]+\*\*\*|\*\*[^*\n]+\*\*|__[^_\n]+__|~~[^~\n]+~~|`[^`\n]+`|\*[^*\s][^*\n]*\*|(?<![A-Za-z0-9_])_[^_\s][^_\n]*_|\[[^\]\n]*\]\([^)\s\n]*\)|https?:\/\/\S+)/g;
|
|
7509
7518
|
function inlineParts(text) {
|
|
@@ -7930,7 +7939,7 @@ var MarkdownEditor = React51.forwardRef(function MarkdownEditor2({
|
|
|
7930
7939
|
};
|
|
7931
7940
|
const lh = 1.55;
|
|
7932
7941
|
return /* @__PURE__ */ jsxs66("div", { className: ["fd-rme-wrap", disabled ? "is-disabled" : "", className].filter(Boolean).join(" "), children: [
|
|
7933
|
-
/* @__PURE__ */
|
|
7942
|
+
/* @__PURE__ */ jsx77(
|
|
7934
7943
|
"div",
|
|
7935
7944
|
{
|
|
7936
7945
|
ref: boxRef,
|
|
@@ -7963,7 +7972,7 @@ var MarkdownEditor = React51.forwardRef(function MarkdownEditor2({
|
|
|
7963
7972
|
}
|
|
7964
7973
|
}
|
|
7965
7974
|
),
|
|
7966
|
-
!value ? /* @__PURE__ */
|
|
7975
|
+
!value ? /* @__PURE__ */ jsx77("span", { className: "fd-rme-ph", "aria-hidden": "true", children: placeholder }) : null
|
|
7967
7976
|
] });
|
|
7968
7977
|
});
|
|
7969
7978
|
|
|
@@ -7975,7 +7984,7 @@ import { defaultKeymap, history, historyKeymap, indentMore, indentLess } from "@
|
|
|
7975
7984
|
import { sql as sqlLang } from "@codemirror/lang-sql";
|
|
7976
7985
|
import { syntaxHighlighting, HighlightStyle, indentOnInput, bracketMatching } from "@codemirror/language";
|
|
7977
7986
|
import { tags } from "@lezer/highlight";
|
|
7978
|
-
import { jsx as
|
|
7987
|
+
import { jsx as jsx78, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7979
7988
|
function clampOffset(state, line, column) {
|
|
7980
7989
|
const total = state.doc.lines;
|
|
7981
7990
|
const ln = state.doc.line(Math.min(Math.max(1, line), total));
|
|
@@ -8160,13 +8169,13 @@ function CodeEditor({
|
|
|
8160
8169
|
const box = ["fd-input", "fd-code-editor", error ? "fd-input-error" : "", disabled ? "fd-input-disabled" : ""].filter(Boolean).join(" ");
|
|
8161
8170
|
const announce = diagnostics.length ? diagnostics.length + (diagnostics.length === 1 ? " problem: " : " problems: ") + diagnostics.map((d) => "line " + d.line + (d.column ? ", column " + d.column : "") + ": " + d.message).join("; ") : "";
|
|
8162
8171
|
return /* @__PURE__ */ jsxs67("div", { className: ["fd-field", className].filter(Boolean).join(" "), style, children: [
|
|
8163
|
-
label ? /* @__PURE__ */
|
|
8164
|
-
/* @__PURE__ */
|
|
8172
|
+
label ? /* @__PURE__ */ jsx78(FieldLabel, { htmlFor: fieldId, required, children: label }) : null,
|
|
8173
|
+
/* @__PURE__ */ jsx78(
|
|
8165
8174
|
"div",
|
|
8166
8175
|
{
|
|
8167
8176
|
className: box,
|
|
8168
8177
|
style: { minHeight },
|
|
8169
|
-
children: /* @__PURE__ */
|
|
8178
|
+
children: /* @__PURE__ */ jsx78(
|
|
8170
8179
|
"div",
|
|
8171
8180
|
{
|
|
8172
8181
|
ref: hostRef,
|
|
@@ -8180,9 +8189,9 @@ function CodeEditor({
|
|
|
8180
8189
|
help ? help + ". " : "",
|
|
8181
8190
|
showEscapeHint ? "Tab indents. Press Escape, then Tab, to move focus out of the editor." : ""
|
|
8182
8191
|
] }),
|
|
8183
|
-
/* @__PURE__ */
|
|
8184
|
-
diagnostics.length ? /* @__PURE__ */
|
|
8185
|
-
/* @__PURE__ */
|
|
8192
|
+
/* @__PURE__ */ jsx78("div", { id: liveId, className: "fd-sr", role: "status", "aria-live": "polite", children: announce }),
|
|
8193
|
+
diagnostics.length ? /* @__PURE__ */ jsx78("ul", { className: "fd-code-editor-diagnostics", children: diagnostics.map((d, i) => /* @__PURE__ */ jsxs67("li", { className: "fd-code-editor-diag is-" + (d.severity || "error"), children: [
|
|
8194
|
+
/* @__PURE__ */ jsx78(
|
|
8186
8195
|
"i",
|
|
8187
8196
|
{
|
|
8188
8197
|
className: "ph ph-" + (d.severity === "warning" ? "warning" : d.severity === "info" ? "info" : "warning-circle"),
|
|
@@ -8194,13 +8203,13 @@ function CodeEditor({
|
|
|
8194
8203
|
d.line,
|
|
8195
8204
|
d.column ? ":" + d.column : ""
|
|
8196
8205
|
] }),
|
|
8197
|
-
/* @__PURE__ */
|
|
8206
|
+
/* @__PURE__ */ jsx78("span", { children: d.message })
|
|
8198
8207
|
] }, i)) }) : null,
|
|
8199
8208
|
error ? /* @__PURE__ */ jsxs67("span", { className: "fd-field-error", children: [
|
|
8200
|
-
/* @__PURE__ */
|
|
8209
|
+
/* @__PURE__ */ jsx78("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
8201
8210
|
error
|
|
8202
|
-
] }) : !diagnostics.length && help ? /* @__PURE__ */
|
|
8203
|
-
showEscapeHint ? /* @__PURE__ */
|
|
8211
|
+
] }) : !diagnostics.length && help ? /* @__PURE__ */ jsx78("span", { className: "fd-field-help", children: help }) : null,
|
|
8212
|
+
showEscapeHint ? /* @__PURE__ */ jsx78("span", { className: "fd-field-help fd-code-editor-hint", children: "Tab indents. Escape, then Tab, moves focus out." }) : null
|
|
8204
8213
|
] });
|
|
8205
8214
|
}
|
|
8206
8215
|
|
|
@@ -8224,7 +8233,7 @@ function useSessionContext() {
|
|
|
8224
8233
|
}
|
|
8225
8234
|
|
|
8226
8235
|
// src/components/platform/AccountMenu.tsx
|
|
8227
|
-
import { Fragment as Fragment18, jsx as
|
|
8236
|
+
import { Fragment as Fragment18, jsx as jsx79, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
8228
8237
|
var DEFAULT_LINKS = [];
|
|
8229
8238
|
var DEFAULT_GROUPS = [];
|
|
8230
8239
|
function Item({ item, onPick }) {
|
|
@@ -8236,9 +8245,9 @@ function Item({ item, onPick }) {
|
|
|
8236
8245
|
className: "fd-acct-item",
|
|
8237
8246
|
onClick: () => onPick(item),
|
|
8238
8247
|
children: [
|
|
8239
|
-
item.icon ? /* @__PURE__ */
|
|
8240
|
-
/* @__PURE__ */
|
|
8241
|
-
item.badge ? /* @__PURE__ */
|
|
8248
|
+
item.icon ? /* @__PURE__ */ jsx79("i", { className: "ph ph-" + item.icon, "aria-hidden": "true" }) : null,
|
|
8249
|
+
/* @__PURE__ */ jsx79("span", { style: { flex: 1 }, children: item.label }),
|
|
8250
|
+
item.badge ? /* @__PURE__ */ jsx79(Badge, { tone: "neutral", children: item.badge }) : null
|
|
8242
8251
|
]
|
|
8243
8252
|
}
|
|
8244
8253
|
);
|
|
@@ -8299,12 +8308,12 @@ function AccountMenu({
|
|
|
8299
8308
|
onClick: () => open2 ? closeMenu() : setOpen(true),
|
|
8300
8309
|
...rest,
|
|
8301
8310
|
children: [
|
|
8302
|
-
/* @__PURE__ */
|
|
8303
|
-
/* @__PURE__ */
|
|
8311
|
+
/* @__PURE__ */ jsx79(Avatar, { name: user.name, size: "sm" }),
|
|
8312
|
+
/* @__PURE__ */ jsx79("i", { className: "ph ph-caret-down", "aria-hidden": "true", style: { fontSize: 11, color: "var(--text-muted)" } })
|
|
8304
8313
|
]
|
|
8305
8314
|
}
|
|
8306
8315
|
),
|
|
8307
|
-
/* @__PURE__ */
|
|
8316
|
+
/* @__PURE__ */ jsx79(
|
|
8308
8317
|
Popover,
|
|
8309
8318
|
{
|
|
8310
8319
|
open: open2,
|
|
@@ -8314,25 +8323,25 @@ function AccountMenu({
|
|
|
8314
8323
|
width: 272,
|
|
8315
8324
|
children: /* @__PURE__ */ jsxs68("div", { role: "menu", className: "fd-stack", style: { gap: 0 }, children: [
|
|
8316
8325
|
/* @__PURE__ */ jsxs68("div", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
|
|
8317
|
-
/* @__PURE__ */
|
|
8326
|
+
/* @__PURE__ */ jsx79(Avatar, { name: user.name }),
|
|
8318
8327
|
/* @__PURE__ */ jsxs68("span", { className: "fd-stack", style: { gap: 1, minWidth: 0, flex: 1 }, children: [
|
|
8319
|
-
/* @__PURE__ */
|
|
8320
|
-
/* @__PURE__ */
|
|
8328
|
+
/* @__PURE__ */ jsx79("span", { className: "fd-body-sm", style: { fontWeight: 700 }, children: user.name }),
|
|
8329
|
+
/* @__PURE__ */ jsx79("span", { className: "fd-body-sm fd-muted fd-table-trunc", title: truncationTitle(user.email), children: user.email })
|
|
8321
8330
|
] })
|
|
8322
8331
|
] }),
|
|
8323
|
-
showRoles && roles.length ? /* @__PURE__ */
|
|
8324
|
-
visibleLinks.length ? /* @__PURE__ */
|
|
8332
|
+
showRoles && roles.length ? /* @__PURE__ */ jsx79("div", { className: "fd-row", style: { gap: 6, padding: "10px 14px", flexWrap: "wrap", borderBottom: "1px solid var(--border)" }, children: roles.map((r) => /* @__PURE__ */ jsx79(Badge, { tone: r.id === "owner" ? "success" : "neutral", children: r.name }, r.id)) }) : null,
|
|
8333
|
+
visibleLinks.length ? /* @__PURE__ */ jsx79("div", { className: "fd-acct-group", children: visibleLinks.map((l) => /* @__PURE__ */ jsx79(Item, { item: l, onPick: pick }, l.id)) }) : null,
|
|
8325
8334
|
visibleGroups.map((g) => /* @__PURE__ */ jsxs68("div", { className: "fd-acct-group", style: { borderTop: "1px solid var(--border)" }, children: [
|
|
8326
|
-
/* @__PURE__ */
|
|
8327
|
-
g.links.map((l) => /* @__PURE__ */
|
|
8335
|
+
/* @__PURE__ */ jsx79("span", { className: "fd-overline fd-muted", style: { padding: "8px 14px 4px", display: "block" }, children: g.label }),
|
|
8336
|
+
g.links.map((l) => /* @__PURE__ */ jsx79(Item, { item: l, onPick: pick }, l.id))
|
|
8328
8337
|
] }, g.label)),
|
|
8329
8338
|
showSwitcher && demo ? /* @__PURE__ */ jsxs68("div", { className: "fd-acct-group", style: { borderTop: "1px solid var(--border)" }, children: [
|
|
8330
8339
|
/* @__PURE__ */ jsxs68("button", { type: "button", role: "menuitem", className: "fd-acct-item", onClick: () => setSwitching((s) => !s), children: [
|
|
8331
|
-
/* @__PURE__ */
|
|
8332
|
-
/* @__PURE__ */
|
|
8333
|
-
/* @__PURE__ */
|
|
8340
|
+
/* @__PURE__ */ jsx79("i", { className: "ph ph-user-switch", "aria-hidden": "true" }),
|
|
8341
|
+
/* @__PURE__ */ jsx79("span", { style: { flex: 1 }, children: "View as another member" }),
|
|
8342
|
+
/* @__PURE__ */ jsx79("i", { className: "ph ph-caret-" + (switching ? "up" : "down"), "aria-hidden": "true", style: { fontSize: 11 } })
|
|
8334
8343
|
] }),
|
|
8335
|
-
switching ? /* @__PURE__ */
|
|
8344
|
+
switching ? /* @__PURE__ */ jsx79("div", { className: "fd-stack", style: { gap: 0 }, children: demo.allUsers.map((u) => /* @__PURE__ */ jsxs68(
|
|
8336
8345
|
"button",
|
|
8337
8346
|
{
|
|
8338
8347
|
type: "button",
|
|
@@ -8344,12 +8353,12 @@ function AccountMenu({
|
|
|
8344
8353
|
setSwitching(false);
|
|
8345
8354
|
},
|
|
8346
8355
|
children: [
|
|
8347
|
-
/* @__PURE__ */
|
|
8356
|
+
/* @__PURE__ */ jsx79(Avatar, { name: u.name, size: "sm" }),
|
|
8348
8357
|
/* @__PURE__ */ jsxs68("span", { className: "fd-stack", style: { gap: 0, flex: 1, minWidth: 0, alignItems: "flex-start" }, children: [
|
|
8349
|
-
/* @__PURE__ */
|
|
8350
|
-
u.roles ? /* @__PURE__ */
|
|
8358
|
+
/* @__PURE__ */ jsx79("span", { style: { fontWeight: u.id === user.id ? 700 : 500 }, children: u.name }),
|
|
8359
|
+
u.roles ? /* @__PURE__ */ jsx79("span", { className: "fd-muted", style: { fontSize: 11.5 }, children: u.roles.join(", ") }) : null
|
|
8351
8360
|
] }),
|
|
8352
|
-
u.id === user.id ? /* @__PURE__ */
|
|
8361
|
+
u.id === user.id ? /* @__PURE__ */ jsx79("i", { className: "ph ph-check", "aria-hidden": "true", style: { color: "var(--ok-text)" } }) : null
|
|
8353
8362
|
]
|
|
8354
8363
|
},
|
|
8355
8364
|
u.id
|
|
@@ -8366,14 +8375,14 @@ function AccountMenu({
|
|
|
8366
8375
|
disabled: signingOut,
|
|
8367
8376
|
onClick: signOut,
|
|
8368
8377
|
children: [
|
|
8369
|
-
signingOut ? /* @__PURE__ */
|
|
8370
|
-
/* @__PURE__ */
|
|
8378
|
+
signingOut ? /* @__PURE__ */ jsx79(Spinner, { size: "sm" }) : /* @__PURE__ */ jsx79("i", { className: "ph ph-sign-out", "aria-hidden": "true" }),
|
|
8379
|
+
/* @__PURE__ */ jsx79("span", { style: { flex: 1 }, children: signingOut ? "Signing out\u2026" : "Sign out" })
|
|
8371
8380
|
]
|
|
8372
8381
|
}
|
|
8373
8382
|
),
|
|
8374
8383
|
signOutError ? /* @__PURE__ */ jsxs68("div", { role: "alert", className: "fd-body-sm", style: { padding: "0 14px 12px" }, children: [
|
|
8375
|
-
/* @__PURE__ */
|
|
8376
|
-
/* @__PURE__ */
|
|
8384
|
+
/* @__PURE__ */ jsx79("span", { style: { display: "block", color: "var(--danger-text)", marginBottom: 6 }, children: signOutError }),
|
|
8385
|
+
/* @__PURE__ */ jsx79("button", { type: "button", className: "fd-soon-link", disabled: signingOut, onClick: signOut, children: "Retry" })
|
|
8377
8386
|
] }) : null
|
|
8378
8387
|
] })
|
|
8379
8388
|
] })
|
|
@@ -8384,7 +8393,7 @@ function AccountMenu({
|
|
|
8384
8393
|
|
|
8385
8394
|
// src/components/platform/AppSwitcher.tsx
|
|
8386
8395
|
import * as React55 from "react";
|
|
8387
|
-
import { jsx as
|
|
8396
|
+
import { jsx as jsx80, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
8388
8397
|
function AppSwitcher({ apps: appsProp, onNavigate, className = "" }) {
|
|
8389
8398
|
const { apps: contextApps } = useSessionContext();
|
|
8390
8399
|
const apps = appsProp ?? contextApps ?? [];
|
|
@@ -8404,7 +8413,7 @@ function AppSwitcher({ apps: appsProp, onNavigate, className = "" }) {
|
|
|
8404
8413
|
}
|
|
8405
8414
|
}));
|
|
8406
8415
|
return /* @__PURE__ */ jsxs69(React55.Fragment, { children: [
|
|
8407
|
-
/* @__PURE__ */
|
|
8416
|
+
/* @__PURE__ */ jsx80("span", { ref: anchorRef, className: ["fd-appswitch-anchor", className].filter(Boolean).join(" "), style: { display: "inline-flex" }, children: /* @__PURE__ */ jsx80(
|
|
8408
8417
|
IconButton,
|
|
8409
8418
|
{
|
|
8410
8419
|
icon: "squares-four",
|
|
@@ -8414,7 +8423,7 @@ function AppSwitcher({ apps: appsProp, onNavigate, className = "" }) {
|
|
|
8414
8423
|
onClick: () => setOpen((v) => !v)
|
|
8415
8424
|
}
|
|
8416
8425
|
) }),
|
|
8417
|
-
/* @__PURE__ */
|
|
8426
|
+
/* @__PURE__ */ jsx80(
|
|
8418
8427
|
Popover,
|
|
8419
8428
|
{
|
|
8420
8429
|
open: open2,
|
|
@@ -8425,7 +8434,7 @@ function AppSwitcher({ apps: appsProp, onNavigate, className = "" }) {
|
|
|
8425
8434
|
label: "All flytedesk apps",
|
|
8426
8435
|
width: 240,
|
|
8427
8436
|
maxHeight: 360,
|
|
8428
|
-
children: /* @__PURE__ */
|
|
8437
|
+
children: /* @__PURE__ */ jsx80(Menu, { items, onClose: () => setOpen(false) })
|
|
8429
8438
|
}
|
|
8430
8439
|
)
|
|
8431
8440
|
] });
|
|
@@ -8559,11 +8568,11 @@ function useAppearancePrefs(store) {
|
|
|
8559
8568
|
|
|
8560
8569
|
// src/components/platform/AppearanceProvider.tsx
|
|
8561
8570
|
import * as React57 from "react";
|
|
8562
|
-
import { jsx as
|
|
8571
|
+
import { jsx as jsx81 } from "react/jsx-runtime";
|
|
8563
8572
|
var AppearanceStoreContext = React57.createContext(null);
|
|
8564
8573
|
function AppearanceProvider({ store, children }) {
|
|
8565
8574
|
React57.useLayoutEffect(() => watchAppearance(store), [store]);
|
|
8566
|
-
return /* @__PURE__ */
|
|
8575
|
+
return /* @__PURE__ */ jsx81(AppearanceStoreContext.Provider, { value: store, children });
|
|
8567
8576
|
}
|
|
8568
8577
|
function useAppearanceStore() {
|
|
8569
8578
|
const store = React57.useContext(AppearanceStoreContext);
|
|
@@ -8572,7 +8581,7 @@ function useAppearanceStore() {
|
|
|
8572
8581
|
}
|
|
8573
8582
|
|
|
8574
8583
|
// src/components/platform/AppearanceMenu.tsx
|
|
8575
|
-
import { jsx as
|
|
8584
|
+
import { jsx as jsx82, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
8576
8585
|
var THEME_OPTIONS = [
|
|
8577
8586
|
{ value: "light", label: "Light" },
|
|
8578
8587
|
{ value: "dark", label: "Dark" },
|
|
@@ -8590,7 +8599,7 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8590
8599
|
const anchorRef = React58.useRef(null);
|
|
8591
8600
|
const patch = (p) => update(p);
|
|
8592
8601
|
return /* @__PURE__ */ jsxs70(React58.Fragment, { children: [
|
|
8593
|
-
/* @__PURE__ */
|
|
8602
|
+
/* @__PURE__ */ jsx82("span", { ref: anchorRef, className: ["fd-appearance-anchor", className].filter(Boolean).join(" "), style: { display: "inline-flex" }, children: /* @__PURE__ */ jsx82(
|
|
8594
8603
|
IconButton,
|
|
8595
8604
|
{
|
|
8596
8605
|
icon: "circle-half",
|
|
@@ -8598,7 +8607,7 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8598
8607
|
onClick: () => setOpen((v) => !v)
|
|
8599
8608
|
}
|
|
8600
8609
|
) }),
|
|
8601
|
-
/* @__PURE__ */
|
|
8610
|
+
/* @__PURE__ */ jsx82(
|
|
8602
8611
|
Popover,
|
|
8603
8612
|
{
|
|
8604
8613
|
open: open2,
|
|
@@ -8610,8 +8619,8 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8610
8619
|
label: "Appearance settings",
|
|
8611
8620
|
children: /* @__PURE__ */ jsxs70("div", { className: "fd-stack", style: { display: "flex", flexDirection: "column", gap: 16 }, children: [
|
|
8612
8621
|
/* @__PURE__ */ jsxs70("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
8613
|
-
/* @__PURE__ */
|
|
8614
|
-
/* @__PURE__ */
|
|
8622
|
+
/* @__PURE__ */ jsx82("span", { className: "fd-field-label", children: "Theme" }),
|
|
8623
|
+
/* @__PURE__ */ jsx82(
|
|
8615
8624
|
SegmentedControl,
|
|
8616
8625
|
{
|
|
8617
8626
|
options: THEME_OPTIONS,
|
|
@@ -8622,8 +8631,8 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8622
8631
|
)
|
|
8623
8632
|
] }),
|
|
8624
8633
|
/* @__PURE__ */ jsxs70("div", { style: { display: "flex", flexDirection: "column", gap: 6 }, children: [
|
|
8625
|
-
/* @__PURE__ */
|
|
8626
|
-
/* @__PURE__ */
|
|
8634
|
+
/* @__PURE__ */ jsx82("span", { className: "fd-field-label", children: "Text size" }),
|
|
8635
|
+
/* @__PURE__ */ jsx82(
|
|
8627
8636
|
SegmentedControl,
|
|
8628
8637
|
{
|
|
8629
8638
|
options: TEXT_SCALE_OPTIONS,
|
|
@@ -8633,7 +8642,7 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8633
8642
|
}
|
|
8634
8643
|
)
|
|
8635
8644
|
] }),
|
|
8636
|
-
/* @__PURE__ */
|
|
8645
|
+
/* @__PURE__ */ jsx82(
|
|
8637
8646
|
Switch,
|
|
8638
8647
|
{
|
|
8639
8648
|
label: "High contrast",
|
|
@@ -8642,7 +8651,7 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8642
8651
|
onChange: (e) => patch({ highContrast: e.target.checked })
|
|
8643
8652
|
}
|
|
8644
8653
|
),
|
|
8645
|
-
/* @__PURE__ */
|
|
8654
|
+
/* @__PURE__ */ jsx82(
|
|
8646
8655
|
Switch,
|
|
8647
8656
|
{
|
|
8648
8657
|
label: "Reduce motion",
|
|
@@ -8659,10 +8668,10 @@ function AppearanceMenu({ className = "" }) {
|
|
|
8659
8668
|
|
|
8660
8669
|
// src/components/platform/ApiSpecBrowser.tsx
|
|
8661
8670
|
import * as React59 from "react";
|
|
8662
|
-
import { jsx as
|
|
8671
|
+
import { jsx as jsx83, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
8663
8672
|
var METHOD_TONE = { GET: "success", POST: "info", PATCH: "warning", PUT: "warning", DELETE: "danger" };
|
|
8664
8673
|
function Json({ obj }) {
|
|
8665
|
-
return /* @__PURE__ */
|
|
8674
|
+
return /* @__PURE__ */ jsx83("pre", { className: "fd-json", children: JSON.stringify(obj, null, 2) });
|
|
8666
8675
|
}
|
|
8667
8676
|
function Endpoint({ s, onRequest }) {
|
|
8668
8677
|
const [tried, setTried] = React59.useState(null);
|
|
@@ -8676,50 +8685,50 @@ function Endpoint({ s, onRequest }) {
|
|
|
8676
8685
|
setTried({ ms: Math.round((window.performance || Date).now() - t0), error: String(e && e.message || e) });
|
|
8677
8686
|
}
|
|
8678
8687
|
};
|
|
8679
|
-
return /* @__PURE__ */
|
|
8688
|
+
return /* @__PURE__ */ jsx83(Card, { elevation: "flat", padded: false, children: /* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 0 }, children: [
|
|
8680
8689
|
/* @__PURE__ */ jsxs71("div", { className: "fd-row", style: { gap: 10, padding: "14px 18px", flexWrap: "wrap" }, children: [
|
|
8681
|
-
/* @__PURE__ */
|
|
8682
|
-
/* @__PURE__ */
|
|
8683
|
-
s.isList ? /* @__PURE__ */
|
|
8684
|
-
/* @__PURE__ */
|
|
8690
|
+
/* @__PURE__ */ jsx83(Badge, { tone: METHOD_TONE[s.method] || "neutral", children: s.method }),
|
|
8691
|
+
/* @__PURE__ */ jsx83("code", { className: "fd-mono", style: { fontSize: 12.5, fontWeight: 600, color: "var(--text)", wordBreak: "break-all" }, children: s.path }),
|
|
8692
|
+
s.isList ? /* @__PURE__ */ jsx83(Badge, { tone: "neutral", icon: "rows", children: "Paged list" }) : null,
|
|
8693
|
+
/* @__PURE__ */ jsx83("span", { style: { flex: 1 } }),
|
|
8685
8694
|
/* @__PURE__ */ jsxs71("span", { className: "fd-body-sm fd-muted fd-mono", children: [
|
|
8686
8695
|
s.latency[0],
|
|
8687
8696
|
"\u2013",
|
|
8688
8697
|
s.latency[1],
|
|
8689
8698
|
"ms"
|
|
8690
8699
|
] }),
|
|
8691
|
-
/* @__PURE__ */
|
|
8700
|
+
/* @__PURE__ */ jsx83(Button, { size: "sm", variant: "secondary", icon: "play", loading: tried === "busy", onClick: run, children: "Try it" })
|
|
8692
8701
|
] }),
|
|
8693
8702
|
/* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 14, padding: "0 18px 16px" }, children: [
|
|
8694
8703
|
/* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
8695
|
-
/* @__PURE__ */
|
|
8696
|
-
/* @__PURE__ */
|
|
8697
|
-
s.usedBy && s.usedBy.length ? /* @__PURE__ */
|
|
8704
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-body-sm", style: { fontWeight: 700 }, children: s.title }),
|
|
8705
|
+
/* @__PURE__ */ jsx83("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: s.purpose }),
|
|
8706
|
+
s.usedBy && s.usedBy.length ? /* @__PURE__ */ jsx83("span", { className: "fd-row", style: { gap: 6, flexWrap: "wrap" }, children: s.usedBy.map((u) => /* @__PURE__ */ jsx83(Tag, { children: u }, u)) }) : null
|
|
8698
8707
|
] }),
|
|
8699
8708
|
/* @__PURE__ */ jsxs71("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(280px,1fr))", gap: 12, alignItems: "start" }, children: [
|
|
8700
8709
|
s.request ? /* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
8701
|
-
/* @__PURE__ */
|
|
8702
|
-
/* @__PURE__ */
|
|
8710
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", children: "Request body" }),
|
|
8711
|
+
/* @__PURE__ */ jsx83(Json, { obj: s.request })
|
|
8703
8712
|
] }) : null,
|
|
8704
8713
|
s.query ? /* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
8705
|
-
/* @__PURE__ */
|
|
8706
|
-
/* @__PURE__ */
|
|
8714
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", children: "Query" }),
|
|
8715
|
+
/* @__PURE__ */ jsx83(Json, { obj: s.query })
|
|
8707
8716
|
] }) : null,
|
|
8708
8717
|
/* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
8709
|
-
/* @__PURE__ */
|
|
8710
|
-
/* @__PURE__ */
|
|
8718
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", children: "Response 200" }),
|
|
8719
|
+
/* @__PURE__ */ jsx83(Json, { obj: s.response })
|
|
8711
8720
|
] })
|
|
8712
8721
|
] }),
|
|
8713
|
-
s.notes ? /* @__PURE__ */
|
|
8722
|
+
s.notes ? /* @__PURE__ */ jsx83(Flag, { tone: "info", statement: "Implementation note", cost: s.notes, actions: null }) : null,
|
|
8714
8723
|
tried && tried !== "busy" ? /* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 6 }, children: [
|
|
8715
8724
|
/* @__PURE__ */ jsxs71("span", { className: "fd-row", style: { gap: 8 }, children: [
|
|
8716
|
-
/* @__PURE__ */
|
|
8725
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", children: "Simulated response" }),
|
|
8717
8726
|
/* @__PURE__ */ jsxs71(Badge, { tone: tried.error ? "danger" : "success", icon: "timer", children: [
|
|
8718
8727
|
tried.ms,
|
|
8719
8728
|
"ms"
|
|
8720
8729
|
] })
|
|
8721
8730
|
] }),
|
|
8722
|
-
/* @__PURE__ */
|
|
8731
|
+
/* @__PURE__ */ jsx83(Json, { obj: tried.error ? { error: tried.error } : tried.data })
|
|
8723
8732
|
] }) : null
|
|
8724
8733
|
] })
|
|
8725
8734
|
] }) });
|
|
@@ -8749,46 +8758,46 @@ function ApiSpecBrowser({
|
|
|
8749
8758
|
const listCount = spec.filter((s) => s.isList).length;
|
|
8750
8759
|
return /* @__PURE__ */ jsxs71("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 20, maxWidth: 1100 }, ...rest, children: [
|
|
8751
8760
|
/* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
8752
|
-
kicker ? /* @__PURE__ */
|
|
8753
|
-
/* @__PURE__ */
|
|
8754
|
-
lede ? /* @__PURE__ */
|
|
8761
|
+
kicker ? /* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", children: kicker }) : null,
|
|
8762
|
+
/* @__PURE__ */ jsx83("h1", { className: "fd-h1", style: { margin: 0 }, children: title }),
|
|
8763
|
+
lede ? /* @__PURE__ */ jsx83("p", { className: "fd-body fd-secondary fd-prose", style: { margin: 0 }, children: lede }) : null
|
|
8755
8764
|
] }),
|
|
8756
8765
|
modules && modules.length ? /* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 8 }, children: [
|
|
8757
|
-
/* @__PURE__ */
|
|
8766
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", children: "Filter by screen \u2014 every endpoint that screen depends on" }),
|
|
8758
8767
|
/* @__PURE__ */ jsxs71("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: [
|
|
8759
8768
|
/* @__PURE__ */ jsxs71(Tag, { icon: "stack", selected: !mod, onClick: () => setMod(null), children: [
|
|
8760
8769
|
"All screens ",
|
|
8761
|
-
/* @__PURE__ */
|
|
8770
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-mono", children: spec.length })
|
|
8762
8771
|
] }),
|
|
8763
8772
|
modules.map((m) => /* @__PURE__ */ jsxs71(Tag, { icon: m.icon, selected: mod === m.id, onClick: () => setMod(mod === m.id ? null : m.id), children: [
|
|
8764
8773
|
m.label,
|
|
8765
8774
|
" ",
|
|
8766
|
-
/* @__PURE__ */
|
|
8775
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-mono", children: m.endpoints.length })
|
|
8767
8776
|
] }, m.id))
|
|
8768
8777
|
] }),
|
|
8769
|
-
activeModule ? /* @__PURE__ */
|
|
8778
|
+
activeModule ? /* @__PURE__ */ jsx83(
|
|
8770
8779
|
Flag,
|
|
8771
8780
|
{
|
|
8772
8781
|
tone: "info",
|
|
8773
8782
|
statement: activeModule.label + " calls " + activeModule.endpoints.length + " endpoints.",
|
|
8774
8783
|
cost: "Integration checklist for this screen: " + activeModule.endpoints.join(", ") + ". Wire these and the screen is done.",
|
|
8775
|
-
actions: /* @__PURE__ */
|
|
8784
|
+
actions: /* @__PURE__ */ jsx83(Button, { size: "sm", variant: "ghost", icon: "x", onClick: () => setMod(null), children: "Show all screens" })
|
|
8776
8785
|
}
|
|
8777
8786
|
) : null
|
|
8778
8787
|
] }) : null,
|
|
8779
|
-
sourceNote ? /* @__PURE__ */
|
|
8788
|
+
sourceNote ? /* @__PURE__ */ jsx83(Flag, { tone: "info", statement: "Design-first: this page is the spec.", cost: sourceNote, actions: null }) : null,
|
|
8780
8789
|
/* @__PURE__ */ jsxs71("div", { className: "fd-row", style: { gap: 10, flexWrap: "wrap" }, children: [
|
|
8781
|
-
/* @__PURE__ */
|
|
8790
|
+
/* @__PURE__ */ jsx83(Input, { icon: "magnifying-glass", placeholder: "Find an endpoint, screen, or behavior", value: q, onChange: (e) => setQ(e.target.value), style: { width: 300 } }),
|
|
8782
8791
|
methods.map((m) => /* @__PURE__ */ jsxs71(Tag, { selected: method === m, onClick: () => setMethod(method === m ? null : m), children: [
|
|
8783
8792
|
m,
|
|
8784
8793
|
" ",
|
|
8785
|
-
/* @__PURE__ */
|
|
8794
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-mono", children: spec.filter((s) => s.method === m).length })
|
|
8786
8795
|
] }, m)),
|
|
8787
8796
|
listCount ? /* @__PURE__ */ jsxs71(Tag, { icon: "rows", selected: listOnly, onClick: () => setListOnly(!listOnly), children: [
|
|
8788
8797
|
"Paged lists ",
|
|
8789
|
-
/* @__PURE__ */
|
|
8798
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-mono", children: listCount })
|
|
8790
8799
|
] }) : null,
|
|
8791
|
-
/* @__PURE__ */
|
|
8800
|
+
/* @__PURE__ */ jsx83("span", { style: { flex: 1 } }),
|
|
8792
8801
|
/* @__PURE__ */ jsxs71("span", { className: "fd-body-sm fd-muted", children: [
|
|
8793
8802
|
hits.length,
|
|
8794
8803
|
" of ",
|
|
@@ -8797,23 +8806,23 @@ function ApiSpecBrowser({
|
|
|
8797
8806
|
listCount ? " \xB7 " + listCount + " paged" : ""
|
|
8798
8807
|
] })
|
|
8799
8808
|
] }),
|
|
8800
|
-
hits.length === 0 ? /* @__PURE__ */
|
|
8809
|
+
hits.length === 0 ? /* @__PURE__ */ jsx83(Card, { elevation: "flat", children: /* @__PURE__ */ jsx83("p", { className: "fd-body-sm fd-muted", style: { margin: 0 }, children: "No endpoint matches those filters." }) }) : effGroups.map(([g, ids]) => {
|
|
8801
8810
|
const items = hits.filter((s) => ids.indexOf(s.id) >= 0);
|
|
8802
8811
|
if (!items.length) return null;
|
|
8803
8812
|
return /* @__PURE__ */ jsxs71("div", { className: "fd-stack", style: { gap: 12 }, children: [
|
|
8804
|
-
/* @__PURE__ */
|
|
8805
|
-
items.map((s) => /* @__PURE__ */
|
|
8813
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-label-lg", children: g }),
|
|
8814
|
+
items.map((s) => /* @__PURE__ */ jsx83(Endpoint, { s, onRequest }, s.id))
|
|
8806
8815
|
] }, g);
|
|
8807
8816
|
}),
|
|
8808
|
-
conventions && conventions.length ? /* @__PURE__ */
|
|
8809
|
-
/* @__PURE__ */
|
|
8810
|
-
/* @__PURE__ */
|
|
8817
|
+
conventions && conventions.length ? /* @__PURE__ */ jsx83(Card, { title: "Cross-cutting conventions", elevation: "flat", children: /* @__PURE__ */ jsx83("div", { className: "fd-stack", style: { gap: 10 }, children: conventions.map(([k, v]) => /* @__PURE__ */ jsxs71("div", { className: "fd-row", style: { gap: 12, alignItems: "flex-start" }, children: [
|
|
8818
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-overline fd-muted", style: { width: 110, flex: "none", paddingTop: 2 }, children: k }),
|
|
8819
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-body-sm fd-secondary", style: { textWrap: "pretty" }, children: v })
|
|
8811
8820
|
] }, k)) }) }) : null,
|
|
8812
|
-
openQuestions && openQuestions.length ? /* @__PURE__ */
|
|
8813
|
-
/* @__PURE__ */
|
|
8821
|
+
openQuestions && openQuestions.length ? /* @__PURE__ */ jsx83(Collapsible, { icon: "list-checks", title: "Open questions before implementation", subtitle: openQuestions.length + " unresolved", children: /* @__PURE__ */ jsx83("div", { className: "fd-stack", style: { gap: 8 }, children: openQuestions.map(([id, question, why]) => /* @__PURE__ */ jsxs71("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start", padding: "8px 0", borderTop: "1px solid var(--border)" }, children: [
|
|
8822
|
+
/* @__PURE__ */ jsx83(Badge, { tone: "danger", children: id }),
|
|
8814
8823
|
/* @__PURE__ */ jsxs71("span", { className: "fd-stack", style: { gap: 2, flex: 1 }, children: [
|
|
8815
|
-
/* @__PURE__ */
|
|
8816
|
-
/* @__PURE__ */
|
|
8824
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-body-sm", style: { fontWeight: 600 }, children: question }),
|
|
8825
|
+
/* @__PURE__ */ jsx83("span", { className: "fd-body-sm fd-muted", children: why })
|
|
8817
8826
|
] })
|
|
8818
8827
|
] }, id)) }) }) : null
|
|
8819
8828
|
] });
|
|
@@ -8821,7 +8830,7 @@ function ApiSpecBrowser({
|
|
|
8821
8830
|
|
|
8822
8831
|
// src/components/platform/ProfilePage.tsx
|
|
8823
8832
|
import * as React60 from "react";
|
|
8824
|
-
import { jsx as
|
|
8833
|
+
import { jsx as jsx84, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
8825
8834
|
function fieldInitialValue(field, user) {
|
|
8826
8835
|
if (field.value) return field.value(user);
|
|
8827
8836
|
const raw = user[field.key];
|
|
@@ -8909,35 +8918,35 @@ function ProfilePage({
|
|
|
8909
8918
|
const fieldGroups = groupFields(fields);
|
|
8910
8919
|
return /* @__PURE__ */ jsxs72("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 20, maxWidth: 860 }, children: [
|
|
8911
8920
|
/* @__PURE__ */ jsxs72("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
8912
|
-
/* @__PURE__ */
|
|
8913
|
-
/* @__PURE__ */
|
|
8914
|
-
/* @__PURE__ */
|
|
8921
|
+
/* @__PURE__ */ jsx84("span", { className: "fd-overline fd-muted", children: "Account" }),
|
|
8922
|
+
/* @__PURE__ */ jsx84("h1", { className: "fd-h1", style: { margin: 0 }, children: "Your profile" }),
|
|
8923
|
+
/* @__PURE__ */ jsx84("p", { className: "fd-body fd-secondary fd-prose", style: { margin: 0 }, children: "How you appear to colleagues and clients across every flytedesk app, and what we send you." })
|
|
8915
8924
|
] }),
|
|
8916
|
-
/* @__PURE__ */
|
|
8917
|
-
/* @__PURE__ */
|
|
8925
|
+
/* @__PURE__ */ jsx84(Card, { elevation: "flat", children: /* @__PURE__ */ jsxs72("div", { className: "fd-row", style: { gap: 16, flexWrap: "wrap", alignItems: "flex-start" }, children: [
|
|
8926
|
+
/* @__PURE__ */ jsx84(Avatar, { name: displayName, size: "lg" }),
|
|
8918
8927
|
/* @__PURE__ */ jsxs72("div", { className: "fd-stack", style: { gap: 4, flex: 1, minWidth: 200 }, children: [
|
|
8919
|
-
/* @__PURE__ */
|
|
8928
|
+
/* @__PURE__ */ jsx84("span", { className: "fd-h3", style: { margin: 0 }, children: displayName }),
|
|
8920
8929
|
/* @__PURE__ */ jsxs72("span", { className: "fd-row", style: { gap: 6, flexWrap: "wrap", paddingTop: 4 }, children: [
|
|
8921
|
-
roles.map((r) => /* @__PURE__ */
|
|
8922
|
-
user.sso ? /* @__PURE__ */
|
|
8930
|
+
roles.map((r) => /* @__PURE__ */ jsx84(Badge, { tone: r.id === "owner" ? "success" : "neutral", children: r.name }, r.id)),
|
|
8931
|
+
user.sso ? /* @__PURE__ */ jsx84(Badge, { tone: "info", icon: "shield-check", children: "SSO" }) : null
|
|
8923
8932
|
] })
|
|
8924
8933
|
] }),
|
|
8925
|
-
onChangePhoto ? /* @__PURE__ */
|
|
8934
|
+
onChangePhoto ? /* @__PURE__ */ jsx84(Button, { variant: "secondary", size: "sm", icon: "image", onClick: onChangePhoto, children: "Change photo" }) : null
|
|
8926
8935
|
] }) }),
|
|
8927
|
-
fieldGroups.map(({ group, description, fields: groupFieldDefs }) => /* @__PURE__ */
|
|
8936
|
+
fieldGroups.map(({ group, description, fields: groupFieldDefs }) => /* @__PURE__ */ jsx84(
|
|
8928
8937
|
Card,
|
|
8929
8938
|
{
|
|
8930
8939
|
title: description ? /* @__PURE__ */ jsxs72("span", { className: "fd-stack", style: { gap: 2 }, children: [
|
|
8931
|
-
/* @__PURE__ */
|
|
8932
|
-
/* @__PURE__ */
|
|
8940
|
+
/* @__PURE__ */ jsx84("span", { children: group }),
|
|
8941
|
+
/* @__PURE__ */ jsx84("span", { className: "fd-body-sm fd-muted", style: { fontWeight: 400 }, children: description })
|
|
8933
8942
|
] }) : group,
|
|
8934
8943
|
elevation: "flat",
|
|
8935
8944
|
children: /* @__PURE__ */ jsxs72("div", { className: "fd-stack", style: { gap: 14 }, children: [
|
|
8936
|
-
/* @__PURE__ */
|
|
8945
|
+
/* @__PURE__ */ jsx84("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit,minmax(220px,1fr))", gap: 14 }, children: groupFieldDefs.filter((f) => f.type !== "textarea").map((field) => {
|
|
8937
8946
|
const help = typeof field.help === "function" ? field.help(user) : field.help;
|
|
8938
8947
|
const readOnly = field.readOnly || field.type === "readonly";
|
|
8939
8948
|
if (field.type === "select") {
|
|
8940
|
-
return /* @__PURE__ */
|
|
8949
|
+
return /* @__PURE__ */ jsx84(
|
|
8941
8950
|
Select,
|
|
8942
8951
|
{
|
|
8943
8952
|
label: field.label,
|
|
@@ -8951,7 +8960,7 @@ function ProfilePage({
|
|
|
8951
8960
|
field.key
|
|
8952
8961
|
);
|
|
8953
8962
|
}
|
|
8954
|
-
return /* @__PURE__ */
|
|
8963
|
+
return /* @__PURE__ */ jsx84(
|
|
8955
8964
|
Input,
|
|
8956
8965
|
{
|
|
8957
8966
|
label: field.label,
|
|
@@ -8967,7 +8976,7 @@ function ProfilePage({
|
|
|
8967
8976
|
}) }),
|
|
8968
8977
|
groupFieldDefs.filter((f) => f.type === "textarea").map((field) => {
|
|
8969
8978
|
const help = typeof field.help === "function" ? field.help(user) : field.help;
|
|
8970
|
-
return /* @__PURE__ */
|
|
8979
|
+
return /* @__PURE__ */ jsx84(
|
|
8971
8980
|
Textarea,
|
|
8972
8981
|
{
|
|
8973
8982
|
label: field.label,
|
|
@@ -8987,16 +8996,16 @@ function ProfilePage({
|
|
|
8987
8996
|
group
|
|
8988
8997
|
)),
|
|
8989
8998
|
extra,
|
|
8990
|
-
notifications.length > 0 ? /* @__PURE__ */
|
|
8999
|
+
notifications.length > 0 ? /* @__PURE__ */ jsx84(Card, { title: "Notifications", elevation: "flat", children: /* @__PURE__ */ jsx84("div", { className: "fd-stack", style: { gap: 14 }, children: notifications.map((n) => /* @__PURE__ */ jsx84(Switch, { checked: !!notify[n.key], onChange: () => toggleNotify(n.key), label: n.label, description: n.description }, n.key)) }) }) : null,
|
|
8991
9000
|
/* @__PURE__ */ jsxs72(
|
|
8992
9001
|
Card,
|
|
8993
9002
|
{
|
|
8994
9003
|
title: /* @__PURE__ */ jsxs72("span", { className: "fd-stack", style: { gap: 2 }, children: [
|
|
8995
|
-
/* @__PURE__ */
|
|
8996
|
-
/* @__PURE__ */
|
|
9004
|
+
/* @__PURE__ */ jsx84("span", { children: "Access" }),
|
|
9005
|
+
/* @__PURE__ */ jsx84("span", { className: "fd-body-sm fd-muted", style: { fontWeight: 400 }, children: "What your roles grant you" })
|
|
8997
9006
|
] }),
|
|
8998
9007
|
elevation: "flat",
|
|
8999
|
-
action: /* @__PURE__ */
|
|
9008
|
+
action: /* @__PURE__ */ jsx84(
|
|
9000
9009
|
Button,
|
|
9001
9010
|
{
|
|
9002
9011
|
size: "sm",
|
|
@@ -9008,34 +9017,34 @@ function ProfilePage({
|
|
|
9008
9017
|
),
|
|
9009
9018
|
children: [
|
|
9010
9019
|
/* @__PURE__ */ jsxs72("div", { className: "fd-stack", style: { gap: 0 }, children: [
|
|
9011
|
-
/* @__PURE__ */
|
|
9020
|
+
/* @__PURE__ */ jsx84(CardRow, { label: "Roles", children: roles.map((r) => r.name).join(", ") || "None" }),
|
|
9012
9021
|
/* @__PURE__ */ jsxs72(CardRow, { label: "Permissions", children: [
|
|
9013
9022
|
permissions.length,
|
|
9014
9023
|
" granted"
|
|
9015
9024
|
] }),
|
|
9016
|
-
/* @__PURE__ */
|
|
9025
|
+
/* @__PURE__ */ jsx84(CardRow, { label: "Member since", children: user.joined || "\u2014" })
|
|
9017
9026
|
] }),
|
|
9018
|
-
/* @__PURE__ */
|
|
9027
|
+
/* @__PURE__ */ jsx84("p", { className: "fd-body-sm fd-muted", style: { margin: "12px 0 0" }, children: "You cannot change your own roles \u2014 that is the point of them. An administrator manages roles from Admin \u2192 Users." })
|
|
9019
9028
|
]
|
|
9020
9029
|
}
|
|
9021
9030
|
),
|
|
9022
|
-
sessions ? /* @__PURE__ */
|
|
9031
|
+
sessions ? /* @__PURE__ */ jsx84(
|
|
9023
9032
|
Card,
|
|
9024
9033
|
{
|
|
9025
9034
|
title: "Signed-in devices",
|
|
9026
9035
|
elevation: "flat",
|
|
9027
|
-
action: /* @__PURE__ */
|
|
9028
|
-
children: /* @__PURE__ */
|
|
9029
|
-
/* @__PURE__ */
|
|
9036
|
+
action: /* @__PURE__ */ jsx84(Button, { size: "sm", variant: "ghost", icon: "sign-out", onClick: onSignOutEverywhere, children: "Sign out everywhere" }),
|
|
9037
|
+
children: /* @__PURE__ */ jsx84("div", { className: "fd-stack", style: { gap: 0 }, children: sessions.length === 0 ? /* @__PURE__ */ jsx84("p", { className: "fd-body-sm fd-muted", style: { margin: 0 }, children: "No other signed-in devices." }) : sessions.map((s) => /* @__PURE__ */ jsxs72("div", { className: "fd-row", style: { gap: 12, padding: "10px 0", borderTop: "1px solid var(--border)", flexWrap: "wrap" }, children: [
|
|
9038
|
+
/* @__PURE__ */ jsx84("i", { className: "ph ph-device-mobile", style: { fontSize: 16, color: "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
9030
9039
|
/* @__PURE__ */ jsxs72("span", { className: "fd-stack", style: { gap: 1, flex: 1, minWidth: 160 }, children: [
|
|
9031
|
-
/* @__PURE__ */
|
|
9040
|
+
/* @__PURE__ */ jsx84("span", { className: "fd-body-sm", style: { fontWeight: 600 }, children: s.device }),
|
|
9032
9041
|
/* @__PURE__ */ jsxs72("span", { className: "fd-body-sm fd-muted", children: [
|
|
9033
9042
|
s.where,
|
|
9034
9043
|
" \xB7 ",
|
|
9035
9044
|
s.when
|
|
9036
9045
|
] })
|
|
9037
9046
|
] }),
|
|
9038
|
-
s.current ? /* @__PURE__ */
|
|
9047
|
+
s.current ? /* @__PURE__ */ jsx84(Badge, { tone: "success", dot: true, children: "This device" }) : /* @__PURE__ */ jsx84(Button, { size: "sm", variant: "ghost", children: "Revoke" })
|
|
9039
9048
|
] }, s.id)) })
|
|
9040
9049
|
}
|
|
9041
9050
|
) : null,
|
|
@@ -9050,16 +9059,16 @@ function ProfilePage({
|
|
|
9050
9059
|
border: "1px solid var(--border)",
|
|
9051
9060
|
boxShadow: "0 -4px 16px rgba(11,13,17,.06)"
|
|
9052
9061
|
}, children: [
|
|
9053
|
-
/* @__PURE__ */
|
|
9054
|
-
/* @__PURE__ */
|
|
9055
|
-
/* @__PURE__ */
|
|
9062
|
+
/* @__PURE__ */ jsx84("span", { className: "fd-body-sm", style: { fontWeight: 600, flex: 1 }, children: saved ? "Saved." : dirty ? "Unsaved changes" : "No pending changes" }),
|
|
9063
|
+
/* @__PURE__ */ jsx84(Button, { size: "sm", variant: "ghost", disabled: !dirty || saving, onClick: discard, children: "Discard" }),
|
|
9064
|
+
/* @__PURE__ */ jsx84(Button, { size: "sm", icon: "check", disabled: !dirty || !canSave, loading: saving, onClick: save, children: "Save changes" })
|
|
9056
9065
|
] })
|
|
9057
9066
|
] });
|
|
9058
9067
|
}
|
|
9059
9068
|
|
|
9060
9069
|
// src/components/platform/SessionScreen.tsx
|
|
9061
9070
|
import * as React61 from "react";
|
|
9062
|
-
import { Fragment as Fragment21, jsx as
|
|
9071
|
+
import { Fragment as Fragment21, jsx as jsx85, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
9063
9072
|
var COPY = {
|
|
9064
9073
|
"signing-in": { busy: "Signing you in\u2026" },
|
|
9065
9074
|
"session-expired": { busy: "Your session expired \u2014 signing you back in\u2026" },
|
|
@@ -9081,19 +9090,19 @@ function SessionScreen({ kind, error, onRetry, productName }) {
|
|
|
9081
9090
|
React61.useEffect(() => {
|
|
9082
9091
|
titleRef.current?.focus({ preventScroll: true });
|
|
9083
9092
|
}, [failed]);
|
|
9084
|
-
return /* @__PURE__ */
|
|
9085
|
-
/* @__PURE__ */
|
|
9093
|
+
return /* @__PURE__ */ jsx85("main", { className: "fd-session-screen", children: /* @__PURE__ */ jsxs73("div", { className: "fd-session-screen-inner", children: [
|
|
9094
|
+
/* @__PURE__ */ jsx85("div", { className: "fd-session-screen-mark", "data-theme": "dark", children: /* @__PURE__ */ jsx85(FlytedeskMark, { size: "lg" }) }),
|
|
9086
9095
|
/* @__PURE__ */ jsxs73("div", { className: "fd-session-screen-frame", children: [
|
|
9087
|
-
/* @__PURE__ */
|
|
9088
|
-
/* @__PURE__ */
|
|
9089
|
-
/* @__PURE__ */
|
|
9090
|
-
/* @__PURE__ */
|
|
9091
|
-
/* @__PURE__ */
|
|
9092
|
-
/* @__PURE__ */
|
|
9096
|
+
/* @__PURE__ */ jsx85("div", { className: "fd-session-screen-stripe" }),
|
|
9097
|
+
/* @__PURE__ */ jsx85(Card, { children: /* @__PURE__ */ jsxs73("div", { className: "fd-session-screen-body", children: [
|
|
9098
|
+
/* @__PURE__ */ jsx85("h1", { ref: titleRef, tabIndex: -1, className: "fd-h3 fd-session-screen-title", children: productName }),
|
|
9099
|
+
/* @__PURE__ */ jsx85("div", { role: "status", "aria-live": "polite", className: "fd-session-screen-status", children: busyMessage !== null ? /* @__PURE__ */ jsxs73(Fragment21, { children: [
|
|
9100
|
+
/* @__PURE__ */ jsx85("span", { className: "fd-spinner fd-spinner-lg fd-session-screen-spinner", "aria-hidden": "true" }),
|
|
9101
|
+
/* @__PURE__ */ jsx85("p", { className: "fd-body fd-session-screen-message", children: announced })
|
|
9093
9102
|
] }) : null }),
|
|
9094
9103
|
failureTitle !== null ? /* @__PURE__ */ jsxs73("div", { className: "fd-session-screen-failure", children: [
|
|
9095
|
-
/* @__PURE__ */
|
|
9096
|
-
onRetry !== null ? /* @__PURE__ */
|
|
9104
|
+
/* @__PURE__ */ jsx85(Banner, { tone: "danger", title: failureTitle, detail: error ?? void 0 }),
|
|
9105
|
+
onRetry !== null ? /* @__PURE__ */ jsx85(Button, { variant: "primary", block: true, onClick: onRetry, children: "Try again" }) : null
|
|
9097
9106
|
] }) : null
|
|
9098
9107
|
] }) })
|
|
9099
9108
|
] })
|
|
@@ -10916,7 +10925,7 @@ var UseRuntimeMode = useRuntimeMode;
|
|
|
10916
10925
|
var UseFeatureStatus = useFeatureStatus;
|
|
10917
10926
|
|
|
10918
10927
|
// src/components/platform/RoadmapTimeline.tsx
|
|
10919
|
-
import { jsx as
|
|
10928
|
+
import { jsx as jsx86, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
10920
10929
|
var STATUS = {
|
|
10921
10930
|
shipped: { tone: "success", icon: "check-circle", label: "Wired" },
|
|
10922
10931
|
next: { tone: "warning", icon: "traffic-cone", label: "Not wired" },
|
|
@@ -10931,43 +10940,43 @@ function RoadmapCard({ item, byKey, onOpenFlag }) {
|
|
|
10931
10940
|
const s = STATUS[item.status] || STATUS.planned;
|
|
10932
10941
|
const deps = (item.dependsOn || []).map((k) => byKey[k]).filter(Boolean);
|
|
10933
10942
|
const blocking = deps.filter((d) => !d.implemented);
|
|
10934
|
-
return /* @__PURE__ */
|
|
10943
|
+
return /* @__PURE__ */ jsx86(Card, { elevation: "flat", children: /* @__PURE__ */ jsxs74("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
10935
10944
|
/* @__PURE__ */ jsxs74("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: [
|
|
10936
|
-
/* @__PURE__ */
|
|
10937
|
-
/* @__PURE__ */
|
|
10938
|
-
/* @__PURE__ */
|
|
10945
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-body", style: { fontWeight: 700, flex: 1, minWidth: 140 }, children: item.label }),
|
|
10946
|
+
/* @__PURE__ */ jsx86(Badge, { tone: "neutral", icon: PROJECT_ICON[item.project] || "squares-four", children: item.project }),
|
|
10947
|
+
/* @__PURE__ */ jsx86(Badge, { tone: s.tone, icon: s.icon, children: s.label })
|
|
10939
10948
|
] }),
|
|
10940
|
-
/* @__PURE__ */
|
|
10949
|
+
/* @__PURE__ */ jsx86("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: item.description }),
|
|
10941
10950
|
item.backend ? /* @__PURE__ */ jsxs74("div", { className: "fd-row", style: { gap: 10, alignItems: "flex-start" }, children: [
|
|
10942
|
-
/* @__PURE__ */
|
|
10943
|
-
/* @__PURE__ */
|
|
10951
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-overline fd-muted", style: { width: 62, flex: "none", paddingTop: 2 }, children: "Backend" }),
|
|
10952
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-body-sm", style: { flex: 1, textWrap: "pretty" }, children: item.backend })
|
|
10944
10953
|
] }) : null,
|
|
10945
10954
|
/* @__PURE__ */ jsxs74("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
|
|
10946
10955
|
item.effort ? /* @__PURE__ */ jsxs74("span", { className: "fd-body-sm fd-muted", children: [
|
|
10947
|
-
/* @__PURE__ */
|
|
10956
|
+
/* @__PURE__ */ jsx86("i", { className: "ph ph-hourglass-medium" }),
|
|
10948
10957
|
" ",
|
|
10949
10958
|
item.effort
|
|
10950
10959
|
] }) : null,
|
|
10951
10960
|
/* @__PURE__ */ jsxs74("span", { className: "fd-body-sm fd-muted", children: [
|
|
10952
|
-
/* @__PURE__ */
|
|
10961
|
+
/* @__PURE__ */ jsx86("i", { className: "ph ph-user" }),
|
|
10953
10962
|
" ",
|
|
10954
10963
|
item.owner
|
|
10955
10964
|
] }),
|
|
10956
|
-
item.screen ? /* @__PURE__ */
|
|
10957
|
-
/* @__PURE__ */
|
|
10958
|
-
/* @__PURE__ */
|
|
10965
|
+
item.screen ? /* @__PURE__ */ jsx86(Badge, { tone: "neutral", icon: "browser", children: "screen" }) : null,
|
|
10966
|
+
/* @__PURE__ */ jsx86("span", { style: { flex: 1 } }),
|
|
10967
|
+
/* @__PURE__ */ jsx86(
|
|
10959
10968
|
"button",
|
|
10960
10969
|
{
|
|
10961
10970
|
type: "button",
|
|
10962
10971
|
onClick: () => onOpenFlag && onOpenFlag(item.key),
|
|
10963
10972
|
style: { all: "unset", cursor: "pointer", display: "inline-flex", alignItems: "center", gap: 5 },
|
|
10964
|
-
children: /* @__PURE__ */
|
|
10973
|
+
children: /* @__PURE__ */ jsx86("code", { className: "fd-mono", style: { fontSize: 11, color: "var(--brand)" }, children: item.key })
|
|
10965
10974
|
}
|
|
10966
10975
|
)
|
|
10967
10976
|
] }),
|
|
10968
10977
|
deps.length ? /* @__PURE__ */ jsxs74("div", { className: "fd-row", style: { gap: 6, flexWrap: "wrap", paddingTop: 6, borderTop: "1px solid var(--border)" }, children: [
|
|
10969
|
-
/* @__PURE__ */
|
|
10970
|
-
deps.map((d) => /* @__PURE__ */
|
|
10978
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-overline fd-muted", style: { paddingTop: 3 }, children: "After" }),
|
|
10979
|
+
deps.map((d) => /* @__PURE__ */ jsx86(Tag, { icon: d.implemented ? "check" : "clock", children: d.label }, d.key))
|
|
10971
10980
|
] }) : null,
|
|
10972
10981
|
blocking.length && !item.implemented ? /* @__PURE__ */ jsxs74("span", { className: "fd-body-sm", style: { color: "var(--warn-text)" }, children: [
|
|
10973
10982
|
"Blocked until ",
|
|
@@ -11024,21 +11033,21 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
11024
11033
|
let lastPhase = null;
|
|
11025
11034
|
return /* @__PURE__ */ jsxs74("div", { className: "fd-stack", style: { gap: 16, maxWidth: 1e3 }, children: [
|
|
11026
11035
|
/* @__PURE__ */ jsxs74("div", { className: "fd-stack", style: { gap: 10 }, children: [
|
|
11027
|
-
/* @__PURE__ */
|
|
11028
|
-
/* @__PURE__ */
|
|
11029
|
-
/* @__PURE__ */
|
|
11036
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-overline fd-muted", children: "Architecture" }),
|
|
11037
|
+
/* @__PURE__ */ jsx86("h1", { className: "fd-h1", style: { margin: 0 }, children: title }),
|
|
11038
|
+
/* @__PURE__ */ jsx86("p", { className: "fd-body fd-secondary fd-prose", style: { margin: 0 }, children: lede || "Every screen and feature in these tools is already designed and working against a simulated backend. This is the plan for connecting them to the real one \u2014 so the only work described here is server work." })
|
|
11030
11039
|
] }),
|
|
11031
11040
|
/* @__PURE__ */ jsxs74("div", { className: "fd-grid-stats is-thin", children: [
|
|
11032
|
-
/* @__PURE__ */
|
|
11033
|
-
/* @__PURE__ */
|
|
11034
|
-
/* @__PURE__ */
|
|
11035
|
-
/* @__PURE__ */
|
|
11041
|
+
/* @__PURE__ */ jsx86(StatTile, { compact: true, label: "Wired", value: String(rm.shipped), sub: "of " + rm.items.length + " features" }),
|
|
11042
|
+
/* @__PURE__ */ jsx86(StatTile, { compact: true, label: "Remaining", value: String(rm.remaining), sub: "backend work" }),
|
|
11043
|
+
/* @__PURE__ */ jsx86(StatTile, { compact: true, label: "Est. effort", value: days ? days + " days" : "\u2014", sub: "sum of estimates, not calendar" }),
|
|
11044
|
+
/* @__PURE__ */ jsx86(StatTile, { compact: true, label: "Up next", value: nextPhase ? "Phase " + nextPhase.phase : "\u2014", sub: nextPhase ? nextPhase.phaseName : "all wired" })
|
|
11036
11045
|
] }),
|
|
11037
11046
|
/* @__PURE__ */ jsxs74("div", { className: "fd-row", style: { gap: 10, flexWrap: "wrap" }, children: [
|
|
11038
|
-
/* @__PURE__ */
|
|
11039
|
-
/* @__PURE__ */
|
|
11040
|
-
/* @__PURE__ */
|
|
11041
|
-
/* @__PURE__ */
|
|
11047
|
+
/* @__PURE__ */ jsx86(Input, { icon: "magnifying-glass", placeholder: "Find a feature or a piece of backend work", value: q, onChange: (e) => setQ(e.target.value), style: { width: 300 } }),
|
|
11048
|
+
/* @__PURE__ */ jsx86(Select, { placeholder: "All projects", value: project, onChange: (e) => setProject(e.target.value), options: projects, style: { width: 190 } }),
|
|
11049
|
+
/* @__PURE__ */ jsx86("span", { style: { flex: 1 } }),
|
|
11050
|
+
/* @__PURE__ */ jsx86(
|
|
11042
11051
|
Button,
|
|
11043
11052
|
{
|
|
11044
11053
|
size: "sm",
|
|
@@ -11052,7 +11061,7 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
11052
11061
|
}
|
|
11053
11062
|
)
|
|
11054
11063
|
] }),
|
|
11055
|
-
/* @__PURE__ */
|
|
11064
|
+
/* @__PURE__ */ jsx86(
|
|
11056
11065
|
Flag,
|
|
11057
11066
|
{
|
|
11058
11067
|
tone: "info",
|
|
@@ -11061,8 +11070,8 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
11061
11070
|
actions: null
|
|
11062
11071
|
}
|
|
11063
11072
|
),
|
|
11064
|
-
/* @__PURE__ */
|
|
11065
|
-
/* @__PURE__ */
|
|
11073
|
+
/* @__PURE__ */ jsx86("div", { className: "fd-rm", children: /* @__PURE__ */ jsx86("div", { className: "fd-rm-scroll", ref: scrollRef, children: /* @__PURE__ */ jsxs74("div", { className: "fd-rm-track", children: [
|
|
11074
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-rm-spine", children: /* @__PURE__ */ jsx86("span", { className: "fd-rm-spine-done", style: { height: items.length ? 100 * shippedShown / items.length + "%" : "0%" } }) }),
|
|
11066
11075
|
items.map((item, n) => {
|
|
11067
11076
|
const showPhase = item.phase !== lastPhase;
|
|
11068
11077
|
lastPhase = item.phase;
|
|
@@ -11071,7 +11080,7 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
11071
11080
|
return /* @__PURE__ */ jsxs74(React64.Fragment, { children: [
|
|
11072
11081
|
showPhase ? /* @__PURE__ */ jsxs74("div", { className: "fd-rm-era", children: [
|
|
11073
11082
|
/* @__PURE__ */ jsxs74("span", { className: "fd-row", style: { gap: 8, flexWrap: "wrap", alignItems: "baseline" }, children: [
|
|
11074
|
-
/* @__PURE__ */
|
|
11083
|
+
/* @__PURE__ */ jsx86("span", { style: { fontWeight: 700 }, children: item.phase === 0 ? "Shipped" : "Phase " + item.phase + " \u2014 " + item.phaseName }),
|
|
11075
11084
|
item.phase === 0 ? null : /* @__PURE__ */ jsxs74("span", { className: "fd-mono", style: { opacity: 0.7, fontWeight: 400 }, children: [
|
|
11076
11085
|
fmtDate(item.phaseStart),
|
|
11077
11086
|
" \u2013 ",
|
|
@@ -11084,28 +11093,28 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
11084
11093
|
inPhase === 1 ? "" : "s"
|
|
11085
11094
|
] })
|
|
11086
11095
|
] }),
|
|
11087
|
-
item.phaseWhy ? /* @__PURE__ */
|
|
11096
|
+
item.phaseWhy ? /* @__PURE__ */ jsx86("p", { className: "fd-rm-era-why", children: item.phaseWhy }) : null
|
|
11088
11097
|
] }) : null,
|
|
11089
|
-
isBoundary ? /* @__PURE__ */
|
|
11090
|
-
/* @__PURE__ */
|
|
11098
|
+
isBoundary ? /* @__PURE__ */ jsx86("div", { className: "fd-rm-now", ref: nowRef, children: /* @__PURE__ */ jsxs74("span", { className: "fd-rm-now-pill", children: [
|
|
11099
|
+
/* @__PURE__ */ jsx86("i", { className: "ph ph-map-pin" }),
|
|
11091
11100
|
" You are here \u2014 everything above is wired"
|
|
11092
11101
|
] }) }) : null,
|
|
11093
11102
|
/* @__PURE__ */ jsxs74("div", { className: "fd-rm-row", children: [
|
|
11094
|
-
/* @__PURE__ */
|
|
11103
|
+
/* @__PURE__ */ jsx86("span", { className: "fd-rm-dot " + (item.implemented ? "is-shipped" : item.status === "next" ? "is-next" : "") }),
|
|
11095
11104
|
/* @__PURE__ */ jsxs74("div", { className: "fd-rm-date", children: [
|
|
11096
11105
|
fmtDate(item.date),
|
|
11097
|
-
/* @__PURE__ */
|
|
11098
|
-
/* @__PURE__ */
|
|
11106
|
+
/* @__PURE__ */ jsx86("br", {}),
|
|
11107
|
+
/* @__PURE__ */ jsx86("span", { style: { opacity: 0.75 }, children: item.implemented ? "shipped" : "phase " + item.phase })
|
|
11099
11108
|
] }),
|
|
11100
|
-
/* @__PURE__ */
|
|
11109
|
+
/* @__PURE__ */ jsx86(RoadmapCard, { item, byKey, onOpenFlag })
|
|
11101
11110
|
] })
|
|
11102
11111
|
] }, item.key);
|
|
11103
11112
|
}),
|
|
11104
|
-
!items.length ? /* @__PURE__ */
|
|
11113
|
+
!items.length ? /* @__PURE__ */ jsx86("p", { className: "fd-body-sm fd-muted", children: "Nothing matches that filter." }) : null
|
|
11105
11114
|
] }) }) }),
|
|
11106
11115
|
/* @__PURE__ */ jsxs74("p", { className: "fd-body-sm fd-muted", style: { margin: 0 }, children: [
|
|
11107
11116
|
"Derived from the feature-flag registry \u2014 each entry's status is its flag's ",
|
|
11108
|
-
/* @__PURE__ */
|
|
11117
|
+
/* @__PURE__ */ jsx86("code", { className: "fd-mono", children: "implemented" }),
|
|
11109
11118
|
" field, so this page cannot drift from what the apps actually do."
|
|
11110
11119
|
] })
|
|
11111
11120
|
] });
|
|
@@ -11114,7 +11123,7 @@ function RoadmapTimeline({ onOpenFlag, title = "Roadmap", lede }) {
|
|
|
11114
11123
|
// src/components/platform/ComingSoon.tsx
|
|
11115
11124
|
import * as React65 from "react";
|
|
11116
11125
|
import { createPortal as createPortal6 } from "react-dom";
|
|
11117
|
-
import { Fragment as Fragment23, jsx as
|
|
11126
|
+
import { Fragment as Fragment23, jsx as jsx87, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
11118
11127
|
var BYPASS_STORE = "fd.soon.bypass.v1";
|
|
11119
11128
|
function readBypassed() {
|
|
11120
11129
|
try {
|
|
@@ -11146,33 +11155,33 @@ function useBypass(key) {
|
|
|
11146
11155
|
function SoonCard({ label, detail, backend, eta, effort, onRoadmap, allowed, onBypass }) {
|
|
11147
11156
|
return /* @__PURE__ */ jsxs75(Fragment23, { children: [
|
|
11148
11157
|
/* @__PURE__ */ jsxs75("span", { className: "fd-soon-badge", children: [
|
|
11149
|
-
/* @__PURE__ */
|
|
11158
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" }),
|
|
11150
11159
|
label
|
|
11151
11160
|
] }),
|
|
11152
|
-
detail ? /* @__PURE__ */
|
|
11161
|
+
detail ? /* @__PURE__ */ jsx87("span", { className: "fd-soon-detail", children: detail }) : null,
|
|
11153
11162
|
backend ? /* @__PURE__ */ jsxs75("span", { className: "fd-soon-backend", children: [
|
|
11154
|
-
/* @__PURE__ */
|
|
11163
|
+
/* @__PURE__ */ jsx87("span", { className: "fd-overline", children: "Needs" }),
|
|
11155
11164
|
" ",
|
|
11156
11165
|
backend
|
|
11157
11166
|
] }) : null,
|
|
11158
11167
|
eta || effort || onRoadmap ? /* @__PURE__ */ jsxs75("span", { className: "fd-soon-meta", children: [
|
|
11159
11168
|
eta ? /* @__PURE__ */ jsxs75("span", { children: [
|
|
11160
|
-
/* @__PURE__ */
|
|
11169
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-calendar-blank", "aria-hidden": "true" }),
|
|
11161
11170
|
" ",
|
|
11162
11171
|
eta
|
|
11163
11172
|
] }) : null,
|
|
11164
11173
|
effort ? /* @__PURE__ */ jsxs75("span", { children: [
|
|
11165
|
-
/* @__PURE__ */
|
|
11174
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-hourglass-medium", "aria-hidden": "true" }),
|
|
11166
11175
|
" ",
|
|
11167
11176
|
effort
|
|
11168
11177
|
] }) : null,
|
|
11169
11178
|
onRoadmap ? /* @__PURE__ */ jsxs75("button", { type: "button", className: "fd-soon-link", onClick: onRoadmap, children: [
|
|
11170
11179
|
"See the roadmap ",
|
|
11171
|
-
/* @__PURE__ */
|
|
11180
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-arrow-right", "aria-hidden": "true" })
|
|
11172
11181
|
] }) : null
|
|
11173
11182
|
] }) : null,
|
|
11174
11183
|
allowed ? /* @__PURE__ */ jsxs75("button", { type: "button", className: "fd-soon-view", onClick: onBypass, children: [
|
|
11175
|
-
/* @__PURE__ */
|
|
11184
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-eye", "aria-hidden": "true" }),
|
|
11176
11185
|
" View and use it anyway"
|
|
11177
11186
|
] }) : null
|
|
11178
11187
|
] });
|
|
@@ -11234,7 +11243,7 @@ function ComingSoon({
|
|
|
11234
11243
|
if (allowed && bypassed) {
|
|
11235
11244
|
return /* @__PURE__ */ jsxs75("span", { className: ["fd-soon-inline-on", className].filter(Boolean).join(" "), ...rest, children: [
|
|
11236
11245
|
children,
|
|
11237
|
-
/* @__PURE__ */
|
|
11246
|
+
/* @__PURE__ */ jsx87(
|
|
11238
11247
|
"button",
|
|
11239
11248
|
{
|
|
11240
11249
|
type: "button",
|
|
@@ -11242,12 +11251,12 @@ function ComingSoon({
|
|
|
11242
11251
|
title: "Unwired \u2014 writes go to the simulated backend. " + tip + " Click to re-blur.",
|
|
11243
11252
|
onClick: () => setBypassed(false),
|
|
11244
11253
|
"aria-label": "Re-blur this unwired feature",
|
|
11245
|
-
children: /* @__PURE__ */
|
|
11254
|
+
children: /* @__PURE__ */ jsx87("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" })
|
|
11246
11255
|
}
|
|
11247
11256
|
)
|
|
11248
11257
|
] });
|
|
11249
11258
|
}
|
|
11250
|
-
return /* @__PURE__ */
|
|
11259
|
+
return /* @__PURE__ */ jsx87(
|
|
11251
11260
|
InlineSoon,
|
|
11252
11261
|
{
|
|
11253
11262
|
label,
|
|
@@ -11270,17 +11279,17 @@ function ComingSoon({
|
|
|
11270
11279
|
return /* @__PURE__ */ jsxs75("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 14 }, ...rest, children: [
|
|
11271
11280
|
/* @__PURE__ */ jsxs75("div", { className: "fd-soon-bar", role: "status", children: [
|
|
11272
11281
|
/* @__PURE__ */ jsxs75("span", { className: "fd-soon-badge", children: [
|
|
11273
|
-
/* @__PURE__ */
|
|
11282
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" }),
|
|
11274
11283
|
"Unwired feature \u2014 you are using it anyway"
|
|
11275
11284
|
] }),
|
|
11276
|
-
/* @__PURE__ */
|
|
11285
|
+
/* @__PURE__ */ jsx87("span", { className: "fd-soon-bar-detail", children: "Every action here writes to the simulated backend, so nothing you do persists beyond this session." }),
|
|
11277
11286
|
/* @__PURE__ */ jsxs75("span", { className: "fd-soon-bar-actions", children: [
|
|
11278
11287
|
onRoadmap ? /* @__PURE__ */ jsxs75("button", { type: "button", className: "fd-soon-link", onClick: onRoadmap, children: [
|
|
11279
11288
|
"Roadmap ",
|
|
11280
|
-
/* @__PURE__ */
|
|
11289
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-arrow-right", "aria-hidden": "true" })
|
|
11281
11290
|
] }) : null,
|
|
11282
11291
|
/* @__PURE__ */ jsxs75("button", { type: "button", className: "fd-soon-link", onClick: () => setBypassed(false), children: [
|
|
11283
|
-
/* @__PURE__ */
|
|
11292
|
+
/* @__PURE__ */ jsx87("i", { className: "ph ph-eye-slash", "aria-hidden": "true" }),
|
|
11284
11293
|
" Re-blur"
|
|
11285
11294
|
] })
|
|
11286
11295
|
] })
|
|
@@ -11289,9 +11298,9 @@ function ComingSoon({
|
|
|
11289
11298
|
] });
|
|
11290
11299
|
}
|
|
11291
11300
|
return /* @__PURE__ */ jsxs75("div", { className: ["fd-soon", className].filter(Boolean).join(" "), style: minHeight ? { minHeight } : void 0, ...rest, children: [
|
|
11292
|
-
/* @__PURE__ */
|
|
11293
|
-
/* @__PURE__ */
|
|
11294
|
-
/* @__PURE__ */
|
|
11301
|
+
/* @__PURE__ */ jsx87("div", { className: "fd-soon-under", style: { filter: "blur(" + blur + "px) saturate(.62)" }, ...{ inert: "" }, "aria-hidden": "true", children }),
|
|
11302
|
+
/* @__PURE__ */ jsx87("div", { className: "fd-soon-veil" }),
|
|
11303
|
+
/* @__PURE__ */ jsx87("div", { className: "fd-soon-note", role: "note", children: /* @__PURE__ */ jsx87(
|
|
11295
11304
|
SoonCard,
|
|
11296
11305
|
{
|
|
11297
11306
|
label,
|
|
@@ -11342,8 +11351,8 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
11342
11351
|
onBlur: hide,
|
|
11343
11352
|
...rest,
|
|
11344
11353
|
children: [
|
|
11345
|
-
/* @__PURE__ */
|
|
11346
|
-
/* @__PURE__ */
|
|
11354
|
+
/* @__PURE__ */ jsx87("span", { className: "fd-soon-under", style: { filter: "blur(" + Math.min(blur, 1.1) + "px) saturate(.66)" }, ...{ inert: "" }, "aria-hidden": "true", children }),
|
|
11355
|
+
/* @__PURE__ */ jsx87(
|
|
11347
11356
|
"button",
|
|
11348
11357
|
{
|
|
11349
11358
|
type: "button",
|
|
@@ -11354,11 +11363,11 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
11354
11363
|
onFocus: show,
|
|
11355
11364
|
onBlur: hide,
|
|
11356
11365
|
onClick: () => open2 ? setOpen(false) : show(),
|
|
11357
|
-
children: /* @__PURE__ */
|
|
11366
|
+
children: /* @__PURE__ */ jsx87("i", { className: "ph ph-traffic-cone", "aria-hidden": "true" })
|
|
11358
11367
|
}
|
|
11359
11368
|
),
|
|
11360
11369
|
open2 && pos ? createPortal6(
|
|
11361
|
-
/* @__PURE__ */
|
|
11370
|
+
/* @__PURE__ */ jsx87(
|
|
11362
11371
|
"div",
|
|
11363
11372
|
{
|
|
11364
11373
|
ref: hoverCardRef,
|
|
@@ -11367,7 +11376,7 @@ function InlineSoon({ label, detail, backend, eta, effort, onRoadmap, allowed, o
|
|
|
11367
11376
|
style: { position: "fixed", left: pos.left, top: pos.top, bottom: pos.bottom, width: pos.width, zIndex },
|
|
11368
11377
|
onMouseEnter: show,
|
|
11369
11378
|
onMouseLeave: hide,
|
|
11370
|
-
children: /* @__PURE__ */
|
|
11379
|
+
children: /* @__PURE__ */ jsx87(
|
|
11371
11380
|
SoonCard,
|
|
11372
11381
|
{
|
|
11373
11382
|
label,
|
|
@@ -11397,7 +11406,7 @@ function formatEta(iso2) {
|
|
|
11397
11406
|
var FormatEta = formatEta;
|
|
11398
11407
|
|
|
11399
11408
|
// src/components/platform/Gate.tsx
|
|
11400
|
-
import { jsx as
|
|
11409
|
+
import { jsx as jsx88, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
11401
11410
|
function PermissionDenied({ permission, title, detail, compact: compact3 = false, className = "", ...rest }) {
|
|
11402
11411
|
const need = Array.isArray(permission) ? permission : [permission].filter(Boolean);
|
|
11403
11412
|
return /* @__PURE__ */ jsxs76(
|
|
@@ -11417,13 +11426,13 @@ function PermissionDenied({ permission, title, detail, compact: compact3 = false
|
|
|
11417
11426
|
...rest,
|
|
11418
11427
|
children: [
|
|
11419
11428
|
/* @__PURE__ */ jsxs76("span", { className: "fd-row", style: { gap: 8 }, children: [
|
|
11420
|
-
/* @__PURE__ */
|
|
11421
|
-
/* @__PURE__ */
|
|
11429
|
+
/* @__PURE__ */ jsx88("i", { className: "ph ph-lock-simple", style: { fontSize: 16, color: "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
11430
|
+
/* @__PURE__ */ jsx88("span", { className: compact3 ? "fd-label-lg" : "fd-h3", children: title || "You do not have access to this" })
|
|
11422
11431
|
] }),
|
|
11423
|
-
/* @__PURE__ */
|
|
11432
|
+
/* @__PURE__ */ jsx88("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: detail || "Your roles do not grant this. An administrator can change that from Admin \u2192 Users." }),
|
|
11424
11433
|
need.length ? /* @__PURE__ */ jsxs76("span", { className: "fd-row", style: { gap: 6, flexWrap: "wrap" }, children: [
|
|
11425
|
-
/* @__PURE__ */
|
|
11426
|
-
need.map((p) => /* @__PURE__ */
|
|
11434
|
+
/* @__PURE__ */ jsx88("span", { className: "fd-overline fd-muted", children: "Requires" }),
|
|
11435
|
+
need.map((p) => /* @__PURE__ */ jsx88("code", { className: "fd-mono", style: {
|
|
11427
11436
|
fontSize: 11.5,
|
|
11428
11437
|
padding: "2px 7px",
|
|
11429
11438
|
borderRadius: 5,
|
|
@@ -11453,10 +11462,10 @@ function GatePending({ compact: compact3 = false, className = "" }) {
|
|
|
11453
11462
|
},
|
|
11454
11463
|
children: [
|
|
11455
11464
|
/* @__PURE__ */ jsxs76("span", { className: "fd-row", style: { gap: 8 }, children: [
|
|
11456
|
-
/* @__PURE__ */
|
|
11457
|
-
/* @__PURE__ */
|
|
11465
|
+
/* @__PURE__ */ jsx88("i", { className: "ph ph-arrows-clockwise", style: { fontSize: 16, color: "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
11466
|
+
/* @__PURE__ */ jsx88("span", { className: compact3 ? "fd-label-lg" : "fd-h3", children: "Reconnecting\u2026" })
|
|
11458
11467
|
] }),
|
|
11459
|
-
/* @__PURE__ */
|
|
11468
|
+
/* @__PURE__ */ jsx88("p", { className: "fd-body-sm fd-secondary", style: { margin: 0, textWrap: "pretty" }, children: "Your access can't be verified right now. This will resolve on its own once the connection is back." })
|
|
11460
11469
|
]
|
|
11461
11470
|
}
|
|
11462
11471
|
);
|
|
@@ -11466,7 +11475,7 @@ function Gate({ perm, anyOf, role, silent = false, fallback, pendingFallback, co
|
|
|
11466
11475
|
if (pending) {
|
|
11467
11476
|
if (pendingFallback !== void 0) return pendingFallback;
|
|
11468
11477
|
if (silent) return null;
|
|
11469
|
-
return /* @__PURE__ */
|
|
11478
|
+
return /* @__PURE__ */ jsx88(GatePending, { compact: compact3 });
|
|
11470
11479
|
}
|
|
11471
11480
|
let ok = true;
|
|
11472
11481
|
if (perm) ok = ok && can2(perm);
|
|
@@ -11475,7 +11484,7 @@ function Gate({ perm, anyOf, role, silent = false, fallback, pendingFallback, co
|
|
|
11475
11484
|
if (ok) return children;
|
|
11476
11485
|
if (fallback !== void 0) return fallback;
|
|
11477
11486
|
if (silent) return null;
|
|
11478
|
-
return /* @__PURE__ */
|
|
11487
|
+
return /* @__PURE__ */ jsx88(PermissionDenied, { permission: perm || anyOf, compact: compact3 });
|
|
11479
11488
|
}
|
|
11480
11489
|
function FeatureGate({
|
|
11481
11490
|
flag,
|
|
@@ -11498,7 +11507,7 @@ function FeatureGate({
|
|
|
11498
11507
|
const f = SessionKit.findFlag(flag) || {};
|
|
11499
11508
|
const missing = rt.missing || [];
|
|
11500
11509
|
const canBypass = pending ? false : bypassPerm === null ? false : !bypassPerm || can2(bypassPerm);
|
|
11501
|
-
return /* @__PURE__ */
|
|
11510
|
+
return /* @__PURE__ */ jsx88(
|
|
11502
11511
|
ComingSoon,
|
|
11503
11512
|
{
|
|
11504
11513
|
label: label || (variant === "inline" ? f.label || "Not wired yet" : "Designed \u2014 backend not wired yet"),
|
|
@@ -11519,22 +11528,22 @@ function FeatureGate({
|
|
|
11519
11528
|
function PermissionHint({ perm, children }) {
|
|
11520
11529
|
const { can: can2, pending } = useSessionContext();
|
|
11521
11530
|
if (pending) {
|
|
11522
|
-
return /* @__PURE__ */
|
|
11531
|
+
return /* @__PURE__ */ jsx88("span", { title: "Access can't be verified right now", style: { display: "inline-flex", opacity: 0.45, cursor: "not-allowed" }, "aria-disabled": "true", children: /* @__PURE__ */ jsx88("span", { style: { pointerEvents: "none" }, children }) });
|
|
11523
11532
|
}
|
|
11524
11533
|
if (can2(perm)) return children;
|
|
11525
|
-
return /* @__PURE__ */
|
|
11534
|
+
return /* @__PURE__ */ jsx88(
|
|
11526
11535
|
"span",
|
|
11527
11536
|
{
|
|
11528
11537
|
title: "Requires " + (Array.isArray(perm) ? perm.join(", ") : perm),
|
|
11529
11538
|
style: { display: "inline-flex", opacity: 0.45, cursor: "not-allowed" },
|
|
11530
11539
|
"aria-disabled": "true",
|
|
11531
|
-
children: /* @__PURE__ */
|
|
11540
|
+
children: /* @__PURE__ */ jsx88("span", { style: { pointerEvents: "none" }, children })
|
|
11532
11541
|
}
|
|
11533
11542
|
);
|
|
11534
11543
|
}
|
|
11535
11544
|
|
|
11536
11545
|
// src/components/platform/ModeSwitch.tsx
|
|
11537
|
-
import { Fragment as Fragment24, jsx as
|
|
11546
|
+
import { Fragment as Fragment24, jsx as jsx89, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
11538
11547
|
function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog, onOpenSpec, summary }) {
|
|
11539
11548
|
const mode2 = useRuntimeMode();
|
|
11540
11549
|
const panel = useInlinePanel();
|
|
@@ -11557,15 +11566,15 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
|
|
|
11557
11566
|
title: test ? "Test mode \u2014 every response is simulated. Click to inspect requests or return to live mode." : "Live mode \u2014 incomplete features are shown under construction. Click for test mode.",
|
|
11558
11567
|
className: "fd-mode-btn" + (test ? " is-test" : "") + (open2 ? " is-open" : ""),
|
|
11559
11568
|
children: [
|
|
11560
|
-
/* @__PURE__ */
|
|
11561
|
-
test && requestCount ? /* @__PURE__ */
|
|
11569
|
+
/* @__PURE__ */ jsx89("i", { className: "ph " + (test ? "ph-flask" : "ph-lightning"), style: { fontSize: 17 } }),
|
|
11570
|
+
test && requestCount ? /* @__PURE__ */ jsx89("span", { className: "fd-mono fd-mode-count", children: requestCount > 99 ? "99+" : requestCount }, requestCount) : null
|
|
11562
11571
|
]
|
|
11563
11572
|
}
|
|
11564
11573
|
),
|
|
11565
11574
|
/* @__PURE__ */ jsxs77(InlinePanelSurface, { panel, align: "right", offset: 8, width: 400, className: "fd-mode-pop", label: test ? "Test mode" : "Live mode", children: [
|
|
11566
11575
|
/* @__PURE__ */ jsxs77("span", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
|
|
11567
11576
|
/* @__PURE__ */ jsxs77("span", { className: "fd-badge " + (test ? "fd-badge-warning" : "fd-badge-neutral"), children: [
|
|
11568
|
-
/* @__PURE__ */
|
|
11577
|
+
/* @__PURE__ */ jsx89("i", { className: "ph " + (test ? "ph-flask" : "ph-lightning"), "aria-hidden": "true" }),
|
|
11569
11578
|
test ? "Test mode" : "Live mode"
|
|
11570
11579
|
] }),
|
|
11571
11580
|
test ? /* @__PURE__ */ jsxs77("span", { className: "fd-body-sm fd-muted fd-mono", children: [
|
|
@@ -11573,11 +11582,11 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
|
|
|
11573
11582
|
" simulated request",
|
|
11574
11583
|
requestCount === 1 ? "" : "s"
|
|
11575
11584
|
] }) : null,
|
|
11576
|
-
/* @__PURE__ */
|
|
11577
|
-
test && onClearLog ? /* @__PURE__ */
|
|
11585
|
+
/* @__PURE__ */ jsx89("span", { style: { flex: 1 } }),
|
|
11586
|
+
test && onClearLog ? /* @__PURE__ */ jsx89("button", { type: "button", className: "fd-soon-link", onClick: onClearLog, children: "Clear" }) : null
|
|
11578
11587
|
] }),
|
|
11579
11588
|
/* @__PURE__ */ jsxs77("span", { style: { display: "block", padding: "12px 14px", borderBottom: "1px solid var(--border)" }, children: [
|
|
11580
|
-
/* @__PURE__ */
|
|
11589
|
+
/* @__PURE__ */ jsx89("span", { className: "fd-body-sm fd-secondary", style: { display: "block", textWrap: "pretty" }, children: test ? "Every feature is usable and nothing is obstructed, but no response comes from a real service \u2014 nothing you do here persists. Use this to review and demo the design." : "This is what a user would see today. " + s.incomplete + " of " + s.total + " features depend on backend work that is not wired yet, so they render under construction." }),
|
|
11581
11590
|
/* @__PURE__ */ jsxs77("span", { className: "fd-row", style: { gap: 8, marginTop: 10, flexWrap: "wrap" }, children: [
|
|
11582
11591
|
/* @__PURE__ */ jsxs77("span", { className: "fd-body-sm fd-muted fd-mono", children: [
|
|
11583
11592
|
s.endpointsWired,
|
|
@@ -11590,36 +11599,36 @@ function ModeSwitch({ canToggle = false, requestCount = 0, onClearLog, renderLog
|
|
|
11590
11599
|
" features complete"
|
|
11591
11600
|
] }),
|
|
11592
11601
|
onOpenSpec ? /* @__PURE__ */ jsxs77(Fragment24, { children: [
|
|
11593
|
-
/* @__PURE__ */
|
|
11602
|
+
/* @__PURE__ */ jsx89("span", { style: { flex: 1 } }),
|
|
11594
11603
|
/* @__PURE__ */ jsxs77("button", { type: "button", className: "fd-soon-link", onClick: () => {
|
|
11595
11604
|
setOpen(false);
|
|
11596
11605
|
onOpenSpec();
|
|
11597
11606
|
}, children: [
|
|
11598
11607
|
"API spec ",
|
|
11599
|
-
/* @__PURE__ */
|
|
11608
|
+
/* @__PURE__ */ jsx89("i", { className: "ph ph-arrow-right", "aria-hidden": "true" })
|
|
11600
11609
|
] })
|
|
11601
11610
|
] }) : null
|
|
11602
11611
|
] })
|
|
11603
11612
|
] }),
|
|
11604
11613
|
/* @__PURE__ */ jsxs77("span", { className: "fd-mode-choice", children: [
|
|
11605
11614
|
/* @__PURE__ */ jsxs77("button", { type: "button", className: "fd-mode-opt" + (!test ? " is-on" : ""), onClick: () => go("live"), children: [
|
|
11606
|
-
/* @__PURE__ */
|
|
11615
|
+
/* @__PURE__ */ jsx89("i", { className: "ph ph-lightning", "aria-hidden": "true" }),
|
|
11607
11616
|
/* @__PURE__ */ jsxs77("span", { className: "fd-mode-opt-text", children: [
|
|
11608
|
-
/* @__PURE__ */
|
|
11609
|
-
/* @__PURE__ */
|
|
11617
|
+
/* @__PURE__ */ jsx89("span", { className: "fd-mode-opt-title", children: "Live mode" }),
|
|
11618
|
+
/* @__PURE__ */ jsx89("span", { className: "fd-mode-opt-desc", children: "Incomplete features under construction" })
|
|
11610
11619
|
] }),
|
|
11611
|
-
!test ? /* @__PURE__ */
|
|
11620
|
+
!test ? /* @__PURE__ */ jsx89("i", { className: "ph ph-check", "aria-hidden": "true" }) : null
|
|
11612
11621
|
] }),
|
|
11613
11622
|
/* @__PURE__ */ jsxs77("button", { type: "button", className: "fd-mode-opt" + (test ? " is-on" : ""), onClick: () => go("test"), children: [
|
|
11614
|
-
/* @__PURE__ */
|
|
11623
|
+
/* @__PURE__ */ jsx89("i", { className: "ph ph-flask", "aria-hidden": "true" }),
|
|
11615
11624
|
/* @__PURE__ */ jsxs77("span", { className: "fd-mode-opt-text", children: [
|
|
11616
|
-
/* @__PURE__ */
|
|
11617
|
-
/* @__PURE__ */
|
|
11625
|
+
/* @__PURE__ */ jsx89("span", { className: "fd-mode-opt-title", children: "Test mode" }),
|
|
11626
|
+
/* @__PURE__ */ jsx89("span", { className: "fd-mode-opt-desc", children: "Everything usable, all data simulated" })
|
|
11618
11627
|
] }),
|
|
11619
|
-
test ? /* @__PURE__ */
|
|
11628
|
+
test ? /* @__PURE__ */ jsx89("i", { className: "ph ph-check", "aria-hidden": "true" }) : null
|
|
11620
11629
|
] })
|
|
11621
11630
|
] }),
|
|
11622
|
-
test && renderLog ? /* @__PURE__ */
|
|
11631
|
+
test && renderLog ? /* @__PURE__ */ jsx89("span", { style: { display: "block", maxHeight: 340, overflowY: "auto", borderTop: "1px solid var(--border)" }, children: renderLog() }) : null
|
|
11623
11632
|
] })
|
|
11624
11633
|
] });
|
|
11625
11634
|
}
|
|
@@ -11628,19 +11637,19 @@ function TestModeBar({ onExit }) {
|
|
|
11628
11637
|
if (mode2 !== "test") return null;
|
|
11629
11638
|
return /* @__PURE__ */ jsxs77("div", { className: "fd-testbar", role: "status", children: [
|
|
11630
11639
|
/* @__PURE__ */ jsxs77("span", { className: "fd-badge fd-badge-warning", children: [
|
|
11631
|
-
/* @__PURE__ */
|
|
11640
|
+
/* @__PURE__ */ jsx89("i", { className: "ph ph-flask", "aria-hidden": "true" }),
|
|
11632
11641
|
"Test mode"
|
|
11633
11642
|
] }),
|
|
11634
|
-
/* @__PURE__ */
|
|
11643
|
+
/* @__PURE__ */ jsx89("span", { className: "fd-testbar-detail", children: "Every feature is unlocked and every response is simulated \u2014 nothing here persists." }),
|
|
11635
11644
|
/* @__PURE__ */ jsxs77("button", { type: "button", className: "fd-soon-link", onClick: () => onExit ? onExit() : RuntimeKit.setMode("live"), children: [
|
|
11636
|
-
/* @__PURE__ */
|
|
11645
|
+
/* @__PURE__ */ jsx89("i", { className: "ph ph-lightning", "aria-hidden": "true" }),
|
|
11637
11646
|
" Back to live mode"
|
|
11638
11647
|
] })
|
|
11639
11648
|
] });
|
|
11640
11649
|
}
|
|
11641
11650
|
|
|
11642
11651
|
// src/components/planner/ChannelMeta.tsx
|
|
11643
|
-
import { jsx as
|
|
11652
|
+
import { jsx as jsx90, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
11644
11653
|
var CHANNEL_WEIGHTS = {
|
|
11645
11654
|
"OOH": 50,
|
|
11646
11655
|
"DOOH": 50,
|
|
@@ -11693,7 +11702,7 @@ function ChannelTag({ channel, size = "md", showLabel = true, dot = false, weigh
|
|
|
11693
11702
|
const m = ChannelMeta(channel);
|
|
11694
11703
|
const wt = channelWeightOf(channel || "");
|
|
11695
11704
|
if (dot) {
|
|
11696
|
-
return /* @__PURE__ */
|
|
11705
|
+
return /* @__PURE__ */ jsx90("span", { className: ["fd-chan-dot", className].filter(Boolean).join(" "), title: m.name, style: { background: m.color }, ...rest });
|
|
11697
11706
|
}
|
|
11698
11707
|
return /* @__PURE__ */ jsxs78(
|
|
11699
11708
|
"span",
|
|
@@ -11703,16 +11712,16 @@ function ChannelTag({ channel, size = "md", showLabel = true, dot = false, weigh
|
|
|
11703
11712
|
style: { "--chan": m.color },
|
|
11704
11713
|
...rest,
|
|
11705
11714
|
children: [
|
|
11706
|
-
/* @__PURE__ */
|
|
11707
|
-
showLabel ? /* @__PURE__ */
|
|
11708
|
-
weight ? /* @__PURE__ */
|
|
11715
|
+
/* @__PURE__ */ jsx90("i", { className: "ph ph-" + m.icon, "aria-hidden": "true" }),
|
|
11716
|
+
showLabel ? /* @__PURE__ */ jsx90("span", { className: "fd-chan-label", children: m.label }) : null,
|
|
11717
|
+
weight ? /* @__PURE__ */ jsx90("span", { className: "fd-chan-weight", children: wt || 0 }) : null
|
|
11709
11718
|
]
|
|
11710
11719
|
}
|
|
11711
11720
|
);
|
|
11712
11721
|
}
|
|
11713
11722
|
|
|
11714
11723
|
// src/components/planner/SaturationDistribution.tsx
|
|
11715
|
-
import { jsx as
|
|
11724
|
+
import { jsx as jsx91, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
11716
11725
|
var BANDS2 = [
|
|
11717
11726
|
{ key: "weak", label: "Weak", n: 1, range: "< 50" },
|
|
11718
11727
|
{ key: "adequate", label: "Adequate", n: 2, range: "50\u2013100" },
|
|
@@ -11724,7 +11733,7 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
11724
11733
|
const tallest = Math.max(1, ...grouped.map((g) => g.items.length));
|
|
11725
11734
|
const floor = BANDS2.find((b) => b.key === floorBand) || BANDS2[0];
|
|
11726
11735
|
return /* @__PURE__ */ jsxs79("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 16 }, children: [
|
|
11727
|
-
/* @__PURE__ */
|
|
11736
|
+
/* @__PURE__ */ jsx91("div", { style: { display: "grid", gridTemplateColumns: "repeat(4,minmax(0,1fr))", gap: 12, alignItems: "end" }, children: grouped.map((g) => {
|
|
11728
11737
|
const mark = "var(--csi-" + g.n + "-mark)";
|
|
11729
11738
|
const active = selectedBand === g.key;
|
|
11730
11739
|
return /* @__PURE__ */ jsxs79(
|
|
@@ -11734,13 +11743,13 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
11734
11743
|
onClick: onSelectBand ? () => onSelectBand(active ? null : g.key) : void 0,
|
|
11735
11744
|
style: { display: "flex", flexDirection: "column", justifyContent: "flex-end", gap: 10, padding: 12, border: "1px solid " + (active ? "var(--border-strong)" : "var(--border)"), borderRadius: "var(--r-lg)", background: active ? "var(--surface-2)" : "var(--surface)", cursor: onSelectBand ? "pointer" : "default", textAlign: "left", minHeight: 190, minWidth: 0, transition: "background var(--dur-fast) var(--ease),border-color var(--dur-fast) var(--ease)" },
|
|
11736
11745
|
children: [
|
|
11737
|
-
/* @__PURE__ */
|
|
11746
|
+
/* @__PURE__ */ jsx91("span", { style: { display: "flex", flexDirection: "column-reverse", gap: 4, minHeight: tallest * 24, minWidth: 0 }, children: loading ? Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ jsx91("span", { className: "fd-skel", style: { height: 16, borderRadius: 4 } }, i)) : g.items.map((c) => (
|
|
11738
11747
|
// `overflow: hidden` + `white-space: nowrap` only clips once the span
|
|
11739
11748
|
// actually HAS a bounded width to clip against (see the grid/flex
|
|
11740
11749
|
// `minWidth: 0` chain above) — `textOverflow: ellipsis` then makes
|
|
11741
11750
|
// that clip readable instead of a hard cut mid-letter; the full name
|
|
11742
11751
|
// is still one hover away via `title`.
|
|
11743
|
-
/* @__PURE__ */
|
|
11752
|
+
/* @__PURE__ */ jsx91(
|
|
11744
11753
|
"span",
|
|
11745
11754
|
{
|
|
11746
11755
|
title: c.name + " \xB7 " + c.crp,
|
|
@@ -11751,11 +11760,11 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
11751
11760
|
)
|
|
11752
11761
|
)) }),
|
|
11753
11762
|
/* @__PURE__ */ jsxs79("span", { className: "fd-row", style: { gap: 8, alignItems: "baseline" }, children: [
|
|
11754
|
-
/* @__PURE__ */
|
|
11755
|
-
/* @__PURE__ */
|
|
11763
|
+
/* @__PURE__ */ jsx91("span", { className: "fd-num-hero", style: { fontSize: 30, color: g.items.length ? "var(--text)" : "var(--text-disabled)" }, children: loading ? "\u2013" : g.items.length }),
|
|
11764
|
+
/* @__PURE__ */ jsx91("span", { className: "fd-meter", style: { gap: 2, color: mark }, "aria-hidden": "true", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx91("span", { className: "fd-meter-seg" + (i <= g.n ? " is-on" : ""), style: { width: 4, height: 9 } }, i)) })
|
|
11756
11765
|
] }),
|
|
11757
11766
|
/* @__PURE__ */ jsxs79("span", { className: "fd-stack", style: { gap: 1 }, children: [
|
|
11758
|
-
/* @__PURE__ */
|
|
11767
|
+
/* @__PURE__ */ jsx91("span", { className: "fd-label-lg", children: g.label }),
|
|
11759
11768
|
/* @__PURE__ */ jsxs79("span", { className: "fd-body-sm fd-muted", style: { fontSize: 11.5 }, children: [
|
|
11760
11769
|
"CRP ",
|
|
11761
11770
|
g.range
|
|
@@ -11767,7 +11776,7 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
11767
11776
|
);
|
|
11768
11777
|
}) }),
|
|
11769
11778
|
floorBand ? /* @__PURE__ */ jsxs79("div", { className: "fd-row", style: { gap: 10, padding: "12px 14px", borderRadius: "var(--r-md)", background: "var(--surface-2)", border: "1px solid var(--border)", flexWrap: "wrap" }, children: [
|
|
11770
|
-
/* @__PURE__ */
|
|
11779
|
+
/* @__PURE__ */ jsx91("span", { className: "fd-meter", style: { gap: 2, color: "var(--csi-" + floor.n + "-mark)" }, "aria-hidden": "true", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsx91("span", { className: "fd-meter-seg" + (i <= floor.n ? " is-on" : ""), style: { width: 5, height: 12 } }, i)) }),
|
|
11771
11780
|
/* @__PURE__ */ jsxs79("span", { className: "fd-body-sm fd-secondary", style: { flex: 1, minWidth: 240 }, children: [
|
|
11772
11781
|
/* @__PURE__ */ jsxs79("strong", { style: { color: "var(--text)" }, children: [
|
|
11773
11782
|
"Plan floor ",
|
|
@@ -11781,7 +11790,7 @@ function SaturationDistribution({ campuses = [], floorBand, floorScore, onSelect
|
|
|
11781
11790
|
|
|
11782
11791
|
// src/components/planner/MixGap.tsx
|
|
11783
11792
|
import * as React66 from "react";
|
|
11784
|
-
import { Fragment as Fragment25, jsx as
|
|
11793
|
+
import { Fragment as Fragment25, jsx as jsx92, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
11785
11794
|
var MIX_GAP_LAYOUT = {
|
|
11786
11795
|
trackHeight: 30,
|
|
11787
11796
|
barHeight: 20,
|
|
@@ -11803,11 +11812,11 @@ function MixGap({ rows = [], loading = false, className = "" }) {
|
|
|
11803
11812
|
return /* @__PURE__ */ jsxs80("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 4 }, children: [
|
|
11804
11813
|
/* @__PURE__ */ jsxs80("div", { className: "fd-row", style: { gap: 16, justifyContent: "flex-end", paddingBottom: 6, flexWrap: "wrap" }, children: [
|
|
11805
11814
|
[["On target", TONE.ok], ["Close", TONE.warn], ["Short", TONE.danger]].map(([l, c]) => /* @__PURE__ */ jsxs80("span", { className: "fd-row fd-body-sm fd-muted", style: { gap: 6 }, children: [
|
|
11806
|
-
/* @__PURE__ */
|
|
11815
|
+
/* @__PURE__ */ jsx92("span", { style: { width: 14, height: 9, borderRadius: 2, background: c } }),
|
|
11807
11816
|
l
|
|
11808
11817
|
] }, l)),
|
|
11809
11818
|
/* @__PURE__ */ jsxs80("span", { className: "fd-row fd-body-sm fd-muted", style: { gap: 6 }, children: [
|
|
11810
|
-
/* @__PURE__ */
|
|
11819
|
+
/* @__PURE__ */ jsx92("span", { "data-mixgap-legend-target": "", style: { width: targetWidth, height: 16, borderRadius: 1, background: MIX_GAP_TARGET_STRIPE } }),
|
|
11811
11820
|
"Target"
|
|
11812
11821
|
] })
|
|
11813
11822
|
] }),
|
|
@@ -11824,15 +11833,15 @@ function MixGap({ rows = [], loading = false, className = "" }) {
|
|
|
11824
11833
|
onMouseEnter: () => setHover(r.channel),
|
|
11825
11834
|
onMouseLeave: () => setHover(null),
|
|
11826
11835
|
children: [
|
|
11827
|
-
/* @__PURE__ */
|
|
11828
|
-
/* @__PURE__ */
|
|
11829
|
-
/* @__PURE__ */
|
|
11830
|
-
/* @__PURE__ */
|
|
11836
|
+
/* @__PURE__ */ jsx92("span", { style: { width: 128, flex: "none" }, children: /* @__PURE__ */ jsx92(ChannelTag, { channel: r.channel, size: "sm" }) }),
|
|
11837
|
+
/* @__PURE__ */ jsx92("span", { style: { position: "relative", flex: 1, height: trackHeight, minWidth: 120 }, children: loading ? /* @__PURE__ */ jsx92("span", { className: "fd-skel", style: { position: "absolute", left: 0, right: 0, top: barTop, height: barHeight, borderRadius: 3 } }) : /* @__PURE__ */ jsxs80(Fragment25, { children: [
|
|
11838
|
+
/* @__PURE__ */ jsx92("span", { "data-mixgap-bar": "", style: { position: "absolute", left: 0, top: barTop, height: barHeight, width: mixGapOffset(r.realized, max), background: TONE[tone], borderRadius: "2px 3px 3px 2px", transition: "width var(--dur-slow) var(--ease), background var(--dur-base) var(--ease)" } }),
|
|
11839
|
+
/* @__PURE__ */ jsx92("span", { "data-mixgap-target": "", style: { position: "absolute", left: `calc(${mixGapOffset(r.target, max)} - ${targetWidth / 2}px)`, top: 0, width: targetWidth, height: trackHeight, background: MIX_GAP_TARGET_STRIPE, borderRadius: 1 } }),
|
|
11831
11840
|
/* @__PURE__ */ jsxs80("span", { "data-mixgap-label": "", className: "fd-num", style: { position: "absolute", left: labelLeft, top: "50%", transform: "translateY(-50%)", fontSize: 12, color: "var(--text-muted)", whiteSpace: "nowrap" }, children: [
|
|
11832
11841
|
r.realized,
|
|
11833
11842
|
"%"
|
|
11834
11843
|
] }),
|
|
11835
|
-
hover === r.channel ? /* @__PURE__ */
|
|
11844
|
+
hover === r.channel ? /* @__PURE__ */ jsx92("span", { className: "fd-tooltip", role: "tooltip", style: { position: "absolute", left: 0, right: "auto", bottom: trackHeight + 4, maxWidth: "min(340px, 100%)", whiteSpace: "normal", textAlign: "left", width: "max-content" }, children: tip }) : null
|
|
11836
11845
|
] }) })
|
|
11837
11846
|
]
|
|
11838
11847
|
},
|
|
@@ -11843,7 +11852,7 @@ function MixGap({ rows = [], loading = false, className = "" }) {
|
|
|
11843
11852
|
}
|
|
11844
11853
|
|
|
11845
11854
|
// src/components/planner/ChannelContribution.tsx
|
|
11846
|
-
import { jsx as
|
|
11855
|
+
import { jsx as jsx93, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
11847
11856
|
var money = (n) => "$" + Math.round(n).toLocaleString();
|
|
11848
11857
|
function ChannelContribution({
|
|
11849
11858
|
channels = [],
|
|
@@ -11860,8 +11869,8 @@ function ChannelContribution({
|
|
|
11860
11869
|
const pct = (v) => grand ? v / grand * 100 : 0;
|
|
11861
11870
|
const spendTotal = channels.reduce((s, c) => s + Number(String(c.spend || 0).replace(/[^0-9.]/g, "")), 0);
|
|
11862
11871
|
return /* @__PURE__ */ jsxs81("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 16 }, children: [
|
|
11863
|
-
loading ? /* @__PURE__ */
|
|
11864
|
-
channels.map((c) => /* @__PURE__ */
|
|
11872
|
+
loading ? /* @__PURE__ */ jsx93("span", { className: "fd-skel", style: { height: 34, borderRadius: "var(--r-sm)" } }) : /* @__PURE__ */ jsxs81("div", { className: "fd-row", style: { height: 34, borderRadius: "var(--r-sm)", overflow: "hidden", gap: 2, background: "var(--surface-3)" }, children: [
|
|
11873
|
+
channels.map((c) => /* @__PURE__ */ jsx93(
|
|
11865
11874
|
"span",
|
|
11866
11875
|
{
|
|
11867
11876
|
title: c.name + " \xB7 " + c.crp.toFixed(1) + " CRP",
|
|
@@ -11870,7 +11879,7 @@ function ChannelContribution({
|
|
|
11870
11879
|
},
|
|
11871
11880
|
c.name
|
|
11872
11881
|
)),
|
|
11873
|
-
bonus > 0 ? /* @__PURE__ */
|
|
11882
|
+
bonus > 0 ? /* @__PURE__ */ jsx93(
|
|
11874
11883
|
"span",
|
|
11875
11884
|
{
|
|
11876
11885
|
title: "Surround-sound bonus +" + bonusPct + "%",
|
|
@@ -11880,17 +11889,17 @@ function ChannelContribution({
|
|
|
11880
11889
|
) : null
|
|
11881
11890
|
] }),
|
|
11882
11891
|
showTable ? /* @__PURE__ */ jsxs81("table", { className: "fd-table", style: { fontSize: "var(--body-sm-size)" }, children: [
|
|
11883
|
-
/* @__PURE__ */
|
|
11884
|
-
/* @__PURE__ */
|
|
11885
|
-
/* @__PURE__ */
|
|
11886
|
-
/* @__PURE__ */
|
|
11887
|
-
/* @__PURE__ */
|
|
11888
|
-
/* @__PURE__ */
|
|
11892
|
+
/* @__PURE__ */ jsx93("thead", { children: /* @__PURE__ */ jsxs81("tr", { children: [
|
|
11893
|
+
/* @__PURE__ */ jsx93("th", { style: { width: "34%" }, children: "Channel" }),
|
|
11894
|
+
/* @__PURE__ */ jsx93("th", { style: { width: "16%" }, children: "Weight" }),
|
|
11895
|
+
/* @__PURE__ */ jsx93("th", { className: "is-num", style: { width: "16%" }, children: "Spend" }),
|
|
11896
|
+
/* @__PURE__ */ jsx93("th", { className: "is-num", style: { width: "17%" }, children: "CRP" }),
|
|
11897
|
+
/* @__PURE__ */ jsx93("th", { className: "is-num", style: { width: "17%" }, children: "Share" })
|
|
11889
11898
|
] }) }),
|
|
11890
11899
|
/* @__PURE__ */ jsxs81("tbody", { children: [
|
|
11891
11900
|
channels.map((c) => /* @__PURE__ */ jsxs81("tr", { children: [
|
|
11892
|
-
/* @__PURE__ */
|
|
11893
|
-
/* @__PURE__ */
|
|
11901
|
+
/* @__PURE__ */ jsx93("td", { children: /* @__PURE__ */ jsx93(ChannelTag, { channel: c.name, size: "sm" }) }),
|
|
11902
|
+
/* @__PURE__ */ jsx93("td", { children: /* @__PURE__ */ jsx93(
|
|
11894
11903
|
"span",
|
|
11895
11904
|
{
|
|
11896
11905
|
className: "fd-badge fd-badge-neutral",
|
|
@@ -11899,38 +11908,38 @@ function ChannelContribution({
|
|
|
11899
11908
|
children: "weight " + (channelWeightOf(c.name) || 0)
|
|
11900
11909
|
}
|
|
11901
11910
|
) }),
|
|
11902
|
-
/* @__PURE__ */
|
|
11903
|
-
/* @__PURE__ */
|
|
11911
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num", children: c.spend }),
|
|
11912
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num", children: c.crp.toFixed(1) }),
|
|
11904
11913
|
/* @__PURE__ */ jsxs81("td", { className: "is-num", children: [
|
|
11905
11914
|
pct(c.crp).toFixed(0),
|
|
11906
11915
|
"%"
|
|
11907
11916
|
] })
|
|
11908
11917
|
] }, c.name)),
|
|
11909
11918
|
bonus > 0 ? /* @__PURE__ */ jsxs81("tr", { children: [
|
|
11910
|
-
/* @__PURE__ */
|
|
11911
|
-
/* @__PURE__ */
|
|
11919
|
+
/* @__PURE__ */ jsx93("td", { children: /* @__PURE__ */ jsxs81("span", { className: "fd-row", style: { gap: 9, fontWeight: 600 }, children: [
|
|
11920
|
+
/* @__PURE__ */ jsx93("span", { style: { width: 9, height: 9, borderRadius: 2, background: "repeating-linear-gradient(135deg,var(--csi-3-mark) 0 3px,var(--csi-2-mark) 3px 6px)", flex: "none" } }),
|
|
11912
11921
|
"Surround-sound bonus"
|
|
11913
11922
|
] }) }),
|
|
11914
|
-
/* @__PURE__ */
|
|
11923
|
+
/* @__PURE__ */ jsx93("td", { children: /* @__PURE__ */ jsxs81("span", { className: "fd-badge fd-badge-success", style: { height: 20, fontSize: 11 }, children: [
|
|
11915
11924
|
"+",
|
|
11916
11925
|
bonusPct,
|
|
11917
11926
|
"% of +",
|
|
11918
11927
|
bonusMax,
|
|
11919
11928
|
"%"
|
|
11920
11929
|
] }) }),
|
|
11921
|
-
/* @__PURE__ */
|
|
11922
|
-
/* @__PURE__ */
|
|
11930
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num fd-muted", children: "\u2014" }),
|
|
11931
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num", children: bonus.toFixed(1) }),
|
|
11923
11932
|
/* @__PURE__ */ jsxs81("td", { className: "is-num", children: [
|
|
11924
11933
|
pct(bonus).toFixed(0),
|
|
11925
11934
|
"%"
|
|
11926
11935
|
] })
|
|
11927
11936
|
] }) : null,
|
|
11928
11937
|
/* @__PURE__ */ jsxs81("tr", { style: { background: "var(--surface-2)" }, children: [
|
|
11929
|
-
/* @__PURE__ */
|
|
11930
|
-
/* @__PURE__ */
|
|
11931
|
-
/* @__PURE__ */
|
|
11932
|
-
/* @__PURE__ */
|
|
11933
|
-
/* @__PURE__ */
|
|
11938
|
+
/* @__PURE__ */ jsx93("td", { style: { fontWeight: 700 }, children: "Campus total" }),
|
|
11939
|
+
/* @__PURE__ */ jsx93("td", {}),
|
|
11940
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num", style: { fontWeight: 700 }, children: money(spendTotal) }),
|
|
11941
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num", style: { fontWeight: 700 }, children: grand.toFixed(1) }),
|
|
11942
|
+
/* @__PURE__ */ jsx93("td", { className: "is-num", style: { fontWeight: 700 }, children: "100%" })
|
|
11934
11943
|
] })
|
|
11935
11944
|
] })
|
|
11936
11945
|
] }) : null
|
|
@@ -11939,7 +11948,7 @@ function ChannelContribution({
|
|
|
11939
11948
|
|
|
11940
11949
|
// src/components/planner/BudgetReallocator.tsx
|
|
11941
11950
|
import * as React67 from "react";
|
|
11942
|
-
import { Fragment as Fragment26, jsx as
|
|
11951
|
+
import { Fragment as Fragment26, jsx as jsx94, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
11943
11952
|
var bandFor = (crp) => crp >= 200 ? "dominant" : crp >= 100 ? "strong" : crp >= 50 ? "adequate" : "weak";
|
|
11944
11953
|
function BudgetReallocator({
|
|
11945
11954
|
campus,
|
|
@@ -12001,16 +12010,16 @@ function BudgetReallocator({
|
|
|
12001
12010
|
style: { gap: 14, padding: 18, border: "1px solid " + (dirty ? "var(--border-brand)" : "var(--border)"), borderRadius: "var(--r-lg)", background: dirty ? "var(--surface-brand)" : "var(--surface)", color: "var(--text)", transition: "background var(--dur-base) var(--ease),border-color var(--dur-base) var(--ease)" },
|
|
12002
12011
|
children: [
|
|
12003
12012
|
/* @__PURE__ */ jsxs82("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
|
|
12004
|
-
/* @__PURE__ */
|
|
12005
|
-
/* @__PURE__ */
|
|
12013
|
+
/* @__PURE__ */ jsx94("span", { className: "fd-h4", style: { flex: 1, minWidth: 140 }, children: campus }),
|
|
12014
|
+
/* @__PURE__ */ jsx94(CsiBadge, { band: nowBand, crp, size: "medium" }),
|
|
12006
12015
|
dirty ? /* @__PURE__ */ jsxs82(Fragment26, { children: [
|
|
12007
|
-
/* @__PURE__ */
|
|
12008
|
-
/* @__PURE__ */
|
|
12016
|
+
/* @__PURE__ */ jsx94("i", { className: "ph ph-arrow-right fd-muted", "aria-hidden": "true" }),
|
|
12017
|
+
/* @__PURE__ */ jsx94(CsiBadge, { band: nextBand, crp: nextCrp, size: "medium", preview: true })
|
|
12009
12018
|
] }) : null
|
|
12010
12019
|
] }),
|
|
12011
12020
|
/* @__PURE__ */ jsxs82("div", { className: "fd-slider", ref: trackRef, children: [
|
|
12012
|
-
/* @__PURE__ */
|
|
12013
|
-
dirty ? /* @__PURE__ */
|
|
12021
|
+
/* @__PURE__ */ jsx94("span", { className: "fd-slider-fill", style: { width: pct + "%" } }),
|
|
12022
|
+
dirty ? /* @__PURE__ */ jsx94(
|
|
12014
12023
|
"span",
|
|
12015
12024
|
{
|
|
12016
12025
|
ref: chipRef,
|
|
@@ -12022,7 +12031,7 @@ function BudgetReallocator({
|
|
|
12022
12031
|
children: (delta < 0 ? "\u2212$" : "+$") + Math.abs(delta).toLocaleString()
|
|
12023
12032
|
}
|
|
12024
12033
|
) : null,
|
|
12025
|
-
/* @__PURE__ */
|
|
12034
|
+
/* @__PURE__ */ jsx94(
|
|
12026
12035
|
"input",
|
|
12027
12036
|
{
|
|
12028
12037
|
type: "range",
|
|
@@ -12040,11 +12049,11 @@ function BudgetReallocator({
|
|
|
12040
12049
|
] }),
|
|
12041
12050
|
/* @__PURE__ */ jsxs82("div", { className: "fd-row", style: { gap: 12, flexWrap: "wrap" }, children: [
|
|
12042
12051
|
/* @__PURE__ */ jsxs82("span", { className: "fd-stack", style: { gap: 2, flex: 1, minWidth: 150 }, children: [
|
|
12043
|
-
/* @__PURE__ */
|
|
12044
|
-
/* @__PURE__ */
|
|
12052
|
+
/* @__PURE__ */ jsx94("span", { className: "fd-num", style: { fontSize: 19, fontWeight: 700 }, children: "$" + draft.toLocaleString() }),
|
|
12053
|
+
/* @__PURE__ */ jsx94("span", { className: "fd-body-sm fd-muted", children: "Arrow keys step $100, shift+arrow $1,000. Escape reverts." })
|
|
12045
12054
|
] }),
|
|
12046
|
-
/* @__PURE__ */
|
|
12047
|
-
/* @__PURE__ */
|
|
12055
|
+
/* @__PURE__ */ jsx94("button", { type: "button", className: "fd-btn fd-btn-ghost", disabled: !dirty, onClick: revert, children: "Cancel" }),
|
|
12056
|
+
/* @__PURE__ */ jsx94(
|
|
12048
12057
|
"button",
|
|
12049
12058
|
{
|
|
12050
12059
|
type: "button",
|
|
@@ -12063,7 +12072,7 @@ function BudgetReallocator({
|
|
|
12063
12072
|
}
|
|
12064
12073
|
|
|
12065
12074
|
// src/components/planner/SurroundSound.tsx
|
|
12066
|
-
import { jsx as
|
|
12075
|
+
import { jsx as jsx95, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
12067
12076
|
var CATEGORIES = [
|
|
12068
12077
|
{ key: "ooh", label: "OOH", icon: "flag-banner", color: "var(--ch-ooh)" },
|
|
12069
12078
|
{ key: "transit", label: "Transit", icon: "bus", color: "var(--ch-transit)" },
|
|
@@ -12076,7 +12085,7 @@ function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost,
|
|
|
12076
12085
|
const earned = Math.max(0, Math.min(1, bonusPct / bonusMax));
|
|
12077
12086
|
const single = present.length <= 2;
|
|
12078
12087
|
return /* @__PURE__ */ jsxs83("div", { className: ["fd-stack", className].filter(Boolean).join(" "), style: { gap: 14 }, children: [
|
|
12079
|
-
/* @__PURE__ */
|
|
12088
|
+
/* @__PURE__ */ jsx95("div", { className: "fd-row", style: { gap: 8, flexWrap: "wrap" }, children: CATEGORIES.map((c) => {
|
|
12080
12089
|
const on = present.includes(c.key);
|
|
12081
12090
|
return /* @__PURE__ */ jsxs83(
|
|
12082
12091
|
"span",
|
|
@@ -12084,8 +12093,8 @@ function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost,
|
|
|
12084
12093
|
title: c.label + (on ? " \u2014 present" : " \u2014 not bought"),
|
|
12085
12094
|
style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 5, width: 62, padding: "10px 0", borderRadius: "var(--r-md)", border: "1px solid " + (on ? "var(--csi-2-edge)" : "var(--border)"), background: on ? "var(--csi-2-fill)" : "var(--surface-2)", color: on ? "var(--csi-2-text)" : "var(--text-disabled)" },
|
|
12086
12095
|
children: [
|
|
12087
|
-
/* @__PURE__ */
|
|
12088
|
-
/* @__PURE__ */
|
|
12096
|
+
/* @__PURE__ */ jsx95("i", { className: "ph ph-" + c.icon, style: { fontSize: 19, color: on ? c.color : "var(--text-muted)" }, "aria-hidden": "true" }),
|
|
12097
|
+
/* @__PURE__ */ jsx95("span", { style: { fontSize: 10.5, fontWeight: 700 }, children: c.label })
|
|
12089
12098
|
]
|
|
12090
12099
|
},
|
|
12091
12100
|
c.key
|
|
@@ -12093,7 +12102,7 @@ function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost,
|
|
|
12093
12102
|
}) }),
|
|
12094
12103
|
/* @__PURE__ */ jsxs83("div", { className: "fd-stack", style: { gap: 8 }, children: [
|
|
12095
12104
|
/* @__PURE__ */ jsxs83("div", { className: "fd-row", style: { justifyContent: "space-between", gap: 12 }, children: [
|
|
12096
|
-
/* @__PURE__ */
|
|
12105
|
+
/* @__PURE__ */ jsx95("span", { className: "fd-label-lg", children: "Surround-sound bonus earned" }),
|
|
12097
12106
|
/* @__PURE__ */ jsxs83("span", { className: "fd-num", style: { color: single ? "var(--warn-text)" : "var(--csi-3-mark)", fontWeight: 700 }, children: [
|
|
12098
12107
|
"+",
|
|
12099
12108
|
bonusPct,
|
|
@@ -12102,7 +12111,7 @@ function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost,
|
|
|
12102
12111
|
"%"
|
|
12103
12112
|
] })
|
|
12104
12113
|
] }),
|
|
12105
|
-
/* @__PURE__ */
|
|
12114
|
+
/* @__PURE__ */ jsx95("div", { style: { height: 8, borderRadius: "var(--r-xs)", background: "var(--surface-3)", overflow: "hidden" }, children: /* @__PURE__ */ jsx95("div", { style: { height: "100%", width: earned * 100 + "%", background: "var(--csi-3-mark)", borderRadius: "inherit", transition: "width var(--dur-slow) var(--ease)" } }) }),
|
|
12106
12115
|
/* @__PURE__ */ jsxs83("span", { className: "fd-body-sm fd-secondary", style: { textWrap: "pretty" }, children: [
|
|
12107
12116
|
present.length,
|
|
12108
12117
|
" of 6 channel categories present.",
|
|
@@ -12115,7 +12124,7 @@ function SurroundSound({ present = [], bonusPct = 0, bonusMax = 40, missedCost,
|
|
|
12115
12124
|
}
|
|
12116
12125
|
|
|
12117
12126
|
// src/components/planner/Importance.tsx
|
|
12118
|
-
import { jsx as
|
|
12127
|
+
import { jsx as jsx96, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
12119
12128
|
var IMPORTANCE_LEVELS = [
|
|
12120
12129
|
{ id: "nudge", rank: 1, label: "Nudge", icon: "feather", description: "Breaks a tie, nothing more." },
|
|
12121
12130
|
{ id: "lean", rank: 2, label: "Lean", icon: "arrow-bend-up-right", description: "A mild preference between otherwise equal options." },
|
|
@@ -12153,8 +12162,8 @@ function ImportanceTag({ level, showLabel = true, size = "sm", className = "", d
|
|
|
12153
12162
|
title: lvl.label + " \u2014 " + lvl.description,
|
|
12154
12163
|
"aria-disabled": disabled ? "true" : void 0,
|
|
12155
12164
|
children: [
|
|
12156
|
-
/* @__PURE__ */
|
|
12157
|
-
showLabel ? lvl.label : /* @__PURE__ */
|
|
12165
|
+
/* @__PURE__ */ jsx96("i", { className: "ph ph-" + lvl.icon, "aria-hidden": "true" }),
|
|
12166
|
+
showLabel ? lvl.label : /* @__PURE__ */ jsx96("span", { className: "fd-sr", children: lvl.label })
|
|
12158
12167
|
]
|
|
12159
12168
|
}
|
|
12160
12169
|
);
|
|
@@ -12162,7 +12171,7 @@ function ImportanceTag({ level, showLabel = true, size = "sm", className = "", d
|
|
|
12162
12171
|
|
|
12163
12172
|
// src/components/planner/PreferenceMeter.tsx
|
|
12164
12173
|
import * as React68 from "react";
|
|
12165
|
-
import { jsx as
|
|
12174
|
+
import { jsx as jsx97, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
12166
12175
|
function preferenceScore(criteria) {
|
|
12167
12176
|
const earned = criteria.reduce((n, c) => n + (Number(c.earned) || 0), 0);
|
|
12168
12177
|
const weight = criteria.reduce((n, c) => n + (Number(c.weight) || 0), 0);
|
|
@@ -12192,7 +12201,7 @@ function PreferenceMeter({
|
|
|
12192
12201
|
}) {
|
|
12193
12202
|
const value = score == null ? preferenceScore(criteria) : score;
|
|
12194
12203
|
const segments = React68.useMemo(() => preferenceSegments(criteria), [criteria]);
|
|
12195
|
-
return /* @__PURE__ */
|
|
12204
|
+
return /* @__PURE__ */ jsx97(
|
|
12196
12205
|
ScoreMeter,
|
|
12197
12206
|
{
|
|
12198
12207
|
score: value,
|
|
@@ -12206,20 +12215,20 @@ function PreferenceMeter({
|
|
|
12206
12215
|
breakdownLabel: breakdownTitle,
|
|
12207
12216
|
breakdown: /* @__PURE__ */ jsxs85("div", { className: "fd-prefbreak", children: [
|
|
12208
12217
|
/* @__PURE__ */ jsxs85("div", { className: "fd-prefbreak-head", children: [
|
|
12209
|
-
/* @__PURE__ */
|
|
12210
|
-
/* @__PURE__ */
|
|
12218
|
+
/* @__PURE__ */ jsx97("span", { className: "fd-label-lg", children: breakdownTitle }),
|
|
12219
|
+
/* @__PURE__ */ jsx97("span", { className: "fd-prefbreak-score fd-tabular", children: Math.round(value) })
|
|
12211
12220
|
] }),
|
|
12212
|
-
/* @__PURE__ */
|
|
12221
|
+
/* @__PURE__ */ jsx97("ul", { className: "fd-prefbreak-list", children: criteria.map((c) => {
|
|
12213
12222
|
const pct = c.weight > 0 ? Math.round((Number(c.earned) || 0) / c.weight * 100) : 0;
|
|
12214
12223
|
return /* @__PURE__ */ jsxs85("li", { className: pct === 0 ? "fd-prefbreak-item is-unmet" : "fd-prefbreak-item", children: [
|
|
12215
|
-
/* @__PURE__ */
|
|
12224
|
+
/* @__PURE__ */ jsx97(ImportanceTag, { level: c.importance }),
|
|
12216
12225
|
/* @__PURE__ */ jsxs85("span", { className: "fd-prefbreak-text", children: [
|
|
12217
|
-
/* @__PURE__ */
|
|
12218
|
-
c.note ? /* @__PURE__ */
|
|
12226
|
+
/* @__PURE__ */ jsx97("span", { className: "fd-prefbreak-label", children: c.label }),
|
|
12227
|
+
c.note ? /* @__PURE__ */ jsx97("span", { className: "fd-prefbreak-note", children: c.note }) : null
|
|
12219
12228
|
] }),
|
|
12220
12229
|
/* @__PURE__ */ jsxs85("span", { className: "fd-prefbreak-val fd-tabular", children: [
|
|
12221
12230
|
Math.round(Number(c.earned) || 0),
|
|
12222
|
-
/* @__PURE__ */
|
|
12231
|
+
/* @__PURE__ */ jsx97("span", { className: "fd-prefbreak-sep", children: "/" }),
|
|
12223
12232
|
Math.round(c.weight)
|
|
12224
12233
|
] })
|
|
12225
12234
|
] }, c.id);
|
|
@@ -12647,7 +12656,7 @@ import * as React71 from "react";
|
|
|
12647
12656
|
|
|
12648
12657
|
// src/components/chat/ChatTurn.tsx
|
|
12649
12658
|
import * as React70 from "react";
|
|
12650
|
-
import { jsx as
|
|
12659
|
+
import { jsx as jsx98, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
12651
12660
|
function JsonView({ value }) {
|
|
12652
12661
|
let text;
|
|
12653
12662
|
try {
|
|
@@ -12655,7 +12664,7 @@ function JsonView({ value }) {
|
|
|
12655
12664
|
} catch (e) {
|
|
12656
12665
|
text = String(value);
|
|
12657
12666
|
}
|
|
12658
|
-
return /* @__PURE__ */
|
|
12667
|
+
return /* @__PURE__ */ jsx98(CodeBlock, { code: text, language: "json", collapseAfter: 18 });
|
|
12659
12668
|
}
|
|
12660
12669
|
function PacketCard({ packet, schema, render, onApply, applied }) {
|
|
12661
12670
|
if (!packet) return null;
|
|
@@ -12664,19 +12673,19 @@ function PacketCard({ packet, schema, render, onApply, applied }) {
|
|
|
12664
12673
|
const title = s.heading || packet.type;
|
|
12665
12674
|
return /* @__PURE__ */ jsxs86("section", { className: "fdc-packet" + (invalid ? " is-invalid" : ""), "aria-label": title, children: [
|
|
12666
12675
|
/* @__PURE__ */ jsxs86("header", { className: "fdc-packet-head", children: [
|
|
12667
|
-
/* @__PURE__ */
|
|
12668
|
-
/* @__PURE__ */
|
|
12669
|
-
packet.repaired ? /* @__PURE__ */
|
|
12670
|
-
invalid ? /* @__PURE__ */
|
|
12676
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-" + (s.icon || "package"), "aria-hidden": "true" }),
|
|
12677
|
+
/* @__PURE__ */ jsx98("span", { className: "fdc-packet-title", title: truncationTitle(title), children: title }),
|
|
12678
|
+
packet.repaired ? /* @__PURE__ */ jsx98("span", { className: "fdc-packet-badge", children: "Repaired" }) : null,
|
|
12679
|
+
invalid ? /* @__PURE__ */ jsx98("span", { className: "fdc-packet-badge is-danger", children: "Invalid" }) : null
|
|
12671
12680
|
] }),
|
|
12672
12681
|
invalid ? /* @__PURE__ */ jsxs86("div", { className: "fdc-packet-alert", role: "alert", children: [
|
|
12673
|
-
/* @__PURE__ */
|
|
12674
|
-
/* @__PURE__ */
|
|
12675
|
-
] }) : /* @__PURE__ */
|
|
12682
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
12683
|
+
/* @__PURE__ */ jsx98("span", { children: packet.error || "This result failed validation and can\u2019t be applied." })
|
|
12684
|
+
] }) : /* @__PURE__ */ jsx98("div", { className: "fdc-packet-body", children: render ? render(packet) : /* @__PURE__ */ jsx98(JsonView, { value: packet.payload }) }),
|
|
12676
12685
|
!invalid && onApply ? /* @__PURE__ */ jsxs86("footer", { className: "fdc-packet-foot", children: [
|
|
12677
|
-
packet.repaired ? /* @__PURE__ */
|
|
12686
|
+
packet.repaired ? /* @__PURE__ */ jsx98("span", { className: "fdc-packet-note", children: "Corrected by the backend after a first attempt." }) : /* @__PURE__ */ jsx98("span", {}),
|
|
12678
12687
|
/* @__PURE__ */ jsxs86("button", { type: "button", className: "fd-btn fd-btn-primary fd-btn-sm", disabled: applied, onClick: () => onApply(packet), children: [
|
|
12679
|
-
/* @__PURE__ */
|
|
12688
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-" + (applied ? "check" : "arrow-square-in"), "aria-hidden": "true" }),
|
|
12680
12689
|
applied ? "Applied" : s.applyLabel || "Apply"
|
|
12681
12690
|
] })
|
|
12682
12691
|
] }) : null
|
|
@@ -12687,16 +12696,16 @@ function ThinkingBlock({ text, durationMs, streaming, defaultOpen = false }) {
|
|
|
12687
12696
|
if (!text) return null;
|
|
12688
12697
|
return /* @__PURE__ */ jsxs86("div", { className: "fdc-think" + (open2 ? " is-open" : ""), children: [
|
|
12689
12698
|
/* @__PURE__ */ jsxs86("button", { type: "button", className: "fdc-think-head", onClick: () => setOpen((v) => !v), "aria-expanded": open2, children: [
|
|
12690
|
-
/* @__PURE__ */
|
|
12691
|
-
/* @__PURE__ */
|
|
12699
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-brain", "aria-hidden": "true" }),
|
|
12700
|
+
/* @__PURE__ */ jsx98("span", { children: streaming ? "Thinking" : durationMs ? "Thought for " + formatDuration(durationMs) : "Thought process" }),
|
|
12692
12701
|
streaming ? /* @__PURE__ */ jsxs86("span", { className: "fdc-dots", "aria-hidden": "true", children: [
|
|
12693
|
-
/* @__PURE__ */
|
|
12694
|
-
/* @__PURE__ */
|
|
12695
|
-
/* @__PURE__ */
|
|
12702
|
+
/* @__PURE__ */ jsx98("span", {}),
|
|
12703
|
+
/* @__PURE__ */ jsx98("span", {}),
|
|
12704
|
+
/* @__PURE__ */ jsx98("span", {})
|
|
12696
12705
|
] }) : null,
|
|
12697
|
-
/* @__PURE__ */
|
|
12706
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-caret-" + (open2 ? "up" : "down"), "aria-hidden": "true" })
|
|
12698
12707
|
] }),
|
|
12699
|
-
open2 ? /* @__PURE__ */
|
|
12708
|
+
open2 ? /* @__PURE__ */ jsx98("div", { className: "fdc-think-body", children: text }) : null
|
|
12700
12709
|
] });
|
|
12701
12710
|
}
|
|
12702
12711
|
function Citations({ items = [], onOpen }) {
|
|
@@ -12704,18 +12713,18 @@ function Citations({ items = [], onOpen }) {
|
|
|
12704
12713
|
if (!items.length) return null;
|
|
12705
12714
|
return /* @__PURE__ */ jsxs86("div", { className: "fdc-cites", children: [
|
|
12706
12715
|
/* @__PURE__ */ jsxs86("button", { type: "button", className: "fdc-cites-head", onClick: () => setOpen((v) => !v), "aria-expanded": open2, children: [
|
|
12707
|
-
/* @__PURE__ */
|
|
12716
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-quotes", "aria-hidden": "true" }),
|
|
12708
12717
|
/* @__PURE__ */ jsxs86("span", { children: [
|
|
12709
12718
|
items.length,
|
|
12710
12719
|
" source",
|
|
12711
12720
|
items.length === 1 ? "" : "s"
|
|
12712
12721
|
] }),
|
|
12713
|
-
/* @__PURE__ */
|
|
12722
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-caret-" + (open2 ? "up" : "down"), "aria-hidden": "true" })
|
|
12714
12723
|
] }),
|
|
12715
|
-
open2 ? /* @__PURE__ */
|
|
12716
|
-
/* @__PURE__ */
|
|
12717
|
-
c.url ? /* @__PURE__ */
|
|
12718
|
-
c.detail ? /* @__PURE__ */
|
|
12724
|
+
open2 ? /* @__PURE__ */ jsx98("ol", { className: "fdc-cites-list", children: items.map((c, i) => /* @__PURE__ */ jsxs86("li", { children: [
|
|
12725
|
+
/* @__PURE__ */ jsx98("span", { className: "fdc-cite-n fd-tabular", children: c.marker || i + 1 }),
|
|
12726
|
+
c.url ? /* @__PURE__ */ jsx98("a", { href: c.url, target: "_blank", rel: "noopener noreferrer", onClick: onOpen ? (e) => onOpen(c, e) : void 0, children: c.title || c.url }) : /* @__PURE__ */ jsx98("span", { children: c.title || "Source" }),
|
|
12727
|
+
c.detail ? /* @__PURE__ */ jsx98("span", { className: "fdc-cite-detail", children: c.detail }) : null
|
|
12719
12728
|
] }, c.id || i)) }) : null
|
|
12720
12729
|
] });
|
|
12721
12730
|
}
|
|
@@ -12733,22 +12742,22 @@ function MessageBody({ message: m, ctx }) {
|
|
|
12733
12742
|
const body = clamped != null ? clamped : raw;
|
|
12734
12743
|
const showMd = ctx.markdown && !isUser;
|
|
12735
12744
|
return /* @__PURE__ */ jsxs86("div", { className: "fdc-body", children: [
|
|
12736
|
-
m.thinking && ctx.showThinking ? /* @__PURE__ */
|
|
12737
|
-
m.steps && m.steps.length && ctx.showSteps ? /* @__PURE__ */
|
|
12745
|
+
m.thinking && ctx.showThinking ? /* @__PURE__ */ jsx98(ThinkingBlock, { text: m.thinking, durationMs: m.thinkingMs, streaming: m.streaming && !m.text }) : null,
|
|
12746
|
+
m.steps && m.steps.length && ctx.showSteps ? /* @__PURE__ */ jsx98(StepList, { steps: m.steps, defaultOpen: m.steps.some((s) => s.status === "running"), dense: true }) : null,
|
|
12738
12747
|
body ? /* @__PURE__ */ jsxs86("div", { className: "fdc-text" + (isUser ? " is-user" : ""), children: [
|
|
12739
|
-
showMd ? /* @__PURE__ */
|
|
12740
|
-
m.streaming ? /* @__PURE__ */
|
|
12748
|
+
showMd ? /* @__PURE__ */ jsx98(Markdown, { source: body, headingOffset: 2, codeProps: { collapseAfter: 22 }, renderCitation: ctx.renderCitation }) : /* @__PURE__ */ jsx98("div", { className: "fdc-plain", children: body }),
|
|
12749
|
+
m.streaming ? /* @__PURE__ */ jsx98("span", { className: "fdc-caret", "aria-hidden": "true" }) : null
|
|
12741
12750
|
] }) : null,
|
|
12742
12751
|
clamped != null ? /* @__PURE__ */ jsxs86("button", { type: "button", className: "fdc-more", onClick: () => setExpanded(true), children: [
|
|
12743
|
-
/* @__PURE__ */
|
|
12752
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-caret-down", "aria-hidden": "true" }),
|
|
12744
12753
|
"Show more",
|
|
12745
|
-
/* @__PURE__ */
|
|
12754
|
+
/* @__PURE__ */ jsx98("span", { className: "fdc-more-len fd-tabular", children: raw.length < 2e3 ? raw.length.toLocaleString() + " characters" : Math.round(raw.length / 100) / 10 + "k characters" })
|
|
12746
12755
|
] }) : expanded && ctx.maxVisibleChars && raw.length > ctx.maxVisibleChars ? /* @__PURE__ */ jsxs86("button", { type: "button", className: "fdc-more", onClick: () => setExpanded(false), children: [
|
|
12747
|
-
/* @__PURE__ */
|
|
12756
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-caret-up", "aria-hidden": "true" }),
|
|
12748
12757
|
"Show less"
|
|
12749
12758
|
] }) : null,
|
|
12750
|
-
m.attachments && m.attachments.length ? /* @__PURE__ */
|
|
12751
|
-
m.packet ? /* @__PURE__ */
|
|
12759
|
+
m.attachments && m.attachments.length ? /* @__PURE__ */ jsx98(FileGrid, { files: m.attachments, onOpen: ctx.onOpenAttachment, tiles: true, maxHeight: ctx.attachmentHeight || 220, compact: ctx.narrow }) : null,
|
|
12760
|
+
m.packet ? /* @__PURE__ */ jsx98(
|
|
12752
12761
|
PacketCard,
|
|
12753
12762
|
{
|
|
12754
12763
|
packet: m.packet,
|
|
@@ -12758,12 +12767,12 @@ function MessageBody({ message: m, ctx }) {
|
|
|
12758
12767
|
applied: ctx.appliedPackets && ctx.appliedPackets[m.id]
|
|
12759
12768
|
}
|
|
12760
12769
|
) : null,
|
|
12761
|
-
m.citations && m.citations.length ? /* @__PURE__ */
|
|
12770
|
+
m.citations && m.citations.length ? /* @__PURE__ */ jsx98(Citations, { items: m.citations, onOpen: ctx.onOpenCitation }) : null,
|
|
12762
12771
|
m.working ? /* @__PURE__ */ jsxs86("div", { className: "fdc-working", role: "status", children: [
|
|
12763
12772
|
/* @__PURE__ */ jsxs86("span", { className: "fdc-dots", "aria-hidden": "true", children: [
|
|
12764
|
-
/* @__PURE__ */
|
|
12765
|
-
/* @__PURE__ */
|
|
12766
|
-
/* @__PURE__ */
|
|
12773
|
+
/* @__PURE__ */ jsx98("span", {}),
|
|
12774
|
+
/* @__PURE__ */ jsx98("span", {}),
|
|
12775
|
+
/* @__PURE__ */ jsx98("span", {})
|
|
12767
12776
|
] }),
|
|
12768
12777
|
/* @__PURE__ */ jsxs86("span", { className: "fdc-working-label", children: [
|
|
12769
12778
|
m.resumed ? "Resuming" : "Working",
|
|
@@ -12776,17 +12785,17 @@ function MessageBody({ message: m, ctx }) {
|
|
|
12776
12785
|
m.job.detail
|
|
12777
12786
|
] }) : null
|
|
12778
12787
|
] }),
|
|
12779
|
-
m.jobId ? /* @__PURE__ */
|
|
12788
|
+
m.jobId ? /* @__PURE__ */ jsx98("span", { className: "fdc-working-id fd-mono", children: String(m.jobId).slice(0, 12) }) : null
|
|
12780
12789
|
] }) : null,
|
|
12781
12790
|
m.stopped ? /* @__PURE__ */ jsxs86("div", { className: "fdc-stopped", children: [
|
|
12782
|
-
/* @__PURE__ */
|
|
12791
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-stop-circle", "aria-hidden": "true" }),
|
|
12783
12792
|
"Stopped"
|
|
12784
12793
|
] }) : null,
|
|
12785
12794
|
m.error ? /* @__PURE__ */ jsxs86("div", { className: "fdc-error", role: "alert", children: [
|
|
12786
|
-
/* @__PURE__ */
|
|
12787
|
-
/* @__PURE__ */
|
|
12795
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
12796
|
+
/* @__PURE__ */ jsx98("span", { className: "fdc-error-text", children: ctx.errorCopy ? ctx.errorCopy(m.error) : m.error }),
|
|
12788
12797
|
m.retryable && ctx.onRetry ? /* @__PURE__ */ jsxs86("button", { type: "button", className: "fdc-error-retry", onClick: ctx.onRetry, children: [
|
|
12789
|
-
/* @__PURE__ */
|
|
12798
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }),
|
|
12790
12799
|
"Retry"
|
|
12791
12800
|
] }) : null
|
|
12792
12801
|
] }) : null
|
|
@@ -12801,14 +12810,14 @@ function RunActions({ group, ctx }) {
|
|
|
12801
12810
|
if (!ctx.messageActions) return null;
|
|
12802
12811
|
return /* @__PURE__ */ jsxs86("div", { className: "fdc-actions", role: "group", "aria-label": "Message actions", children: [
|
|
12803
12812
|
/* @__PURE__ */ jsxs86("button", { type: "button", className: "fdc-act" + (copied ? " is-done" : ""), onClick: () => copy(markdownToText(text)), "aria-label": "Copy message", children: [
|
|
12804
|
-
/* @__PURE__ */
|
|
12805
|
-
/* @__PURE__ */
|
|
12813
|
+
/* @__PURE__ */ jsx98("i", { className: "ph ph-" + (copied ? "check" : "copy"), "aria-hidden": "true" }),
|
|
12814
|
+
/* @__PURE__ */ jsx98("span", { className: "fdc-act-label", children: copied ? "Copied" : "Copy" })
|
|
12806
12815
|
] }),
|
|
12807
|
-
isAssistant && ctx.onRetry ? /* @__PURE__ */
|
|
12808
|
-
group.role === "user" && ctx.onEdit ? /* @__PURE__ */
|
|
12816
|
+
isAssistant && ctx.onRetry ? /* @__PURE__ */ jsx98("button", { type: "button", className: "fdc-act", onClick: ctx.onRetry, "aria-label": "Retry this turn", children: /* @__PURE__ */ jsx98("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }) }) : null,
|
|
12817
|
+
group.role === "user" && ctx.onEdit ? /* @__PURE__ */ jsx98("button", { type: "button", className: "fdc-act", onClick: () => ctx.onEdit(last), "aria-label": "Edit and resend", children: /* @__PURE__ */ jsx98("i", { className: "ph ph-pencil-simple", "aria-hidden": "true" }) }) : null,
|
|
12809
12818
|
isAssistant && ctx.onFeedback ? /* @__PURE__ */ jsxs86(React70.Fragment, { children: [
|
|
12810
|
-
/* @__PURE__ */
|
|
12811
|
-
/* @__PURE__ */
|
|
12819
|
+
/* @__PURE__ */ jsx98("button", { type: "button", className: "fdc-act" + (fb === "up" ? " is-on" : ""), onClick: () => ctx.onFeedback(last.id, "up"), "aria-pressed": fb === "up", "aria-label": "Good response", children: /* @__PURE__ */ jsx98("i", { className: "ph ph-thumbs-up", "aria-hidden": "true" }) }),
|
|
12820
|
+
/* @__PURE__ */ jsx98("button", { type: "button", className: "fdc-act" + (fb === "down" ? " is-on" : ""), onClick: () => ctx.onFeedback(last.id, "down"), "aria-pressed": fb === "down", "aria-label": "Bad response", children: /* @__PURE__ */ jsx98("i", { className: "ph ph-thumbs-down", "aria-hidden": "true" }) })
|
|
12812
12821
|
] }) : null,
|
|
12813
12822
|
ctx.extraActions ? ctx.extraActions(group) : null
|
|
12814
12823
|
] });
|
|
@@ -12820,20 +12829,20 @@ function ChatTurn({ group, ctx }) {
|
|
|
12820
12829
|
const stamp = group.messages[0].timestamp;
|
|
12821
12830
|
return /* @__PURE__ */ jsxs86("article", { className: "fdc-turn is-" + group.role, "aria-label": String(name) + (stamp ? " at " + formatClock(stamp) : ""), children: [
|
|
12822
12831
|
/* @__PURE__ */ jsxs86("div", { className: "fdc-turn-head", children: [
|
|
12823
|
-
ctx.showAvatars ? /* @__PURE__ */
|
|
12824
|
-
/* @__PURE__ */
|
|
12825
|
-
stamp ? /* @__PURE__ */
|
|
12826
|
-
group.messages.some((m) => m.model) ? /* @__PURE__ */
|
|
12832
|
+
ctx.showAvatars ? /* @__PURE__ */ jsx98("span", { className: "fdc-avatar is-" + group.role, "aria-hidden": "true", children: avatar ? /* @__PURE__ */ jsx98("img", { src: avatar, alt: "" }) : isUser ? /* @__PURE__ */ jsx98("span", { className: "fdc-avatar-txt", children: (name || "You").slice(0, 1).toUpperCase() }) : /* @__PURE__ */ jsx98("i", { className: "ph ph-" + (ctx.assistantIcon || "sparkle") }) }) : null,
|
|
12833
|
+
/* @__PURE__ */ jsx98("span", { className: "fdc-who", children: name }),
|
|
12834
|
+
stamp ? /* @__PURE__ */ jsx98(RelativeTime, { className: "fdc-when", value: stamp }) : null,
|
|
12835
|
+
group.messages.some((m) => m.model) ? /* @__PURE__ */ jsx98("span", { className: "fdc-turn-model", children: group.messages.find((m) => m.model).model }) : null
|
|
12827
12836
|
] }),
|
|
12828
12837
|
/* @__PURE__ */ jsxs86("div", { className: "fdc-turn-body", children: [
|
|
12829
|
-
group.messages.map((m) => /* @__PURE__ */
|
|
12830
|
-
/* @__PURE__ */
|
|
12838
|
+
group.messages.map((m) => /* @__PURE__ */ jsx98("div", { className: "fdc-msg" + (m.pending ? " is-pending" : ""), children: /* @__PURE__ */ jsx98(MessageBody, { message: m, ctx }) }, m.id)),
|
|
12839
|
+
/* @__PURE__ */ jsx98(RunActions, { group, ctx })
|
|
12831
12840
|
] })
|
|
12832
12841
|
] });
|
|
12833
12842
|
}
|
|
12834
12843
|
|
|
12835
12844
|
// src/components/chat/ChatTranscript.tsx
|
|
12836
|
-
import { jsx as
|
|
12845
|
+
import { jsx as jsx99, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
12837
12846
|
var GROUP_WINDOW = 6e4;
|
|
12838
12847
|
var STICK_PX = 100;
|
|
12839
12848
|
function groupMessages(list) {
|
|
@@ -12866,25 +12875,25 @@ function dayLabel(key) {
|
|
|
12866
12875
|
}
|
|
12867
12876
|
function Suggestions({ items = [], onPick }) {
|
|
12868
12877
|
if (!items.length) return null;
|
|
12869
|
-
return /* @__PURE__ */
|
|
12878
|
+
return /* @__PURE__ */ jsx99("div", { className: "fdc-suggest", children: items.map((s, i) => {
|
|
12870
12879
|
const it = typeof s === "string" ? { label: s, text: s } : s;
|
|
12871
12880
|
return /* @__PURE__ */ jsxs87("button", { type: "button", className: "fdc-suggest-item", onClick: () => onPick && onPick(it.text || it.label), children: [
|
|
12872
|
-
it.icon ? /* @__PURE__ */
|
|
12881
|
+
it.icon ? /* @__PURE__ */ jsx99("i", { className: "ph ph-" + it.icon, "aria-hidden": "true" }) : null,
|
|
12873
12882
|
/* @__PURE__ */ jsxs87("span", { className: "fdc-suggest-text", children: [
|
|
12874
|
-
/* @__PURE__ */
|
|
12875
|
-
it.description ? /* @__PURE__ */
|
|
12883
|
+
/* @__PURE__ */ jsx99("span", { className: "fdc-suggest-label", children: it.label }),
|
|
12884
|
+
it.description ? /* @__PURE__ */ jsx99("span", { className: "fdc-suggest-desc", children: it.description }) : null
|
|
12876
12885
|
] }),
|
|
12877
|
-
/* @__PURE__ */
|
|
12886
|
+
/* @__PURE__ */ jsx99("i", { className: "ph ph-arrow-up-right fdc-suggest-go", "aria-hidden": "true" })
|
|
12878
12887
|
] }, it.id || i);
|
|
12879
12888
|
}) });
|
|
12880
12889
|
}
|
|
12881
12890
|
function LoadingTurns() {
|
|
12882
|
-
return /* @__PURE__ */
|
|
12883
|
-
/* @__PURE__ */
|
|
12891
|
+
return /* @__PURE__ */ jsx99("div", { className: "fdc-skel", "aria-hidden": "true", children: [0, 1].map((i) => /* @__PURE__ */ jsxs87("div", { className: "fdc-skel-turn", children: [
|
|
12892
|
+
/* @__PURE__ */ jsx99("div", { className: "fd-skel fd-skel-circle", style: { width: 22, height: 22 } }),
|
|
12884
12893
|
/* @__PURE__ */ jsxs87("div", { className: "fdc-skel-lines", children: [
|
|
12885
|
-
/* @__PURE__ */
|
|
12886
|
-
/* @__PURE__ */
|
|
12887
|
-
/* @__PURE__ */
|
|
12894
|
+
/* @__PURE__ */ jsx99("div", { className: "fd-skel", style: { width: i ? "62%" : "44%", height: 11 } }),
|
|
12895
|
+
/* @__PURE__ */ jsx99("div", { className: "fd-skel", style: { width: i ? "94%" : "78%", height: 11 } }),
|
|
12896
|
+
/* @__PURE__ */ jsx99("div", { className: "fd-skel", style: { width: i ? "71%" : "56%", height: 11 } })
|
|
12888
12897
|
] })
|
|
12889
12898
|
] }, i)) });
|
|
12890
12899
|
}
|
|
@@ -12945,34 +12954,34 @@ function ChatTranscript({
|
|
|
12945
12954
|
const empty = !messages.length && status === "ready";
|
|
12946
12955
|
return /* @__PURE__ */ jsxs87("div", { className: ["fdc-scroll", className].filter(Boolean).join(" "), ref: scroller, onScroll, children: [
|
|
12947
12956
|
/* @__PURE__ */ jsxs87("div", { className: "fdc-log", role: "log", "aria-label": "Conversation", children: [
|
|
12948
|
-
status === "loading" || status === "resolving" ? /* @__PURE__ */
|
|
12957
|
+
status === "loading" || status === "resolving" ? /* @__PURE__ */ jsx99(LoadingTurns, {}) : null,
|
|
12949
12958
|
status === "disconnected" ? /* @__PURE__ */ jsxs87("div", { className: "fdc-dead", children: [
|
|
12950
|
-
/* @__PURE__ */
|
|
12951
|
-
/* @__PURE__ */
|
|
12952
|
-
/* @__PURE__ */
|
|
12959
|
+
/* @__PURE__ */ jsx99("span", { className: "fdc-dead-icon", children: /* @__PURE__ */ jsx99("i", { className: "ph ph-plugs", "aria-hidden": "true" }) }),
|
|
12960
|
+
/* @__PURE__ */ jsx99("h3", { className: "fdc-dead-title", children: ctx.deadTitle || "The assistant isn\u2019t reachable" }),
|
|
12961
|
+
/* @__PURE__ */ jsx99("p", { className: "fdc-dead-body", children: fatal === "chat_unavailable" ? "The service reported chat_unavailable. Nothing you type will be lost \u2014 reopen the panel once it\u2019s back." : "The thread couldn\u2019t be resolved" + (fatal ? " (" + fatal + ")" : "") + ". The composer stays disabled until it resolves." }),
|
|
12953
12962
|
ctx.onReconnect ? /* @__PURE__ */ jsxs87("button", { type: "button", className: "fd-btn fd-btn-secondary fd-btn-sm", onClick: ctx.onReconnect, children: [
|
|
12954
|
-
/* @__PURE__ */
|
|
12963
|
+
/* @__PURE__ */ jsx99("i", { className: "ph ph-arrow-clockwise", "aria-hidden": "true" }),
|
|
12955
12964
|
"Try again"
|
|
12956
12965
|
] }) : null
|
|
12957
12966
|
] }) : null,
|
|
12958
12967
|
empty ? renderEmpty ? renderEmpty() : /* @__PURE__ */ jsxs87("div", { className: "fdc-empty", children: [
|
|
12959
|
-
/* @__PURE__ */
|
|
12960
|
-
/* @__PURE__ */
|
|
12961
|
-
emptyDescription ? /* @__PURE__ */
|
|
12962
|
-
/* @__PURE__ */
|
|
12968
|
+
/* @__PURE__ */ jsx99("span", { className: "fdc-empty-icon", children: /* @__PURE__ */ jsx99("i", { className: "ph ph-" + emptyIcon, "aria-hidden": "true" }) }),
|
|
12969
|
+
/* @__PURE__ */ jsx99("h3", { className: "fdc-empty-title", children: emptyTitle }),
|
|
12970
|
+
emptyDescription ? /* @__PURE__ */ jsx99("p", { className: "fdc-empty-body", children: emptyDescription }) : null,
|
|
12971
|
+
/* @__PURE__ */ jsx99(Suggestions, { items: suggestions, onPick })
|
|
12963
12972
|
] }) : null,
|
|
12964
12973
|
groups.map((g, i) => {
|
|
12965
12974
|
const prev = groups[i - 1];
|
|
12966
12975
|
const k = dayKey(g.messages[0].timestamp);
|
|
12967
12976
|
const showDay = !!k && (!prev || dayKey(prev.messages[0].timestamp) !== k);
|
|
12968
12977
|
return /* @__PURE__ */ jsxs87(React71.Fragment, { children: [
|
|
12969
|
-
showDay ? /* @__PURE__ */
|
|
12970
|
-
/* @__PURE__ */
|
|
12978
|
+
showDay ? /* @__PURE__ */ jsx99("div", { className: "fdc-day", children: /* @__PURE__ */ jsx99("span", { children: dayLabel(k) }) }) : null,
|
|
12979
|
+
/* @__PURE__ */ jsx99(ChatTurn, { group: g, ctx })
|
|
12971
12980
|
] }, g.key || i);
|
|
12972
12981
|
})
|
|
12973
12982
|
] }),
|
|
12974
12983
|
pill ? /* @__PURE__ */ jsxs87("button", { type: "button", className: "fdc-pill", onClick: () => toBottom(true), children: [
|
|
12975
|
-
/* @__PURE__ */
|
|
12984
|
+
/* @__PURE__ */ jsx99("i", { className: "ph ph-arrow-down", "aria-hidden": "true" }),
|
|
12976
12985
|
pill,
|
|
12977
12986
|
" new message",
|
|
12978
12987
|
pill === 1 ? "" : "s"
|
|
@@ -12983,7 +12992,7 @@ var TranscriptKit = { groupMessages };
|
|
|
12983
12992
|
|
|
12984
12993
|
// src/components/chat/ChatComposer.tsx
|
|
12985
12994
|
import * as React72 from "react";
|
|
12986
|
-
import { jsx as
|
|
12995
|
+
import { jsx as jsx100, jsxs as jsxs88 } from "react/jsx-runtime";
|
|
12987
12996
|
function ChatComposer({
|
|
12988
12997
|
onSubmit,
|
|
12989
12998
|
onStop,
|
|
@@ -13088,7 +13097,7 @@ function ChatComposer({
|
|
|
13088
13097
|
description: it.description,
|
|
13089
13098
|
icon: it.icon,
|
|
13090
13099
|
meta: mention.meta,
|
|
13091
|
-
shortcut: slash.shortcut ? /* @__PURE__ */
|
|
13100
|
+
shortcut: slash.shortcut ? /* @__PURE__ */ jsx100(KeyHint, { keys: slash.shortcut, size: "sm" }) : void 0,
|
|
13092
13101
|
onSelect: () => {
|
|
13093
13102
|
const insert = trigger.type === "slash" ? slash.immediate ? "/" + slash.id : "/" + slash.id + " " : "@" + (mention.value || mention.label) + " ";
|
|
13094
13103
|
editor.current && editor.current.replaceRange(trigger.from, trigger.to, insert);
|
|
@@ -13148,13 +13157,13 @@ function ChatComposer({
|
|
|
13148
13157
|
};
|
|
13149
13158
|
};
|
|
13150
13159
|
return /* @__PURE__ */ jsxs88("div", { className: "fdc-composer" + (disabled ? " is-disabled" : "") + (narrow ? " is-narrow" : ""), children: [
|
|
13151
|
-
queue.length ? /* @__PURE__ */
|
|
13152
|
-
/* @__PURE__ */
|
|
13153
|
-
/* @__PURE__ */
|
|
13154
|
-
onRemoveQueued ? /* @__PURE__ */
|
|
13160
|
+
queue.length ? /* @__PURE__ */ jsx100("div", { className: "fdc-queue", "aria-label": "Queued messages", children: queue.map((q) => /* @__PURE__ */ jsxs88("div", { className: "fdc-queue-row", children: [
|
|
13161
|
+
/* @__PURE__ */ jsx100("i", { className: "ph ph-clock-countdown", "aria-hidden": "true" }),
|
|
13162
|
+
/* @__PURE__ */ jsx100("span", { className: "fdc-queue-text", title: truncationTitle(q.text || (q.attachments ? q.attachments.length + " file(s)" : "")), children: q.text || (q.attachments ? q.attachments.length + " file(s)" : "") }),
|
|
13163
|
+
onRemoveQueued ? /* @__PURE__ */ jsx100("button", { type: "button", className: "fdc-queue-x", onClick: () => onRemoveQueued(q.id), "aria-label": "Remove queued message", children: /* @__PURE__ */ jsx100("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
13155
13164
|
] }, q.id)) }) : null,
|
|
13156
13165
|
sessionBar,
|
|
13157
|
-
/* @__PURE__ */
|
|
13166
|
+
/* @__PURE__ */ jsx100(
|
|
13158
13167
|
Dropzone,
|
|
13159
13168
|
{
|
|
13160
13169
|
className: "fdc-field",
|
|
@@ -13169,8 +13178,8 @@ function ChatComposer({
|
|
|
13169
13178
|
label: "Drop to attach",
|
|
13170
13179
|
hint: acceptFiles ? acceptFiles.replace(/,/g, " \xB7 ") : void 0,
|
|
13171
13180
|
children: /* @__PURE__ */ jsxs88("div", { ref: wrap, className: "fdc-field-inner", children: [
|
|
13172
|
-
staged.items.length ? /* @__PURE__ */
|
|
13173
|
-
/* @__PURE__ */
|
|
13181
|
+
staged.items.length ? /* @__PURE__ */ jsx100("div", { className: "fdc-staged", children: /* @__PURE__ */ jsx100(FileStrip, { files: staged.items, size: narrow ? 60 : 68, onRemove: staged.remove, onRetry: staged.retry, onOpen: onOpenAttachment }) }) : null,
|
|
13182
|
+
/* @__PURE__ */ jsx100(
|
|
13174
13183
|
MarkdownEditor,
|
|
13175
13184
|
{
|
|
13176
13185
|
ref: editor,
|
|
@@ -13190,32 +13199,32 @@ function ChatComposer({
|
|
|
13190
13199
|
}
|
|
13191
13200
|
),
|
|
13192
13201
|
/* @__PURE__ */ jsxs88("div", { className: "fdc-tools", children: [
|
|
13193
|
-
fileUploadHandler ? /* @__PURE__ */
|
|
13194
|
-
voiceHandler ? /* @__PURE__ */
|
|
13202
|
+
fileUploadHandler ? /* @__PURE__ */ jsx100(FilePickButton, { onFiles: staged.add, onReject: (r) => flash(r[0].message), accept: acceptFiles, maxFileSize, label: "Attach files", icon: "plus" }) : null,
|
|
13203
|
+
voiceHandler ? /* @__PURE__ */ jsx100("button", { type: "button", className: "fd-attachbtn" + (listening ? " is-live" : ""), onClick: voice, "aria-pressed": listening, "aria-label": listening ? "Stop dictation" : "Dictate", children: /* @__PURE__ */ jsx100("i", { className: "ph ph-" + (listening ? "waveform" : "microphone"), "aria-hidden": "true" }) }) : null,
|
|
13195
13204
|
toolbarExtras,
|
|
13196
|
-
/* @__PURE__ */
|
|
13205
|
+
/* @__PURE__ */ jsx100("span", { className: "fdc-tools-gap" }),
|
|
13197
13206
|
maxLength && text.length > maxLength * 0.6 ? /* @__PURE__ */ jsxs88("span", { className: "fdc-count fd-tabular" + (text.length > maxLength * 0.95 ? " is-hot" : ""), children: [
|
|
13198
13207
|
text.length,
|
|
13199
13208
|
"/",
|
|
13200
13209
|
maxLength
|
|
13201
13210
|
] }) : null,
|
|
13202
13211
|
busy ? /* @__PURE__ */ jsxs88("button", { type: "button", className: "fdc-stop", onClick: onStop, "aria-label": "Stop generating", children: [
|
|
13203
|
-
/* @__PURE__ */
|
|
13204
|
-
/* @__PURE__ */
|
|
13212
|
+
/* @__PURE__ */ jsx100("i", { className: "ph ph-stop-circle", "aria-hidden": "true" }),
|
|
13213
|
+
/* @__PURE__ */ jsx100("span", { children: "Stop" })
|
|
13205
13214
|
] }) : /* @__PURE__ */ jsxs88("button", { type: "button", className: "fdc-send", onClick: submit, disabled: !canSend, "aria-label": "Send message", children: [
|
|
13206
|
-
/* @__PURE__ */
|
|
13207
|
-
/* @__PURE__ */
|
|
13215
|
+
/* @__PURE__ */ jsx100("i", { className: "ph ph-paper-plane-right", "aria-hidden": "true" }),
|
|
13216
|
+
/* @__PURE__ */ jsx100("span", { className: "fdc-send-label", children: "Send" })
|
|
13208
13217
|
] })
|
|
13209
13218
|
] })
|
|
13210
13219
|
] })
|
|
13211
13220
|
}
|
|
13212
13221
|
),
|
|
13213
13222
|
notice ? /* @__PURE__ */ jsxs88("div", { className: "fdc-notice", role: "status", children: [
|
|
13214
|
-
/* @__PURE__ */
|
|
13223
|
+
/* @__PURE__ */ jsx100("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
|
|
13215
13224
|
notice
|
|
13216
13225
|
] }) : null,
|
|
13217
|
-
hint && !notice ? /* @__PURE__ */
|
|
13218
|
-
/* @__PURE__ */
|
|
13226
|
+
hint && !notice ? /* @__PURE__ */ jsx100("div", { className: "fdc-hint", children: hint }) : null,
|
|
13227
|
+
/* @__PURE__ */ jsx100(
|
|
13219
13228
|
Popover,
|
|
13220
13229
|
{
|
|
13221
13230
|
open: menuOpen,
|
|
@@ -13229,12 +13238,12 @@ function ChatComposer({
|
|
|
13229
13238
|
returnFocus: false,
|
|
13230
13239
|
closeOnOutside: true,
|
|
13231
13240
|
label: trigger && trigger.type === "slash" ? "Commands" : "Mentions",
|
|
13232
|
-
children: /* @__PURE__ */
|
|
13241
|
+
children: /* @__PURE__ */ jsx100(
|
|
13233
13242
|
Menu,
|
|
13234
13243
|
{
|
|
13235
13244
|
items: menuItems,
|
|
13236
13245
|
autoFocus: false,
|
|
13237
|
-
header: /* @__PURE__ */
|
|
13246
|
+
header: /* @__PURE__ */ jsx100("div", { className: "fd-pop-group", children: trigger && trigger.type === "slash" ? "Commands" : "Attach context" }),
|
|
13238
13247
|
onClose: () => setTrigger(null)
|
|
13239
13248
|
}
|
|
13240
13249
|
)
|
|
@@ -13245,7 +13254,7 @@ function ChatComposer({
|
|
|
13245
13254
|
|
|
13246
13255
|
// src/components/chat/ChatSessionBar.tsx
|
|
13247
13256
|
import * as React73 from "react";
|
|
13248
|
-
import { jsx as
|
|
13257
|
+
import { jsx as jsx101, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
13249
13258
|
var compact2 = meterFormats.compact;
|
|
13250
13259
|
function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extras }) {
|
|
13251
13260
|
const [open2, setOpen] = React73.useState(false);
|
|
@@ -13277,15 +13286,15 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
13277
13286
|
"aria-expanded": expandable ? open2 : void 0,
|
|
13278
13287
|
"aria-label": expandable ? "Usage details" : void 0,
|
|
13279
13288
|
children: [
|
|
13280
|
-
cu ? /* @__PURE__ */
|
|
13281
|
-
/* @__PURE__ */
|
|
13282
|
-
expandable ? /* @__PURE__ */
|
|
13289
|
+
cu ? /* @__PURE__ */ jsx101("span", { className: "fdc-bar-mini", "aria-hidden": "true", children: /* @__PURE__ */ jsx101(SegmentedMeter, { total, segments: cu.segments, height: 4, showTotal: false }) }) : null,
|
|
13290
|
+
/* @__PURE__ */ jsx101("span", { className: "fdc-bar-text", title: truncationTitle(bits.join(" \xB7 ")), children: bits.join(" \xB7 ") }),
|
|
13291
|
+
expandable ? /* @__PURE__ */ jsx101("i", { className: "ph ph-caret-right fdc-bar-caret", "aria-hidden": "true" }) : null
|
|
13283
13292
|
]
|
|
13284
13293
|
}
|
|
13285
13294
|
),
|
|
13286
13295
|
extras
|
|
13287
13296
|
] }),
|
|
13288
|
-
/* @__PURE__ */
|
|
13297
|
+
/* @__PURE__ */ jsx101(
|
|
13289
13298
|
Popover,
|
|
13290
13299
|
{
|
|
13291
13300
|
open: open2,
|
|
@@ -13300,11 +13309,11 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
13300
13309
|
setOpen(false);
|
|
13301
13310
|
onClear();
|
|
13302
13311
|
}, children: [
|
|
13303
|
-
/* @__PURE__ */
|
|
13312
|
+
/* @__PURE__ */ jsx101("i", { className: "ph ph-trash", "aria-hidden": "true" }),
|
|
13304
13313
|
"Clear conversation"
|
|
13305
13314
|
] }) : void 0,
|
|
13306
13315
|
children: /* @__PURE__ */ jsxs89("div", { className: "fdc-usage", children: [
|
|
13307
|
-
cu ? /* @__PURE__ */
|
|
13316
|
+
cu ? /* @__PURE__ */ jsx101("section", { className: "fdc-usage-sec", children: /* @__PURE__ */ jsx101(
|
|
13308
13317
|
SegmentedMeter,
|
|
13309
13318
|
{
|
|
13310
13319
|
total,
|
|
@@ -13317,8 +13326,8 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
13317
13326
|
}
|
|
13318
13327
|
) }) : null,
|
|
13319
13328
|
limits && limits.length ? /* @__PURE__ */ jsxs89("section", { className: "fdc-usage-sec", children: [
|
|
13320
|
-
/* @__PURE__ */
|
|
13321
|
-
/* @__PURE__ */
|
|
13329
|
+
/* @__PURE__ */ jsx101("h4", { className: "fdc-usage-h", children: "Usage limits" }),
|
|
13330
|
+
/* @__PURE__ */ jsx101("div", { className: "fdc-usage-rows", children: limits.map((l) => /* @__PURE__ */ jsx101(
|
|
13322
13331
|
QuotaRow,
|
|
13323
13332
|
{
|
|
13324
13333
|
label: l.label,
|
|
@@ -13330,23 +13339,23 @@ function ChatSessionBar({ sessionStats, contextUsage, usageLimits, onClear, extr
|
|
|
13330
13339
|
] }) : null,
|
|
13331
13340
|
stats ? /* @__PURE__ */ jsxs89("section", { className: "fdc-usage-sec fdc-usage-stats", children: [
|
|
13332
13341
|
stats.elapsedMs ? /* @__PURE__ */ jsxs89("div", { children: [
|
|
13333
|
-
/* @__PURE__ */
|
|
13334
|
-
/* @__PURE__ */
|
|
13342
|
+
/* @__PURE__ */ jsx101("span", { children: "Session" }),
|
|
13343
|
+
/* @__PURE__ */ jsx101("b", { className: "fd-tabular", children: formatDuration(stats.elapsedMs) })
|
|
13335
13344
|
] }) : null,
|
|
13336
13345
|
stats.tokens ? /* @__PURE__ */ jsxs89("div", { children: [
|
|
13337
|
-
/* @__PURE__ */
|
|
13338
|
-
/* @__PURE__ */
|
|
13346
|
+
/* @__PURE__ */ jsx101("span", { children: "Tokens" }),
|
|
13347
|
+
/* @__PURE__ */ jsx101("b", { className: "fd-tabular", children: stats.tokens.toLocaleString() })
|
|
13339
13348
|
] }) : null,
|
|
13340
13349
|
stats.costUsd != null ? /* @__PURE__ */ jsxs89("div", { children: [
|
|
13341
|
-
/* @__PURE__ */
|
|
13350
|
+
/* @__PURE__ */ jsx101("span", { children: "Cost" }),
|
|
13342
13351
|
/* @__PURE__ */ jsxs89("b", { className: "fd-tabular", children: [
|
|
13343
13352
|
"$",
|
|
13344
13353
|
Number(stats.costUsd).toFixed(3)
|
|
13345
13354
|
] })
|
|
13346
13355
|
] }) : null,
|
|
13347
13356
|
stats.turns ? /* @__PURE__ */ jsxs89("div", { children: [
|
|
13348
|
-
/* @__PURE__ */
|
|
13349
|
-
/* @__PURE__ */
|
|
13357
|
+
/* @__PURE__ */ jsx101("span", { children: "Turns" }),
|
|
13358
|
+
/* @__PURE__ */ jsx101("b", { className: "fd-tabular", children: stats.turns })
|
|
13350
13359
|
] }) : null
|
|
13351
13360
|
] }) : null
|
|
13352
13361
|
] })
|
|
@@ -13385,7 +13394,7 @@ function ModelControls({
|
|
|
13385
13394
|
disabled: m.disabled,
|
|
13386
13395
|
checked: m.id === (current2 && current2.id),
|
|
13387
13396
|
meta: m.meta,
|
|
13388
|
-
shortcut: m.shortcut ? /* @__PURE__ */
|
|
13397
|
+
shortcut: m.shortcut ? /* @__PURE__ */ jsx101(KeyHint, { keys: m.shortcut, size: "sm" }) : void 0,
|
|
13389
13398
|
onSelect: () => onModelChange && onModelChange(m.id)
|
|
13390
13399
|
});
|
|
13391
13400
|
const items = [{ kind: "section", label: "Models" }].concat(flat.map(item));
|
|
@@ -13399,14 +13408,14 @@ function ModelControls({
|
|
|
13399
13408
|
items.push({
|
|
13400
13409
|
kind: "custom",
|
|
13401
13410
|
render: () => /* @__PURE__ */ jsxs89("label", { className: "fdc-switchrow", children: [
|
|
13402
|
-
/* @__PURE__ */
|
|
13403
|
-
/* @__PURE__ */
|
|
13404
|
-
/* @__PURE__ */
|
|
13411
|
+
/* @__PURE__ */ jsx101("span", { children: fastModeLabel }),
|
|
13412
|
+
/* @__PURE__ */ jsx101("input", { type: "checkbox", className: "fd-sr", checked: !!fastMode, onChange: (e) => onFastModeChange(e.target.checked) }),
|
|
13413
|
+
/* @__PURE__ */ jsx101("span", { className: "fd-switch-track" + (fastMode ? " is-on" : ""), "aria-hidden": "true", children: /* @__PURE__ */ jsx101("span", { className: "fd-switch-thumb" }) })
|
|
13405
13414
|
] })
|
|
13406
13415
|
});
|
|
13407
13416
|
}
|
|
13408
13417
|
return /* @__PURE__ */ jsxs89(React73.Fragment, { children: [
|
|
13409
|
-
/* @__PURE__ */
|
|
13418
|
+
/* @__PURE__ */ jsx101(
|
|
13410
13419
|
MenuButton,
|
|
13411
13420
|
{
|
|
13412
13421
|
items,
|
|
@@ -13417,7 +13426,7 @@ function ModelControls({
|
|
|
13417
13426
|
title: "Choose a model"
|
|
13418
13427
|
}
|
|
13419
13428
|
),
|
|
13420
|
-
effortLevels && effortLevels.length ? /* @__PURE__ */
|
|
13429
|
+
effortLevels && effortLevels.length ? /* @__PURE__ */ jsx101(
|
|
13421
13430
|
MenuButton,
|
|
13422
13431
|
{
|
|
13423
13432
|
placement: "top-end",
|
|
@@ -13438,7 +13447,7 @@ function ModelControls({
|
|
|
13438
13447
|
}
|
|
13439
13448
|
|
|
13440
13449
|
// src/components/chat/AgentChatPanel.tsx
|
|
13441
|
-
import { jsx as
|
|
13450
|
+
import { jsx as jsx102, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
13442
13451
|
var SURFACES = { sidebar: "is-sidebar", inline: "is-inline", page: "is-page", modal: "is-modal", sheet: "is-sheet" };
|
|
13443
13452
|
function AgentChatPanel({
|
|
13444
13453
|
/* required */
|
|
@@ -13592,7 +13601,7 @@ function AgentChatPanel({
|
|
|
13592
13601
|
onReconnect: engine.reload,
|
|
13593
13602
|
deadTitle: "The assistant isn\u2019t reachable"
|
|
13594
13603
|
};
|
|
13595
|
-
const sessionBar = /* @__PURE__ */
|
|
13604
|
+
const sessionBar = /* @__PURE__ */ jsx102(
|
|
13596
13605
|
ChatSessionBar,
|
|
13597
13606
|
{
|
|
13598
13607
|
sessionStats,
|
|
@@ -13601,7 +13610,7 @@ function AgentChatPanel({
|
|
|
13601
13610
|
onClear: engine.visible.length ? engine.clear : void 0
|
|
13602
13611
|
}
|
|
13603
13612
|
);
|
|
13604
|
-
const modelControls = /* @__PURE__ */
|
|
13613
|
+
const modelControls = /* @__PURE__ */ jsx102(
|
|
13605
13614
|
ModelControls,
|
|
13606
13615
|
{
|
|
13607
13616
|
models,
|
|
@@ -13616,7 +13625,7 @@ function AgentChatPanel({
|
|
|
13616
13625
|
narrow
|
|
13617
13626
|
}
|
|
13618
13627
|
);
|
|
13619
|
-
const threadMenu = threads && threads.length ? /* @__PURE__ */
|
|
13628
|
+
const threadMenu = threads && threads.length ? /* @__PURE__ */ jsx102(
|
|
13620
13629
|
MenuButton,
|
|
13621
13630
|
{
|
|
13622
13631
|
variant: "ghost",
|
|
@@ -13654,7 +13663,7 @@ function AgentChatPanel({
|
|
|
13654
13663
|
},
|
|
13655
13664
|
"aria-label": title,
|
|
13656
13665
|
children: [
|
|
13657
|
-
surface === "sidebar" && resizable ? /* @__PURE__ */
|
|
13666
|
+
surface === "sidebar" && resizable ? /* @__PURE__ */ jsx102(
|
|
13658
13667
|
"div",
|
|
13659
13668
|
{
|
|
13660
13669
|
className: "fdc-grip",
|
|
@@ -13670,19 +13679,19 @@ function AgentChatPanel({
|
|
|
13670
13679
|
}
|
|
13671
13680
|
) : null,
|
|
13672
13681
|
showHeader ? /* @__PURE__ */ jsxs90("header", { className: "fdc-head", children: [
|
|
13673
|
-
/* @__PURE__ */
|
|
13682
|
+
/* @__PURE__ */ jsx102("span", { className: "fdc-head-mark", "aria-hidden": "true", children: /* @__PURE__ */ jsx102("i", { className: "ph ph-" + assistantIcon }) }),
|
|
13674
13683
|
/* @__PURE__ */ jsxs90("span", { className: "fdc-head-titles", children: [
|
|
13675
|
-
/* @__PURE__ */
|
|
13676
|
-
subtitle ? /* @__PURE__ */
|
|
13684
|
+
/* @__PURE__ */ jsx102("span", { className: "fdc-head-title", title: truncationTitle(title), children: title }),
|
|
13685
|
+
subtitle ? /* @__PURE__ */ jsx102("span", { className: "fdc-head-sub", title: truncationTitle(subtitle), children: subtitle }) : null
|
|
13677
13686
|
] }),
|
|
13678
13687
|
/* @__PURE__ */ jsxs90("span", { className: "fdc-head-acts", children: [
|
|
13679
13688
|
headerActions,
|
|
13680
13689
|
threadMenu,
|
|
13681
|
-
onNewThread ? /* @__PURE__ */
|
|
13682
|
-
onClose ? /* @__PURE__ */
|
|
13690
|
+
onNewThread ? /* @__PURE__ */ jsx102("button", { type: "button", className: "fdc-iconbtn", onClick: onNewThread, "aria-label": "New conversation", title: "New conversation", children: /* @__PURE__ */ jsx102("i", { className: "ph ph-plus", "aria-hidden": "true" }) }) : null,
|
|
13691
|
+
onClose ? /* @__PURE__ */ jsx102("button", { type: "button", className: "fdc-iconbtn", onClick: onClose, "aria-label": "Close panel", title: "Close", children: /* @__PURE__ */ jsx102("i", { className: "ph ph-x", "aria-hidden": "true" }) }) : null
|
|
13683
13692
|
] })
|
|
13684
13693
|
] }) : null,
|
|
13685
|
-
/* @__PURE__ */
|
|
13694
|
+
/* @__PURE__ */ jsx102(
|
|
13686
13695
|
ChatTranscript,
|
|
13687
13696
|
{
|
|
13688
13697
|
messages: engine.visible,
|
|
@@ -13697,7 +13706,7 @@ function AgentChatPanel({
|
|
|
13697
13706
|
renderEmpty
|
|
13698
13707
|
}
|
|
13699
13708
|
),
|
|
13700
|
-
/* @__PURE__ */
|
|
13709
|
+
/* @__PURE__ */ jsx102(
|
|
13701
13710
|
ChatComposer,
|
|
13702
13711
|
{
|
|
13703
13712
|
onSubmit: (text, atts) => engine.send(text, atts),
|
|
@@ -13731,7 +13740,7 @@ function AgentChatPanel({
|
|
|
13731
13740
|
|
|
13732
13741
|
// src/components/files/FileViewer.tsx
|
|
13733
13742
|
import * as React75 from "react";
|
|
13734
|
-
import { jsx as
|
|
13743
|
+
import { jsx as jsx103, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
13735
13744
|
function previewKindOf(file) {
|
|
13736
13745
|
const mime = (file.mime || "").toLowerCase();
|
|
13737
13746
|
const ext = extensionOf(file.name || "");
|
|
@@ -13826,16 +13835,16 @@ function usePreview(file, kind, resolveUrl) {
|
|
|
13826
13835
|
return { ...state, retry: React75.useCallback(() => setAttempt((a) => a + 1), []) };
|
|
13827
13836
|
}
|
|
13828
13837
|
function PreviewBody({ file, kind, state }) {
|
|
13829
|
-
if (kind === "image") return /* @__PURE__ */
|
|
13830
|
-
if (kind === "pdf") return /* @__PURE__ */
|
|
13831
|
-
if (kind === "markdown") return /* @__PURE__ */
|
|
13838
|
+
if (kind === "image") return /* @__PURE__ */ jsx103("img", { className: "fd-fv-image", src: state.url, alt: file.name || "Preview" });
|
|
13839
|
+
if (kind === "pdf") return /* @__PURE__ */ jsx103("iframe", { className: "fd-fv-pdf", src: state.url, title: file.name || "PDF preview" });
|
|
13840
|
+
if (kind === "markdown") return /* @__PURE__ */ jsx103(Markdown, { className: "fd-fv-markdown", source: state.text || "" });
|
|
13832
13841
|
if (kind === "json") {
|
|
13833
13842
|
let pretty = state.text || "";
|
|
13834
13843
|
try {
|
|
13835
13844
|
pretty = JSON.stringify(JSON.parse(pretty), null, 2);
|
|
13836
13845
|
} catch {
|
|
13837
13846
|
}
|
|
13838
|
-
return /* @__PURE__ */
|
|
13847
|
+
return /* @__PURE__ */ jsx103(CodeBlock, { code: pretty, language: "json" });
|
|
13839
13848
|
}
|
|
13840
13849
|
if (kind === "csv") {
|
|
13841
13850
|
const tsv = extensionOf(file.name || "") === "tsv" || (file.mime || "").toLowerCase().includes("tab-separated");
|
|
@@ -13845,8 +13854,8 @@ function PreviewBody({ file, kind, state }) {
|
|
|
13845
13854
|
const shown = dataRows.slice(0, FILE_VIEWER_CSV_ROW_LIMIT);
|
|
13846
13855
|
return /* @__PURE__ */ jsxs91("div", { className: "fd-fv-csv", children: [
|
|
13847
13856
|
/* @__PURE__ */ jsxs91("table", { className: "fd-fv-csv-table", children: [
|
|
13848
|
-
/* @__PURE__ */
|
|
13849
|
-
/* @__PURE__ */
|
|
13857
|
+
/* @__PURE__ */ jsx103("thead", { children: /* @__PURE__ */ jsx103("tr", { children: head.map((c, i) => /* @__PURE__ */ jsx103("th", { children: c }, i)) }) }),
|
|
13858
|
+
/* @__PURE__ */ jsx103("tbody", { children: shown.map((r, ri) => /* @__PURE__ */ jsx103("tr", { children: head.map((_, ci) => /* @__PURE__ */ jsx103("td", { children: r[ci] ?? "" }, ci)) }, ri)) })
|
|
13850
13859
|
] }),
|
|
13851
13860
|
dataRows.length > FILE_VIEWER_CSV_ROW_LIMIT ? /* @__PURE__ */ jsxs91("p", { className: "fd-fv-csv-note fd-body-sm fd-muted", children: [
|
|
13852
13861
|
"Showing the first ",
|
|
@@ -13857,10 +13866,10 @@ function PreviewBody({ file, kind, state }) {
|
|
|
13857
13866
|
] }) : null
|
|
13858
13867
|
] });
|
|
13859
13868
|
}
|
|
13860
|
-
if (kind === "text") return /* @__PURE__ */
|
|
13869
|
+
if (kind === "text") return /* @__PURE__ */ jsx103(CodeBlock, { code: state.text || "", language: extensionOf(file.name || "") || void 0 });
|
|
13861
13870
|
return /* @__PURE__ */ jsxs91("div", { className: "fd-fv-fallback", children: [
|
|
13862
|
-
/* @__PURE__ */
|
|
13863
|
-
/* @__PURE__ */
|
|
13871
|
+
/* @__PURE__ */ jsx103("span", { className: "fd-fv-fallback-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx103("i", { className: "ph ph-" + iconForMime(file.mime, file.name) }) }),
|
|
13872
|
+
/* @__PURE__ */ jsx103("span", { className: "fd-fv-fallback-title", children: "No preview available" }),
|
|
13864
13873
|
/* @__PURE__ */ jsxs91("span", { className: "fd-fv-fallback-meta", children: [
|
|
13865
13874
|
file.mime || "Unknown type",
|
|
13866
13875
|
file.size ? " \xB7 " + formatBytes(file.size) : ""
|
|
@@ -13897,9 +13906,9 @@ function FileViewer({ file, resolveUrl, sidePanel, sidePanelLabel = "Details", o
|
|
|
13897
13906
|
"aria-label": file.name || "File",
|
|
13898
13907
|
children: [
|
|
13899
13908
|
/* @__PURE__ */ jsxs91("header", { className: "fd-fv-head", children: [
|
|
13900
|
-
/* @__PURE__ */
|
|
13909
|
+
/* @__PURE__ */ jsx103("span", { className: "fd-fv-head-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx103("i", { className: "ph ph-" + iconForMime(file.mime, file.name) }) }),
|
|
13901
13910
|
/* @__PURE__ */ jsxs91("span", { className: "fd-fv-head-titles", children: [
|
|
13902
|
-
/* @__PURE__ */
|
|
13911
|
+
/* @__PURE__ */ jsx103("span", { className: "fd-fv-head-title", title: file.name, children: file.name }),
|
|
13903
13912
|
/* @__PURE__ */ jsxs91("span", { className: "fd-fv-head-meta", children: [
|
|
13904
13913
|
file.mime || "Unknown type",
|
|
13905
13914
|
file.size ? " \xB7 " + formatBytes(file.size) : ""
|
|
@@ -13907,12 +13916,12 @@ function FileViewer({ file, resolveUrl, sidePanel, sidePanelLabel = "Details", o
|
|
|
13907
13916
|
] }),
|
|
13908
13917
|
/* @__PURE__ */ jsxs91("span", { className: "fd-fv-head-actions", children: [
|
|
13909
13918
|
actions,
|
|
13910
|
-
/* @__PURE__ */
|
|
13911
|
-
onClose ? /* @__PURE__ */
|
|
13919
|
+
/* @__PURE__ */ jsx103(Button, { variant: "secondary", size: "sm", icon: "download-simple", loading: downloading, onClick: download, children: "Download" }),
|
|
13920
|
+
onClose ? /* @__PURE__ */ jsx103(IconButton, { icon: "x", label: "Close", onClick: onClose }) : null
|
|
13912
13921
|
] })
|
|
13913
13922
|
] }),
|
|
13914
|
-
downloadError ? /* @__PURE__ */
|
|
13915
|
-
hasSide ? /* @__PURE__ */
|
|
13923
|
+
downloadError ? /* @__PURE__ */ jsx103("div", { className: "fd-fv-download-error", role: "alert", children: downloadError }) : null,
|
|
13924
|
+
hasSide ? /* @__PURE__ */ jsx103(
|
|
13916
13925
|
Tabs,
|
|
13917
13926
|
{
|
|
13918
13927
|
className: "fd-fv-tabs",
|
|
@@ -13922,18 +13931,18 @@ function FileViewer({ file, resolveUrl, sidePanel, sidePanelLabel = "Details", o
|
|
|
13922
13931
|
}
|
|
13923
13932
|
) : null,
|
|
13924
13933
|
/* @__PURE__ */ jsxs91("div", { className: "fd-fv-body", children: [
|
|
13925
|
-
/* @__PURE__ */
|
|
13934
|
+
/* @__PURE__ */ jsx103("div", { className: "fd-fv-preview", role: "region", "aria-label": "Preview of " + (file.name || "file"), children: /* @__PURE__ */ jsx103(
|
|
13926
13935
|
LoadingRegion,
|
|
13927
13936
|
{
|
|
13928
13937
|
state: preview.status === "loading" ? "loading" : preview.status === "error" ? "error" : "ready",
|
|
13929
13938
|
error: preview.error,
|
|
13930
13939
|
label: "Loading preview of " + (file.name || "file"),
|
|
13931
13940
|
onRetry: preview.status === "error" ? preview.retry : void 0,
|
|
13932
|
-
skeleton: /* @__PURE__ */
|
|
13933
|
-
children: /* @__PURE__ */
|
|
13941
|
+
skeleton: /* @__PURE__ */ jsx103(Skeleton, { shape: "card", h: 220 }),
|
|
13942
|
+
children: /* @__PURE__ */ jsx103(PreviewBody, { file, kind, state: preview })
|
|
13934
13943
|
}
|
|
13935
13944
|
) }),
|
|
13936
|
-
hasSide ? /* @__PURE__ */
|
|
13945
|
+
hasSide ? /* @__PURE__ */ jsx103("div", { className: "fd-fv-side", role: "region", "aria-label": sidePanelLabel, children: sidePanel }) : null
|
|
13937
13946
|
] })
|
|
13938
13947
|
]
|
|
13939
13948
|
}
|
|
@@ -13942,7 +13951,7 @@ function FileViewer({ file, resolveUrl, sidePanel, sidePanelLabel = "Details", o
|
|
|
13942
13951
|
|
|
13943
13952
|
// src/components/files/FileBrowser.tsx
|
|
13944
13953
|
import * as React76 from "react";
|
|
13945
|
-
import { Fragment as Fragment30, jsx as
|
|
13954
|
+
import { Fragment as Fragment30, jsx as jsx104, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
13946
13955
|
function childrenOf(folders, parentId) {
|
|
13947
13956
|
return folders.filter((f) => f.parentId === parentId).sort((a, b) => a.name.localeCompare(b.name));
|
|
13948
13957
|
}
|
|
@@ -14015,7 +14024,7 @@ function FolderPickerMenu({
|
|
|
14015
14024
|
const panel = useInlinePanel();
|
|
14016
14025
|
const { open: open2, setOpen, ref } = panel;
|
|
14017
14026
|
return /* @__PURE__ */ jsxs92("span", { className: "fd-fb-menu-anchor", ref, children: [
|
|
14018
|
-
/* @__PURE__ */
|
|
14027
|
+
/* @__PURE__ */ jsx104(
|
|
14019
14028
|
IconButton,
|
|
14020
14029
|
{
|
|
14021
14030
|
icon: "arrows-out-cardinal",
|
|
@@ -14027,8 +14036,8 @@ function FolderPickerMenu({
|
|
|
14027
14036
|
onClick: () => setOpen((v) => !v)
|
|
14028
14037
|
}
|
|
14029
14038
|
),
|
|
14030
|
-
/* @__PURE__ */
|
|
14031
|
-
/* @__PURE__ */
|
|
14039
|
+
/* @__PURE__ */ jsx104(InlinePanelSurface, { panel, align: "right", offset: 4, width: 220, maxHeight: 280, role: "menu", label, children: /* @__PURE__ */ jsxs92("div", { className: "fd-fb-menu", children: [
|
|
14040
|
+
/* @__PURE__ */ jsx104("span", { className: "fd-overline fd-muted fd-fb-menu-title", children: "Move to\u2026" }),
|
|
14032
14041
|
destinations.map((d) => /* @__PURE__ */ jsxs92(
|
|
14033
14042
|
"button",
|
|
14034
14043
|
{
|
|
@@ -14041,7 +14050,7 @@ function FolderPickerMenu({
|
|
|
14041
14050
|
setOpen(false);
|
|
14042
14051
|
},
|
|
14043
14052
|
children: [
|
|
14044
|
-
/* @__PURE__ */
|
|
14053
|
+
/* @__PURE__ */ jsx104("i", { className: "ph ph-" + (d.id == null ? "house-simple" : "folder-simple"), "aria-hidden": "true" }),
|
|
14045
14054
|
d.name
|
|
14046
14055
|
]
|
|
14047
14056
|
},
|
|
@@ -14087,15 +14096,15 @@ function RowShell({ icon, name, meta, onOpen, draggableId, isDropTarget, onDropP
|
|
|
14087
14096
|
draggable: !!draggableId,
|
|
14088
14097
|
onDragStart: draggableId ? (e) => writeDragPayload(e, draggableId) : void 0,
|
|
14089
14098
|
children: [
|
|
14090
|
-
/* @__PURE__ */
|
|
14099
|
+
/* @__PURE__ */ jsx104("span", { className: "fd-fb-row-icon", "aria-hidden": "true", children: /* @__PURE__ */ jsx104("i", { className: "ph ph-" + icon }) }),
|
|
14091
14100
|
/* @__PURE__ */ jsxs92("span", { className: "fd-fb-row-text", children: [
|
|
14092
|
-
/* @__PURE__ */
|
|
14093
|
-
meta ? /* @__PURE__ */
|
|
14101
|
+
/* @__PURE__ */ jsx104("span", { className: "fd-fb-row-name", title: name, children: name }),
|
|
14102
|
+
meta ? /* @__PURE__ */ jsx104("span", { className: "fd-fb-row-meta", children: meta }) : null
|
|
14094
14103
|
] })
|
|
14095
14104
|
]
|
|
14096
14105
|
}
|
|
14097
14106
|
),
|
|
14098
|
-
actions ? /* @__PURE__ */
|
|
14107
|
+
actions ? /* @__PURE__ */ jsx104("span", { className: "fd-fb-row-actions", children: actions }) : null
|
|
14099
14108
|
] });
|
|
14100
14109
|
}
|
|
14101
14110
|
function TreeNode({ folder, depth, folders, currentFolderId, onNavigate, onMoveInto, canMove }) {
|
|
@@ -14106,7 +14115,7 @@ function TreeNode({ folder, depth, folders, currentFolderId, onNavigate, onMoveI
|
|
|
14106
14115
|
}, [currentFolderId, folder.id, folders]);
|
|
14107
14116
|
const isCurrent = folder.id === currentFolderId;
|
|
14108
14117
|
return /* @__PURE__ */ jsxs92("div", { className: "fd-fb-tree-node", children: [
|
|
14109
|
-
/* @__PURE__ */
|
|
14118
|
+
/* @__PURE__ */ jsx104(
|
|
14110
14119
|
RowShell,
|
|
14111
14120
|
{
|
|
14112
14121
|
icon: folder.id === currentFolderId ? "folder-open" : "folder-simple",
|
|
@@ -14116,7 +14125,7 @@ function TreeNode({ folder, depth, folders, currentFolderId, onNavigate, onMoveI
|
|
|
14116
14125
|
isDropTarget: canMove,
|
|
14117
14126
|
onDropPayload: (payload) => onMoveInto(payload, folder.id),
|
|
14118
14127
|
className: ["fd-fb-tree-row", isCurrent ? "is-current" : ""].filter(Boolean).join(" "),
|
|
14119
|
-
actions: kids.length ? /* @__PURE__ */
|
|
14128
|
+
actions: kids.length ? /* @__PURE__ */ jsx104(
|
|
14120
14129
|
IconButton,
|
|
14121
14130
|
{
|
|
14122
14131
|
icon: expanded ? "caret-down" : "caret-right",
|
|
@@ -14128,7 +14137,7 @@ function TreeNode({ folder, depth, folders, currentFolderId, onNavigate, onMoveI
|
|
|
14128
14137
|
) : void 0
|
|
14129
14138
|
}
|
|
14130
14139
|
),
|
|
14131
|
-
expanded && kids.length ? /* @__PURE__ */
|
|
14140
|
+
expanded && kids.length ? /* @__PURE__ */ jsx104("div", { className: "fd-fb-tree-children", style: { paddingLeft: 14 }, children: kids.map((k) => /* @__PURE__ */ jsx104(
|
|
14132
14141
|
TreeNode,
|
|
14133
14142
|
{
|
|
14134
14143
|
folder: k,
|
|
@@ -14217,7 +14226,7 @@ function FileBrowser({
|
|
|
14217
14226
|
const content = /* @__PURE__ */ jsxs92("div", { className: ["fd-fb", className].filter(Boolean).join(" "), children: [
|
|
14218
14227
|
/* @__PURE__ */ jsxs92("div", { className: "fd-fb-head", children: [
|
|
14219
14228
|
/* @__PURE__ */ jsxs92("nav", { className: "fd-fb-crumbs", "aria-label": "Folder path", children: [
|
|
14220
|
-
/* @__PURE__ */
|
|
14229
|
+
/* @__PURE__ */ jsx104(
|
|
14221
14230
|
BreadcrumbCrumb,
|
|
14222
14231
|
{
|
|
14223
14232
|
label: "Home",
|
|
@@ -14227,7 +14236,7 @@ function FileBrowser({
|
|
|
14227
14236
|
onDropPayload: (p) => moveIntoFolder(p, null)
|
|
14228
14237
|
}
|
|
14229
14238
|
),
|
|
14230
|
-
crumbFolders.map((f, i) => /* @__PURE__ */
|
|
14239
|
+
crumbFolders.map((f, i) => /* @__PURE__ */ jsx104(
|
|
14231
14240
|
BreadcrumbCrumb,
|
|
14232
14241
|
{
|
|
14233
14242
|
label: f.name,
|
|
@@ -14240,10 +14249,10 @@ function FileBrowser({
|
|
|
14240
14249
|
))
|
|
14241
14250
|
] }),
|
|
14242
14251
|
/* @__PURE__ */ jsxs92("span", { className: "fd-fb-actions", children: [
|
|
14243
|
-
canCreateFolder ? /* @__PURE__ */
|
|
14252
|
+
canCreateFolder ? /* @__PURE__ */ jsx104(Button, { variant: "secondary", size: "sm", icon: "folder-simple-plus", onClick: openCreate, children: "New folder" }) : null,
|
|
14244
14253
|
canUpload ? /* @__PURE__ */ jsxs92(Fragment30, { children: [
|
|
14245
|
-
/* @__PURE__ */
|
|
14246
|
-
/* @__PURE__ */
|
|
14254
|
+
/* @__PURE__ */ jsx104(Button, { variant: "secondary", size: "sm", icon: "upload-simple", onClick: () => uploadInputRef.current && uploadInputRef.current.click(), children: "Upload" }),
|
|
14255
|
+
/* @__PURE__ */ jsx104(
|
|
14247
14256
|
"input",
|
|
14248
14257
|
{
|
|
14249
14258
|
ref: uploadInputRef,
|
|
@@ -14263,7 +14272,7 @@ function FileBrowser({
|
|
|
14263
14272
|
] }),
|
|
14264
14273
|
/* @__PURE__ */ jsxs92("div", { className: "fd-fb-body", children: [
|
|
14265
14274
|
/* @__PURE__ */ jsxs92("div", { className: "fd-fb-tree", role: "region", "aria-label": "Folder tree", children: [
|
|
14266
|
-
/* @__PURE__ */
|
|
14275
|
+
/* @__PURE__ */ jsx104(
|
|
14267
14276
|
RowShell,
|
|
14268
14277
|
{
|
|
14269
14278
|
icon: "house-simple",
|
|
@@ -14274,7 +14283,7 @@ function FileBrowser({
|
|
|
14274
14283
|
className: ["fd-fb-tree-row", currentFolderId == null ? "is-current" : ""].filter(Boolean).join(" ")
|
|
14275
14284
|
}
|
|
14276
14285
|
),
|
|
14277
|
-
childrenOf(folders, null).map((f) => /* @__PURE__ */
|
|
14286
|
+
childrenOf(folders, null).map((f) => /* @__PURE__ */ jsx104(
|
|
14278
14287
|
TreeNode,
|
|
14279
14288
|
{
|
|
14280
14289
|
folder: f,
|
|
@@ -14288,18 +14297,18 @@ function FileBrowser({
|
|
|
14288
14297
|
f.id
|
|
14289
14298
|
))
|
|
14290
14299
|
] }),
|
|
14291
|
-
/* @__PURE__ */
|
|
14300
|
+
/* @__PURE__ */ jsx104("div", { className: "fd-fb-main", role: "region", "aria-label": "Folder contents", children: /* @__PURE__ */ jsx104(
|
|
14292
14301
|
LoadingRegion,
|
|
14293
14302
|
{
|
|
14294
14303
|
state: loading ? "loading" : "ready",
|
|
14295
14304
|
label: "Loading folder contents",
|
|
14296
14305
|
skeleton: /* @__PURE__ */ jsxs92("div", { className: "fd-stack", style: { gap: 8, padding: 12 }, children: [
|
|
14297
|
-
/* @__PURE__ */
|
|
14298
|
-
/* @__PURE__ */
|
|
14299
|
-
/* @__PURE__ */
|
|
14306
|
+
/* @__PURE__ */ jsx104(Skeleton, { h: 44, radius: "10px" }),
|
|
14307
|
+
/* @__PURE__ */ jsx104(Skeleton, { h: 44, radius: "10px" }),
|
|
14308
|
+
/* @__PURE__ */ jsx104(Skeleton, { h: 44, radius: "10px" })
|
|
14300
14309
|
] }),
|
|
14301
|
-
children: isEmpty ? /* @__PURE__ */
|
|
14302
|
-
subfolders.map((f) => /* @__PURE__ */
|
|
14310
|
+
children: isEmpty ? /* @__PURE__ */ jsx104(EmptyState, { icon: "folder-open", title: "This folder is empty", children: canUpload ? "Drop files here, or use Upload above." : "Nothing has been filed here yet." }) : /* @__PURE__ */ jsxs92("div", { className: "fd-fb-list", children: [
|
|
14311
|
+
subfolders.map((f) => /* @__PURE__ */ jsx104(
|
|
14303
14312
|
RowShell,
|
|
14304
14313
|
{
|
|
14305
14314
|
icon: "folder-simple",
|
|
@@ -14309,8 +14318,8 @@ function FileBrowser({
|
|
|
14309
14318
|
isDropTarget: canMove,
|
|
14310
14319
|
onDropPayload: (p) => moveIntoFolder(p, f.id),
|
|
14311
14320
|
actions: /* @__PURE__ */ jsxs92(Fragment30, { children: [
|
|
14312
|
-
canRenameFolder ? /* @__PURE__ */
|
|
14313
|
-
canMove ? /* @__PURE__ */
|
|
14321
|
+
canRenameFolder ? /* @__PURE__ */ jsx104(IconButton, { icon: "pencil-simple", label: "Rename " + f.name, size: "sm", variant: "ghost", onClick: () => openRename(f) }) : null,
|
|
14322
|
+
canMove ? /* @__PURE__ */ jsx104(
|
|
14314
14323
|
FolderPickerMenu,
|
|
14315
14324
|
{
|
|
14316
14325
|
label: "Move " + f.name,
|
|
@@ -14318,12 +14327,12 @@ function FileBrowser({
|
|
|
14318
14327
|
onPick: (target) => moveIntoFolder({ kind: "folder", id: f.id }, target)
|
|
14319
14328
|
}
|
|
14320
14329
|
) : null,
|
|
14321
|
-
canDeleteFolder ? /* @__PURE__ */
|
|
14330
|
+
canDeleteFolder ? /* @__PURE__ */ jsx104(IconButton, { icon: "trash-simple", label: "Delete " + f.name, size: "sm", variant: "ghost", onClick: () => openDelete(f) }) : null
|
|
14322
14331
|
] })
|
|
14323
14332
|
},
|
|
14324
14333
|
f.id
|
|
14325
14334
|
)),
|
|
14326
|
-
currentFiles.map((file) => /* @__PURE__ */
|
|
14335
|
+
currentFiles.map((file) => /* @__PURE__ */ jsx104(
|
|
14327
14336
|
RowShell,
|
|
14328
14337
|
{
|
|
14329
14338
|
icon: iconForMime(file.mime, file.name),
|
|
@@ -14332,7 +14341,7 @@ function FileBrowser({
|
|
|
14332
14341
|
onOpen: onOpenFile ? () => onOpenFile(file) : void 0,
|
|
14333
14342
|
draggableId: canMove ? { kind: "file", id: file.id } : void 0,
|
|
14334
14343
|
actions: /* @__PURE__ */ jsxs92(Fragment30, { children: [
|
|
14335
|
-
canMove ? /* @__PURE__ */
|
|
14344
|
+
canMove ? /* @__PURE__ */ jsx104(
|
|
14336
14345
|
FolderPickerMenu,
|
|
14337
14346
|
{
|
|
14338
14347
|
label: "Move " + file.name,
|
|
@@ -14340,7 +14349,7 @@ function FileBrowser({
|
|
|
14340
14349
|
onPick: (target) => onMoveFile && onMoveFile(file.id, target)
|
|
14341
14350
|
}
|
|
14342
14351
|
) : null,
|
|
14343
|
-
canRemoveFile ? /* @__PURE__ */
|
|
14352
|
+
canRemoveFile ? /* @__PURE__ */ jsx104(IconButton, { icon: "trash-simple", label: "Remove " + file.name, size: "sm", variant: "ghost", onClick: () => onRemoveFile && onRemoveFile(file) }) : null
|
|
14344
14353
|
] })
|
|
14345
14354
|
},
|
|
14346
14355
|
file.id
|
|
@@ -14349,10 +14358,10 @@ function FileBrowser({
|
|
|
14349
14358
|
}
|
|
14350
14359
|
) })
|
|
14351
14360
|
] }),
|
|
14352
|
-
/* @__PURE__ */
|
|
14353
|
-
/* @__PURE__ */
|
|
14354
|
-
/* @__PURE__ */
|
|
14355
|
-
] }), children: /* @__PURE__ */
|
|
14361
|
+
/* @__PURE__ */ jsx104(Modal, { open: createOpen, title: "New folder", onClose: () => setCreateOpen(false), footer: /* @__PURE__ */ jsxs92(Fragment30, { children: [
|
|
14362
|
+
/* @__PURE__ */ jsx104(Button, { variant: "secondary", onClick: () => setCreateOpen(false), children: "Cancel" }),
|
|
14363
|
+
/* @__PURE__ */ jsx104(Button, { onClick: submitCreate, disabled: !createName.trim(), children: "Create" })
|
|
14364
|
+
] }), children: /* @__PURE__ */ jsx104(
|
|
14356
14365
|
"input",
|
|
14357
14366
|
{
|
|
14358
14367
|
className: "fd-fb-input",
|
|
@@ -14366,10 +14375,10 @@ function FileBrowser({
|
|
|
14366
14375
|
autoFocus: true
|
|
14367
14376
|
}
|
|
14368
14377
|
) }),
|
|
14369
|
-
/* @__PURE__ */
|
|
14370
|
-
/* @__PURE__ */
|
|
14371
|
-
/* @__PURE__ */
|
|
14372
|
-
] }), children: /* @__PURE__ */
|
|
14378
|
+
/* @__PURE__ */ jsx104(Modal, { open: renameTarget != null, title: "Rename folder", onClose: () => setRenameTarget(null), footer: /* @__PURE__ */ jsxs92(Fragment30, { children: [
|
|
14379
|
+
/* @__PURE__ */ jsx104(Button, { variant: "secondary", onClick: () => setRenameTarget(null), children: "Cancel" }),
|
|
14380
|
+
/* @__PURE__ */ jsx104(Button, { onClick: submitRename, disabled: !renameValue.trim(), children: "Save" })
|
|
14381
|
+
] }), children: /* @__PURE__ */ jsx104(
|
|
14373
14382
|
"input",
|
|
14374
14383
|
{
|
|
14375
14384
|
className: "fd-fb-input",
|
|
@@ -14383,7 +14392,7 @@ function FileBrowser({
|
|
|
14383
14392
|
autoFocus: true
|
|
14384
14393
|
}
|
|
14385
14394
|
) }),
|
|
14386
|
-
/* @__PURE__ */
|
|
14395
|
+
/* @__PURE__ */ jsx104(
|
|
14387
14396
|
Modal,
|
|
14388
14397
|
{
|
|
14389
14398
|
open: deleteTarget != null,
|
|
@@ -14391,14 +14400,14 @@ function FileBrowser({
|
|
|
14391
14400
|
description: "This can't be undone. The folder must be empty.",
|
|
14392
14401
|
onClose: () => setDeleteTarget(null),
|
|
14393
14402
|
footer: /* @__PURE__ */ jsxs92(Fragment30, { children: [
|
|
14394
|
-
/* @__PURE__ */
|
|
14395
|
-
/* @__PURE__ */
|
|
14403
|
+
/* @__PURE__ */ jsx104(Button, { variant: "secondary", onClick: () => setDeleteTarget(null), children: "Cancel" }),
|
|
14404
|
+
/* @__PURE__ */ jsx104(Button, { variant: "danger", onClick: confirmDelete, children: "Delete" })
|
|
14396
14405
|
] })
|
|
14397
14406
|
}
|
|
14398
14407
|
)
|
|
14399
14408
|
] });
|
|
14400
14409
|
if (!canUpload) return content;
|
|
14401
|
-
return /* @__PURE__ */
|
|
14410
|
+
return /* @__PURE__ */ jsx104(Dropzone, { className: "fd-fb-dropzone", onFiles: (picked) => onUpload && onUpload(picked, currentFolderId), label: "Drop files to upload", children: content });
|
|
14402
14411
|
}
|
|
14403
14412
|
function BreadcrumbCrumb({
|
|
14404
14413
|
label,
|
|
@@ -14433,7 +14442,7 @@ function BreadcrumbCrumb({
|
|
|
14433
14442
|
if (payload && onDropPayload) onDropPayload(payload);
|
|
14434
14443
|
}
|
|
14435
14444
|
} : {};
|
|
14436
|
-
return /* @__PURE__ */
|
|
14445
|
+
return /* @__PURE__ */ jsx104("span", { className: ["fd-fb-crumb", over ? "is-drop-target" : ""].filter(Boolean).join(" "), ...dropHandlers, children: isCurrent ? /* @__PURE__ */ jsx104("span", { className: "fd-fb-crumb-current", "aria-current": "page", children: label }) : /* @__PURE__ */ jsx104("button", { type: "button", className: "fd-fb-crumb-link", onClick, children: label }) });
|
|
14437
14446
|
}
|
|
14438
14447
|
|
|
14439
14448
|
// src/kits/query.ts
|
|
@@ -15143,6 +15152,7 @@ export {
|
|
|
15143
15152
|
SortMenu,
|
|
15144
15153
|
Spinner,
|
|
15145
15154
|
StackedLayerProvider,
|
|
15155
|
+
StatGrid,
|
|
15146
15156
|
StatTile,
|
|
15147
15157
|
StepList,
|
|
15148
15158
|
SurroundSound,
|
|
@@ -15189,6 +15199,7 @@ export {
|
|
|
15189
15199
|
formatDuration,
|
|
15190
15200
|
formatEta,
|
|
15191
15201
|
formatRelative,
|
|
15202
|
+
formatShare,
|
|
15192
15203
|
groupMessages,
|
|
15193
15204
|
hasModifier,
|
|
15194
15205
|
historyUrlAdapter,
|