@localstack/appinspector-ui 1.0.206 → 1.0.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -16803,7 +16803,7 @@ var import_react52 = require("react");
16803
16803
 
16804
16804
  // src/dev-settings.tsx
16805
16805
  var React122 = __toESM(require("react"), 1);
16806
- var DEFAULT_DEV_SETTINGS = { operationStatus: "subtitle-chips", requestTerms: "on", waterfallIssueBackgrounds: "off", waterfallLayout: "tree", waterfallStatusIcons: "first column" };
16806
+ var DEFAULT_DEV_SETTINGS = { operationStatus: "subtitle-chips", waterfallLayout: "tree" };
16807
16807
  var DevSettingsContext = React122.createContext(DEFAULT_DEV_SETTINGS);
16808
16808
  var useDevSettings = () => React122.useContext(DevSettingsContext);
16809
16809
 
@@ -32536,7 +32536,7 @@ var ROW_HEIGHT = 24;
32536
32536
  var OFFSET_COLUMN_WIDTH = 72;
32537
32537
  var OFFSET_UNIT_WIDTH = 20;
32538
32538
  var STATUS_ICONS_WIDTH = 30;
32539
- var gridColumns = (statusIconsFirst) => `${String(OFFSET_COLUMN_WIDTH + (statusIconsFirst ? STATUS_ICONS_WIDTH : 0))}px minmax(0, 2fr) minmax(0, 1fr)`;
32539
+ var GRID_COLUMNS = `${String(OFFSET_COLUMN_WIDTH + STATUS_ICONS_WIDTH)}px minmax(0, 2fr) minmax(0, 1fr)`;
32540
32540
  var INDENT = 16;
32541
32541
  var lineX = (level) => 8 + level * INDENT + 7;
32542
32542
  var flatten = (nodes2, collapsed, depth = 0, branches = [], parent) => nodes2.flatMap((node, index) => {
@@ -32576,7 +32576,7 @@ var useWidth = (elementRef) => {
32576
32576
  return width;
32577
32577
  };
32578
32578
  var LABEL_TRANSFORMS = { center: "translateX(-50%)", end: "translateX(-100%)", start: void 0 };
32579
- var WaterfallAxis = ({ durationMs, flat, gridColumns: gridColumns2, onFlatChange }) => {
32579
+ var WaterfallAxis = ({ durationMs, flat, onFlatChange }) => {
32580
32580
  const trackRef = React124.useRef(null);
32581
32581
  const width = useWidth(trackRef);
32582
32582
  const { labels, marks } = layoutAxis(durationMs, width);
@@ -32589,7 +32589,7 @@ var WaterfallAxis = ({ durationMs, flat, gridColumns: gridColumns2, onFlatChange
32589
32589
  borderBottom: 1,
32590
32590
  borderColor: "divider",
32591
32591
  display: "grid",
32592
- gridTemplateColumns: gridColumns2,
32592
+ gridTemplateColumns: GRID_COLUMNS,
32593
32593
  height: AXIS_HEIGHT,
32594
32594
  position: "sticky",
32595
32595
  top: 0,
@@ -32650,9 +32650,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32650
32650
  const containerRef = React124.useRef(null);
32651
32651
  const tree = React124.useMemo(() => buildTraceTree(spans), [spans]);
32652
32652
  const bounds = React124.useMemo(() => getTraceBounds(spans), [spans]);
32653
- const { waterfallIssueBackgrounds, waterfallLayout, waterfallStatusIcons } = useDevSettings();
32654
- const issueBackgrounds = waterfallIssueBackgrounds === "on";
32655
- const statusIconsFirst = waterfallStatusIcons === "first column";
32653
+ const { waterfallLayout } = useDevSettings();
32656
32654
  const [toggledFlat, setToggledFlat] = React124.useState(false);
32657
32655
  const flat = waterfallLayout === "list" || waterfallLayout === "toggle" && toggledFlat;
32658
32656
  const rows = React124.useMemo(() => flat ? flattenAll(tree.roots) : flatten(tree.roots, collapsed), [tree, collapsed, flat]);
@@ -32691,7 +32689,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32691
32689
  }
32692
32690
  const percentAt = (nano) => bounds.durationMs > 0 ? Number(BigInt(nano) - bounds.startNano) / 1e6 / bounds.durationMs * 100 : 0;
32693
32691
  return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_material24.Box, { "aria-label": "Operations waterfall", "data-testid": WATERFALL_TEST_ID, ref: containerRef, role: "tree", sx: { fontSize: 13, minWidth: 0 }, children: [
32694
- /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WaterfallAxis, { durationMs: bounds.durationMs, flat, gridColumns: gridColumns(statusIconsFirst), onFlatChange: waterfallLayout === "toggle" ? setToggledFlat : void 0 }),
32692
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(WaterfallAxis, { durationMs: bounds.durationMs, flat, onFlatChange: waterfallLayout === "toggle" ? setToggledFlat : void 0 }),
32695
32693
  rows.map(({ branches, depth, last, node, parent }) => {
32696
32694
  const { span } = node;
32697
32695
  const issues = getSpanIssues(span);
@@ -32727,20 +32725,17 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32727
32725
  sx: (theme) => ({
32728
32726
  "&:focus-visible": { boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}` },
32729
32727
  // Tints over the paper, all in one opaque background: the duration label repeats it
32730
- // to cover the lead line behind it, which a translucent tint would let through. The
32731
- // hover is translucent too (the theme's is an opaque grey), so issue tints show through.
32728
+ // to cover the lead line behind it, which a translucent tint would let through.
32732
32729
  "&:hover": { "--row-tint": selected ? (0, import_styles4.alpha)(theme.palette.primary.main, 0.16) : (0, import_styles4.alpha)(theme.palette.text.primary, 0.04) },
32733
- // Only the content fades for a row the filters don't match: its background (selection, hover,
32734
- // issue tint) keeps its contrast.
32730
+ // Only the content fades for a row the filters don't match: its background (selection, hover)
32731
+ // keeps its contrast.
32735
32732
  "& > *": { opacity: spanMatches && !spanMatches(span.span_id) ? 0.4 : 1 },
32736
- "--row-bg": `linear-gradient(var(--row-tint), var(--row-tint)), linear-gradient(var(--row-issue), var(--row-issue)), ${theme.palette.background.paper}`,
32737
- // Under the hover and selection tints: an error wins over a warning.
32738
- "--row-issue": issueBackgrounds && issues.error ? (0, import_styles4.alpha)(theme.palette.error.main, 0.08) : issueBackgrounds && issues.warning ? (0, import_styles4.alpha)(theme.palette.warning.main, 0.1) : "transparent",
32733
+ "--row-bg": `linear-gradient(var(--row-tint), var(--row-tint)), ${theme.palette.background.paper}`,
32739
32734
  "--row-tint": selected ? (0, import_styles4.alpha)(theme.palette.primary.main, 0.12) : "transparent",
32740
32735
  "background": "var(--row-bg)",
32741
32736
  "cursor": "pointer",
32742
32737
  "display": "grid",
32743
- "gridTemplateColumns": gridColumns(statusIconsFirst),
32738
+ "gridTemplateColumns": GRID_COLUMNS,
32744
32739
  "height": ROW_HEIGHT,
32745
32740
  "outline": 0,
32746
32741
  "position": "relative",
@@ -32749,7 +32744,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32749
32744
  }),
32750
32745
  children: [
32751
32746
  /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_material24.Box, { sx: { alignItems: "center", display: "flex", minWidth: 0, pr: 1 }, children: [
32752
- statusIconsFirst && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Box, { sx: { display: "inline-flex", flex: "none", gap: "2px", pl: 1, width: STATUS_ICONS_WIDTH }, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(StatusIcons, { error: issues.error, warning: issues.warning }) }),
32747
+ /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Box, { sx: { display: "inline-flex", flex: "none", gap: "2px", pl: 1, width: STATUS_ICONS_WIDTH }, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(StatusIcons, { error: issues.error, warning: issues.warning }) }),
32753
32748
  /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(
32754
32749
  import_material24.Typography,
32755
32750
  {
@@ -32798,8 +32793,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32798
32793
  ) : !flat && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Box, { sx: { flex: "none", width: 14 } }),
32799
32794
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Box, { sx: { display: "flex", flex: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(AwsServiceIcon, { hideTooltip: true, service: span.service_name, size: "small" }) }),
32800
32795
  /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Typography, { component: "span", noWrap: true, sx: { flex: "0 1 auto", fontSize: "inherit", fontWeight: 600, minWidth: 0 }, title: span.operation_name, children: span.operation_name }),
32801
- resource !== "" && resource !== "*" && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Typography, { color: "text.secondary", component: "span", noWrap: true, sx: { flex: "1 1 0", fontSize: 11, minWidth: 0 }, title: resource, children: resource }),
32802
- !statusIconsFirst && (issues.error || issues.warning) && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Box, { sx: { display: "inline-flex", flex: "none", ml: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(StatusIcons, { error: issues.error, warning: issues.warning }) })
32796
+ resource !== "" && resource !== "*" && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Typography, { color: "text.secondary", component: "span", noWrap: true, sx: { flex: "1 1 0", fontSize: 11, minWidth: 0 }, title: resource, children: resource })
32803
32797
  ] }),
32804
32798
  /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_material24.Box, { sx: { mx: TRACK_INSET, position: "relative" }, children: [
32805
32799
  parentStartPercent !== void 0 && startPercent > parentStartPercent && /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_material24.Box, { sx: { backgroundColor: serviceColor, height: "1px", left: `${String(parentStartPercent)}%`, opacity: 0.35, position: "absolute", top: 11.5, width: `${String(startPercent - parentStartPercent)}%` } }),
@@ -32862,7 +32856,6 @@ var SPLIT_STORAGE_KEY = "appinspector-trace-sidebar-split";
32862
32856
  var clampSplit = (split2) => Math.min(MAX_SPLIT, Math.max(MIN_SPLIT, split2));
32863
32857
  var noop = () => void 0;
32864
32858
  var TraceSidebar = ({ onClose, onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32865
- const { requestTerms } = useDevSettings();
32866
32859
  const [storedWidth, setStoredWidth] = useLocalStorage(WIDTH_STORAGE_KEY, DEFAULT_WIDTH);
32867
32860
  const [storedSplit, setStoredSplit] = useLocalStorage(SPLIT_STORAGE_KEY, DEFAULT_SPLIT);
32868
32861
  const [view, setView] = React125.useState("waterfall");
@@ -32970,7 +32963,7 @@ var TraceSidebar = ({ onClose, onSelectSpan, selectedSpanId, spanMatches, spans
32970
32963
  ),
32971
32964
  /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_material25.Box, { sx: { alignItems: "center", borderBottom: 1, borderColor: "divider", display: "flex", gap: 1.5, px: 2, py: 1 }, children: [
32972
32965
  /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_material25.Box, { sx: { flex: 1, minWidth: 0 }, children: [
32973
- /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_material25.Typography, { color: "text.secondary", component: "div", sx: { lineHeight: 1.5 }, variant: "overline", children: requestTerms === "on" ? "Request" : "Trace root" }),
32966
+ /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_material25.Typography, { color: "text.secondary", component: "div", sx: { lineHeight: 1.5 }, variant: "overline", children: "Request" }),
32974
32967
  root2 && /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(import_material25.Box, { "data-testid": TRACE_SIDEBAR_ROOT_HEADING_TEST_ID, sx: { alignItems: "center", display: "flex", gap: 1, minWidth: 0 }, children: [
32975
32968
  /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(AwsServiceIcon, { hideTooltip: true, service: root2.service_name, size: "small" }),
32976
32969
  /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_material25.Typography, { noWrap: true, sx: { flex: "0 1 auto", fontWeight: 600, minWidth: 0 }, title: root2.operation_name, variant: "subtitle1", children: root2.operation_name }),