@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.js CHANGED
@@ -16829,7 +16829,7 @@ import { useMemo as useMemo10, useState as useState14 } from "react";
16829
16829
 
16830
16830
  // src/dev-settings.tsx
16831
16831
  import * as React122 from "react";
16832
- var DEFAULT_DEV_SETTINGS = { operationStatus: "subtitle-chips", requestTerms: "on", waterfallIssueBackgrounds: "off", waterfallLayout: "tree", waterfallStatusIcons: "first column" };
16832
+ var DEFAULT_DEV_SETTINGS = { operationStatus: "subtitle-chips", waterfallLayout: "tree" };
16833
16833
  var DevSettingsContext = React122.createContext(DEFAULT_DEV_SETTINGS);
16834
16834
  var useDevSettings = () => React122.useContext(DevSettingsContext);
16835
16835
 
@@ -32562,7 +32562,7 @@ var ROW_HEIGHT = 24;
32562
32562
  var OFFSET_COLUMN_WIDTH = 72;
32563
32563
  var OFFSET_UNIT_WIDTH = 20;
32564
32564
  var STATUS_ICONS_WIDTH = 30;
32565
- var gridColumns = (statusIconsFirst) => `${String(OFFSET_COLUMN_WIDTH + (statusIconsFirst ? STATUS_ICONS_WIDTH : 0))}px minmax(0, 2fr) minmax(0, 1fr)`;
32565
+ var GRID_COLUMNS = `${String(OFFSET_COLUMN_WIDTH + STATUS_ICONS_WIDTH)}px minmax(0, 2fr) minmax(0, 1fr)`;
32566
32566
  var INDENT = 16;
32567
32567
  var lineX = (level) => 8 + level * INDENT + 7;
32568
32568
  var flatten = (nodes2, collapsed, depth = 0, branches = [], parent) => nodes2.flatMap((node, index) => {
@@ -32602,7 +32602,7 @@ var useWidth = (elementRef) => {
32602
32602
  return width;
32603
32603
  };
32604
32604
  var LABEL_TRANSFORMS = { center: "translateX(-50%)", end: "translateX(-100%)", start: void 0 };
32605
- var WaterfallAxis = ({ durationMs, flat, gridColumns: gridColumns2, onFlatChange }) => {
32605
+ var WaterfallAxis = ({ durationMs, flat, onFlatChange }) => {
32606
32606
  const trackRef = React124.useRef(null);
32607
32607
  const width = useWidth(trackRef);
32608
32608
  const { labels, marks } = layoutAxis(durationMs, width);
@@ -32615,7 +32615,7 @@ var WaterfallAxis = ({ durationMs, flat, gridColumns: gridColumns2, onFlatChange
32615
32615
  borderBottom: 1,
32616
32616
  borderColor: "divider",
32617
32617
  display: "grid",
32618
- gridTemplateColumns: gridColumns2,
32618
+ gridTemplateColumns: GRID_COLUMNS,
32619
32619
  height: AXIS_HEIGHT,
32620
32620
  position: "sticky",
32621
32621
  top: 0,
@@ -32676,9 +32676,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32676
32676
  const containerRef = React124.useRef(null);
32677
32677
  const tree = React124.useMemo(() => buildTraceTree(spans), [spans]);
32678
32678
  const bounds = React124.useMemo(() => getTraceBounds(spans), [spans]);
32679
- const { waterfallIssueBackgrounds, waterfallLayout, waterfallStatusIcons } = useDevSettings();
32680
- const issueBackgrounds = waterfallIssueBackgrounds === "on";
32681
- const statusIconsFirst = waterfallStatusIcons === "first column";
32679
+ const { waterfallLayout } = useDevSettings();
32682
32680
  const [toggledFlat, setToggledFlat] = React124.useState(false);
32683
32681
  const flat = waterfallLayout === "list" || waterfallLayout === "toggle" && toggledFlat;
32684
32682
  const rows = React124.useMemo(() => flat ? flattenAll(tree.roots) : flatten(tree.roots, collapsed), [tree, collapsed, flat]);
@@ -32717,7 +32715,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32717
32715
  }
32718
32716
  const percentAt = (nano) => bounds.durationMs > 0 ? Number(BigInt(nano) - bounds.startNano) / 1e6 / bounds.durationMs * 100 : 0;
32719
32717
  return /* @__PURE__ */ jsxs136(Box19, { "aria-label": "Operations waterfall", "data-testid": WATERFALL_TEST_ID, ref: containerRef, role: "tree", sx: { fontSize: 13, minWidth: 0 }, children: [
32720
- /* @__PURE__ */ jsx148(WaterfallAxis, { durationMs: bounds.durationMs, flat, gridColumns: gridColumns(statusIconsFirst), onFlatChange: waterfallLayout === "toggle" ? setToggledFlat : void 0 }),
32718
+ /* @__PURE__ */ jsx148(WaterfallAxis, { durationMs: bounds.durationMs, flat, onFlatChange: waterfallLayout === "toggle" ? setToggledFlat : void 0 }),
32721
32719
  rows.map(({ branches, depth, last, node, parent }) => {
32722
32720
  const { span } = node;
32723
32721
  const issues = getSpanIssues(span);
@@ -32753,20 +32751,17 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32753
32751
  sx: (theme) => ({
32754
32752
  "&:focus-visible": { boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}` },
32755
32753
  // Tints over the paper, all in one opaque background: the duration label repeats it
32756
- // to cover the lead line behind it, which a translucent tint would let through. The
32757
- // hover is translucent too (the theme's is an opaque grey), so issue tints show through.
32754
+ // to cover the lead line behind it, which a translucent tint would let through.
32758
32755
  "&:hover": { "--row-tint": selected ? alpha6(theme.palette.primary.main, 0.16) : alpha6(theme.palette.text.primary, 0.04) },
32759
- // Only the content fades for a row the filters don't match: its background (selection, hover,
32760
- // issue tint) keeps its contrast.
32756
+ // Only the content fades for a row the filters don't match: its background (selection, hover)
32757
+ // keeps its contrast.
32761
32758
  "& > *": { opacity: spanMatches && !spanMatches(span.span_id) ? 0.4 : 1 },
32762
- "--row-bg": `linear-gradient(var(--row-tint), var(--row-tint)), linear-gradient(var(--row-issue), var(--row-issue)), ${theme.palette.background.paper}`,
32763
- // Under the hover and selection tints: an error wins over a warning.
32764
- "--row-issue": issueBackgrounds && issues.error ? alpha6(theme.palette.error.main, 0.08) : issueBackgrounds && issues.warning ? alpha6(theme.palette.warning.main, 0.1) : "transparent",
32759
+ "--row-bg": `linear-gradient(var(--row-tint), var(--row-tint)), ${theme.palette.background.paper}`,
32765
32760
  "--row-tint": selected ? alpha6(theme.palette.primary.main, 0.12) : "transparent",
32766
32761
  "background": "var(--row-bg)",
32767
32762
  "cursor": "pointer",
32768
32763
  "display": "grid",
32769
- "gridTemplateColumns": gridColumns(statusIconsFirst),
32764
+ "gridTemplateColumns": GRID_COLUMNS,
32770
32765
  "height": ROW_HEIGHT,
32771
32766
  "outline": 0,
32772
32767
  "position": "relative",
@@ -32775,7 +32770,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32775
32770
  }),
32776
32771
  children: [
32777
32772
  /* @__PURE__ */ jsxs136(Box19, { sx: { alignItems: "center", display: "flex", minWidth: 0, pr: 1 }, children: [
32778
- statusIconsFirst && /* @__PURE__ */ jsx148(Box19, { sx: { display: "inline-flex", flex: "none", gap: "2px", pl: 1, width: STATUS_ICONS_WIDTH }, children: /* @__PURE__ */ jsx148(StatusIcons, { error: issues.error, warning: issues.warning }) }),
32773
+ /* @__PURE__ */ jsx148(Box19, { sx: { display: "inline-flex", flex: "none", gap: "2px", pl: 1, width: STATUS_ICONS_WIDTH }, children: /* @__PURE__ */ jsx148(StatusIcons, { error: issues.error, warning: issues.warning }) }),
32779
32774
  /* @__PURE__ */ jsxs136(
32780
32775
  Typography14,
32781
32776
  {
@@ -32824,8 +32819,7 @@ var Waterfall = ({ onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32824
32819
  ) : !flat && /* @__PURE__ */ jsx148(Box19, { sx: { flex: "none", width: 14 } }),
32825
32820
  /* @__PURE__ */ jsx148(Box19, { sx: { display: "flex", flex: "none" }, children: /* @__PURE__ */ jsx148(AwsServiceIcon, { hideTooltip: true, service: span.service_name, size: "small" }) }),
32826
32821
  /* @__PURE__ */ jsx148(Typography14, { component: "span", noWrap: true, sx: { flex: "0 1 auto", fontSize: "inherit", fontWeight: 600, minWidth: 0 }, title: span.operation_name, children: span.operation_name }),
32827
- resource !== "" && resource !== "*" && /* @__PURE__ */ jsx148(Typography14, { color: "text.secondary", component: "span", noWrap: true, sx: { flex: "1 1 0", fontSize: 11, minWidth: 0 }, title: resource, children: resource }),
32828
- !statusIconsFirst && (issues.error || issues.warning) && /* @__PURE__ */ jsx148(Box19, { sx: { display: "inline-flex", flex: "none", ml: "auto" }, children: /* @__PURE__ */ jsx148(StatusIcons, { error: issues.error, warning: issues.warning }) })
32822
+ resource !== "" && resource !== "*" && /* @__PURE__ */ jsx148(Typography14, { color: "text.secondary", component: "span", noWrap: true, sx: { flex: "1 1 0", fontSize: 11, minWidth: 0 }, title: resource, children: resource })
32829
32823
  ] }),
32830
32824
  /* @__PURE__ */ jsxs136(Box19, { sx: { mx: TRACK_INSET, position: "relative" }, children: [
32831
32825
  parentStartPercent !== void 0 && startPercent > parentStartPercent && /* @__PURE__ */ jsx148(Box19, { sx: { backgroundColor: serviceColor, height: "1px", left: `${String(parentStartPercent)}%`, opacity: 0.35, position: "absolute", top: 11.5, width: `${String(startPercent - parentStartPercent)}%` } }),
@@ -32888,7 +32882,6 @@ var SPLIT_STORAGE_KEY = "appinspector-trace-sidebar-split";
32888
32882
  var clampSplit = (split2) => Math.min(MAX_SPLIT, Math.max(MIN_SPLIT, split2));
32889
32883
  var noop = () => void 0;
32890
32884
  var TraceSidebar = ({ onClose, onSelectSpan, selectedSpanId, spanMatches, spans }) => {
32891
- const { requestTerms } = useDevSettings();
32892
32885
  const [storedWidth, setStoredWidth] = useLocalStorage(WIDTH_STORAGE_KEY, DEFAULT_WIDTH);
32893
32886
  const [storedSplit, setStoredSplit] = useLocalStorage(SPLIT_STORAGE_KEY, DEFAULT_SPLIT);
32894
32887
  const [view, setView] = React125.useState("waterfall");
@@ -32996,7 +32989,7 @@ var TraceSidebar = ({ onClose, onSelectSpan, selectedSpanId, spanMatches, spans
32996
32989
  ),
32997
32990
  /* @__PURE__ */ jsxs137(Box20, { sx: { alignItems: "center", borderBottom: 1, borderColor: "divider", display: "flex", gap: 1.5, px: 2, py: 1 }, children: [
32998
32991
  /* @__PURE__ */ jsxs137(Box20, { sx: { flex: 1, minWidth: 0 }, children: [
32999
- /* @__PURE__ */ jsx149(Typography15, { color: "text.secondary", component: "div", sx: { lineHeight: 1.5 }, variant: "overline", children: requestTerms === "on" ? "Request" : "Trace root" }),
32992
+ /* @__PURE__ */ jsx149(Typography15, { color: "text.secondary", component: "div", sx: { lineHeight: 1.5 }, variant: "overline", children: "Request" }),
33000
32993
  root2 && /* @__PURE__ */ jsxs137(Box20, { "data-testid": TRACE_SIDEBAR_ROOT_HEADING_TEST_ID, sx: { alignItems: "center", display: "flex", gap: 1, minWidth: 0 }, children: [
33001
32994
  /* @__PURE__ */ jsx149(AwsServiceIcon, { hideTooltip: true, service: root2.service_name, size: "small" }),
33002
32995
  /* @__PURE__ */ jsx149(Typography15, { noWrap: true, sx: { flex: "0 1 auto", fontWeight: 600, minWidth: 0 }, title: root2.operation_name, variant: "subtitle1", children: root2.operation_name }),