msw-dev-tool 1.1.7 → 1.1.9

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/cjs/index.js CHANGED
@@ -27960,13 +27960,14 @@ const useUiControlStore = zustand.create((set) => ({
27960
27960
  const HttpControl = () => {
27961
27961
  const table = useFlattenHandlersTable();
27962
27962
  const { setDebuggerHandler } = useUiControlStore();
27963
+ const currentHandler = useUiControlStore((state) => state.currentHandler);
27963
27964
  return (React.createElement(p$3, { style: { flex: 3, overflowY: "auto" }, direction: "column", gap: "4" },
27964
27965
  React.createElement(r$8, { as: "h2", size: "5" }, "Handlers"),
27965
27966
  React.createElement(m, { onDragStart: (e) => e.stopPropagation(), style: { userSelect: "text" } },
27966
27967
  React.createElement(d, null, table.getHeaderGroups().map((headerGroup) => (React.createElement(P, { key: headerGroup.id }, headerGroup.headers.map((header) => (React.createElement(f$1, { key: header.id }, header.isPlaceholder
27967
27968
  ? null
27968
27969
  : flexRender(header.column.columnDef.header, header.getContext())))))))),
27969
- React.createElement(b, null, table.getRowModel().rows.map((row) => (React.createElement(P, { key: row.id, align: "center", className: "msw-dt-http-control-row", onClick: () => {
27970
+ React.createElement(b, null, table.getRowModel().rows.map((row) => (React.createElement(P, { key: row.id, align: "center", className: `msw-dt-http-control-row ${row.original.handler === currentHandler && "msw-dt-current-row"}`, onClick: () => {
27970
27971
  setDebuggerHandler(row.original.handler);
27971
27972
  } }, row.getVisibleCells().map((cell) => (React.createElement(T, { key: cell.id }, flexRender(cell.column.columnDef.cell, cell.getContext())))))))))));
27972
27973
  };
@@ -27987,6 +27988,109 @@ const PathParamSetter = ({ paramValues, onParamChange, }) => {
27987
27988
  } }))))))));
27988
27989
  };
27989
27990
 
27991
+ function _objectWithoutPropertiesLoose(source, excluded) {
27992
+ if (source == null) return {};
27993
+ var target = {};
27994
+ var sourceKeys = Object.keys(source);
27995
+ var key, i;
27996
+
27997
+ for (i = 0; i < sourceKeys.length; i++) {
27998
+ key = sourceKeys[i];
27999
+ if (excluded.indexOf(key) >= 0) continue;
28000
+ target[key] = source[key];
28001
+ }
28002
+
28003
+ return target;
28004
+ }
28005
+
28006
+ var _excluded$3w = ["color"];
28007
+ var PlayIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
28008
+ var _ref$color = _ref.color,
28009
+ color = _ref$color === void 0 ? 'currentColor' : _ref$color,
28010
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3w);
28011
+
28012
+ return React.createElement("svg", Object.assign({
28013
+ width: "15",
28014
+ height: "15",
28015
+ viewBox: "0 0 15 15",
28016
+ fill: "none",
28017
+ xmlns: "http://www.w3.org/2000/svg"
28018
+ }, props, {
28019
+ ref: forwardedRef
28020
+ }), React.createElement("path", {
28021
+ d: "M3.24182 2.32181C3.3919 2.23132 3.5784 2.22601 3.73338 2.30781L12.7334 7.05781C12.8974 7.14436 13 7.31457 13 7.5C13 7.68543 12.8974 7.85564 12.7334 7.94219L3.73338 12.6922C3.5784 12.774 3.3919 12.7687 3.24182 12.6782C3.09175 12.5877 3 12.4252 3 12.25V2.75C3 2.57476 3.09175 2.4123 3.24182 2.32181ZM4 3.57925V11.4207L11.4288 7.5L4 3.57925Z",
28022
+ fill: color,
28023
+ fillRule: "evenodd",
28024
+ clipRule: "evenodd"
28025
+ }));
28026
+ });
28027
+
28028
+ var _excluded$3x = ["color"];
28029
+ var PlusIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
28030
+ var _ref$color = _ref.color,
28031
+ color = _ref$color === void 0 ? 'currentColor' : _ref$color,
28032
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3x);
28033
+
28034
+ return React.createElement("svg", Object.assign({
28035
+ width: "15",
28036
+ height: "15",
28037
+ viewBox: "0 0 15 15",
28038
+ fill: "none",
28039
+ xmlns: "http://www.w3.org/2000/svg"
28040
+ }, props, {
28041
+ ref: forwardedRef
28042
+ }), React.createElement("path", {
28043
+ d: "M8 2.75C8 2.47386 7.77614 2.25 7.5 2.25C7.22386 2.25 7 2.47386 7 2.75V7H2.75C2.47386 7 2.25 7.22386 2.25 7.5C2.25 7.77614 2.47386 8 2.75 8H7V12.25C7 12.5261 7.22386 12.75 7.5 12.75C7.77614 12.75 8 12.5261 8 12.25V8H12.25C12.5261 8 12.75 7.77614 12.75 7.5C12.75 7.22386 12.5261 7 12.25 7H8V2.75Z",
28044
+ fill: color,
28045
+ fillRule: "evenodd",
28046
+ clipRule: "evenodd"
28047
+ }));
28048
+ });
28049
+
28050
+ var _excluded$3E = ["color"];
28051
+ var ReloadIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
28052
+ var _ref$color = _ref.color,
28053
+ color = _ref$color === void 0 ? 'currentColor' : _ref$color,
28054
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$3E);
28055
+
28056
+ return React.createElement("svg", Object.assign({
28057
+ width: "15",
28058
+ height: "15",
28059
+ viewBox: "0 0 15 15",
28060
+ fill: "none",
28061
+ xmlns: "http://www.w3.org/2000/svg"
28062
+ }, props, {
28063
+ ref: forwardedRef
28064
+ }), React.createElement("path", {
28065
+ d: "M1.84998 7.49998C1.84998 4.66458 4.05979 1.84998 7.49998 1.84998C10.2783 1.84998 11.6515 3.9064 12.2367 5H10.5C10.2239 5 10 5.22386 10 5.5C10 5.77614 10.2239 6 10.5 6H13.5C13.7761 6 14 5.77614 14 5.5V2.5C14 2.22386 13.7761 2 13.5 2C13.2239 2 13 2.22386 13 2.5V4.31318C12.2955 3.07126 10.6659 0.849976 7.49998 0.849976C3.43716 0.849976 0.849976 4.18537 0.849976 7.49998C0.849976 10.8146 3.43716 14.15 7.49998 14.15C9.44382 14.15 11.0622 13.3808 12.2145 12.2084C12.8315 11.5806 13.3133 10.839 13.6418 10.0407C13.7469 9.78536 13.6251 9.49315 13.3698 9.38806C13.1144 9.28296 12.8222 9.40478 12.7171 9.66014C12.4363 10.3425 12.0251 10.9745 11.5013 11.5074C10.5295 12.4963 9.16504 13.15 7.49998 13.15C4.05979 13.15 1.84998 10.3354 1.84998 7.49998Z",
28066
+ fill: color,
28067
+ fillRule: "evenodd",
28068
+ clipRule: "evenodd"
28069
+ }));
28070
+ });
28071
+
28072
+ var _excluded$4G = ["color"];
28073
+ var TrashIcon = /*#__PURE__*/React.forwardRef(function (_ref, forwardedRef) {
28074
+ var _ref$color = _ref.color,
28075
+ color = _ref$color === void 0 ? 'currentColor' : _ref$color,
28076
+ props = _objectWithoutPropertiesLoose(_ref, _excluded$4G);
28077
+
28078
+ return React.createElement("svg", Object.assign({
28079
+ width: "15",
28080
+ height: "15",
28081
+ viewBox: "0 0 15 15",
28082
+ fill: "none",
28083
+ xmlns: "http://www.w3.org/2000/svg"
28084
+ }, props, {
28085
+ ref: forwardedRef
28086
+ }), React.createElement("path", {
28087
+ d: "M5.5 1C5.22386 1 5 1.22386 5 1.5C5 1.77614 5.22386 2 5.5 2H9.5C9.77614 2 10 1.77614 10 1.5C10 1.22386 9.77614 1 9.5 1H5.5ZM3 3.5C3 3.22386 3.22386 3 3.5 3H5H10H11.5C11.7761 3 12 3.22386 12 3.5C12 3.77614 11.7761 4 11.5 4H11V12C11 12.5523 10.5523 13 10 13H5C4.44772 13 4 12.5523 4 12V4L3.5 4C3.22386 4 3 3.77614 3 3.5ZM5 4H10V12H5V4Z",
28088
+ fill: color,
28089
+ fillRule: "evenodd",
28090
+ clipRule: "evenodd"
28091
+ }));
28092
+ });
28093
+
27990
28094
  const KeyValueInputList = ({ items, setItems, title, }) => {
27991
28095
  const id = React.useId();
27992
28096
  const [key, setKey] = React.useState("");
@@ -28023,15 +28127,27 @@ const KeyValueInputList = ({ items, setItems, title, }) => {
28023
28127
  border: "1px solid #ccc",
28024
28128
  width: "180px",
28025
28129
  } }),
28026
- React.createElement(o$2, { onClick: handleAdd, variant: "soft" }, "Add")),
28130
+ React.createElement(o$2, { onClick: handleAdd, variant: "soft" },
28131
+ React.createElement(PlusIcon, null),
28132
+ "Add")),
28027
28133
  React.createElement(p$3, { direction: "column", gap: "1" }, Object.entries(items).map(([key, value]) => (React.createElement(p$3, { key: key, style: {
28028
28134
  backgroundColor: "#f5f5f5",
28029
28135
  borderRadius: "4px",
28030
- width: "fit-content"
28136
+ width: "fit-content",
28031
28137
  }, align: "center", gap: "2", py: "1" },
28032
- React.createElement("span", { style: { width: "160px", paddingLeft: "8px", boxSizing: "border-box" } }, key),
28033
- React.createElement("span", { style: { width: "180px", paddingLeft: "8px", boxSizing: "border-box" } }, value),
28034
- React.createElement(o$2, { onClick: () => handleDelete(key), variant: "soft", color: "crimson" }, "Delete")))))));
28138
+ React.createElement("span", { style: {
28139
+ width: "160px",
28140
+ paddingLeft: "8px",
28141
+ boxSizing: "border-box",
28142
+ } }, key),
28143
+ React.createElement("span", { style: {
28144
+ width: "180px",
28145
+ paddingLeft: "8px",
28146
+ boxSizing: "border-box",
28147
+ } }, value),
28148
+ React.createElement(o$2, { onClick: () => handleDelete(key), variant: "soft", color: "crimson" },
28149
+ React.createElement(TrashIcon, null),
28150
+ "Delete")))))));
28035
28151
  };
28036
28152
 
28037
28153
  /**
@@ -28105,7 +28221,9 @@ const RequestPreview = ({ url, paramValues, headers = {}, searchParams = {}, })
28105
28221
  borderRadius: "4px",
28106
28222
  backgroundColor: loading ? "#f5f5f5" : undefined,
28107
28223
  cursor: loading ? "not-allowed" : "pointer",
28108
- }, color: "gray", variant: "outline" }, loading ? "Fetching..." : "Send Request"),
28224
+ }, color: "gray", variant: "outline" },
28225
+ React.createElement(PlayIcon, null),
28226
+ loading ? "Fetching..." : "Send Request"),
28109
28227
  error && (React.createElement(p$6, { style: {
28110
28228
  marginTop: "8px",
28111
28229
  color: "#f44336",
@@ -28190,7 +28308,9 @@ ThemeProvider.displayName = "ThemeProvider";
28190
28308
  const ToolButtonGroup = () => {
28191
28309
  const { resetMSWDevTool } = useHandlerStore();
28192
28310
  return (React.createElement(p$3, { gap: "8", py: "4" },
28193
- React.createElement(o$2, { onClick: () => resetMSWDevTool() }, "Reset Dev tool")));
28311
+ React.createElement(o$2, { onClick: () => resetMSWDevTool() },
28312
+ React.createElement(ReloadIcon, null),
28313
+ "Reset Dev tool")));
28194
28314
  };
28195
28315
 
28196
28316
  const MSWDevTool = () => {