@localstack/appinspector-ui 1.0.6 → 1.0.8

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
@@ -2660,8 +2660,8 @@ var columns = [
2660
2660
  return /* @__PURE__ */ jsx124(ServiceCell, { resource: parameters.row.parent_resource_name, service: parameters.row.parent_service_name });
2661
2661
  },
2662
2662
  sortable: true,
2663
- sortComparator: resourceNameComparator
2664
- // width: 280,
2663
+ sortComparator: resourceNameComparator,
2664
+ width: 320
2665
2665
  },
2666
2666
  {
2667
2667
  field: "operation_name",
@@ -3460,7 +3460,7 @@ var SpansListPage = () => {
3460
3460
 
3461
3461
  // src/pages/trace-graph-page.tsx
3462
3462
  import { ArrowBack } from "@mui/icons-material";
3463
- import { Box as Box12, Button as Button5, Drawer, Paper as Paper2 } from "@mui/material";
3463
+ import { Box as Box13, Button as Button5, Drawer, Paper as Paper2 } from "@mui/material";
3464
3464
  import { styled } from "@mui/material/styles";
3465
3465
  import { ReactFlowProvider } from "@xyflow/react";
3466
3466
  import { useCallback as useCallback8, useEffect as useEffect6, useState as useState8 } from "react";
@@ -3616,7 +3616,7 @@ var EventDetails = ({ selectedEvent }) => {
3616
3616
  // src/components/trace-graph/trace-graph.tsx
3617
3617
  import "@xyflow/react/dist/base.css";
3618
3618
  import { Alert as Alert3, Button as Button4 } from "@mui/material";
3619
- import { Background, Controls, ReactFlow, useReactFlow, useStoreApi } from "@xyflow/react";
3619
+ import { Background, ReactFlow, useReactFlow as useReactFlow2, useStoreApi } from "@xyflow/react";
3620
3620
  import { useCallback as useCallback7, useEffect as useEffect5, useState as useState7 } from "react";
3621
3621
 
3622
3622
  // src/components/trace-graph/service-node.tsx
@@ -3872,8 +3872,127 @@ var calculateCenterX = (focusNodeX, viewPortPixelWidth, minX, maxX) => {
3872
3872
  return Math.min(Math.max(desiredCenter, minX + viewPortPixelWidth / 2), maxX - viewPortPixelWidth / 2 + nodeWidth);
3873
3873
  };
3874
3874
 
3875
+ // src/components/trace-graph/xyflow/controls.tsx
3876
+ import { Add, FitScreen, Remove } from "@mui/icons-material";
3877
+ import { Box as Box12, IconButton as IconButton2 } from "@mui/material";
3878
+ import { useReactFlow, useStore } from "@xyflow/react";
3879
+ import { memo as memo2 } from "react";
3880
+
3881
+ // node_modules/zustand/esm/shallow.mjs
3882
+ function shallow$1(objA, objB) {
3883
+ if (Object.is(objA, objB)) {
3884
+ return true;
3885
+ }
3886
+ if (typeof objA !== "object" || objA === null || typeof objB !== "object" || objB === null) {
3887
+ return false;
3888
+ }
3889
+ if (objA instanceof Map && objB instanceof Map) {
3890
+ if (objA.size !== objB.size) return false;
3891
+ for (const [key, value] of objA) {
3892
+ if (!Object.is(value, objB.get(key))) {
3893
+ return false;
3894
+ }
3895
+ }
3896
+ return true;
3897
+ }
3898
+ if (objA instanceof Set && objB instanceof Set) {
3899
+ if (objA.size !== objB.size) return false;
3900
+ for (const value of objA) {
3901
+ if (!objB.has(value)) {
3902
+ return false;
3903
+ }
3904
+ }
3905
+ return true;
3906
+ }
3907
+ const keysA = Object.keys(objA);
3908
+ if (keysA.length !== Object.keys(objB).length) {
3909
+ return false;
3910
+ }
3911
+ for (const keyA of keysA) {
3912
+ if (!Object.prototype.hasOwnProperty.call(objB, keyA) || !Object.is(objA[keyA], objB[keyA])) {
3913
+ return false;
3914
+ }
3915
+ }
3916
+ return true;
3917
+ }
3918
+
3919
+ // src/components/trace-graph/xyflow/controls.tsx
3920
+ import { jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
3921
+ var selector = (s) => ({
3922
+ ariaLabelConfig: s.ariaLabelConfig,
3923
+ isInteractive: s.nodesDraggable || s.nodesConnectable || s.elementsSelectable,
3924
+ maxZoomReached: s.transform[2] >= s.maxZoom,
3925
+ minZoomReached: s.transform[2] <= s.minZoom
3926
+ });
3927
+ var Controls = memo2(() => {
3928
+ const { ariaLabelConfig, maxZoomReached, minZoomReached } = useStore(selector, shallow$1);
3929
+ const { fitView, zoomIn, zoomOut } = useReactFlow();
3930
+ const onZoomInHandler = () => {
3931
+ void zoomIn();
3932
+ };
3933
+ const onZoomOutHandler = () => {
3934
+ void zoomOut();
3935
+ };
3936
+ const onFitViewHandler = () => {
3937
+ void fitView();
3938
+ };
3939
+ return /* @__PURE__ */ jsxs127(
3940
+ Box12,
3941
+ {
3942
+ "aria-label": ariaLabelConfig["controls.ariaLabel"],
3943
+ sx: {
3944
+ bottom: 0,
3945
+ display: "flex",
3946
+ flexDirection: "column",
3947
+ gap: 1,
3948
+ left: 0,
3949
+ m: 2,
3950
+ position: "absolute",
3951
+ zIndex: 5
3952
+ },
3953
+ children: [
3954
+ /* @__PURE__ */ jsx134(
3955
+ IconButton2,
3956
+ {
3957
+ "aria-label": ariaLabelConfig["controls.zoomIn.ariaLabel"],
3958
+ className: "react-flow__controls-zoomin",
3959
+ disabled: maxZoomReached,
3960
+ onClick: onZoomInHandler,
3961
+ size: "small",
3962
+ title: ariaLabelConfig["controls.zoomIn.ariaLabel"],
3963
+ children: /* @__PURE__ */ jsx134(Add, {})
3964
+ }
3965
+ ),
3966
+ /* @__PURE__ */ jsx134(
3967
+ IconButton2,
3968
+ {
3969
+ "aria-label": ariaLabelConfig["controls.zoomOut.ariaLabel"],
3970
+ className: "react-flow__controls-zoomout",
3971
+ disabled: minZoomReached,
3972
+ onClick: onZoomOutHandler,
3973
+ size: "small",
3974
+ title: ariaLabelConfig["controls.zoomOut.ariaLabel"],
3975
+ children: /* @__PURE__ */ jsx134(Remove, {})
3976
+ }
3977
+ ),
3978
+ /* @__PURE__ */ jsx134(
3979
+ IconButton2,
3980
+ {
3981
+ "aria-label": ariaLabelConfig["controls.fitView.ariaLabel"],
3982
+ className: "react-flow__controls-fitview",
3983
+ onClick: onFitViewHandler,
3984
+ size: "small",
3985
+ title: ariaLabelConfig["controls.fitView.ariaLabel"],
3986
+ children: /* @__PURE__ */ jsx134(FitScreen, {})
3987
+ }
3988
+ )
3989
+ ]
3990
+ }
3991
+ );
3992
+ });
3993
+
3875
3994
  // src/components/trace-graph/trace-graph.tsx
3876
- import { Fragment as Fragment4, jsx as jsx134, jsxs as jsxs127 } from "react/jsx-runtime";
3995
+ import { Fragment as Fragment4, jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
3877
3996
  var nodeTypes = {
3878
3997
  service: ServiceNode
3879
3998
  };
@@ -3887,7 +4006,7 @@ var TraceGraph = ({
3887
4006
  const [nodes, setNodes] = useState7([]);
3888
4007
  const [edges, setEdges] = useState7([]);
3889
4008
  const [initialViewSet, setInitialViewSet] = useState7(false);
3890
- const { fitView, setCenter } = useReactFlow();
4009
+ const { fitView, setCenter } = useReactFlow2();
3891
4010
  const store = useStoreApi();
3892
4011
  const updateSelectedNode = useCallback7(
3893
4012
  (nodeId) => {
@@ -3962,11 +4081,11 @@ var TraceGraph = ({
3962
4081
  onEventSelect(node.data.event);
3963
4082
  updateSelectedNode(node.id);
3964
4083
  }, [onEventSelect, updateSelectedNode]);
3965
- return /* @__PURE__ */ jsxs127(Fragment4, { children: [
3966
- spans.error && /* @__PURE__ */ jsxs127(
4084
+ return /* @__PURE__ */ jsxs128(Fragment4, { children: [
4085
+ spans.error && /* @__PURE__ */ jsxs128(
3967
4086
  Alert3,
3968
4087
  {
3969
- action: /* @__PURE__ */ jsx134(Button4, { onClick: () => {
4088
+ action: /* @__PURE__ */ jsx135(Button4, { onClick: () => {
3970
4089
  onRefresh();
3971
4090
  }, children: "Retry" }),
3972
4091
  severity: "error",
@@ -3977,7 +4096,7 @@ var TraceGraph = ({
3977
4096
  ]
3978
4097
  }
3979
4098
  ),
3980
- /* @__PURE__ */ jsxs127(
4099
+ /* @__PURE__ */ jsxs128(
3981
4100
  ReactFlow,
3982
4101
  {
3983
4102
  "data-testid": "trace-graph",
@@ -3991,8 +4110,8 @@ var TraceGraph = ({
3991
4110
  onNodeClick,
3992
4111
  selectNodesOnDrag: false,
3993
4112
  children: [
3994
- /* @__PURE__ */ jsx134(Controls, { showInteractive: false }),
3995
- /* @__PURE__ */ jsx134(Background, {})
4113
+ /* @__PURE__ */ jsx135(Controls, {}),
4114
+ /* @__PURE__ */ jsx135(Background, {})
3996
4115
  ]
3997
4116
  }
3998
4117
  )
@@ -4000,7 +4119,7 @@ var TraceGraph = ({
4000
4119
  };
4001
4120
 
4002
4121
  // src/pages/trace-graph-page.tsx
4003
- import { Fragment as Fragment5, jsx as jsx135, jsxs as jsxs128 } from "react/jsx-runtime";
4122
+ import { Fragment as Fragment5, jsx as jsx136, jsxs as jsxs129 } from "react/jsx-runtime";
4004
4123
  var HEADER_HEIGHT = 56;
4005
4124
  var DRAWER_WIDTH = "35%";
4006
4125
  var Main = styled("main", { shouldForwardProp: (property) => property !== "open" })(({ open, theme }) => ({
@@ -4097,8 +4216,8 @@ var TraceGraphPage = () => {
4097
4216
  const url = resolveLink({ to: "spans-list" });
4098
4217
  navigate(url);
4099
4218
  }, [navigate, resolveLink]);
4100
- return /* @__PURE__ */ jsxs128(
4101
- Box12,
4219
+ return /* @__PURE__ */ jsxs129(
4220
+ Box13,
4102
4221
  {
4103
4222
  "data-testid": "trace-graph-page",
4104
4223
  sx: {
@@ -4110,13 +4229,13 @@ var TraceGraphPage = () => {
4110
4229
  overflow: "hidden"
4111
4230
  },
4112
4231
  children: [
4113
- /* @__PURE__ */ jsxs128(Box12, { sx: { display: "flex", width: "100%" }, children: [
4114
- /* @__PURE__ */ jsx135(Button5, { onClick: () => {
4232
+ /* @__PURE__ */ jsxs129(Box13, { sx: { display: "flex", width: "100%" }, children: [
4233
+ /* @__PURE__ */ jsx136(Button5, { onClick: () => {
4115
4234
  navigateToSpansList();
4116
- }, startIcon: /* @__PURE__ */ jsx135(ArrowBack, {}), children: "Go back" }),
4117
- /* @__PURE__ */ jsx135(Box12, { sx: { flexGrow: 1 } })
4235
+ }, startIcon: /* @__PURE__ */ jsx136(ArrowBack, {}), children: "Go back" }),
4236
+ /* @__PURE__ */ jsx136(Box13, { sx: { flexGrow: 1 } })
4118
4237
  ] }),
4119
- /* @__PURE__ */ jsx135(
4238
+ /* @__PURE__ */ jsx136(
4120
4239
  Paper2,
4121
4240
  {
4122
4241
  sx: {
@@ -4126,22 +4245,22 @@ var TraceGraphPage = () => {
4126
4245
  position: "relative",
4127
4246
  width: "100%"
4128
4247
  },
4129
- children: shouldShowStatusMessage ? /* @__PURE__ */ jsx135(
4248
+ children: shouldShowStatusMessage ? /* @__PURE__ */ jsx136(
4130
4249
  StatusMessage,
4131
4250
  {
4132
4251
  error: statusError,
4133
4252
  onRetry: handleRetry,
4134
4253
  status
4135
4254
  }
4136
- ) : /* @__PURE__ */ jsxs128(Fragment5, { children: [
4137
- /* @__PURE__ */ jsx135(Main, { open, children: /* @__PURE__ */ jsx135(
4138
- Box12,
4255
+ ) : /* @__PURE__ */ jsxs129(Fragment5, { children: [
4256
+ /* @__PURE__ */ jsx136(Main, { open, children: /* @__PURE__ */ jsx136(
4257
+ Box13,
4139
4258
  {
4140
4259
  sx: {
4141
4260
  height: "100%",
4142
4261
  overflow: "auto"
4143
4262
  },
4144
- children: traceId !== void 0 && /* @__PURE__ */ jsx135(ReactFlowProvider, { children: /* @__PURE__ */ jsx135(
4263
+ children: traceId !== void 0 && /* @__PURE__ */ jsx136(ReactFlowProvider, { children: /* @__PURE__ */ jsx136(
4145
4264
  TraceGraph,
4146
4265
  {
4147
4266
  initialFocusEventId: spanId,
@@ -4159,7 +4278,7 @@ var TraceGraphPage = () => {
4159
4278
  ) })
4160
4279
  }
4161
4280
  ) }),
4162
- /* @__PURE__ */ jsx135(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx135(EventDetails, { selectedEvent }) })
4281
+ /* @__PURE__ */ jsx136(StyledDrawer, { anchor: "right", open, variant: "persistent", children: /* @__PURE__ */ jsx136(EventDetails, { selectedEvent }) })
4163
4282
  ] })
4164
4283
  }
4165
4284
  )