msw-dev-tool 1.1.8 → 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 +126 -7
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +127 -8
- package/dist/esm/index.js.map +1 -1
- package/package.json +2 -1
package/dist/esm/index.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import React__default, { useState, useLayoutEffect, useEffect, useMemo, useId as useId$1
|
2
|
+
import React__default, { useState, useLayoutEffect, useEffect, useMemo, forwardRef, createElement, useId as useId$1 } from 'react';
|
3
3
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
4
4
|
import * as ReactDOM from 'react-dom';
|
5
5
|
import ReactDOM__default from 'react-dom';
|
@@ -27968,6 +27968,109 @@ const PathParamSetter = ({ paramValues, onParamChange, }) => {
|
|
27968
27968
|
} }))))))));
|
27969
27969
|
};
|
27970
27970
|
|
27971
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
27972
|
+
if (source == null) return {};
|
27973
|
+
var target = {};
|
27974
|
+
var sourceKeys = Object.keys(source);
|
27975
|
+
var key, i;
|
27976
|
+
|
27977
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
27978
|
+
key = sourceKeys[i];
|
27979
|
+
if (excluded.indexOf(key) >= 0) continue;
|
27980
|
+
target[key] = source[key];
|
27981
|
+
}
|
27982
|
+
|
27983
|
+
return target;
|
27984
|
+
}
|
27985
|
+
|
27986
|
+
var _excluded$3w = ["color"];
|
27987
|
+
var PlayIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
27988
|
+
var _ref$color = _ref.color,
|
27989
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
27990
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3w);
|
27991
|
+
|
27992
|
+
return createElement("svg", Object.assign({
|
27993
|
+
width: "15",
|
27994
|
+
height: "15",
|
27995
|
+
viewBox: "0 0 15 15",
|
27996
|
+
fill: "none",
|
27997
|
+
xmlns: "http://www.w3.org/2000/svg"
|
27998
|
+
}, props, {
|
27999
|
+
ref: forwardedRef
|
28000
|
+
}), createElement("path", {
|
28001
|
+
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",
|
28002
|
+
fill: color,
|
28003
|
+
fillRule: "evenodd",
|
28004
|
+
clipRule: "evenodd"
|
28005
|
+
}));
|
28006
|
+
});
|
28007
|
+
|
28008
|
+
var _excluded$3x = ["color"];
|
28009
|
+
var PlusIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
28010
|
+
var _ref$color = _ref.color,
|
28011
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
28012
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3x);
|
28013
|
+
|
28014
|
+
return createElement("svg", Object.assign({
|
28015
|
+
width: "15",
|
28016
|
+
height: "15",
|
28017
|
+
viewBox: "0 0 15 15",
|
28018
|
+
fill: "none",
|
28019
|
+
xmlns: "http://www.w3.org/2000/svg"
|
28020
|
+
}, props, {
|
28021
|
+
ref: forwardedRef
|
28022
|
+
}), createElement("path", {
|
28023
|
+
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",
|
28024
|
+
fill: color,
|
28025
|
+
fillRule: "evenodd",
|
28026
|
+
clipRule: "evenodd"
|
28027
|
+
}));
|
28028
|
+
});
|
28029
|
+
|
28030
|
+
var _excluded$3E = ["color"];
|
28031
|
+
var ReloadIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
28032
|
+
var _ref$color = _ref.color,
|
28033
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
28034
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$3E);
|
28035
|
+
|
28036
|
+
return createElement("svg", Object.assign({
|
28037
|
+
width: "15",
|
28038
|
+
height: "15",
|
28039
|
+
viewBox: "0 0 15 15",
|
28040
|
+
fill: "none",
|
28041
|
+
xmlns: "http://www.w3.org/2000/svg"
|
28042
|
+
}, props, {
|
28043
|
+
ref: forwardedRef
|
28044
|
+
}), createElement("path", {
|
28045
|
+
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",
|
28046
|
+
fill: color,
|
28047
|
+
fillRule: "evenodd",
|
28048
|
+
clipRule: "evenodd"
|
28049
|
+
}));
|
28050
|
+
});
|
28051
|
+
|
28052
|
+
var _excluded$4G = ["color"];
|
28053
|
+
var TrashIcon = /*#__PURE__*/forwardRef(function (_ref, forwardedRef) {
|
28054
|
+
var _ref$color = _ref.color,
|
28055
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
28056
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$4G);
|
28057
|
+
|
28058
|
+
return createElement("svg", Object.assign({
|
28059
|
+
width: "15",
|
28060
|
+
height: "15",
|
28061
|
+
viewBox: "0 0 15 15",
|
28062
|
+
fill: "none",
|
28063
|
+
xmlns: "http://www.w3.org/2000/svg"
|
28064
|
+
}, props, {
|
28065
|
+
ref: forwardedRef
|
28066
|
+
}), createElement("path", {
|
28067
|
+
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",
|
28068
|
+
fill: color,
|
28069
|
+
fillRule: "evenodd",
|
28070
|
+
clipRule: "evenodd"
|
28071
|
+
}));
|
28072
|
+
});
|
28073
|
+
|
27971
28074
|
const KeyValueInputList = ({ items, setItems, title, }) => {
|
27972
28075
|
const id = useId$1();
|
27973
28076
|
const [key, setKey] = useState("");
|
@@ -28004,15 +28107,27 @@ const KeyValueInputList = ({ items, setItems, title, }) => {
|
|
28004
28107
|
border: "1px solid #ccc",
|
28005
28108
|
width: "180px",
|
28006
28109
|
} }),
|
28007
|
-
React__default.createElement(o$2, { onClick: handleAdd, variant: "soft" },
|
28110
|
+
React__default.createElement(o$2, { onClick: handleAdd, variant: "soft" },
|
28111
|
+
React__default.createElement(PlusIcon, null),
|
28112
|
+
"Add")),
|
28008
28113
|
React__default.createElement(p$3, { direction: "column", gap: "1" }, Object.entries(items).map(([key, value]) => (React__default.createElement(p$3, { key: key, style: {
|
28009
28114
|
backgroundColor: "#f5f5f5",
|
28010
28115
|
borderRadius: "4px",
|
28011
|
-
width: "fit-content"
|
28116
|
+
width: "fit-content",
|
28012
28117
|
}, align: "center", gap: "2", py: "1" },
|
28013
|
-
React__default.createElement("span", { style: {
|
28014
|
-
|
28015
|
-
|
28118
|
+
React__default.createElement("span", { style: {
|
28119
|
+
width: "160px",
|
28120
|
+
paddingLeft: "8px",
|
28121
|
+
boxSizing: "border-box",
|
28122
|
+
} }, key),
|
28123
|
+
React__default.createElement("span", { style: {
|
28124
|
+
width: "180px",
|
28125
|
+
paddingLeft: "8px",
|
28126
|
+
boxSizing: "border-box",
|
28127
|
+
} }, value),
|
28128
|
+
React__default.createElement(o$2, { onClick: () => handleDelete(key), variant: "soft", color: "crimson" },
|
28129
|
+
React__default.createElement(TrashIcon, null),
|
28130
|
+
"Delete")))))));
|
28016
28131
|
};
|
28017
28132
|
|
28018
28133
|
/**
|
@@ -28086,7 +28201,9 @@ const RequestPreview = ({ url, paramValues, headers = {}, searchParams = {}, })
|
|
28086
28201
|
borderRadius: "4px",
|
28087
28202
|
backgroundColor: loading ? "#f5f5f5" : undefined,
|
28088
28203
|
cursor: loading ? "not-allowed" : "pointer",
|
28089
|
-
}, color: "gray", variant: "outline" },
|
28204
|
+
}, color: "gray", variant: "outline" },
|
28205
|
+
React__default.createElement(PlayIcon, null),
|
28206
|
+
loading ? "Fetching..." : "Send Request"),
|
28090
28207
|
error && (React__default.createElement(p$6, { style: {
|
28091
28208
|
marginTop: "8px",
|
28092
28209
|
color: "#f44336",
|
@@ -28171,7 +28288,9 @@ ThemeProvider.displayName = "ThemeProvider";
|
|
28171
28288
|
const ToolButtonGroup = () => {
|
28172
28289
|
const { resetMSWDevTool } = useHandlerStore();
|
28173
28290
|
return (React__default.createElement(p$3, { gap: "8", py: "4" },
|
28174
|
-
React__default.createElement(o$2, { onClick: () => resetMSWDevTool() },
|
28291
|
+
React__default.createElement(o$2, { onClick: () => resetMSWDevTool() },
|
28292
|
+
React__default.createElement(ReloadIcon, null),
|
28293
|
+
"Reset Dev tool")));
|
28175
28294
|
};
|
28176
28295
|
|
28177
28296
|
const MSWDevTool = () => {
|