@merittdev/horus-lens 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -22
- package/dist/browser.cjs +1 -1
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +2 -2
- package/dist/{chunk-DU7HNRF4.js → chunk-CTBY5XIN.js} +2 -2
- package/dist/{chunk-S6S3ZZQA.js → chunk-XRONR4GR.js} +2 -2
- package/dist/{chunk-S6S3ZZQA.js.map → chunk-XRONR4GR.js.map} +1 -1
- package/dist/dashboard.cjs +784 -434
- package/dist/dashboard.cjs.map +1 -1
- package/dist/dashboard.css +224 -1
- package/dist/dashboard.d.cts +85 -1
- package/dist/dashboard.d.ts +85 -1
- package/dist/dashboard.js +648 -301
- package/dist/dashboard.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lens.min.js +1 -1
- package/dist/lens.min.js.map +1 -1
- package/dist/react.cjs +6 -3
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +18 -6
- package/dist/react.d.ts +18 -6
- package/dist/react.js +6 -4
- package/dist/react.js.map +1 -1
- package/dist/server.cjs +109 -0
- package/dist/server.cjs.map +1 -0
- package/dist/server.d.cts +59 -0
- package/dist/server.d.ts +59 -0
- package/dist/server.js +82 -0
- package/dist/server.js.map +1 -0
- package/package.json +9 -4
- /package/dist/{chunk-DU7HNRF4.js.map → chunk-CTBY5XIN.js.map} +0 -0
package/dist/dashboard.cjs
CHANGED
|
@@ -17504,8 +17504,11 @@ var init_rrweb = __esm({
|
|
|
17504
17504
|
var dashboard_exports = {};
|
|
17505
17505
|
__export(dashboard_exports, {
|
|
17506
17506
|
IntegrationSettings: () => IntegrationSettings,
|
|
17507
|
+
LensAdmin: () => LensAdmin,
|
|
17507
17508
|
LensApiError: () => LensApiError,
|
|
17509
|
+
LensDashboard: () => LensDashboard,
|
|
17508
17510
|
LensDashboardProvider: () => LensDashboardProvider,
|
|
17511
|
+
LensProvider: () => LensProvider,
|
|
17509
17512
|
OnboardingWizard: () => OnboardingWizard,
|
|
17510
17513
|
ProjectSettings: () => ProjectSettings,
|
|
17511
17514
|
ReplayPlayer: () => ReplayPlayer,
|
|
@@ -17542,21 +17545,23 @@ var clsx_default = clsx;
|
|
|
17542
17545
|
// ../dashboard/dist/index.js
|
|
17543
17546
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
17544
17547
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
17545
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
17546
17548
|
var import_react3 = require("react");
|
|
17549
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
17550
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
17547
17551
|
var import_react4 = require("react");
|
|
17548
17552
|
var import_react5 = require("react");
|
|
17549
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
17550
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
17551
17553
|
var import_react6 = require("react");
|
|
17552
|
-
var
|
|
17554
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
17553
17555
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
17554
|
-
var
|
|
17556
|
+
var import_react7 = require("react");
|
|
17555
17557
|
var import_react8 = require("react");
|
|
17558
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
17556
17559
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
17557
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
17558
17560
|
var import_react9 = require("react");
|
|
17561
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
17559
17562
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
17563
|
+
var import_react10 = require("react");
|
|
17564
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
17560
17565
|
var LensApiError = class extends Error {
|
|
17561
17566
|
constructor(status, code, message) {
|
|
17562
17567
|
super(message);
|
|
@@ -17671,6 +17676,11 @@ function createLensApi(config) {
|
|
|
17671
17676
|
if (res && Array.isArray(res.integrations)) return res.integrations;
|
|
17672
17677
|
return this.listIntegrations();
|
|
17673
17678
|
},
|
|
17679
|
+
async getIntegrationOptions(provider) {
|
|
17680
|
+
return request(
|
|
17681
|
+
`/v1/integrations/${encodeURIComponent(provider)}/options`
|
|
17682
|
+
);
|
|
17683
|
+
},
|
|
17674
17684
|
async createProject(body) {
|
|
17675
17685
|
return request("/v1/projects", {
|
|
17676
17686
|
method: "POST",
|
|
@@ -17718,61 +17728,6 @@ function useLensApi() {
|
|
|
17718
17728
|
}
|
|
17719
17729
|
return api;
|
|
17720
17730
|
}
|
|
17721
|
-
function relativeTime(iso, now = Date.now()) {
|
|
17722
|
-
if (!iso) return "\u2014";
|
|
17723
|
-
const then = new Date(iso).getTime();
|
|
17724
|
-
if (Number.isNaN(then)) return "\u2014";
|
|
17725
|
-
const diff2 = now - then;
|
|
17726
|
-
const sec = Math.round(diff2 / 1e3);
|
|
17727
|
-
if (sec < 5) return "just now";
|
|
17728
|
-
if (sec < 60) return `${sec}s ago`;
|
|
17729
|
-
const min = Math.round(sec / 60);
|
|
17730
|
-
if (min < 60) return `${min}m ago`;
|
|
17731
|
-
const hr = Math.round(min / 60);
|
|
17732
|
-
if (hr < 24) return `${hr}h ago`;
|
|
17733
|
-
const day = Math.round(hr / 24);
|
|
17734
|
-
if (day < 7) return `${day}d ago`;
|
|
17735
|
-
const wk = Math.round(day / 7);
|
|
17736
|
-
if (wk < 5) return `${wk}w ago`;
|
|
17737
|
-
const mo = Math.round(day / 30);
|
|
17738
|
-
if (mo < 12) return `${mo}mo ago`;
|
|
17739
|
-
const yr = Math.round(day / 365);
|
|
17740
|
-
return `${yr}y ago`;
|
|
17741
|
-
}
|
|
17742
|
-
function formatTimestamp(iso) {
|
|
17743
|
-
if (!iso) return "\u2014";
|
|
17744
|
-
const d = new Date(iso);
|
|
17745
|
-
if (Number.isNaN(d.getTime())) return "\u2014";
|
|
17746
|
-
return d.toLocaleString();
|
|
17747
|
-
}
|
|
17748
|
-
function truncate(value, max = 80) {
|
|
17749
|
-
if (value.length <= max) return value;
|
|
17750
|
-
return `${value.slice(0, max - 1).trimEnd()}\u2026`;
|
|
17751
|
-
}
|
|
17752
|
-
function urlPath(raw) {
|
|
17753
|
-
if (!raw) return "\u2014";
|
|
17754
|
-
try {
|
|
17755
|
-
const u2 = new URL(raw);
|
|
17756
|
-
return `${u2.pathname}${u2.search}` || "/";
|
|
17757
|
-
} catch {
|
|
17758
|
-
return raw;
|
|
17759
|
-
}
|
|
17760
|
-
}
|
|
17761
|
-
function formatDuration(ms) {
|
|
17762
|
-
if (ms == null) return "\u2014";
|
|
17763
|
-
if (ms < 1e3) return `${Math.round(ms)}ms`;
|
|
17764
|
-
return `${(ms / 1e3).toFixed(2)}s`;
|
|
17765
|
-
}
|
|
17766
|
-
var LABELS = {
|
|
17767
|
-
initiated: "Initiated",
|
|
17768
|
-
submitted: "Submitted",
|
|
17769
|
-
triaged: "Triaged",
|
|
17770
|
-
linked: "Linked",
|
|
17771
|
-
resolved: "Resolved"
|
|
17772
|
-
};
|
|
17773
|
-
function StatusBadge({ status }) {
|
|
17774
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: clsx_default("lens-db__badge", `lens-db__badge--${status}`), children: LABELS[status] });
|
|
17775
|
-
}
|
|
17776
17731
|
function base({ size = 16, ...rest }) {
|
|
17777
17732
|
return {
|
|
17778
17733
|
width: size,
|
|
@@ -17789,55 +17744,77 @@ function base({ size = 16, ...rest }) {
|
|
|
17789
17744
|
};
|
|
17790
17745
|
}
|
|
17791
17746
|
function IconPlay(props) {
|
|
17792
|
-
return /* @__PURE__ */ (0,
|
|
17747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M8 5.5v13l11-6.5-11-6.5Z", fill: "currentColor", stroke: "none" }) });
|
|
17793
17748
|
}
|
|
17794
17749
|
function IconPause(props) {
|
|
17795
|
-
return /* @__PURE__ */ (0,
|
|
17796
|
-
/* @__PURE__ */ (0,
|
|
17797
|
-
/* @__PURE__ */ (0,
|
|
17750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17751
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "7", y: "5", width: "3.5", height: "14", rx: "1", fill: "currentColor", stroke: "none" }),
|
|
17752
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "13.5", y: "5", width: "3.5", height: "14", rx: "1", fill: "currentColor", stroke: "none" })
|
|
17798
17753
|
] });
|
|
17799
17754
|
}
|
|
17800
17755
|
function IconClose(props) {
|
|
17801
|
-
return /* @__PURE__ */ (0,
|
|
17756
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M18 6 6 18M6 6l12 12" }) });
|
|
17802
17757
|
}
|
|
17803
17758
|
function IconChevronLeft(props) {
|
|
17804
|
-
return /* @__PURE__ */ (0,
|
|
17759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M15 6l-6 6 6 6" }) });
|
|
17805
17760
|
}
|
|
17806
17761
|
function IconChevronRight(props) {
|
|
17807
|
-
return /* @__PURE__ */ (0,
|
|
17762
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9 6l6 6-6 6" }) });
|
|
17808
17763
|
}
|
|
17809
17764
|
function IconExternal(props) {
|
|
17810
|
-
return /* @__PURE__ */ (0,
|
|
17811
|
-
/* @__PURE__ */ (0,
|
|
17812
|
-
/* @__PURE__ */ (0,
|
|
17765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17766
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M14 5h5v5M19 5l-8 8" }),
|
|
17767
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M18 13.5V18a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 18V7.5A1.5 1.5 0 0 1 6 6h4.5" })
|
|
17813
17768
|
] });
|
|
17814
17769
|
}
|
|
17815
17770
|
function IconCopy(props) {
|
|
17816
|
-
return /* @__PURE__ */ (0,
|
|
17817
|
-
/* @__PURE__ */ (0,
|
|
17818
|
-
/* @__PURE__ */ (0,
|
|
17771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17772
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
|
|
17773
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M5 15V6a1 1 0 0 1 1-1h9" })
|
|
17819
17774
|
] });
|
|
17820
17775
|
}
|
|
17821
17776
|
function IconCheck(props) {
|
|
17822
|
-
return /* @__PURE__ */ (0,
|
|
17777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...base(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M20 6 9 17l-5-5" }) });
|
|
17823
17778
|
}
|
|
17824
17779
|
function IconCheckCircle(props) {
|
|
17825
|
-
return /* @__PURE__ */ (0,
|
|
17826
|
-
/* @__PURE__ */ (0,
|
|
17827
|
-
/* @__PURE__ */ (0,
|
|
17780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17781
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "12", r: "9" }),
|
|
17782
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "m8.5 12 2.5 2.5 4.5-5" })
|
|
17828
17783
|
] });
|
|
17829
17784
|
}
|
|
17830
17785
|
function IconAlertTriangle(props) {
|
|
17831
|
-
return /* @__PURE__ */ (0,
|
|
17832
|
-
/* @__PURE__ */ (0,
|
|
17833
|
-
/* @__PURE__ */ (0,
|
|
17834
|
-
/* @__PURE__ */ (0,
|
|
17786
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17787
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 4.5 21 19.5H3L12 4.5Z" }),
|
|
17788
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 10v4.5" }),
|
|
17789
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 17.25h.01" })
|
|
17835
17790
|
] });
|
|
17836
17791
|
}
|
|
17837
17792
|
function IconInbox(props) {
|
|
17838
|
-
return /* @__PURE__ */ (0,
|
|
17839
|
-
/* @__PURE__ */ (0,
|
|
17840
|
-
/* @__PURE__ */ (0,
|
|
17793
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17794
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M4 13h4l1.5 2.5h5L16 13h4" }),
|
|
17795
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M6.5 5h11l3 8v4.5A1.5 1.5 0 0 1 19 19H5a1.5 1.5 0 0 1-1.5-1.5V13l3-8Z" })
|
|
17796
|
+
] });
|
|
17797
|
+
}
|
|
17798
|
+
function IconBug(props) {
|
|
17799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17800
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("rect", { x: "8", y: "7", width: "8", height: "12", rx: "4" }),
|
|
17801
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9 5a3 3 0 0 1 6 0" }),
|
|
17802
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 8.5v10" }),
|
|
17803
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M8 11H4.5M8 15H4M8 8 5.5 6M16 11h3.5M16 15h4M16 8l2.5-2" })
|
|
17804
|
+
] });
|
|
17805
|
+
}
|
|
17806
|
+
function IconPlug(props) {
|
|
17807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17808
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9 3v5M15 3v5" }),
|
|
17809
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M6.5 8h11v1.5a5.5 5.5 0 0 1-11 0V8Z" }),
|
|
17810
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 15v6" })
|
|
17811
|
+
] });
|
|
17812
|
+
}
|
|
17813
|
+
function IconRocket(props) {
|
|
17814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { ...base(props), children: [
|
|
17815
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 3c2.6 1.7 4 4.6 4 7.5l-1.8 2.5H9.8L8 10.5C8 7.6 9.4 4.7 12 3Z" }),
|
|
17816
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "12", cy: "9", r: "1.4" }),
|
|
17817
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M9.8 13l-2 2.2.2 3 2.4-1.4M14.2 13l2 2.2-.2 3-2.4-1.4" })
|
|
17841
17818
|
] });
|
|
17842
17819
|
}
|
|
17843
17820
|
function brand({ size = 16, ...rest }) {
|
|
@@ -17852,27 +17829,128 @@ function brand({ size = 16, ...rest }) {
|
|
|
17852
17829
|
};
|
|
17853
17830
|
}
|
|
17854
17831
|
function IconGitHub(props) {
|
|
17855
|
-
return /* @__PURE__ */ (0,
|
|
17832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...brand(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12" }) });
|
|
17856
17833
|
}
|
|
17857
17834
|
function IconLinear(props) {
|
|
17858
|
-
return /* @__PURE__ */ (0,
|
|
17835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...brand(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z" }) });
|
|
17859
17836
|
}
|
|
17860
17837
|
function IconJira(props) {
|
|
17861
|
-
return /* @__PURE__ */ (0,
|
|
17838
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("svg", { ...brand(props), children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M11.571 11.513H0a5.218 5.218 0 0 0 5.232 5.215h2.13v2.057A5.215 5.215 0 0 0 12.575 24V12.518a1.005 1.005 0 0 0-1.005-1.005zm5.723-5.756H5.736a5.215 5.215 0 0 0 5.215 5.214h2.129v2.058a5.218 5.218 0 0 0 5.215 5.214V6.758a1.001 1.001 0 0 0-1.001-1.001zM23.013 0H11.455a5.215 5.215 0 0 0 5.215 5.215h2.129v2.057A5.215 5.215 0 0 0 24 12.483V1.005A1.001 1.001 0 0 0 23.013 0Z" }) });
|
|
17839
|
+
}
|
|
17840
|
+
var MARKUP_RULES = [
|
|
17841
|
+
{ cls: "com", re: /<!--[\s\S]*?-->|\/\*[\s\S]*?\*\/|\/\/[^\n]*/y },
|
|
17842
|
+
{ cls: "str", re: /"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`/y },
|
|
17843
|
+
{ cls: "tag", re: /<\/?[a-zA-Z][\w.-]*|\/>|>/y },
|
|
17844
|
+
{
|
|
17845
|
+
cls: "kw",
|
|
17846
|
+
re: /\b(?:import|from|export|function|return|const|let|var|async|await|new|window|default)\b/y
|
|
17847
|
+
},
|
|
17848
|
+
{ cls: "attr", re: /\b[a-zA-Z_][\w-]*(?==)/y },
|
|
17849
|
+
{ cls: "num", re: /\b\d+(?:\.\d+)?\b/y }
|
|
17850
|
+
];
|
|
17851
|
+
var ENV_RULES = [
|
|
17852
|
+
{ cls: "com", re: /#[^\n]*/y },
|
|
17853
|
+
{ cls: "attr", re: /^[A-Z][A-Z0-9_]*(?==)/my },
|
|
17854
|
+
{ cls: "str", re: /(?<==)[^\n]+/y }
|
|
17855
|
+
];
|
|
17856
|
+
function highlightCode(code, lang) {
|
|
17857
|
+
const rules2 = lang === "env" ? ENV_RULES : MARKUP_RULES;
|
|
17858
|
+
const out = [];
|
|
17859
|
+
let pos = 0;
|
|
17860
|
+
let plainStart = 0;
|
|
17861
|
+
let key = 0;
|
|
17862
|
+
const flushPlain = (until) => {
|
|
17863
|
+
if (until > plainStart) out.push(code.slice(plainStart, until));
|
|
17864
|
+
};
|
|
17865
|
+
while (pos < code.length) {
|
|
17866
|
+
let matched = false;
|
|
17867
|
+
for (const rule2 of rules2) {
|
|
17868
|
+
rule2.re.lastIndex = pos;
|
|
17869
|
+
const m = rule2.re.exec(code);
|
|
17870
|
+
if (m && m[0].length > 0) {
|
|
17871
|
+
flushPlain(pos);
|
|
17872
|
+
out.push(
|
|
17873
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: `lens-db__tok-${rule2.cls}`, children: m[0] }, key++)
|
|
17874
|
+
);
|
|
17875
|
+
pos += m[0].length;
|
|
17876
|
+
plainStart = pos;
|
|
17877
|
+
matched = true;
|
|
17878
|
+
break;
|
|
17879
|
+
}
|
|
17880
|
+
}
|
|
17881
|
+
if (!matched) pos += 1;
|
|
17882
|
+
}
|
|
17883
|
+
flushPlain(code.length);
|
|
17884
|
+
return out;
|
|
17885
|
+
}
|
|
17886
|
+
function relativeTime(iso, now = Date.now()) {
|
|
17887
|
+
if (!iso) return "\u2014";
|
|
17888
|
+
const then = new Date(iso).getTime();
|
|
17889
|
+
if (Number.isNaN(then)) return "\u2014";
|
|
17890
|
+
const diff2 = now - then;
|
|
17891
|
+
const sec = Math.round(diff2 / 1e3);
|
|
17892
|
+
if (sec < 5) return "just now";
|
|
17893
|
+
if (sec < 60) return `${sec}s ago`;
|
|
17894
|
+
const min = Math.round(sec / 60);
|
|
17895
|
+
if (min < 60) return `${min}m ago`;
|
|
17896
|
+
const hr = Math.round(min / 60);
|
|
17897
|
+
if (hr < 24) return `${hr}h ago`;
|
|
17898
|
+
const day = Math.round(hr / 24);
|
|
17899
|
+
if (day < 7) return `${day}d ago`;
|
|
17900
|
+
const wk = Math.round(day / 7);
|
|
17901
|
+
if (wk < 5) return `${wk}w ago`;
|
|
17902
|
+
const mo = Math.round(day / 30);
|
|
17903
|
+
if (mo < 12) return `${mo}mo ago`;
|
|
17904
|
+
const yr = Math.round(day / 365);
|
|
17905
|
+
return `${yr}y ago`;
|
|
17906
|
+
}
|
|
17907
|
+
function formatTimestamp(iso) {
|
|
17908
|
+
if (!iso) return "\u2014";
|
|
17909
|
+
const d = new Date(iso);
|
|
17910
|
+
if (Number.isNaN(d.getTime())) return "\u2014";
|
|
17911
|
+
return d.toLocaleString();
|
|
17912
|
+
}
|
|
17913
|
+
function truncate(value, max = 80) {
|
|
17914
|
+
if (value.length <= max) return value;
|
|
17915
|
+
return `${value.slice(0, max - 1).trimEnd()}\u2026`;
|
|
17916
|
+
}
|
|
17917
|
+
function urlPath(raw) {
|
|
17918
|
+
if (!raw) return "\u2014";
|
|
17919
|
+
try {
|
|
17920
|
+
const u2 = new URL(raw);
|
|
17921
|
+
return `${u2.pathname}${u2.search}` || "/";
|
|
17922
|
+
} catch {
|
|
17923
|
+
return raw;
|
|
17924
|
+
}
|
|
17925
|
+
}
|
|
17926
|
+
function formatDuration(ms) {
|
|
17927
|
+
if (ms == null) return "\u2014";
|
|
17928
|
+
if (ms < 1e3) return `${Math.round(ms)}ms`;
|
|
17929
|
+
return `${(ms / 1e3).toFixed(2)}s`;
|
|
17930
|
+
}
|
|
17931
|
+
var LABELS = {
|
|
17932
|
+
initiated: "Initiated",
|
|
17933
|
+
submitted: "Submitted",
|
|
17934
|
+
triaged: "Triaged",
|
|
17935
|
+
linked: "Linked",
|
|
17936
|
+
resolved: "Resolved"
|
|
17937
|
+
};
|
|
17938
|
+
function StatusBadge({ status }) {
|
|
17939
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: clsx_default("lens-db__badge", `lens-db__badge--${status}`), children: LABELS[status] });
|
|
17862
17940
|
}
|
|
17863
17941
|
var SEARCH_DEBOUNCE_MS = 350;
|
|
17864
17942
|
function ReportsTable(props) {
|
|
17865
17943
|
const { onSelect, status, pageSize = 20, className } = props;
|
|
17866
17944
|
const api = useLensApi();
|
|
17867
|
-
const [reports, setReports] = (0,
|
|
17868
|
-
const [nextCursor, setNextCursor] = (0,
|
|
17869
|
-
const [loading, setLoading] = (0,
|
|
17870
|
-
const [error, setError] = (0,
|
|
17871
|
-
const [input2, setInput] = (0,
|
|
17872
|
-
const [query, setQuery] = (0,
|
|
17873
|
-
const [pageCursor, setPageCursor] = (0,
|
|
17874
|
-
const [history, setHistory] = (0,
|
|
17875
|
-
const load = (0,
|
|
17945
|
+
const [reports, setReports] = (0, import_react3.useState)([]);
|
|
17946
|
+
const [nextCursor, setNextCursor] = (0, import_react3.useState)(null);
|
|
17947
|
+
const [loading, setLoading] = (0, import_react3.useState)(true);
|
|
17948
|
+
const [error, setError] = (0, import_react3.useState)(void 0);
|
|
17949
|
+
const [input2, setInput] = (0, import_react3.useState)("");
|
|
17950
|
+
const [query, setQuery] = (0, import_react3.useState)("");
|
|
17951
|
+
const [pageCursor, setPageCursor] = (0, import_react3.useState)(void 0);
|
|
17952
|
+
const [history, setHistory] = (0, import_react3.useState)([]);
|
|
17953
|
+
const load = (0, import_react3.useCallback)(
|
|
17876
17954
|
async (cursor, q) => {
|
|
17877
17955
|
setLoading(true);
|
|
17878
17956
|
setError(void 0);
|
|
@@ -17893,11 +17971,11 @@ function ReportsTable(props) {
|
|
|
17893
17971
|
},
|
|
17894
17972
|
[api, status, pageSize]
|
|
17895
17973
|
);
|
|
17896
|
-
(0,
|
|
17974
|
+
(0, import_react3.useEffect)(() => {
|
|
17897
17975
|
const timer = setTimeout(() => setQuery(input2.trim()), SEARCH_DEBOUNCE_MS);
|
|
17898
17976
|
return () => clearTimeout(timer);
|
|
17899
17977
|
}, [input2]);
|
|
17900
|
-
(0,
|
|
17978
|
+
(0, import_react3.useEffect)(() => {
|
|
17901
17979
|
setHistory([]);
|
|
17902
17980
|
setPageCursor(void 0);
|
|
17903
17981
|
void load(void 0, query);
|
|
@@ -17919,9 +17997,9 @@ function ReportsTable(props) {
|
|
|
17919
17997
|
const canNext = nextCursor !== null;
|
|
17920
17998
|
const isOnlyPage = !canPrev && !canNext;
|
|
17921
17999
|
const contextText = isOnlyPage ? `Showing ${reports.length}` : `${reports.length} on this page`;
|
|
17922
|
-
return /* @__PURE__ */ (0,
|
|
17923
|
-
/* @__PURE__ */ (0,
|
|
17924
|
-
/* @__PURE__ */ (0,
|
|
18000
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: clsx_default("lens-db", "lens-db__table-wrap", className), children: [
|
|
18001
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "lens-db__table-toolbar", children: [
|
|
18002
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
17925
18003
|
"input",
|
|
17926
18004
|
{
|
|
17927
18005
|
type: "search",
|
|
@@ -17938,23 +18016,23 @@ function ReportsTable(props) {
|
|
|
17938
18016
|
}
|
|
17939
18017
|
}
|
|
17940
18018
|
),
|
|
17941
|
-
!loading && !error && reports.length > 0 && /* @__PURE__ */ (0,
|
|
18019
|
+
!loading && !error && reports.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__table-context lens-db__muted", children: contextText })
|
|
17942
18020
|
] }),
|
|
17943
|
-
/* @__PURE__ */ (0,
|
|
17944
|
-
/* @__PURE__ */ (0,
|
|
17945
|
-
/* @__PURE__ */ (0,
|
|
17946
|
-
/* @__PURE__ */ (0,
|
|
17947
|
-
/* @__PURE__ */ (0,
|
|
17948
|
-
/* @__PURE__ */ (0,
|
|
17949
|
-
/* @__PURE__ */ (0,
|
|
17950
|
-
/* @__PURE__ */ (0,
|
|
17951
|
-
/* @__PURE__ */ (0,
|
|
18021
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("table", { className: "lens-db__table", children: [
|
|
18022
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("tr", { children: [
|
|
18023
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { children: "Created" }),
|
|
18024
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { children: "Comment" }),
|
|
18025
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { children: "Path" }),
|
|
18026
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { children: "Status" }),
|
|
18027
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: "lens-db__num", children: "Errors" }),
|
|
18028
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { className: "lens-db__center", children: "Replay" }),
|
|
18029
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("th", { children: "Issue" })
|
|
17952
18030
|
] }) }),
|
|
17953
|
-
/* @__PURE__ */ (0,
|
|
18031
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tbody", { children: loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(SkeletonRows, { rows: 6 }) : error ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("td", { colSpan: 7, className: "lens-db__error", children: [
|
|
17954
18032
|
"Failed to load reports: ",
|
|
17955
18033
|
error.message,
|
|
17956
18034
|
" ",
|
|
17957
|
-
/* @__PURE__ */ (0,
|
|
18035
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
17958
18036
|
"button",
|
|
17959
18037
|
{
|
|
17960
18038
|
type: "button",
|
|
@@ -17963,24 +18041,24 @@ function ReportsTable(props) {
|
|
|
17963
18041
|
children: "Retry"
|
|
17964
18042
|
}
|
|
17965
18043
|
)
|
|
17966
|
-
] }) }) : reports.length === 0 ? /* @__PURE__ */ (0,
|
|
17967
|
-
/* @__PURE__ */ (0,
|
|
17968
|
-
query ? /* @__PURE__ */ (0,
|
|
17969
|
-
/* @__PURE__ */ (0,
|
|
17970
|
-
/* @__PURE__ */ (0,
|
|
18044
|
+
] }) }) : reports.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tr", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("td", { colSpan: 7, className: "lens-db__empty", children: [
|
|
18045
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__empty-icon", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconInbox, { size: 32 }) }),
|
|
18046
|
+
query ? /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
18047
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "lens-db__empty-title", children: "No matching reports" }),
|
|
18048
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "lens-db__empty-hint", children: [
|
|
17971
18049
|
"No reports match \u201C",
|
|
17972
18050
|
query,
|
|
17973
18051
|
"\u201D. Try a different search."
|
|
17974
18052
|
] })
|
|
17975
|
-
] }) : /* @__PURE__ */ (0,
|
|
17976
|
-
/* @__PURE__ */ (0,
|
|
17977
|
-
/* @__PURE__ */ (0,
|
|
18053
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
18054
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "lens-db__empty-title", children: "No reports yet" }),
|
|
18055
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "lens-db__empty-hint", children: [
|
|
17978
18056
|
"Visit your app with ",
|
|
17979
|
-
/* @__PURE__ */ (0,
|
|
18057
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { children: "?lens=true" }),
|
|
17980
18058
|
" and submit one."
|
|
17981
18059
|
] })
|
|
17982
18060
|
] })
|
|
17983
|
-
] }) }) : reports.map((r3) => /* @__PURE__ */ (0,
|
|
18061
|
+
] }) }) : reports.map((r3) => /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
17984
18062
|
"tr",
|
|
17985
18063
|
{
|
|
17986
18064
|
className: clsx_default("lens-db__row", onSelect && "lens-db__row--clickable"),
|
|
@@ -17993,13 +18071,13 @@ function ReportsTable(props) {
|
|
|
17993
18071
|
}
|
|
17994
18072
|
} : void 0,
|
|
17995
18073
|
children: [
|
|
17996
|
-
/* @__PURE__ */ (0,
|
|
17997
|
-
/* @__PURE__ */ (0,
|
|
17998
|
-
/* @__PURE__ */ (0,
|
|
17999
|
-
/* @__PURE__ */ (0,
|
|
18000
|
-
/* @__PURE__ */ (0,
|
|
18001
|
-
/* @__PURE__ */ (0,
|
|
18002
|
-
/* @__PURE__ */ (0,
|
|
18074
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "lens-db__muted lens-db__tnum", title: r3.createdAt, children: relativeTime(r3.createdAt) }),
|
|
18075
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { children: r3.comment ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__cell-comment", title: r3.comment, children: r3.comment }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__muted", children: "\u2014" }) }),
|
|
18076
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "lens-db__mono lens-db__muted", title: r3.url, children: urlPath(r3.url) }),
|
|
18077
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(StatusBadge, { status: r3.status }) }),
|
|
18078
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "lens-db__num", children: r3.errorCount > 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__badge lens-db__badge--danger", children: r3.errorCount }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__muted", children: "0" }) }),
|
|
18079
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { className: "lens-db__center", children: r3.hasReplay ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__play", title: "Session replay captured", "aria-label": "Has replay", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconPlay, { size: 14 }) }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__muted", "aria-label": "No replay", children: "\u2014" }) }),
|
|
18080
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { children: r3.externalIssue ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
18003
18081
|
"a",
|
|
18004
18082
|
{
|
|
18005
18083
|
className: "lens-db__link",
|
|
@@ -18009,14 +18087,14 @@ function ReportsTable(props) {
|
|
|
18009
18087
|
onClick: (e2) => e2.stopPropagation(),
|
|
18010
18088
|
children: r3.externalIssue.key
|
|
18011
18089
|
}
|
|
18012
|
-
) : /* @__PURE__ */ (0,
|
|
18090
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__muted", children: "\u2014" }) })
|
|
18013
18091
|
]
|
|
18014
18092
|
},
|
|
18015
18093
|
r3.id
|
|
18016
18094
|
)) })
|
|
18017
18095
|
] }),
|
|
18018
|
-
!error && (canPrev || canNext) && /* @__PURE__ */ (0,
|
|
18019
|
-
/* @__PURE__ */ (0,
|
|
18096
|
+
!error && (canPrev || canNext) && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "lens-db__table-footer lens-db__pager", children: [
|
|
18097
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
18020
18098
|
"button",
|
|
18021
18099
|
{
|
|
18022
18100
|
type: "button",
|
|
@@ -18024,12 +18102,12 @@ function ReportsTable(props) {
|
|
|
18024
18102
|
disabled: !canPrev || loading,
|
|
18025
18103
|
onClick: goPrev,
|
|
18026
18104
|
children: [
|
|
18027
|
-
/* @__PURE__ */ (0,
|
|
18105
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconChevronLeft, { size: 16 }),
|
|
18028
18106
|
"Prev"
|
|
18029
18107
|
]
|
|
18030
18108
|
}
|
|
18031
18109
|
),
|
|
18032
|
-
/* @__PURE__ */ (0,
|
|
18110
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
18033
18111
|
"button",
|
|
18034
18112
|
{
|
|
18035
18113
|
type: "button",
|
|
@@ -18038,7 +18116,7 @@ function ReportsTable(props) {
|
|
|
18038
18116
|
onClick: goNext,
|
|
18039
18117
|
children: [
|
|
18040
18118
|
"Next",
|
|
18041
|
-
/* @__PURE__ */ (0,
|
|
18119
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IconChevronRight, { size: 16 })
|
|
18042
18120
|
]
|
|
18043
18121
|
}
|
|
18044
18122
|
)
|
|
@@ -18046,16 +18124,16 @@ function ReportsTable(props) {
|
|
|
18046
18124
|
] });
|
|
18047
18125
|
}
|
|
18048
18126
|
function SkeletonRows({ rows }) {
|
|
18049
|
-
return /* @__PURE__ */ (0,
|
|
18127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_jsx_runtime5.Fragment, { children: Array.from({ length: rows }).map((_, i2) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("tr", { className: "lens-db__row lens-db__row--skeleton", "aria-hidden": true, children: Array.from({ length: 7 }).map((__, j) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "lens-db__skeleton" }) }, j)) }, i2)) });
|
|
18050
18128
|
}
|
|
18051
18129
|
function useAsync(fn, deps) {
|
|
18052
|
-
const [data, setData] = (0,
|
|
18053
|
-
const [error, setError] = (0,
|
|
18054
|
-
const [loading, setLoading] = (0,
|
|
18055
|
-
const [nonce, setNonce] = (0,
|
|
18056
|
-
const runId = (0,
|
|
18057
|
-
const reload = (0,
|
|
18058
|
-
(0,
|
|
18130
|
+
const [data, setData] = (0, import_react5.useState)(void 0);
|
|
18131
|
+
const [error, setError] = (0, import_react5.useState)(void 0);
|
|
18132
|
+
const [loading, setLoading] = (0, import_react5.useState)(true);
|
|
18133
|
+
const [nonce, setNonce] = (0, import_react5.useState)(0);
|
|
18134
|
+
const runId = (0, import_react5.useRef)(0);
|
|
18135
|
+
const reload = (0, import_react5.useCallback)(() => setNonce((n2) => n2 + 1), []);
|
|
18136
|
+
(0, import_react5.useEffect)(() => {
|
|
18059
18137
|
const id = ++runId.current;
|
|
18060
18138
|
let active = true;
|
|
18061
18139
|
setLoading(true);
|
|
@@ -18100,42 +18178,42 @@ function readViewport(events) {
|
|
|
18100
18178
|
function ReplayPlayer(props) {
|
|
18101
18179
|
const { reportId, className } = props;
|
|
18102
18180
|
const api = useLensApi();
|
|
18103
|
-
const frameRef = (0,
|
|
18104
|
-
const replayerRef = (0,
|
|
18105
|
-
const rafRef = (0,
|
|
18106
|
-
const totalRef = (0,
|
|
18107
|
-
const finishedRef = (0,
|
|
18108
|
-
const playingRef = (0,
|
|
18109
|
-
const [status, setStatus] = (0,
|
|
18110
|
-
const [message, setMessage] = (0,
|
|
18111
|
-
const [playing, setPlaying] = (0,
|
|
18112
|
-
const [speed, setSpeed] = (0,
|
|
18113
|
-
const [skipInactive, setSkipInactive] = (0,
|
|
18114
|
-
const [elapsed, setElapsed] = (0,
|
|
18115
|
-
const [total, setTotal] = (0,
|
|
18116
|
-
const stopRaf = (0,
|
|
18181
|
+
const frameRef = (0, import_react6.useRef)(null);
|
|
18182
|
+
const replayerRef = (0, import_react6.useRef)(null);
|
|
18183
|
+
const rafRef = (0, import_react6.useRef)(null);
|
|
18184
|
+
const totalRef = (0, import_react6.useRef)(0);
|
|
18185
|
+
const finishedRef = (0, import_react6.useRef)(false);
|
|
18186
|
+
const playingRef = (0, import_react6.useRef)(false);
|
|
18187
|
+
const [status, setStatus] = (0, import_react6.useState)("loading");
|
|
18188
|
+
const [message, setMessage] = (0, import_react6.useState)(void 0);
|
|
18189
|
+
const [playing, setPlaying] = (0, import_react6.useState)(false);
|
|
18190
|
+
const [speed, setSpeed] = (0, import_react6.useState)(1);
|
|
18191
|
+
const [skipInactive, setSkipInactive] = (0, import_react6.useState)(true);
|
|
18192
|
+
const [elapsed, setElapsed] = (0, import_react6.useState)(0);
|
|
18193
|
+
const [total, setTotal] = (0, import_react6.useState)(0);
|
|
18194
|
+
const stopRaf = (0, import_react6.useCallback)(() => {
|
|
18117
18195
|
if (rafRef.current != null) {
|
|
18118
18196
|
cancelAnimationFrame(rafRef.current);
|
|
18119
18197
|
rafRef.current = null;
|
|
18120
18198
|
}
|
|
18121
18199
|
}, []);
|
|
18122
|
-
const safeCurrentTime = (0,
|
|
18200
|
+
const safeCurrentTime = (0, import_react6.useCallback)(() => {
|
|
18123
18201
|
const r3 = replayerRef.current;
|
|
18124
18202
|
if (!r3) return 0;
|
|
18125
18203
|
const t2 = r3.getCurrentTime();
|
|
18126
18204
|
if (!Number.isFinite(t2) || t2 < 0) return 0;
|
|
18127
18205
|
return totalRef.current > 0 ? Math.min(t2, totalRef.current) : t2;
|
|
18128
18206
|
}, []);
|
|
18129
|
-
const tick = (0,
|
|
18207
|
+
const tick = (0, import_react6.useCallback)(() => {
|
|
18130
18208
|
if (!replayerRef.current) return;
|
|
18131
18209
|
setElapsed(safeCurrentTime());
|
|
18132
18210
|
rafRef.current = requestAnimationFrame(tick);
|
|
18133
18211
|
}, [safeCurrentTime]);
|
|
18134
|
-
const startRaf = (0,
|
|
18212
|
+
const startRaf = (0, import_react6.useCallback)(() => {
|
|
18135
18213
|
stopRaf();
|
|
18136
18214
|
rafRef.current = requestAnimationFrame(tick);
|
|
18137
18215
|
}, [stopRaf, tick]);
|
|
18138
|
-
const togglePlay = (0,
|
|
18216
|
+
const togglePlay = (0, import_react6.useCallback)(() => {
|
|
18139
18217
|
const r3 = replayerRef.current;
|
|
18140
18218
|
if (!r3) return;
|
|
18141
18219
|
if (playingRef.current) {
|
|
@@ -18152,7 +18230,7 @@ function ReplayPlayer(props) {
|
|
|
18152
18230
|
startRaf();
|
|
18153
18231
|
}
|
|
18154
18232
|
}, [safeCurrentTime, startRaf, stopRaf]);
|
|
18155
|
-
const seekTo = (0,
|
|
18233
|
+
const seekTo = (0, import_react6.useCallback)((offsetMs) => {
|
|
18156
18234
|
const r3 = replayerRef.current;
|
|
18157
18235
|
if (!r3) return;
|
|
18158
18236
|
const clamped = totalRef.current > 0 ? Math.max(0, Math.min(offsetMs, totalRef.current)) : Math.max(0, offsetMs);
|
|
@@ -18164,26 +18242,26 @@ function ReplayPlayer(props) {
|
|
|
18164
18242
|
}
|
|
18165
18243
|
setElapsed(clamped);
|
|
18166
18244
|
}, []);
|
|
18167
|
-
const changeSpeed = (0,
|
|
18245
|
+
const changeSpeed = (0, import_react6.useCallback)((next) => {
|
|
18168
18246
|
setSpeed(next);
|
|
18169
18247
|
replayerRef.current?.setConfig({ speed: next });
|
|
18170
18248
|
}, []);
|
|
18171
|
-
const toggleSkipInactive = (0,
|
|
18249
|
+
const toggleSkipInactive = (0, import_react6.useCallback)(() => {
|
|
18172
18250
|
setSkipInactive((prev) => {
|
|
18173
18251
|
const next = !prev;
|
|
18174
18252
|
replayerRef.current?.setConfig({ skipInactive: next });
|
|
18175
18253
|
return next;
|
|
18176
18254
|
});
|
|
18177
18255
|
}, []);
|
|
18178
|
-
const trackRef = (0,
|
|
18179
|
-
const offsetFromPointer = (0,
|
|
18256
|
+
const trackRef = (0, import_react6.useRef)(null);
|
|
18257
|
+
const offsetFromPointer = (0, import_react6.useCallback)((clientX) => {
|
|
18180
18258
|
const track = trackRef.current;
|
|
18181
18259
|
if (!track || totalRef.current <= 0) return 0;
|
|
18182
18260
|
const rect = track.getBoundingClientRect();
|
|
18183
18261
|
const frac = rect.width > 0 ? (clientX - rect.left) / rect.width : 0;
|
|
18184
18262
|
return Math.max(0, Math.min(1, frac)) * totalRef.current;
|
|
18185
18263
|
}, []);
|
|
18186
|
-
const onTrackPointerDown = (0,
|
|
18264
|
+
const onTrackPointerDown = (0, import_react6.useCallback)(
|
|
18187
18265
|
(e2) => {
|
|
18188
18266
|
if (!replayerRef.current || totalRef.current <= 0) return;
|
|
18189
18267
|
e2.currentTarget.setPointerCapture(e2.pointerId);
|
|
@@ -18191,14 +18269,14 @@ function ReplayPlayer(props) {
|
|
|
18191
18269
|
},
|
|
18192
18270
|
[offsetFromPointer, seekTo]
|
|
18193
18271
|
);
|
|
18194
|
-
const onTrackPointerMove = (0,
|
|
18272
|
+
const onTrackPointerMove = (0, import_react6.useCallback)(
|
|
18195
18273
|
(e2) => {
|
|
18196
18274
|
if (!e2.currentTarget.hasPointerCapture(e2.pointerId)) return;
|
|
18197
18275
|
seekTo(offsetFromPointer(e2.clientX));
|
|
18198
18276
|
},
|
|
18199
18277
|
[offsetFromPointer, seekTo]
|
|
18200
18278
|
);
|
|
18201
|
-
const onTrackKeyDown = (0,
|
|
18279
|
+
const onTrackKeyDown = (0, import_react6.useCallback)(
|
|
18202
18280
|
(e2) => {
|
|
18203
18281
|
const step = totalRef.current * 0.05;
|
|
18204
18282
|
if (e2.key === "ArrowLeft") {
|
|
@@ -18211,7 +18289,7 @@ function ReplayPlayer(props) {
|
|
|
18211
18289
|
},
|
|
18212
18290
|
[seekTo]
|
|
18213
18291
|
);
|
|
18214
|
-
(0,
|
|
18292
|
+
(0, import_react6.useEffect)(() => {
|
|
18215
18293
|
let cancelled = false;
|
|
18216
18294
|
let observer = null;
|
|
18217
18295
|
setStatus("loading");
|
|
@@ -18290,18 +18368,18 @@ function ReplayPlayer(props) {
|
|
|
18290
18368
|
};
|
|
18291
18369
|
}, [api, reportId, stopRaf]);
|
|
18292
18370
|
const pct = total > 0 ? Math.min(100, elapsed / total * 100) : 0;
|
|
18293
|
-
return /* @__PURE__ */ (0,
|
|
18294
|
-
status === "loading" && /* @__PURE__ */ (0,
|
|
18295
|
-
status === "empty" && /* @__PURE__ */ (0,
|
|
18296
|
-
status === "error" && /* @__PURE__ */ (0,
|
|
18371
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: clsx_default("lens-db", "lens-db__replay", className), children: [
|
|
18372
|
+
status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "lens-db__replay-state", children: "Loading replay\u2026" }),
|
|
18373
|
+
status === "empty" && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "lens-db__replay-state lens-db__muted", children: "No replay captured." }),
|
|
18374
|
+
status === "error" && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "lens-db__replay-state lens-db__error", children: [
|
|
18297
18375
|
"No replay captured",
|
|
18298
18376
|
message ? ` \u2014 ${message}` : "",
|
|
18299
18377
|
"."
|
|
18300
18378
|
] }),
|
|
18301
|
-
/* @__PURE__ */ (0,
|
|
18302
|
-
/* @__PURE__ */ (0,
|
|
18303
|
-
/* @__PURE__ */ (0,
|
|
18304
|
-
/* @__PURE__ */ (0,
|
|
18379
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "lens-db__rp", "data-visible": status === "ready", children: [
|
|
18380
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref: frameRef, className: "lens-db__rp-frame" }),
|
|
18381
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "lens-db__rp-bar", children: [
|
|
18382
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18305
18383
|
"button",
|
|
18306
18384
|
{
|
|
18307
18385
|
type: "button",
|
|
@@ -18309,11 +18387,11 @@ function ReplayPlayer(props) {
|
|
|
18309
18387
|
onClick: togglePlay,
|
|
18310
18388
|
"aria-label": playing ? "Pause replay" : "Play replay",
|
|
18311
18389
|
"aria-pressed": playing,
|
|
18312
|
-
children: playing ? /* @__PURE__ */ (0,
|
|
18390
|
+
children: playing ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconPause, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IconPlay, { size: 16 })
|
|
18313
18391
|
}
|
|
18314
18392
|
),
|
|
18315
|
-
/* @__PURE__ */ (0,
|
|
18316
|
-
/* @__PURE__ */ (0,
|
|
18393
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "lens-db__rp-time", children: formatTime(elapsed) }),
|
|
18394
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18317
18395
|
"div",
|
|
18318
18396
|
{
|
|
18319
18397
|
ref: trackRef,
|
|
@@ -18328,11 +18406,11 @@ function ReplayPlayer(props) {
|
|
|
18328
18406
|
onPointerDown: onTrackPointerDown,
|
|
18329
18407
|
onPointerMove: onTrackPointerMove,
|
|
18330
18408
|
onKeyDown: onTrackKeyDown,
|
|
18331
|
-
children: /* @__PURE__ */ (0,
|
|
18409
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "lens-db__rp-fill", style: { width: `${pct}%` } })
|
|
18332
18410
|
}
|
|
18333
18411
|
),
|
|
18334
|
-
/* @__PURE__ */ (0,
|
|
18335
|
-
/* @__PURE__ */ (0,
|
|
18412
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "lens-db__rp-time", children: formatTime(total) }),
|
|
18413
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "lens-db__rp-speeds", role: "group", "aria-label": "Playback speed", children: SPEEDS.map((s2) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
18336
18414
|
"button",
|
|
18337
18415
|
{
|
|
18338
18416
|
type: "button",
|
|
@@ -18346,7 +18424,7 @@ function ReplayPlayer(props) {
|
|
|
18346
18424
|
},
|
|
18347
18425
|
s2
|
|
18348
18426
|
)) }),
|
|
18349
|
-
/* @__PURE__ */ (0,
|
|
18427
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
18350
18428
|
"button",
|
|
18351
18429
|
{
|
|
18352
18430
|
type: "button",
|
|
@@ -18367,23 +18445,23 @@ function ReportDetail(props) {
|
|
|
18367
18445
|
() => api.getReport(reportId),
|
|
18368
18446
|
[reportId]
|
|
18369
18447
|
);
|
|
18370
|
-
return /* @__PURE__ */ (0,
|
|
18371
|
-
loading && /* @__PURE__ */ (0,
|
|
18372
|
-
error && /* @__PURE__ */ (0,
|
|
18448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: clsx_default("lens-db", "lens-db__detail", className), children: [
|
|
18449
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__detail-loading", children: "Loading report\u2026" }),
|
|
18450
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lens-db__error", children: [
|
|
18373
18451
|
"Failed to load report: ",
|
|
18374
18452
|
error.message,
|
|
18375
18453
|
" ",
|
|
18376
|
-
/* @__PURE__ */ (0,
|
|
18454
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "lens-db__link-btn", onClick: reload, children: "Retry" })
|
|
18377
18455
|
] }),
|
|
18378
|
-
report && /* @__PURE__ */ (0,
|
|
18456
|
+
report && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ReportDetailBody, { report, onClose })
|
|
18379
18457
|
] });
|
|
18380
18458
|
}
|
|
18381
18459
|
function ReportDetailBody({ report, onClose }) {
|
|
18382
18460
|
const meta = report.metadata;
|
|
18383
|
-
const [tab, setTab] = (0,
|
|
18384
|
-
const [replayMounted, setReplayMounted] = (0,
|
|
18385
|
-
const uid = (0,
|
|
18386
|
-
const tabRefs = (0,
|
|
18461
|
+
const [tab, setTab] = (0, import_react4.useState)("overview");
|
|
18462
|
+
const [replayMounted, setReplayMounted] = (0, import_react4.useState)(false);
|
|
18463
|
+
const uid = (0, import_react4.useId)();
|
|
18464
|
+
const tabRefs = (0, import_react4.useRef)({
|
|
18387
18465
|
overview: null,
|
|
18388
18466
|
replay: null,
|
|
18389
18467
|
logs: null,
|
|
@@ -18417,12 +18495,12 @@ function ReportDetailBody({ report, onClose }) {
|
|
|
18417
18495
|
}
|
|
18418
18496
|
const tabId = (id) => `${uid}-tab-${id}`;
|
|
18419
18497
|
const panelId = (id) => `${uid}-panel-${id}`;
|
|
18420
|
-
return /* @__PURE__ */ (0,
|
|
18421
|
-
/* @__PURE__ */ (0,
|
|
18422
|
-
/* @__PURE__ */ (0,
|
|
18423
|
-
/* @__PURE__ */ (0,
|
|
18424
|
-
/* @__PURE__ */ (0,
|
|
18425
|
-
report.externalIssue && /* @__PURE__ */ (0,
|
|
18498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
18499
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("header", { className: "lens-db__detail-header", children: [
|
|
18500
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lens-db__detail-header-main", children: [
|
|
18501
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(StatusBadge, { status: report.status }),
|
|
18502
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__detail-time", title: formatTimestamp(report.createdAt), children: relativeTime(report.createdAt) }),
|
|
18503
|
+
report.externalIssue && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
18426
18504
|
"a",
|
|
18427
18505
|
{
|
|
18428
18506
|
className: "lens-db__link lens-db__link-inline",
|
|
@@ -18433,16 +18511,16 @@ function ReportDetailBody({ report, onClose }) {
|
|
|
18433
18511
|
report.externalIssue.provider,
|
|
18434
18512
|
" \xB7 ",
|
|
18435
18513
|
report.externalIssue.key,
|
|
18436
|
-
/* @__PURE__ */ (0,
|
|
18514
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconExternal, { size: 13 })
|
|
18437
18515
|
]
|
|
18438
18516
|
}
|
|
18439
18517
|
)
|
|
18440
18518
|
] }),
|
|
18441
|
-
onClose && /* @__PURE__ */ (0,
|
|
18519
|
+
onClose && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "lens-db__icon-btn", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IconClose, {}) })
|
|
18442
18520
|
] }),
|
|
18443
|
-
/* @__PURE__ */ (0,
|
|
18521
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__tabs", role: "tablist", "aria-label": "Report sections", children: tabs.map((t2, i2) => {
|
|
18444
18522
|
const active = t2.id === tab;
|
|
18445
|
-
return /* @__PURE__ */ (0,
|
|
18523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
18446
18524
|
"button",
|
|
18447
18525
|
{
|
|
18448
18526
|
type: "button",
|
|
@@ -18458,18 +18536,18 @@ function ReportDetailBody({ report, onClose }) {
|
|
|
18458
18536
|
onClick: () => select(t2.id),
|
|
18459
18537
|
onKeyDown: (e2) => onTabKeyDown(e2, i2),
|
|
18460
18538
|
children: [
|
|
18461
|
-
/* @__PURE__ */ (0,
|
|
18462
|
-
t2.count != null && t2.count > 0 && /* @__PURE__ */ (0,
|
|
18539
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__tab-label", children: t2.label }),
|
|
18540
|
+
t2.count != null && t2.count > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__tab-count", children: t2.count })
|
|
18463
18541
|
]
|
|
18464
18542
|
},
|
|
18465
18543
|
t2.id
|
|
18466
18544
|
);
|
|
18467
18545
|
}) }),
|
|
18468
|
-
/* @__PURE__ */ (0,
|
|
18469
|
-
tab === "overview" && /* @__PURE__ */ (0,
|
|
18470
|
-
tab === "logs" && /* @__PURE__ */ (0,
|
|
18471
|
-
tab === "network" && /* @__PURE__ */ (0,
|
|
18472
|
-
replayMounted && /* @__PURE__ */ (0,
|
|
18546
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lens-db__tabpanels", children: [
|
|
18547
|
+
tab === "overview" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { role: "tabpanel", id: panelId("overview"), "aria-labelledby": tabId("overview"), tabIndex: 0, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(OverviewPanel, { report, meta }) }),
|
|
18548
|
+
tab === "logs" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { role: "tabpanel", id: panelId("logs"), "aria-labelledby": tabId("logs"), tabIndex: 0, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LogsPanel, { errors: meta?.errors ?? [], consoleEntries: meta?.consoleTail ?? [] }) }),
|
|
18549
|
+
tab === "network" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { role: "tabpanel", id: panelId("network"), "aria-labelledby": tabId("network"), tabIndex: 0, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NetworkPanel, { entries: meta?.networkTail ?? [] }) }),
|
|
18550
|
+
replayMounted && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
18473
18551
|
"div",
|
|
18474
18552
|
{
|
|
18475
18553
|
role: "tabpanel",
|
|
@@ -18477,7 +18555,7 @@ function ReportDetailBody({ report, onClose }) {
|
|
|
18477
18555
|
"aria-labelledby": tabId("replay"),
|
|
18478
18556
|
tabIndex: 0,
|
|
18479
18557
|
hidden: tab !== "replay",
|
|
18480
|
-
children: /* @__PURE__ */ (0,
|
|
18558
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__panel", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ReplayPlayer, { reportId: report.id }) })
|
|
18481
18559
|
}
|
|
18482
18560
|
)
|
|
18483
18561
|
] })
|
|
@@ -18487,21 +18565,21 @@ function OverviewPanel({ report, meta }) {
|
|
|
18487
18565
|
const hasScreenshot = report.assets.some((a2) => a2.kind === "screenshot");
|
|
18488
18566
|
const attachments = report.assets.filter((a2) => a2.kind !== "screenshot");
|
|
18489
18567
|
if (!meta) {
|
|
18490
|
-
return /* @__PURE__ */ (0,
|
|
18491
|
-
hasScreenshot && /* @__PURE__ */ (0,
|
|
18492
|
-
/* @__PURE__ */ (0,
|
|
18568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
18569
|
+
hasScreenshot && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Screenshot", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Screenshot, { reportId: report.id }) }),
|
|
18570
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Report", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "lens-db__muted", children: "This report has no metadata yet (still initiating)." }) })
|
|
18493
18571
|
] });
|
|
18494
18572
|
}
|
|
18495
18573
|
const hasTarget = Boolean(meta.target && (meta.target.domPath || meta.target.reactComponents?.length));
|
|
18496
|
-
return /* @__PURE__ */ (0,
|
|
18497
|
-
meta.comment && /* @__PURE__ */ (0,
|
|
18498
|
-
hasScreenshot && /* @__PURE__ */ (0,
|
|
18499
|
-
/* @__PURE__ */ (0,
|
|
18500
|
-
hasTarget && meta.target && /* @__PURE__ */ (0,
|
|
18501
|
-
meta.target.domPath && /* @__PURE__ */ (0,
|
|
18502
|
-
meta.target.reactComponents && meta.target.reactComponents.length > 0 && /* @__PURE__ */ (0,
|
|
18574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
18575
|
+
meta.comment && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Comment", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "lens-db__comment", children: meta.comment }) }),
|
|
18576
|
+
hasScreenshot && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Screenshot", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Screenshot, { reportId: report.id }) }),
|
|
18577
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Environment", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(EnvironmentGrid, { env: meta.env, app: meta.app }) }),
|
|
18578
|
+
hasTarget && meta.target && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(Section, { title: "Target element", children: [
|
|
18579
|
+
meta.target.domPath && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { className: "lens-db__dompath", children: meta.target.domPath }),
|
|
18580
|
+
meta.target.reactComponents && meta.target.reactComponents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__chips", children: meta.target.reactComponents.map((c2, i2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__chip", children: c2 }, `${c2}-${i2}`)) })
|
|
18503
18581
|
] }),
|
|
18504
|
-
attachments.length > 0 && /* @__PURE__ */ (0,
|
|
18582
|
+
attachments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Attachments", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Attachments, { reportId: report.id, assets: attachments }) })
|
|
18505
18583
|
] });
|
|
18506
18584
|
}
|
|
18507
18585
|
function Screenshot({ reportId }) {
|
|
@@ -18511,10 +18589,10 @@ function Screenshot({ reportId }) {
|
|
|
18511
18589
|
[reportId]
|
|
18512
18590
|
);
|
|
18513
18591
|
if (loading) {
|
|
18514
|
-
return /* @__PURE__ */ (0,
|
|
18592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__shot lens-db__shot--loading", "aria-hidden": true });
|
|
18515
18593
|
}
|
|
18516
18594
|
if (error || !url) return null;
|
|
18517
|
-
return /* @__PURE__ */ (0,
|
|
18595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
18518
18596
|
"a",
|
|
18519
18597
|
{
|
|
18520
18598
|
className: "lens-db__shot",
|
|
@@ -18522,7 +18600,7 @@ function Screenshot({ reportId }) {
|
|
|
18522
18600
|
target: "_blank",
|
|
18523
18601
|
rel: "noreferrer",
|
|
18524
18602
|
title: "Open full screenshot in a new tab",
|
|
18525
|
-
children: /* @__PURE__ */ (0,
|
|
18603
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("img", { className: "lens-db__shot-img", src: url, alt: "Captured screenshot", loading: "lazy" })
|
|
18526
18604
|
}
|
|
18527
18605
|
);
|
|
18528
18606
|
}
|
|
@@ -18543,61 +18621,61 @@ function dedupeErrors(errors) {
|
|
|
18543
18621
|
}
|
|
18544
18622
|
function LogsPanel({ errors, consoleEntries }) {
|
|
18545
18623
|
const groups = dedupeErrors(errors);
|
|
18546
|
-
return /* @__PURE__ */ (0,
|
|
18547
|
-
/* @__PURE__ */ (0,
|
|
18548
|
-
/* @__PURE__ */ (0,
|
|
18624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
18625
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: `Errors${errors.length ? ` (${groups.length})` : ""}`, children: groups.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "lens-db__muted", children: "Nothing captured." }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__scroll", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "lens-db__errlog", children: groups.map((g, i2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ErrorRow, { group: g }, i2)) }) }) }),
|
|
18626
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Section, { title: "Console", children: consoleEntries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "lens-db__muted", children: "Nothing captured." }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__scroll", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ConsoleTail, { entries: consoleEntries }) }) })
|
|
18549
18627
|
] });
|
|
18550
18628
|
}
|
|
18551
18629
|
function ErrorRow({ group }) {
|
|
18552
18630
|
const { entry, count } = group;
|
|
18553
18631
|
const firstLine = entry.message.split("\n")[0] ?? entry.message;
|
|
18554
|
-
return /* @__PURE__ */ (0,
|
|
18555
|
-
/* @__PURE__ */ (0,
|
|
18556
|
-
/* @__PURE__ */ (0,
|
|
18557
|
-
count > 1 && /* @__PURE__ */ (0,
|
|
18632
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { className: "lens-db__errlog-item", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "lens-db__errlog-details", children: [
|
|
18633
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { className: "lens-db__errlog-summary", children: [
|
|
18634
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__errlog-msg", children: truncate(firstLine, 140) }),
|
|
18635
|
+
count > 1 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "lens-db__count-badge", children: [
|
|
18558
18636
|
"\xD7",
|
|
18559
18637
|
count
|
|
18560
18638
|
] }),
|
|
18561
|
-
/* @__PURE__ */ (0,
|
|
18639
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__errlog-source", children: entry.source })
|
|
18562
18640
|
] }),
|
|
18563
|
-
/* @__PURE__ */ (0,
|
|
18564
|
-
entry.message !== firstLine && /* @__PURE__ */ (0,
|
|
18565
|
-
entry.stack && /* @__PURE__ */ (0,
|
|
18641
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lens-db__errlog-body", children: [
|
|
18642
|
+
entry.message !== firstLine && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { className: "lens-db__stack", children: entry.message }),
|
|
18643
|
+
entry.stack && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("pre", { className: "lens-db__stack", children: entry.stack })
|
|
18566
18644
|
] })
|
|
18567
18645
|
] }) });
|
|
18568
18646
|
}
|
|
18569
18647
|
function ConsoleTail({ entries }) {
|
|
18570
|
-
return /* @__PURE__ */ (0,
|
|
18571
|
-
/* @__PURE__ */ (0,
|
|
18572
|
-
/* @__PURE__ */ (0,
|
|
18648
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__console", children: entries.map((e2, i2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: clsx_default("lens-db__console-line", `lens-db__console-line--${e2.level}`), children: [
|
|
18649
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__console-level", children: e2.level }),
|
|
18650
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__console-args", children: e2.args.join(" ") })
|
|
18573
18651
|
] }, i2)) });
|
|
18574
18652
|
}
|
|
18575
18653
|
function NetworkPanel({ entries }) {
|
|
18576
|
-
return /* @__PURE__ */ (0,
|
|
18654
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__panel", children: entries.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "lens-db__muted", children: "Nothing captured." }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NetworkTail, { entries }) });
|
|
18577
18655
|
}
|
|
18578
18656
|
function NetworkTail({ entries }) {
|
|
18579
|
-
return /* @__PURE__ */ (0,
|
|
18580
|
-
/* @__PURE__ */ (0,
|
|
18581
|
-
/* @__PURE__ */ (0,
|
|
18582
|
-
/* @__PURE__ */ (0,
|
|
18583
|
-
/* @__PURE__ */ (0,
|
|
18584
|
-
/* @__PURE__ */ (0,
|
|
18657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("table", { className: "lens-db__nettable", children: [
|
|
18658
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("tr", { children: [
|
|
18659
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("th", { children: "Method" }),
|
|
18660
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("th", { children: "Path" }),
|
|
18661
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("th", { className: "lens-db__num", children: "Status" }),
|
|
18662
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("th", { className: "lens-db__num", children: "Duration" })
|
|
18585
18663
|
] }) }),
|
|
18586
|
-
/* @__PURE__ */ (0,
|
|
18664
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("tbody", { children: entries.map((e2, i2) => {
|
|
18587
18665
|
const bad = e2.error != null || e2.ok === false || e2.status != null && (e2.status < 200 || e2.status >= 300);
|
|
18588
|
-
return /* @__PURE__ */ (0,
|
|
18589
|
-
/* @__PURE__ */ (0,
|
|
18590
|
-
/* @__PURE__ */ (0,
|
|
18591
|
-
/* @__PURE__ */ (0,
|
|
18592
|
-
/* @__PURE__ */ (0,
|
|
18666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("tr", { className: clsx_default(bad && "lens-db__netrow--bad"), children: [
|
|
18667
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("td", { className: "lens-db__mono", children: e2.method }),
|
|
18668
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("td", { className: "lens-db__mono lens-db__muted", title: e2.url, children: urlPath(e2.url) }),
|
|
18669
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("td", { className: "lens-db__num lens-db__mono lens-db__net-status", children: e2.error ? "ERR" : e2.status ?? "\u2014" }),
|
|
18670
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("td", { className: "lens-db__num lens-db__muted", children: formatDuration(e2.durationMs) })
|
|
18593
18671
|
] }, i2);
|
|
18594
18672
|
}) })
|
|
18595
18673
|
] });
|
|
18596
18674
|
}
|
|
18597
18675
|
function Section({ title, children }) {
|
|
18598
|
-
return /* @__PURE__ */ (0,
|
|
18599
|
-
/* @__PURE__ */ (0,
|
|
18600
|
-
/* @__PURE__ */ (0,
|
|
18676
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "lens-db__section", children: [
|
|
18677
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { className: "lens-db__section-title", children: title }),
|
|
18678
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__section-body", children })
|
|
18601
18679
|
] });
|
|
18602
18680
|
}
|
|
18603
18681
|
function EnvironmentGrid({ env, app }) {
|
|
@@ -18613,15 +18691,15 @@ function EnvironmentGrid({ env, app }) {
|
|
|
18613
18691
|
["Git SHA", app?.gitSha]
|
|
18614
18692
|
];
|
|
18615
18693
|
const monoLabels = /* @__PURE__ */ new Set(["URL", "Route", "Release", "Git SHA"]);
|
|
18616
|
-
return /* @__PURE__ */ (0,
|
|
18617
|
-
/* @__PURE__ */ (0,
|
|
18618
|
-
/* @__PURE__ */ (0,
|
|
18694
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dl", { className: "lens-db__grid", children: rows.filter(([, v2]) => v2 != null && v2 !== "").map(([label, value]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lens-db__grid-row", children: [
|
|
18695
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { className: "lens-db__grid-label", children: label }),
|
|
18696
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { className: clsx_default("lens-db__grid-value", monoLabels.has(label) && "lens-db__mono"), children: value })
|
|
18619
18697
|
] }, label)) });
|
|
18620
18698
|
}
|
|
18621
18699
|
function Attachments({ reportId, assets }) {
|
|
18622
18700
|
const api = useLensApi();
|
|
18623
|
-
const [busy, setBusy] = (0,
|
|
18624
|
-
const [err, setErr] = (0,
|
|
18701
|
+
const [busy, setBusy] = (0, import_react4.useState)(null);
|
|
18702
|
+
const [err, setErr] = (0, import_react4.useState)(void 0);
|
|
18625
18703
|
async function open(kind) {
|
|
18626
18704
|
setBusy(kind);
|
|
18627
18705
|
setErr(void 0);
|
|
@@ -18634,13 +18712,13 @@ function Attachments({ reportId, assets }) {
|
|
|
18634
18712
|
setBusy(null);
|
|
18635
18713
|
}
|
|
18636
18714
|
}
|
|
18637
|
-
return /* @__PURE__ */ (0,
|
|
18638
|
-
err && /* @__PURE__ */ (0,
|
|
18639
|
-
/* @__PURE__ */ (0,
|
|
18640
|
-
/* @__PURE__ */ (0,
|
|
18641
|
-
/* @__PURE__ */ (0,
|
|
18642
|
-
a2.byteSize != null && /* @__PURE__ */ (0,
|
|
18643
|
-
/* @__PURE__ */ (0,
|
|
18715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "lens-db__attachments", children: [
|
|
18716
|
+
err && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "lens-db__error", children: err }),
|
|
18717
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "lens-db__attachment-list", children: assets.map((a2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { className: "lens-db__attachment", children: [
|
|
18718
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__attachment-kind", children: a2.kind }),
|
|
18719
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__muted lens-db__attachment-type", children: a2.contentType }),
|
|
18720
|
+
a2.byteSize != null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "lens-db__muted lens-db__attachment-size", children: formatBytes(a2.byteSize) }),
|
|
18721
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
18644
18722
|
"button",
|
|
18645
18723
|
{
|
|
18646
18724
|
type: "button",
|
|
@@ -18683,6 +18761,11 @@ var CONFIG_FIELD = {
|
|
|
18683
18761
|
placeholder: "First team (default)"
|
|
18684
18762
|
}
|
|
18685
18763
|
};
|
|
18764
|
+
var SELECT_PLACEHOLDER = {
|
|
18765
|
+
linear: "First team (default)",
|
|
18766
|
+
github: "Select a repository\u2026",
|
|
18767
|
+
jira: "Select a project\u2026"
|
|
18768
|
+
};
|
|
18686
18769
|
function IntegrationList(props) {
|
|
18687
18770
|
const {
|
|
18688
18771
|
integrations,
|
|
@@ -18699,9 +18782,10 @@ function IntegrationList(props) {
|
|
|
18699
18782
|
onDisconnect,
|
|
18700
18783
|
onCompleteDev,
|
|
18701
18784
|
onSaveConfig,
|
|
18785
|
+
loadOptions,
|
|
18702
18786
|
className
|
|
18703
18787
|
} = props;
|
|
18704
|
-
(0,
|
|
18788
|
+
(0, import_react8.useEffect)(() => {
|
|
18705
18789
|
if (!flash || !onFlashDismiss) return;
|
|
18706
18790
|
const t2 = setTimeout(onFlashDismiss, 4e3);
|
|
18707
18791
|
return () => clearTimeout(t2);
|
|
@@ -18709,12 +18793,12 @@ function IntegrationList(props) {
|
|
|
18709
18793
|
const byProvider = /* @__PURE__ */ new Map();
|
|
18710
18794
|
for (const it of integrations) byProvider.set(it.provider, it);
|
|
18711
18795
|
const hasHeader = Boolean(title || description);
|
|
18712
|
-
return /* @__PURE__ */ (0,
|
|
18713
|
-
hasHeader && /* @__PURE__ */ (0,
|
|
18714
|
-
title && /* @__PURE__ */ (0,
|
|
18715
|
-
description && /* @__PURE__ */ (0,
|
|
18796
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: clsx_default("lens-db__intlist", className), children: [
|
|
18797
|
+
hasHeader && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "lens-db__intlist-head", children: [
|
|
18798
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "lens-db__intlist-title", children: title }),
|
|
18799
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "lens-db__intlist-desc lens-db__muted", children: description })
|
|
18716
18800
|
] }),
|
|
18717
|
-
flash && /* @__PURE__ */ (0,
|
|
18801
|
+
flash && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
18718
18802
|
"div",
|
|
18719
18803
|
{
|
|
18720
18804
|
className: clsx_default(
|
|
@@ -18723,16 +18807,16 @@ function IntegrationList(props) {
|
|
|
18723
18807
|
),
|
|
18724
18808
|
role: "status",
|
|
18725
18809
|
children: [
|
|
18726
|
-
flash.kind === "ok" ? /* @__PURE__ */ (0,
|
|
18727
|
-
/* @__PURE__ */ (0,
|
|
18810
|
+
flash.kind === "ok" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconCheckCircle, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconAlertTriangle, { size: 16 }),
|
|
18811
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: flash.message })
|
|
18728
18812
|
]
|
|
18729
18813
|
}
|
|
18730
18814
|
),
|
|
18731
|
-
loading ? /* @__PURE__ */ (0,
|
|
18732
|
-
/* @__PURE__ */ (0,
|
|
18733
|
-
/* @__PURE__ */ (0,
|
|
18734
|
-
/* @__PURE__ */ (0,
|
|
18735
|
-
/* @__PURE__ */ (0,
|
|
18815
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "lens-db__intlist-rows", "aria-busy": "true", children: PROVIDER_ORDER.map((p) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "lens-db__introw lens-db__introw--skeleton", children: [
|
|
18816
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__skeleton lens-db__intmark-skeleton" }),
|
|
18817
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "lens-db__intbody", children: [
|
|
18818
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__skeleton", style: { width: "35%" } }),
|
|
18819
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18736
18820
|
"span",
|
|
18737
18821
|
{
|
|
18738
18822
|
className: "lens-db__skeleton",
|
|
@@ -18740,14 +18824,14 @@ function IntegrationList(props) {
|
|
|
18740
18824
|
}
|
|
18741
18825
|
)
|
|
18742
18826
|
] })
|
|
18743
|
-
] }, p)) }) : loadError ? /* @__PURE__ */ (0,
|
|
18827
|
+
] }, p)) }) : loadError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "lens-db__intlist-load-error", children: [
|
|
18744
18828
|
"Failed to load integrations: ",
|
|
18745
18829
|
loadError,
|
|
18746
|
-
onRetry && /* @__PURE__ */ (0,
|
|
18830
|
+
onRetry && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
18747
18831
|
" ",
|
|
18748
|
-
/* @__PURE__ */ (0,
|
|
18832
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "lens-db__link-btn", onClick: onRetry, children: "Retry" })
|
|
18749
18833
|
] })
|
|
18750
|
-
] }) : /* @__PURE__ */ (0,
|
|
18834
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18751
18835
|
"div",
|
|
18752
18836
|
{
|
|
18753
18837
|
className: "lens-db__intlist-rows",
|
|
@@ -18763,16 +18847,16 @@ function IntegrationList(props) {
|
|
|
18763
18847
|
const isBusy = busy === provider;
|
|
18764
18848
|
const isConnected = status === "connected";
|
|
18765
18849
|
const statusLine = status === "connected" ? account ? `Connected as ${account}` : "Connected" : status === "pending" ? "Waiting for authorization\u2026" : "Not connected";
|
|
18766
|
-
return /* @__PURE__ */ (0,
|
|
18850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
18767
18851
|
"div",
|
|
18768
18852
|
{
|
|
18769
18853
|
className: clsx_default("lens-db__introw", active && "lens-db__introw--active"),
|
|
18770
18854
|
children: [
|
|
18771
|
-
/* @__PURE__ */ (0,
|
|
18772
|
-
/* @__PURE__ */ (0,
|
|
18773
|
-
/* @__PURE__ */ (0,
|
|
18774
|
-
/* @__PURE__ */ (0,
|
|
18775
|
-
/* @__PURE__ */ (0,
|
|
18855
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intmark", "aria-hidden": true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { size: 20 }) }),
|
|
18856
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "lens-db__intbody", children: [
|
|
18857
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intname", children: meta.name }),
|
|
18858
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "lens-db__intstatus", children: [
|
|
18859
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18776
18860
|
"span",
|
|
18777
18861
|
{
|
|
18778
18862
|
className: clsx_default(
|
|
@@ -18782,11 +18866,11 @@ function IntegrationList(props) {
|
|
|
18782
18866
|
"aria-hidden": true
|
|
18783
18867
|
}
|
|
18784
18868
|
),
|
|
18785
|
-
/* @__PURE__ */ (0,
|
|
18869
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: statusLine })
|
|
18786
18870
|
] })
|
|
18787
18871
|
] }),
|
|
18788
|
-
/* @__PURE__ */ (0,
|
|
18789
|
-
isConnected && /* @__PURE__ */ (0,
|
|
18872
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "lens-db__introw-right", children: [
|
|
18873
|
+
isConnected && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
18790
18874
|
"button",
|
|
18791
18875
|
{
|
|
18792
18876
|
type: "button",
|
|
@@ -18800,14 +18884,14 @@ function IntegrationList(props) {
|
|
|
18800
18884
|
disabled: isBusy || active,
|
|
18801
18885
|
onClick: () => !active && onActivate(provider),
|
|
18802
18886
|
children: [
|
|
18803
|
-
/* @__PURE__ */ (0,
|
|
18887
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intradio-dot", children: active && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intradio-fill" }) }),
|
|
18804
18888
|
"Destination"
|
|
18805
18889
|
]
|
|
18806
18890
|
}
|
|
18807
18891
|
),
|
|
18808
|
-
status === "pending" && /* @__PURE__ */ (0,
|
|
18809
|
-
/* @__PURE__ */ (0,
|
|
18810
|
-
/* @__PURE__ */ (0,
|
|
18892
|
+
status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
18893
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intwait", children: "waiting for authorization\u2026" }),
|
|
18894
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18811
18895
|
"button",
|
|
18812
18896
|
{
|
|
18813
18897
|
type: "button",
|
|
@@ -18818,7 +18902,7 @@ function IntegrationList(props) {
|
|
|
18818
18902
|
}
|
|
18819
18903
|
)
|
|
18820
18904
|
] }),
|
|
18821
|
-
status === "disconnected" && /* @__PURE__ */ (0,
|
|
18905
|
+
status === "disconnected" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18822
18906
|
"button",
|
|
18823
18907
|
{
|
|
18824
18908
|
type: "button",
|
|
@@ -18828,7 +18912,7 @@ function IntegrationList(props) {
|
|
|
18828
18912
|
children: isBusy ? "Opening\u2026" : "Connect"
|
|
18829
18913
|
}
|
|
18830
18914
|
),
|
|
18831
|
-
status !== "disconnected" && /* @__PURE__ */ (0,
|
|
18915
|
+
status !== "disconnected" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18832
18916
|
"button",
|
|
18833
18917
|
{
|
|
18834
18918
|
type: "button",
|
|
@@ -18840,14 +18924,15 @@ function IntegrationList(props) {
|
|
|
18840
18924
|
}
|
|
18841
18925
|
)
|
|
18842
18926
|
] }),
|
|
18843
|
-
isConnected && /* @__PURE__ */ (0,
|
|
18927
|
+
isConnected && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18844
18928
|
IntegrationConfigLine,
|
|
18845
18929
|
{
|
|
18846
18930
|
provider,
|
|
18847
18931
|
config: integration?.config ?? {},
|
|
18848
18932
|
active,
|
|
18849
18933
|
disabled: isBusy,
|
|
18850
|
-
onSave: (config) => onSaveConfig(provider, config)
|
|
18934
|
+
onSave: (config) => onSaveConfig(provider, config),
|
|
18935
|
+
loadOptions
|
|
18851
18936
|
}
|
|
18852
18937
|
)
|
|
18853
18938
|
]
|
|
@@ -18864,23 +18949,38 @@ function IntegrationConfigLine({
|
|
|
18864
18949
|
config,
|
|
18865
18950
|
active,
|
|
18866
18951
|
disabled,
|
|
18867
|
-
onSave
|
|
18952
|
+
onSave,
|
|
18953
|
+
loadOptions
|
|
18868
18954
|
}) {
|
|
18869
18955
|
const field = CONFIG_FIELD[provider];
|
|
18870
18956
|
const saved = config[field.key] ?? "";
|
|
18871
|
-
const [value, setValue] = (0,
|
|
18872
|
-
const [busy, setBusy] = (0,
|
|
18873
|
-
const [done, setDone] = (0,
|
|
18874
|
-
(0,
|
|
18957
|
+
const [value, setValue] = (0, import_react8.useState)(saved);
|
|
18958
|
+
const [busy, setBusy] = (0, import_react8.useState)(false);
|
|
18959
|
+
const [done, setDone] = (0, import_react8.useState)(false);
|
|
18960
|
+
const [options, setOptions] = (0, import_react8.useState)({ status: "idle" });
|
|
18961
|
+
(0, import_react8.useEffect)(() => {
|
|
18875
18962
|
setValue(saved);
|
|
18876
18963
|
}, [saved]);
|
|
18964
|
+
(0, import_react8.useEffect)(() => {
|
|
18965
|
+
if (!loadOptions) return;
|
|
18966
|
+
let cancelled = false;
|
|
18967
|
+
setOptions({ status: "loading" });
|
|
18968
|
+
loadOptions(provider).then((res) => {
|
|
18969
|
+
if (!cancelled) setOptions({ status: "ready", options: res.options });
|
|
18970
|
+
}).catch(() => {
|
|
18971
|
+
if (!cancelled) setOptions({ status: "error" });
|
|
18972
|
+
});
|
|
18973
|
+
return () => {
|
|
18974
|
+
cancelled = true;
|
|
18975
|
+
};
|
|
18976
|
+
}, [loadOptions, provider]);
|
|
18877
18977
|
const dirty = value.trim() !== saved;
|
|
18878
|
-
async function
|
|
18879
|
-
if (busy
|
|
18978
|
+
async function commit(raw) {
|
|
18979
|
+
if (busy) return;
|
|
18880
18980
|
setBusy(true);
|
|
18881
18981
|
setDone(false);
|
|
18882
18982
|
const next = { ...config };
|
|
18883
|
-
next[field.key] =
|
|
18983
|
+
next[field.key] = raw.trim() || void 0;
|
|
18884
18984
|
try {
|
|
18885
18985
|
await onSave(next);
|
|
18886
18986
|
setDone(true);
|
|
@@ -18890,11 +18990,29 @@ function IntegrationConfigLine({
|
|
|
18890
18990
|
setBusy(false);
|
|
18891
18991
|
}
|
|
18892
18992
|
}
|
|
18993
|
+
const saveText = () => {
|
|
18994
|
+
if (dirty) void commit(value);
|
|
18995
|
+
};
|
|
18996
|
+
const onSelect = (next) => {
|
|
18997
|
+
setValue(next);
|
|
18998
|
+
void commit(next);
|
|
18999
|
+
};
|
|
18893
19000
|
const showHint = Boolean(field.requiredHint) && active && !saved;
|
|
18894
|
-
|
|
18895
|
-
|
|
18896
|
-
|
|
18897
|
-
/* @__PURE__ */ (0,
|
|
19001
|
+
const useSelect = Boolean(loadOptions) && (options.status === "loading" || options.status === "ready");
|
|
19002
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "lens-db__intconfig", children: [
|
|
19003
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "lens-db__intconfig-field", children: [
|
|
19004
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intconfig-label", children: field.label }),
|
|
19005
|
+
useSelect ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
19006
|
+
ConfigSelect,
|
|
19007
|
+
{
|
|
19008
|
+
provider,
|
|
19009
|
+
value,
|
|
19010
|
+
options: options.status === "ready" ? options.options : null,
|
|
19011
|
+
loading: options.status === "loading",
|
|
19012
|
+
disabled: disabled || busy,
|
|
19013
|
+
onChange: onSelect
|
|
19014
|
+
}
|
|
19015
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18898
19016
|
"input",
|
|
18899
19017
|
{
|
|
18900
19018
|
className: "lens-db__intconfig-input",
|
|
@@ -18909,25 +19027,55 @@ function IntegrationConfigLine({
|
|
|
18909
19027
|
onKeyDown: (e2) => {
|
|
18910
19028
|
if (e2.key === "Enter") {
|
|
18911
19029
|
e2.preventDefault();
|
|
18912
|
-
|
|
19030
|
+
saveText();
|
|
18913
19031
|
}
|
|
18914
19032
|
}
|
|
18915
19033
|
}
|
|
18916
19034
|
)
|
|
18917
19035
|
] }),
|
|
18918
|
-
busy ? /* @__PURE__ */ (0,
|
|
19036
|
+
busy ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intconfig-busy", "aria-live": "polite", "aria-label": "Saving", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__spinner", "aria-hidden": true }) }) : done ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intconfig-done", "aria-live": "polite", "aria-label": "Saved", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(IconCheck, { size: 14 }) }) : !useSelect && dirty ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
18919
19037
|
"button",
|
|
18920
19038
|
{
|
|
18921
19039
|
type: "button",
|
|
18922
19040
|
className: "lens-db__btn lens-db__btn--sm",
|
|
18923
19041
|
disabled,
|
|
18924
|
-
onClick:
|
|
19042
|
+
onClick: saveText,
|
|
18925
19043
|
children: "Save"
|
|
18926
19044
|
}
|
|
18927
19045
|
) : null,
|
|
18928
|
-
|
|
19046
|
+
!useSelect && options.status === "error" && loadOptions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intconfig-note", children: "Couldn't load options \u2014 enter manually." }),
|
|
19047
|
+
showHint && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "lens-db__intconfig-hint", children: field.requiredHint })
|
|
18929
19048
|
] });
|
|
18930
19049
|
}
|
|
19050
|
+
function ConfigSelect({
|
|
19051
|
+
provider,
|
|
19052
|
+
value,
|
|
19053
|
+
options,
|
|
19054
|
+
loading,
|
|
19055
|
+
disabled,
|
|
19056
|
+
onChange
|
|
19057
|
+
}) {
|
|
19058
|
+
if (loading || !options) {
|
|
19059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("select", { className: "lens-db__intconfig-select", disabled: true, "aria-label": "Loading options", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { children: "Loading\u2026" }) });
|
|
19060
|
+
}
|
|
19061
|
+
const placeholderDisabled = provider !== "linear";
|
|
19062
|
+
const known = new Set(options.map((o2) => o2.value));
|
|
19063
|
+
const orphan = value && !known.has(value) ? value : null;
|
|
19064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
19065
|
+
"select",
|
|
19066
|
+
{
|
|
19067
|
+
className: "lens-db__intconfig-select",
|
|
19068
|
+
value,
|
|
19069
|
+
disabled,
|
|
19070
|
+
onChange: (e2) => onChange(e2.target.value),
|
|
19071
|
+
children: [
|
|
19072
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "", disabled: placeholderDisabled, children: SELECT_PLACEHOLDER[provider] }),
|
|
19073
|
+
orphan && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: orphan, children: orphan }),
|
|
19074
|
+
options.map((o2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: o2.value, children: o2.label }, o2.value))
|
|
19075
|
+
]
|
|
19076
|
+
}
|
|
19077
|
+
);
|
|
19078
|
+
}
|
|
18931
19079
|
var PROVIDER_NAME = {
|
|
18932
19080
|
linear: "Linear",
|
|
18933
19081
|
jira: "Jira",
|
|
@@ -18958,10 +19106,10 @@ function consumeOAuthCallback() {
|
|
|
18958
19106
|
function IntegrationSettings(props) {
|
|
18959
19107
|
const api = useLensApi();
|
|
18960
19108
|
const { data, error, loading, reload } = useAsync(() => api.listIntegrations(), []);
|
|
18961
|
-
const [busy, setBusy] = (0,
|
|
18962
|
-
const [list, setList] = (0,
|
|
18963
|
-
const [flash, setFlash] = (0,
|
|
18964
|
-
(0,
|
|
19109
|
+
const [busy, setBusy] = (0, import_react7.useState)(null);
|
|
19110
|
+
const [list, setList] = (0, import_react7.useState)(null);
|
|
19111
|
+
const [flash, setFlash] = (0, import_react7.useState)(null);
|
|
19112
|
+
(0, import_react7.useEffect)(() => {
|
|
18965
19113
|
const outcome = consumeOAuthCallback();
|
|
18966
19114
|
if (!outcome) return;
|
|
18967
19115
|
if (outcome.connected) {
|
|
@@ -19011,7 +19159,7 @@ function IntegrationSettings(props) {
|
|
|
19011
19159
|
setBusy(null);
|
|
19012
19160
|
}
|
|
19013
19161
|
}
|
|
19014
|
-
return /* @__PURE__ */ (0,
|
|
19162
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: clsx_default("lens-db", props.className), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
19015
19163
|
IntegrationList,
|
|
19016
19164
|
{
|
|
19017
19165
|
integrations,
|
|
@@ -19027,56 +19175,11 @@ function IntegrationSettings(props) {
|
|
|
19027
19175
|
onActivate: (p) => void activate(p),
|
|
19028
19176
|
onDisconnect: (p) => void disconnect(p),
|
|
19029
19177
|
onCompleteDev: (p) => void completeDev(p),
|
|
19030
|
-
onSaveConfig: saveConfig
|
|
19178
|
+
onSaveConfig: saveConfig,
|
|
19179
|
+
loadOptions: (p) => api.getIntegrationOptions(p)
|
|
19031
19180
|
}
|
|
19032
19181
|
) });
|
|
19033
19182
|
}
|
|
19034
|
-
var MARKUP_RULES = [
|
|
19035
|
-
{ cls: "com", re: /<!--[\s\S]*?-->|\/\*[\s\S]*?\*\/|\/\/[^\n]*/y },
|
|
19036
|
-
{ cls: "str", re: /"(?:[^"\\\n]|\\.)*"|'(?:[^'\\\n]|\\.)*'|`(?:[^`\\]|\\.)*`/y },
|
|
19037
|
-
{ cls: "tag", re: /<\/?[a-zA-Z][\w.-]*|\/>|>/y },
|
|
19038
|
-
{
|
|
19039
|
-
cls: "kw",
|
|
19040
|
-
re: /\b(?:import|from|export|function|return|const|let|var|async|await|new|window|default)\b/y
|
|
19041
|
-
},
|
|
19042
|
-
{ cls: "attr", re: /\b[a-zA-Z_][\w-]*(?==)/y },
|
|
19043
|
-
{ cls: "num", re: /\b\d+(?:\.\d+)?\b/y }
|
|
19044
|
-
];
|
|
19045
|
-
var ENV_RULES = [
|
|
19046
|
-
{ cls: "com", re: /#[^\n]*/y },
|
|
19047
|
-
{ cls: "attr", re: /^[A-Z][A-Z0-9_]*(?==)/my },
|
|
19048
|
-
{ cls: "str", re: /(?<==)[^\n]+/y }
|
|
19049
|
-
];
|
|
19050
|
-
function highlightCode(code, lang) {
|
|
19051
|
-
const rules2 = lang === "env" ? ENV_RULES : MARKUP_RULES;
|
|
19052
|
-
const out = [];
|
|
19053
|
-
let pos = 0;
|
|
19054
|
-
let plainStart = 0;
|
|
19055
|
-
let key = 0;
|
|
19056
|
-
const flushPlain = (until) => {
|
|
19057
|
-
if (until > plainStart) out.push(code.slice(plainStart, until));
|
|
19058
|
-
};
|
|
19059
|
-
while (pos < code.length) {
|
|
19060
|
-
let matched = false;
|
|
19061
|
-
for (const rule2 of rules2) {
|
|
19062
|
-
rule2.re.lastIndex = pos;
|
|
19063
|
-
const m = rule2.re.exec(code);
|
|
19064
|
-
if (m && m[0].length > 0) {
|
|
19065
|
-
flushPlain(pos);
|
|
19066
|
-
out.push(
|
|
19067
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: `lens-db__tok-${rule2.cls}`, children: m[0] }, key++)
|
|
19068
|
-
);
|
|
19069
|
-
pos += m[0].length;
|
|
19070
|
-
plainStart = pos;
|
|
19071
|
-
matched = true;
|
|
19072
|
-
break;
|
|
19073
|
-
}
|
|
19074
|
-
}
|
|
19075
|
-
if (!matched) pos += 1;
|
|
19076
|
-
}
|
|
19077
|
-
flushPlain(code.length);
|
|
19078
|
-
return out;
|
|
19079
|
-
}
|
|
19080
19183
|
var STEPS = ["Project", "Destination", "Asset storage", "Install"];
|
|
19081
19184
|
var PROVIDER_NAME2 = {
|
|
19082
19185
|
linear: "Linear",
|
|
@@ -19124,7 +19227,7 @@ function CopyButton({
|
|
|
19124
19227
|
label = "Copy",
|
|
19125
19228
|
ghost = false
|
|
19126
19229
|
}) {
|
|
19127
|
-
const [copied, setCopied] = (0,
|
|
19230
|
+
const [copied, setCopied] = (0, import_react9.useState)(false);
|
|
19128
19231
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
19129
19232
|
"button",
|
|
19130
19233
|
{
|
|
@@ -19153,25 +19256,25 @@ function CopyButton({
|
|
|
19153
19256
|
}
|
|
19154
19257
|
function OnboardingWizard(props) {
|
|
19155
19258
|
const api = useLensApi();
|
|
19156
|
-
const [step, setStep] = (0,
|
|
19157
|
-
const [name, setName] = (0,
|
|
19158
|
-
const [origins, setOrigins] = (0,
|
|
19159
|
-
const [dashboardUrl, setDashboardUrl] = (0,
|
|
19160
|
-
const [project, setProject] = (0,
|
|
19161
|
-
const [accessId, setAccessId] = (0,
|
|
19162
|
-
const [accessSecret, setAccessSecret] = (0,
|
|
19163
|
-
const [step1Busy, setStep1Busy] = (0,
|
|
19164
|
-
const [step1Error, setStep1Error] = (0,
|
|
19165
|
-
const [loadingExisting, setLoadingExisting] = (0,
|
|
19166
|
-
const [integrations, setIntegrations] = (0,
|
|
19167
|
-
const [intBusy, setIntBusy] = (0,
|
|
19168
|
-
const [intLoadError, setIntLoadError] = (0,
|
|
19169
|
-
const [intFlash, setIntFlash] = (0,
|
|
19170
|
-
const [storage, setStorage] = (0,
|
|
19171
|
-
const [storageError, setStorageError] = (0,
|
|
19172
|
-
const [finishBusy, setFinishBusy] = (0,
|
|
19173
|
-
const [finishError, setFinishError] = (0,
|
|
19174
|
-
(0,
|
|
19259
|
+
const [step, setStep] = (0, import_react9.useState)(0);
|
|
19260
|
+
const [name, setName] = (0, import_react9.useState)("");
|
|
19261
|
+
const [origins, setOrigins] = (0, import_react9.useState)("");
|
|
19262
|
+
const [dashboardUrl, setDashboardUrl] = (0, import_react9.useState)("");
|
|
19263
|
+
const [project, setProject] = (0, import_react9.useState)(null);
|
|
19264
|
+
const [accessId, setAccessId] = (0, import_react9.useState)(null);
|
|
19265
|
+
const [accessSecret, setAccessSecret] = (0, import_react9.useState)(null);
|
|
19266
|
+
const [step1Busy, setStep1Busy] = (0, import_react9.useState)(false);
|
|
19267
|
+
const [step1Error, setStep1Error] = (0, import_react9.useState)(void 0);
|
|
19268
|
+
const [loadingExisting, setLoadingExisting] = (0, import_react9.useState)(Boolean(props.existingProject));
|
|
19269
|
+
const [integrations, setIntegrations] = (0, import_react9.useState)(null);
|
|
19270
|
+
const [intBusy, setIntBusy] = (0, import_react9.useState)(null);
|
|
19271
|
+
const [intLoadError, setIntLoadError] = (0, import_react9.useState)(void 0);
|
|
19272
|
+
const [intFlash, setIntFlash] = (0, import_react9.useState)(null);
|
|
19273
|
+
const [storage, setStorage] = (0, import_react9.useState)(null);
|
|
19274
|
+
const [storageError, setStorageError] = (0, import_react9.useState)(void 0);
|
|
19275
|
+
const [finishBusy, setFinishBusy] = (0, import_react9.useState)(false);
|
|
19276
|
+
const [finishError, setFinishError] = (0, import_react9.useState)(void 0);
|
|
19277
|
+
(0, import_react9.useEffect)(() => {
|
|
19175
19278
|
if (!props.existingProject) return;
|
|
19176
19279
|
let active = true;
|
|
19177
19280
|
setLoadingExisting(true);
|
|
@@ -19192,7 +19295,7 @@ function OnboardingWizard(props) {
|
|
|
19192
19295
|
active = false;
|
|
19193
19296
|
};
|
|
19194
19297
|
}, []);
|
|
19195
|
-
(0,
|
|
19298
|
+
(0, import_react9.useEffect)(() => {
|
|
19196
19299
|
if (step !== 1) return;
|
|
19197
19300
|
const outcome = consumeOAuthCallback2();
|
|
19198
19301
|
if (!outcome) return;
|
|
@@ -19202,7 +19305,7 @@ function OnboardingWizard(props) {
|
|
|
19202
19305
|
}
|
|
19203
19306
|
if (outcome.error) setIntFlash({ kind: "error", message: outcome.error });
|
|
19204
19307
|
}, [step]);
|
|
19205
|
-
(0,
|
|
19308
|
+
(0, import_react9.useEffect)(() => {
|
|
19206
19309
|
if (step !== 1 || integrations !== null) return;
|
|
19207
19310
|
let active = true;
|
|
19208
19311
|
api.listIntegrations().then((list) => active && setIntegrations(list)).catch(
|
|
@@ -19314,7 +19417,7 @@ function OnboardingWizard(props) {
|
|
|
19314
19417
|
setIntBusy(null);
|
|
19315
19418
|
}
|
|
19316
19419
|
}
|
|
19317
|
-
(0,
|
|
19420
|
+
(0, import_react9.useEffect)(() => {
|
|
19318
19421
|
if (step !== 2 || storage !== null) return;
|
|
19319
19422
|
let active = true;
|
|
19320
19423
|
api.getStorageStatus().then((s2) => active && setStorage(s2)).catch(
|
|
@@ -19442,7 +19545,8 @@ export function App() {
|
|
|
19442
19545
|
onActivate: (p) => void activate(p),
|
|
19443
19546
|
onDisconnect: (p) => void disconnect(p),
|
|
19444
19547
|
onCompleteDev: (p) => void completeDev(p),
|
|
19445
|
-
onSaveConfig: saveConfig
|
|
19548
|
+
onSaveConfig: saveConfig,
|
|
19549
|
+
loadOptions: (p) => api.getIntegrationOptions(p)
|
|
19446
19550
|
}
|
|
19447
19551
|
),
|
|
19448
19552
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "lens-db__hint", children: activeProvider ? `Issues will route to ${providerLabel2(activeProvider)}.` : "No destination selected yet \u2014 issues will queue until you pick one." })
|
|
@@ -19589,20 +19693,263 @@ export function App() {
|
|
|
19589
19693
|
] })
|
|
19590
19694
|
] });
|
|
19591
19695
|
}
|
|
19696
|
+
var HOSTED_LENS_API_URL = "https://api-lens.meritt.app";
|
|
19697
|
+
var LensConfigContext = (0, import_react2.createContext)(null);
|
|
19698
|
+
function LensProvider({
|
|
19699
|
+
config,
|
|
19700
|
+
children
|
|
19701
|
+
}) {
|
|
19702
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LensConfigContext.Provider, { value: config, children });
|
|
19703
|
+
}
|
|
19704
|
+
var TABS = [
|
|
19705
|
+
{ id: "reports", label: "Issue Reports", Icon: IconBug },
|
|
19706
|
+
{ id: "integrations", label: "Integrations", Icon: IconPlug },
|
|
19707
|
+
{ id: "setup", label: "Setup", Icon: IconRocket }
|
|
19708
|
+
];
|
|
19709
|
+
function readInitialParams() {
|
|
19710
|
+
if (typeof window === "undefined") return { report: null, project: null };
|
|
19711
|
+
const params = new URLSearchParams(window.location.search);
|
|
19712
|
+
return { report: params.get("report"), project: params.get("project") };
|
|
19713
|
+
}
|
|
19714
|
+
function syncReportParam(reportId) {
|
|
19715
|
+
if (typeof window === "undefined") return;
|
|
19716
|
+
try {
|
|
19717
|
+
const params = new URLSearchParams(window.location.search);
|
|
19718
|
+
if (reportId) params.set("report", reportId);
|
|
19719
|
+
else params.delete("report");
|
|
19720
|
+
const qs = params.toString();
|
|
19721
|
+
const url = window.location.pathname + (qs ? `?${qs}` : "") + window.location.hash;
|
|
19722
|
+
window.history.replaceState(window.history.state, "", url);
|
|
19723
|
+
} catch {
|
|
19724
|
+
}
|
|
19725
|
+
}
|
|
19726
|
+
function CopyButton2({ value, label = "Copy" }) {
|
|
19727
|
+
const [copied, setCopied] = (0, import_react2.useState)(false);
|
|
19728
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
19729
|
+
"button",
|
|
19730
|
+
{
|
|
19731
|
+
type: "button",
|
|
19732
|
+
className: clsx_default("lens-db__copy-btn", copied && "lens-db__copy-btn--done"),
|
|
19733
|
+
"aria-label": copied ? "Copied" : label,
|
|
19734
|
+
onClick: () => {
|
|
19735
|
+
void navigator.clipboard?.writeText(value).then(
|
|
19736
|
+
() => {
|
|
19737
|
+
setCopied(true);
|
|
19738
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
19739
|
+
},
|
|
19740
|
+
() => void 0
|
|
19741
|
+
);
|
|
19742
|
+
},
|
|
19743
|
+
children: [
|
|
19744
|
+
copied ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconCheck, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IconCopy, { size: 14 }),
|
|
19745
|
+
copied ? "Copied" : label
|
|
19746
|
+
]
|
|
19747
|
+
}
|
|
19748
|
+
);
|
|
19749
|
+
}
|
|
19750
|
+
function LensAdmin(props) {
|
|
19751
|
+
const contextConfig = (0, import_react2.useContext)(LensConfigContext);
|
|
19752
|
+
const {
|
|
19753
|
+
config = contextConfig ?? void 0,
|
|
19754
|
+
baseUrl = "/api/lens",
|
|
19755
|
+
projectsUrl = "/api/lens-projects",
|
|
19756
|
+
projects: propProjects,
|
|
19757
|
+
defaultTab = "reports",
|
|
19758
|
+
theme,
|
|
19759
|
+
className
|
|
19760
|
+
} = props;
|
|
19761
|
+
const direct = !!config;
|
|
19762
|
+
const staticProjects = (0, import_react2.useMemo)(
|
|
19763
|
+
() => config?.projects.map(({ name, accessId }) => ({ name, accessId })) ?? propProjects,
|
|
19764
|
+
[config, propProjects]
|
|
19765
|
+
);
|
|
19766
|
+
const wizardSecretRef = (0, import_react2.useRef)("");
|
|
19767
|
+
const activeProjectRef = (0, import_react2.useRef)(null);
|
|
19768
|
+
const configRef = (0, import_react2.useRef)(config);
|
|
19769
|
+
configRef.current = config;
|
|
19770
|
+
const api = (0, import_react2.useMemo)(
|
|
19771
|
+
() => direct ? createLensApi({
|
|
19772
|
+
baseUrl: configRef.current?.apiUrl ?? HOSTED_LENS_API_URL,
|
|
19773
|
+
getToken: () => {
|
|
19774
|
+
const cfg = configRef.current;
|
|
19775
|
+
const active = cfg?.projects.find((p) => p.accessId === activeProjectRef.current);
|
|
19776
|
+
return wizardSecretRef.current || active?.secretKey || cfg?.adminToken || "";
|
|
19777
|
+
}
|
|
19778
|
+
}) : createLensApi({
|
|
19779
|
+
baseUrl,
|
|
19780
|
+
tokenHeader: "x-lens-token",
|
|
19781
|
+
getToken: () => wizardSecretRef.current,
|
|
19782
|
+
project: () => activeProjectRef.current
|
|
19783
|
+
}),
|
|
19784
|
+
[direct, baseUrl]
|
|
19785
|
+
);
|
|
19786
|
+
const [initialParams] = (0, import_react2.useState)(readInitialParams);
|
|
19787
|
+
const [projects, setProjects] = (0, import_react2.useState)(staticProjects ?? []);
|
|
19788
|
+
const [loadingProjects, setLoadingProjects] = (0, import_react2.useState)(!staticProjects);
|
|
19789
|
+
const [activeAccessId, setActiveAccessId] = (0, import_react2.useState)(null);
|
|
19790
|
+
const [firstReportId, setFirstReportId] = (0, import_react2.useState)(initialParams.report);
|
|
19791
|
+
(0, import_react2.useEffect)(() => {
|
|
19792
|
+
if (staticProjects) return;
|
|
19793
|
+
let active = true;
|
|
19794
|
+
setLoadingProjects(true);
|
|
19795
|
+
fetch(projectsUrl, { headers: { Accept: "application/json" } }).then((res) => res.ok ? res.json() : Promise.reject(new Error(String(res.status)))).then((body) => {
|
|
19796
|
+
if (!active) return;
|
|
19797
|
+
const list = body && typeof body === "object" && Array.isArray(body.projects) ? body.projects.filter(
|
|
19798
|
+
(p) => !!p && typeof p === "object" && typeof p.name === "string" && typeof p.accessId === "string"
|
|
19799
|
+
) : [];
|
|
19800
|
+
setProjects(list);
|
|
19801
|
+
setLoadingProjects(false);
|
|
19802
|
+
}).catch(() => {
|
|
19803
|
+
if (!active) return;
|
|
19804
|
+
setProjects([]);
|
|
19805
|
+
setLoadingProjects(false);
|
|
19806
|
+
});
|
|
19807
|
+
return () => {
|
|
19808
|
+
active = false;
|
|
19809
|
+
};
|
|
19810
|
+
}, [projectsUrl, staticProjects]);
|
|
19811
|
+
(0, import_react2.useEffect)(() => {
|
|
19812
|
+
const first = projects[0];
|
|
19813
|
+
if (!first) {
|
|
19814
|
+
setActiveAccessId(null);
|
|
19815
|
+
return;
|
|
19816
|
+
}
|
|
19817
|
+
setActiveAccessId((current) => {
|
|
19818
|
+
if (current && projects.some((p) => p.accessId === current)) return current;
|
|
19819
|
+
const fromUrl = initialParams.project && projects.find((p) => p.accessId === initialParams.project);
|
|
19820
|
+
return fromUrl ? fromUrl.accessId : first.accessId;
|
|
19821
|
+
});
|
|
19822
|
+
}, [projects, initialParams.project]);
|
|
19823
|
+
if (activeAccessId) activeProjectRef.current = activeAccessId;
|
|
19824
|
+
const provisioning = !loadingProjects && projects.length === 0;
|
|
19825
|
+
function switchProject(accessId) {
|
|
19826
|
+
setFirstReportId(null);
|
|
19827
|
+
setActiveAccessId(accessId);
|
|
19828
|
+
}
|
|
19829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: clsx_default("lens-db", "lens-db__shell", className), children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LensDashboardProvider, { api, theme, children: loadingProjects ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "lens-db__shell-loading", children: "Loading\u2026" }) : provisioning ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
19830
|
+
Provisioning,
|
|
19831
|
+
{
|
|
19832
|
+
onProjectCreated: (res) => {
|
|
19833
|
+
wizardSecretRef.current = res.accessSecret;
|
|
19834
|
+
activeProjectRef.current = res.accessId;
|
|
19835
|
+
}
|
|
19836
|
+
}
|
|
19837
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
19838
|
+
DashboardSurface,
|
|
19839
|
+
{
|
|
19840
|
+
projects,
|
|
19841
|
+
activeAccessId,
|
|
19842
|
+
onSwitchProject: switchProject,
|
|
19843
|
+
defaultTab,
|
|
19844
|
+
initialReportId: firstReportId
|
|
19845
|
+
},
|
|
19846
|
+
activeAccessId ?? "none"
|
|
19847
|
+
) }) });
|
|
19848
|
+
}
|
|
19849
|
+
function Provisioning({
|
|
19850
|
+
onProjectCreated
|
|
19851
|
+
}) {
|
|
19852
|
+
const [minted, setMinted] = (0, import_react2.useState)(
|
|
19853
|
+
null
|
|
19854
|
+
);
|
|
19855
|
+
const envBlock = minted ? `LENS_PROJECTS=[${JSON.stringify({
|
|
19856
|
+
name: minted.name,
|
|
19857
|
+
accessId: minted.accessId,
|
|
19858
|
+
secretKey: minted.secretKey
|
|
19859
|
+
})}]` : "";
|
|
19860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lens-db__shell-provision", children: [
|
|
19861
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lens-db__shell-notice", children: [
|
|
19862
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "lens-db__shell-notice-title", children: "No Lens projects configured" }),
|
|
19863
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "lens-db__muted", children: "Create your first project below. The minted access secret is shown once \u2014 add it to your server environment to finish wiring up the proxy." })
|
|
19864
|
+
] }),
|
|
19865
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
19866
|
+
OnboardingWizard,
|
|
19867
|
+
{
|
|
19868
|
+
onProjectCreated: (res) => {
|
|
19869
|
+
onProjectCreated(res);
|
|
19870
|
+
setMinted({
|
|
19871
|
+
name: res.project.name,
|
|
19872
|
+
accessId: res.accessId,
|
|
19873
|
+
secretKey: res.accessSecret
|
|
19874
|
+
});
|
|
19875
|
+
}
|
|
19876
|
+
}
|
|
19877
|
+
),
|
|
19878
|
+
minted && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lens-db__shell-env", children: [
|
|
19879
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "lens-db__label", children: "Add this to your server env and restart \u2014 the proxy reads it to route requests to the new project:" }),
|
|
19880
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lens-db__codeblock", children: [
|
|
19881
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("pre", { className: "lens-db__pre", children: highlightCode(envBlock, "env") }),
|
|
19882
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(CopyButton2, { value: envBlock, label: "Copy" })
|
|
19883
|
+
] })
|
|
19884
|
+
] })
|
|
19885
|
+
] });
|
|
19886
|
+
}
|
|
19887
|
+
function DashboardSurface({
|
|
19888
|
+
projects,
|
|
19889
|
+
activeAccessId,
|
|
19890
|
+
onSwitchProject,
|
|
19891
|
+
defaultTab,
|
|
19892
|
+
initialReportId
|
|
19893
|
+
}) {
|
|
19894
|
+
const [tab, setTab] = (0, import_react2.useState)(defaultTab);
|
|
19895
|
+
const [selected, setSelected] = (0, import_react2.useState)(initialReportId);
|
|
19896
|
+
(0, import_react2.useEffect)(() => {
|
|
19897
|
+
syncReportParam(selected);
|
|
19898
|
+
}, [selected]);
|
|
19899
|
+
const showSwitcher = projects.length > 1;
|
|
19900
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
19901
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lens-db__shell-bar", children: [
|
|
19902
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "lens-db__shell-tabs", role: "tablist", "aria-label": "Lens sections", children: TABS.map(({ id, label, Icon }) => {
|
|
19903
|
+
const active = id === tab;
|
|
19904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
19905
|
+
"button",
|
|
19906
|
+
{
|
|
19907
|
+
type: "button",
|
|
19908
|
+
role: "tab",
|
|
19909
|
+
"aria-selected": active,
|
|
19910
|
+
className: clsx_default("lens-db__shell-tab", active && "lens-db__shell-tab--active"),
|
|
19911
|
+
onClick: () => setTab(id),
|
|
19912
|
+
children: [
|
|
19913
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Icon, { size: 16 }),
|
|
19914
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "lens-db__shell-tab-label", children: label })
|
|
19915
|
+
]
|
|
19916
|
+
},
|
|
19917
|
+
id
|
|
19918
|
+
);
|
|
19919
|
+
}) }),
|
|
19920
|
+
showSwitcher && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "lens-db__shell-switcher", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
19921
|
+
"select",
|
|
19922
|
+
{
|
|
19923
|
+
className: "lens-db__shell-select",
|
|
19924
|
+
"aria-label": "Switch project",
|
|
19925
|
+
value: activeAccessId ?? "",
|
|
19926
|
+
onChange: (e2) => onSwitchProject(e2.target.value),
|
|
19927
|
+
children: projects.map((p) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: p.accessId, children: p.name }, p.accessId))
|
|
19928
|
+
}
|
|
19929
|
+
) })
|
|
19930
|
+
] }),
|
|
19931
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "lens-db__shell-content", children: [
|
|
19932
|
+
tab === "reports" && (selected ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ReportDetail, { reportId: selected, onClose: () => setSelected(null) }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ReportsTable, { onSelect: setSelected })),
|
|
19933
|
+
tab === "integrations" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(IntegrationSettings, {}),
|
|
19934
|
+
tab === "setup" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(OnboardingWizard, { existingProject: true })
|
|
19935
|
+
] })
|
|
19936
|
+
] });
|
|
19937
|
+
}
|
|
19938
|
+
var LensDashboard = LensAdmin;
|
|
19592
19939
|
function parseOrigins2(raw) {
|
|
19593
19940
|
return raw.split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
19594
19941
|
}
|
|
19595
19942
|
function ProjectSettings(props) {
|
|
19596
19943
|
const api = useLensApi();
|
|
19597
19944
|
const { data, error, loading, reload } = useAsync(() => api.getProject(), []);
|
|
19598
|
-
const [name, setName] = (0,
|
|
19599
|
-
const [origins, setOrigins] = (0,
|
|
19600
|
-
const [dashboardUrl, setDashboardUrl] = (0,
|
|
19601
|
-
const [saving, setSaving] = (0,
|
|
19602
|
-
const [saveError, setSaveError] = (0,
|
|
19603
|
-
const [saved, setSaved] = (0,
|
|
19604
|
-
const [copied, setCopied] = (0,
|
|
19605
|
-
(0,
|
|
19945
|
+
const [name, setName] = (0, import_react10.useState)("");
|
|
19946
|
+
const [origins, setOrigins] = (0, import_react10.useState)("");
|
|
19947
|
+
const [dashboardUrl, setDashboardUrl] = (0, import_react10.useState)("");
|
|
19948
|
+
const [saving, setSaving] = (0, import_react10.useState)(false);
|
|
19949
|
+
const [saveError, setSaveError] = (0, import_react10.useState)(void 0);
|
|
19950
|
+
const [saved, setSaved] = (0, import_react10.useState)(false);
|
|
19951
|
+
const [copied, setCopied] = (0, import_react10.useState)(false);
|
|
19952
|
+
(0, import_react10.useEffect)(() => {
|
|
19606
19953
|
if (!data) return;
|
|
19607
19954
|
setName(data.name);
|
|
19608
19955
|
setOrigins(data.allowedOrigins.join("\n"));
|
|
@@ -19634,22 +19981,22 @@ function ProjectSettings(props) {
|
|
|
19634
19981
|
}
|
|
19635
19982
|
}
|
|
19636
19983
|
const accessId = data?.accessId ?? "";
|
|
19637
|
-
return /* @__PURE__ */ (0,
|
|
19638
|
-
/* @__PURE__ */ (0,
|
|
19639
|
-
/* @__PURE__ */ (0,
|
|
19640
|
-
/* @__PURE__ */ (0,
|
|
19984
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: clsx_default("lens-db", "lens-db__panel", props.className), children: [
|
|
19985
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
19986
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "lens-db__wizard-title", children: "Project settings" }),
|
|
19987
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "lens-db__muted", children: "Update the project name and the origins allowed to submit reports." })
|
|
19641
19988
|
] }),
|
|
19642
|
-
loading && !data && /* @__PURE__ */ (0,
|
|
19643
|
-
error && !data && /* @__PURE__ */ (0,
|
|
19989
|
+
loading && !data && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "lens-db__muted", children: "Loading project\u2026" }),
|
|
19990
|
+
error && !data && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lens-db__error", children: [
|
|
19644
19991
|
"Failed to load project: ",
|
|
19645
19992
|
error.message,
|
|
19646
19993
|
" ",
|
|
19647
|
-
/* @__PURE__ */ (0,
|
|
19994
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "lens-db__link-btn", onClick: reload, children: "Retry" })
|
|
19648
19995
|
] }),
|
|
19649
|
-
data && /* @__PURE__ */ (0,
|
|
19650
|
-
/* @__PURE__ */ (0,
|
|
19651
|
-
/* @__PURE__ */ (0,
|
|
19652
|
-
/* @__PURE__ */ (0,
|
|
19996
|
+
data && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
19997
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "lens-db__field", children: [
|
|
19998
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lens-db__label", children: "Project name" }),
|
|
19999
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
19653
20000
|
"input",
|
|
19654
20001
|
{
|
|
19655
20002
|
className: "lens-db__input",
|
|
@@ -19661,9 +20008,9 @@ function ProjectSettings(props) {
|
|
|
19661
20008
|
}
|
|
19662
20009
|
)
|
|
19663
20010
|
] }),
|
|
19664
|
-
/* @__PURE__ */ (0,
|
|
19665
|
-
/* @__PURE__ */ (0,
|
|
19666
|
-
/* @__PURE__ */ (0,
|
|
20011
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "lens-db__field", children: [
|
|
20012
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lens-db__label", children: "Allowed origins" }),
|
|
20013
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
19667
20014
|
"textarea",
|
|
19668
20015
|
{
|
|
19669
20016
|
className: "lens-db__input lens-db__textarea",
|
|
@@ -19674,11 +20021,11 @@ function ProjectSettings(props) {
|
|
|
19674
20021
|
onChange: (e2) => setOrigins(e2.target.value)
|
|
19675
20022
|
}
|
|
19676
20023
|
),
|
|
19677
|
-
/* @__PURE__ */ (0,
|
|
20024
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lens-db__hint", children: "One origin per line." })
|
|
19678
20025
|
] }),
|
|
19679
|
-
/* @__PURE__ */ (0,
|
|
19680
|
-
/* @__PURE__ */ (0,
|
|
19681
|
-
/* @__PURE__ */ (0,
|
|
20026
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "lens-db__field", children: [
|
|
20027
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lens-db__label", children: "Dashboard URL" }),
|
|
20028
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
19682
20029
|
"input",
|
|
19683
20030
|
{
|
|
19684
20031
|
className: "lens-db__input",
|
|
@@ -19689,13 +20036,13 @@ function ProjectSettings(props) {
|
|
|
19689
20036
|
onChange: (e2) => setDashboardUrl(e2.target.value)
|
|
19690
20037
|
}
|
|
19691
20038
|
),
|
|
19692
|
-
/* @__PURE__ */ (0,
|
|
20039
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lens-db__hint", children: "Issues link reports back to this page." })
|
|
19693
20040
|
] }),
|
|
19694
|
-
/* @__PURE__ */ (0,
|
|
19695
|
-
/* @__PURE__ */ (0,
|
|
19696
|
-
/* @__PURE__ */ (0,
|
|
19697
|
-
/* @__PURE__ */ (0,
|
|
19698
|
-
/* @__PURE__ */ (0,
|
|
20041
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lens-db__field", children: [
|
|
20042
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "lens-db__label", children: "Access ID" }),
|
|
20043
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lens-db__cred-row", children: [
|
|
20044
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("code", { className: "lens-db__code-inline", children: accessId }),
|
|
20045
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
19699
20046
|
"button",
|
|
19700
20047
|
{
|
|
19701
20048
|
type: "button",
|
|
@@ -19711,16 +20058,16 @@ function ProjectSettings(props) {
|
|
|
19711
20058
|
);
|
|
19712
20059
|
},
|
|
19713
20060
|
children: [
|
|
19714
|
-
copied ? /* @__PURE__ */ (0,
|
|
20061
|
+
copied ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconCheck, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconCopy, { size: 14 }),
|
|
19715
20062
|
copied ? "Copied" : "Copy"
|
|
19716
20063
|
]
|
|
19717
20064
|
}
|
|
19718
20065
|
)
|
|
19719
20066
|
] })
|
|
19720
20067
|
] }),
|
|
19721
|
-
saveError && /* @__PURE__ */ (0,
|
|
19722
|
-
/* @__PURE__ */ (0,
|
|
19723
|
-
/* @__PURE__ */ (0,
|
|
20068
|
+
saveError && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "lens-db__error", children: saveError }),
|
|
20069
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "lens-db__panel-actions", children: [
|
|
20070
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
19724
20071
|
"button",
|
|
19725
20072
|
{
|
|
19726
20073
|
type: "button",
|
|
@@ -19730,8 +20077,8 @@ function ProjectSettings(props) {
|
|
|
19730
20077
|
children: saving ? "Saving\u2026" : "Save"
|
|
19731
20078
|
}
|
|
19732
20079
|
),
|
|
19733
|
-
saved && /* @__PURE__ */ (0,
|
|
19734
|
-
/* @__PURE__ */ (0,
|
|
20080
|
+
saved && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "lens-db__flash lens-db__flash--ok", children: [
|
|
20081
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(IconCheck, { size: 14 }),
|
|
19735
20082
|
"Saved"
|
|
19736
20083
|
] })
|
|
19737
20084
|
] })
|
|
@@ -19741,8 +20088,11 @@ function ProjectSettings(props) {
|
|
|
19741
20088
|
// Annotate the CommonJS export names for ESM import in node:
|
|
19742
20089
|
0 && (module.exports = {
|
|
19743
20090
|
IntegrationSettings,
|
|
20091
|
+
LensAdmin,
|
|
19744
20092
|
LensApiError,
|
|
20093
|
+
LensDashboard,
|
|
19745
20094
|
LensDashboardProvider,
|
|
20095
|
+
LensProvider,
|
|
19746
20096
|
OnboardingWizard,
|
|
19747
20097
|
ProjectSettings,
|
|
19748
20098
|
ReplayPlayer,
|