swr-devtools-react 0.0.0-stage → 0.1.0
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/LICENSE +22 -0
- package/README.md +209 -2
- package/dist/index.d.ts +15 -0
- package/dist/index.js +17 -0
- package/dist/production-BQanzhqs.js +1452 -0
- package/dist/production-C15b5Ipu.d.ts +30 -0
- package/dist/production.d.ts +3 -0
- package/dist/production.js +2 -0
- package/package.json +46 -3
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { ReactElement } from "react";
|
|
3
|
+
/** Where the panel docks. */
|
|
4
|
+
type PanelPosition = "bottom" | "right";
|
|
5
|
+
/** Which corner of the viewport the toggle button sits in. */
|
|
6
|
+
type ButtonPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
7
|
+
interface SWRDevtoolsProps {
|
|
8
|
+
/** Start with the panel open, until the user opens or closes it. Then their choice is remembered. */
|
|
9
|
+
initialIsOpen?: boolean;
|
|
10
|
+
/** Corner for the toggle button. Defaults to `bottom-right`. */
|
|
11
|
+
buttonPosition?: ButtonPosition;
|
|
12
|
+
/** Where the panel docks. Defaults to `bottom`. */
|
|
13
|
+
position?: PanelPosition;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A floating button that opens the devtools panel, docked to the bottom or
|
|
17
|
+
* right of the viewport. Place it inside the app's `<SWRConfig>`.
|
|
18
|
+
*
|
|
19
|
+
* Whether it's open, and its size, are remembered in `localStorage`.
|
|
20
|
+
*/
|
|
21
|
+
declare function SWRDevtools({ initialIsOpen, buttonPosition, position }: SWRDevtoolsProps): ReactElement | null;
|
|
22
|
+
/**
|
|
23
|
+
* The devtools panel on its own, with no floating button. It fills the
|
|
24
|
+
* element you render it in, so give that element a size. Place it inside the
|
|
25
|
+
* app's `<SWRConfig>`.
|
|
26
|
+
*
|
|
27
|
+
* For embedding in your own layout or another devtools host.
|
|
28
|
+
*/
|
|
29
|
+
declare function SWRDevtoolsPanel(): ReactElement | null;
|
|
30
|
+
export { PanelPosition as a, SWRDevtoolsProps as i, ButtonPosition as n, SWRDevtools as r, SWRDevtoolsPanel as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,49 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swr-devtools-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "In-app devtools panel for SWR: inspect, revalidate, edit and delete cache keys.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"cache",
|
|
7
|
+
"debug",
|
|
8
|
+
"devtools",
|
|
9
|
+
"react",
|
|
10
|
+
"swr"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/TheFlyer1983/swr-devtools-react#readme",
|
|
13
|
+
"bugs": "https://github.com/TheFlyer1983/swr-devtools-react/issues",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "Paul Livingstone",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/TheFlyer1983/swr-devtools-react.git",
|
|
19
|
+
"directory": "packages/react"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"type": "module",
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"exports": {
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
|
+
"default": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./production": {
|
|
32
|
+
"types": "./dist/production.d.ts",
|
|
33
|
+
"default": "./dist/production.js"
|
|
34
|
+
},
|
|
35
|
+
"./package.json": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@swr-devtools-react/core": "0.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
42
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
43
|
+
"swr": "^2.0.0"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"build": "tsdown",
|
|
47
|
+
"typecheck": "tsc --noEmit -p ."
|
|
48
|
+
}
|
|
6
49
|
}
|