@tanstack/react-query-devtools 5.0.0-alpha.25 → 5.0.0-alpha.27
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/build/lib/__tests__/devtools.test.d.ts +0 -1
- package/build/lib/__tests__/devtools.test.d.ts.map +1 -0
- package/build/lib/__tests__/utils.d.ts.map +1 -0
- package/build/lib/devtools.d.ts +8 -30
- package/build/lib/devtools.d.ts.map +1 -0
- package/build/lib/devtools.esm.js +47 -226
- package/build/lib/devtools.esm.js.map +1 -1
- package/build/lib/devtools.js +45 -244
- package/build/lib/devtools.js.map +1 -1
- package/build/lib/devtools.mjs +47 -225
- package/build/lib/devtools.mjs.map +1 -1
- package/build/lib/index.d.ts +0 -1
- package/build/lib/index.d.ts.map +1 -0
- package/build/lib/index.esm.js +8 -5
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +7 -5
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +8 -5
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/index.prod.d.ts +0 -1
- package/build/lib/index.prod.esm.js +7901 -1501
- package/build/lib/index.prod.esm.js.map +1 -1
- package/build/lib/index.prod.js +7909 -1528
- package/build/lib/index.prod.js.map +1 -1
- package/build/lib/index.prod.mjs +7922 -1489
- package/build/lib/index.prod.mjs.map +1 -1
- package/build/umd/index.development.js +7146 -2375
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +4 -5
- package/src/__tests__/devtools.test.tsx +1 -1135
- package/src/devtools.tsx +52 -306
- package/src/index.ts +6 -6
- package/build/lib/CachePanel/ActiveQuery.d.ts +0 -19
- package/build/lib/CachePanel/ActiveQuery.esm.js +0 -277
- package/build/lib/CachePanel/ActiveQuery.esm.js.map +0 -1
- package/build/lib/CachePanel/ActiveQuery.js +0 -281
- package/build/lib/CachePanel/ActiveQuery.js.map +0 -1
- package/build/lib/CachePanel/ActiveQuery.mjs +0 -261
- package/build/lib/CachePanel/ActiveQuery.mjs.map +0 -1
- package/build/lib/CachePanel/CachePanel.d.ts +0 -58
- package/build/lib/CachePanel/CachePanel.esm.js +0 -310
- package/build/lib/CachePanel/CachePanel.esm.js.map +0 -1
- package/build/lib/CachePanel/CachePanel.js +0 -315
- package/build/lib/CachePanel/CachePanel.js.map +0 -1
- package/build/lib/CachePanel/CachePanel.mjs +0 -310
- package/build/lib/CachePanel/CachePanel.mjs.map +0 -1
- package/build/lib/CachePanel/Header/QueryStatusCount.d.ts +0 -8
- package/build/lib/CachePanel/Header/QueryStatusCount.esm.js +0 -49
- package/build/lib/CachePanel/Header/QueryStatusCount.esm.js.map +0 -1
- package/build/lib/CachePanel/Header/QueryStatusCount.js +0 -53
- package/build/lib/CachePanel/Header/QueryStatusCount.js.map +0 -1
- package/build/lib/CachePanel/Header/QueryStatusCount.mjs +0 -49
- package/build/lib/CachePanel/Header/QueryStatusCount.mjs.map +0 -1
- package/build/lib/CachePanel/QueryRow.d.ts +0 -14
- package/build/lib/CachePanel/QueryRow.esm.js +0 -98
- package/build/lib/CachePanel/QueryRow.esm.js.map +0 -1
- package/build/lib/CachePanel/QueryRow.js +0 -102
- package/build/lib/CachePanel/QueryRow.js.map +0 -1
- package/build/lib/CachePanel/QueryRow.mjs +0 -82
- package/build/lib/CachePanel/QueryRow.mjs.map +0 -1
- package/build/lib/Explorer.d.ts +0 -51
- package/build/lib/Explorer.esm.js +0 -254
- package/build/lib/Explorer.esm.js.map +0 -1
- package/build/lib/Explorer.js +0 -288
- package/build/lib/Explorer.js.map +0 -1
- package/build/lib/Explorer.mjs +0 -254
- package/build/lib/Explorer.mjs.map +0 -1
- package/build/lib/Logo.d.ts +0 -2
- package/build/lib/Logo.esm.js +0 -32
- package/build/lib/Logo.esm.js.map +0 -1
- package/build/lib/Logo.js +0 -55
- package/build/lib/Logo.js.map +0 -1
- package/build/lib/Logo.mjs +0 -32
- package/build/lib/Logo.mjs.map +0 -1
- package/build/lib/__tests__/Explorer.test.d.ts +0 -2
- package/build/lib/_virtual/_rollupPluginBabelHelpers.esm.js +0 -17
- package/build/lib/_virtual/_rollupPluginBabelHelpers.esm.js.map +0 -1
- package/build/lib/_virtual/_rollupPluginBabelHelpers.js +0 -19
- package/build/lib/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
- package/build/lib/_virtual/_rollupPluginBabelHelpers.mjs +0 -17
- package/build/lib/_virtual/_rollupPluginBabelHelpers.mjs.map +0 -1
- package/build/lib/noop.d.ts +0 -3
- package/build/lib/screenreader.d.ts +0 -4
- package/build/lib/screenreader.esm.js +0 -17
- package/build/lib/screenreader.esm.js.map +0 -1
- package/build/lib/screenreader.js +0 -40
- package/build/lib/screenreader.js.map +0 -1
- package/build/lib/screenreader.mjs +0 -17
- package/build/lib/screenreader.mjs.map +0 -1
- package/build/lib/styledComponents.d.ts +0 -9
- package/build/lib/styledComponents.esm.js +0 -103
- package/build/lib/styledComponents.esm.js.map +0 -1
- package/build/lib/styledComponents.js +0 -112
- package/build/lib/styledComponents.js.map +0 -1
- package/build/lib/styledComponents.mjs +0 -103
- package/build/lib/styledComponents.mjs.map +0 -1
- package/build/lib/theme.d.ts +0 -37
- package/build/lib/theme.esm.js +0 -33
- package/build/lib/theme.esm.js.map +0 -1
- package/build/lib/theme.js +0 -56
- package/build/lib/theme.js.map +0 -1
- package/build/lib/theme.mjs +0 -33
- package/build/lib/theme.mjs.map +0 -1
- package/build/lib/types.d.ts +0 -12
- package/build/lib/useLocalStorage.d.ts +0 -2
- package/build/lib/useLocalStorage.esm.js +0 -40
- package/build/lib/useLocalStorage.esm.js.map +0 -1
- package/build/lib/useLocalStorage.js +0 -63
- package/build/lib/useLocalStorage.js.map +0 -1
- package/build/lib/useLocalStorage.mjs +0 -40
- package/build/lib/useLocalStorage.mjs.map +0 -1
- package/build/lib/useMediaQuery.d.ts +0 -2
- package/build/lib/useMediaQuery.esm.js +0 -36
- package/build/lib/useMediaQuery.esm.js.map +0 -1
- package/build/lib/useMediaQuery.js +0 -59
- package/build/lib/useMediaQuery.js.map +0 -1
- package/build/lib/useMediaQuery.mjs +0 -36
- package/build/lib/useMediaQuery.mjs.map +0 -1
- package/build/lib/useSubscribeToQueryCache.d.ts +0 -4
- package/build/lib/useSubscribeToQueryCache.esm.js +0 -15
- package/build/lib/useSubscribeToQueryCache.esm.js.map +0 -1
- package/build/lib/useSubscribeToQueryCache.js +0 -19
- package/build/lib/useSubscribeToQueryCache.js.map +0 -1
- package/build/lib/useSubscribeToQueryCache.mjs +0 -15
- package/build/lib/useSubscribeToQueryCache.mjs.map +0 -1
- package/build/lib/utils.d.ts +0 -80
- package/build/lib/utils.esm.js +0 -184
- package/build/lib/utils.esm.js.map +0 -1
- package/build/lib/utils.js +0 -218
- package/build/lib/utils.js.map +0 -1
- package/build/lib/utils.mjs +0 -184
- package/build/lib/utils.mjs.map +0 -1
- package/src/CachePanel/ActiveQuery.tsx +0 -388
- package/src/CachePanel/CachePanel.tsx +0 -439
- package/src/CachePanel/Header/QueryStatusCount.tsx +0 -93
- package/src/CachePanel/QueryRow.tsx +0 -125
- package/src/Explorer.tsx +0 -385
- package/src/Logo.tsx +0 -32
- package/src/__tests__/Explorer.test.tsx +0 -150
- package/src/noop.ts +0 -7
- package/src/screenreader.tsx +0 -16
- package/src/styledComponents.ts +0 -126
- package/src/theme.tsx +0 -33
- package/src/types.ts +0 -12
- package/src/useLocalStorage.ts +0 -52
- package/src/useMediaQuery.ts +0 -34
- package/src/useSubscribeToQueryCache.ts +0 -26
- package/src/utils.ts +0 -319
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var utils = require('./utils.js');
|
|
4
|
-
|
|
5
|
-
const Panel = utils.styled('div', (_props, theme) => ({
|
|
6
|
-
fontSize: 'clamp(12px, 1.5vw, 14px)',
|
|
7
|
-
fontFamily: `sans-serif`,
|
|
8
|
-
display: 'flex',
|
|
9
|
-
backgroundColor: theme.background,
|
|
10
|
-
color: theme.foreground
|
|
11
|
-
}), {
|
|
12
|
-
'(max-width: 700px)': {
|
|
13
|
-
flexDirection: 'column'
|
|
14
|
-
},
|
|
15
|
-
'(max-width: 600px)': {
|
|
16
|
-
fontSize: '.9em'
|
|
17
|
-
// flexDirection: 'column',
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
Panel.displayName = 'Panel';
|
|
22
|
-
const ActiveQueryPanel = utils.styled('div', () => ({
|
|
23
|
-
flex: '1 1 500px',
|
|
24
|
-
display: 'flex',
|
|
25
|
-
flexDirection: 'column',
|
|
26
|
-
overflow: 'auto',
|
|
27
|
-
height: '100%'
|
|
28
|
-
}), {
|
|
29
|
-
'(max-width: 700px)': (_props, theme) => ({
|
|
30
|
-
borderTop: `2px solid ${theme.gray}`
|
|
31
|
-
})
|
|
32
|
-
});
|
|
33
|
-
ActiveQueryPanel.displayName = 'ActiveQueryPanel';
|
|
34
|
-
const Button = utils.styled('button', (props, theme) => ({
|
|
35
|
-
appearance: 'none',
|
|
36
|
-
fontSize: '.9em',
|
|
37
|
-
fontWeight: 'bold',
|
|
38
|
-
background: theme.gray,
|
|
39
|
-
border: '0',
|
|
40
|
-
borderRadius: '.3em',
|
|
41
|
-
color: 'white',
|
|
42
|
-
padding: '.5em',
|
|
43
|
-
opacity: props.disabled ? '.5' : undefined,
|
|
44
|
-
cursor: 'pointer'
|
|
45
|
-
}));
|
|
46
|
-
Button.displayName = 'Button';
|
|
47
|
-
const QueryKeys = utils.styled('span', {
|
|
48
|
-
display: 'flex',
|
|
49
|
-
flexWrap: 'wrap',
|
|
50
|
-
gap: '0.5em',
|
|
51
|
-
fontSize: '0.9em'
|
|
52
|
-
});
|
|
53
|
-
QueryKeys.displayName = 'QueryKeys';
|
|
54
|
-
const QueryKey = utils.styled('span', {
|
|
55
|
-
display: 'inline-flex',
|
|
56
|
-
alignItems: 'center',
|
|
57
|
-
padding: '.2em .4em',
|
|
58
|
-
fontWeight: 'bold',
|
|
59
|
-
textShadow: '0 0 10px black',
|
|
60
|
-
borderRadius: '.2em'
|
|
61
|
-
});
|
|
62
|
-
QueryKey.displayName = 'QueryKey';
|
|
63
|
-
const Code = utils.styled('code', {
|
|
64
|
-
fontSize: '.9em',
|
|
65
|
-
color: 'inherit',
|
|
66
|
-
background: 'inherit'
|
|
67
|
-
});
|
|
68
|
-
Code.displayName = 'Code';
|
|
69
|
-
const Input = utils.styled('input', (_props, theme) => ({
|
|
70
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
71
|
-
border: 0,
|
|
72
|
-
borderRadius: '.2em',
|
|
73
|
-
color: theme.inputTextColor,
|
|
74
|
-
fontSize: '.9em',
|
|
75
|
-
lineHeight: `1.3`,
|
|
76
|
-
padding: '.3em .4em'
|
|
77
|
-
}));
|
|
78
|
-
Input.displayName = 'Input';
|
|
79
|
-
const Select = utils.styled('select', (_props, theme) => ({
|
|
80
|
-
display: `inline-block`,
|
|
81
|
-
fontSize: `.9em`,
|
|
82
|
-
fontFamily: `sans-serif`,
|
|
83
|
-
fontWeight: 'normal',
|
|
84
|
-
lineHeight: `1.3`,
|
|
85
|
-
padding: `.3em 1.5em .3em .5em`,
|
|
86
|
-
height: 'auto',
|
|
87
|
-
border: 0,
|
|
88
|
-
borderRadius: `.2em`,
|
|
89
|
-
appearance: `none`,
|
|
90
|
-
WebkitAppearance: 'none',
|
|
91
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
92
|
-
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,
|
|
93
|
-
backgroundRepeat: `no-repeat`,
|
|
94
|
-
backgroundPosition: `right .55em center`,
|
|
95
|
-
backgroundSize: `.65em auto, 100%`,
|
|
96
|
-
color: theme.inputTextColor
|
|
97
|
-
}), {
|
|
98
|
-
'(max-width: 500px)': {
|
|
99
|
-
display: 'none'
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Select.displayName = 'Select';
|
|
103
|
-
|
|
104
|
-
exports.ActiveQueryPanel = ActiveQueryPanel;
|
|
105
|
-
exports.Button = Button;
|
|
106
|
-
exports.Code = Code;
|
|
107
|
-
exports.Input = Input;
|
|
108
|
-
exports.Panel = Panel;
|
|
109
|
-
exports.QueryKey = QueryKey;
|
|
110
|
-
exports.QueryKeys = QueryKeys;
|
|
111
|
-
exports.Select = Select;
|
|
112
|
-
//# sourceMappingURL=styledComponents.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styledComponents.js","sources":["../../src/styledComponents.ts"],"sourcesContent":["import { styled } from './utils'\n\nexport const Panel = styled(\n 'div',\n (_props, theme) => ({\n fontSize: 'clamp(12px, 1.5vw, 14px)',\n fontFamily: `sans-serif`,\n display: 'flex',\n backgroundColor: theme.background,\n color: theme.foreground,\n }),\n {\n '(max-width: 700px)': {\n flexDirection: 'column',\n },\n '(max-width: 600px)': {\n fontSize: '.9em',\n // flexDirection: 'column',\n },\n },\n)\n\nPanel.displayName = 'Panel'\n\nexport const ActiveQueryPanel = styled(\n 'div',\n () => ({\n flex: '1 1 500px',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n height: '100%',\n }),\n {\n '(max-width: 700px)': (_props, theme) => ({\n borderTop: `2px solid ${theme.gray}`,\n }),\n },\n)\n\nActiveQueryPanel.displayName = 'ActiveQueryPanel'\n\nexport const Button = styled('button', (props, theme) => ({\n appearance: 'none',\n fontSize: '.9em',\n fontWeight: 'bold',\n background: theme.gray,\n border: '0',\n borderRadius: '.3em',\n color: 'white',\n padding: '.5em',\n opacity: props.disabled ? '.5' : undefined,\n cursor: 'pointer',\n}))\n\nButton.displayName = 'Button'\n\nexport const QueryKeys = styled('span', {\n display: 'flex',\n flexWrap: 'wrap',\n gap: '0.5em',\n fontSize: '0.9em',\n})\n\nQueryKeys.displayName = 'QueryKeys'\n\nexport const QueryKey = styled('span', {\n display: 'inline-flex',\n alignItems: 'center',\n padding: '.2em .4em',\n fontWeight: 'bold',\n textShadow: '0 0 10px black',\n borderRadius: '.2em',\n})\n\nQueryKey.displayName = 'QueryKey'\n\nexport const Code = styled('code', {\n fontSize: '.9em',\n color: 'inherit',\n background: 'inherit',\n})\n\nCode.displayName = 'Code'\n\nexport const Input = styled('input', (_props, theme) => ({\n backgroundColor: theme.inputBackgroundColor,\n border: 0,\n borderRadius: '.2em',\n color: theme.inputTextColor,\n fontSize: '.9em',\n lineHeight: `1.3`,\n padding: '.3em .4em',\n}))\n\nInput.displayName = 'Input'\n\nexport const Select = styled(\n 'select',\n (_props, theme) => ({\n display: `inline-block`,\n fontSize: `.9em`,\n fontFamily: `sans-serif`,\n fontWeight: 'normal',\n lineHeight: `1.3`,\n padding: `.3em 1.5em .3em .5em`,\n height: 'auto',\n border: 0,\n borderRadius: `.2em`,\n appearance: `none`,\n WebkitAppearance: 'none',\n backgroundColor: theme.inputBackgroundColor,\n backgroundImage: `url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")`,\n backgroundRepeat: `no-repeat`,\n backgroundPosition: `right .55em center`,\n backgroundSize: `.65em auto, 100%`,\n color: theme.inputTextColor,\n }),\n {\n '(max-width: 500px)': {\n display: 'none',\n },\n },\n)\n\nSelect.displayName = 'Select'\n"],"names":["Panel","styled","_props","theme","fontSize","fontFamily","display","backgroundColor","background","color","foreground","flexDirection","displayName","ActiveQueryPanel","flex","overflow","height","borderTop","gray","Button","props","appearance","fontWeight","border","borderRadius","padding","opacity","disabled","undefined","cursor","QueryKeys","flexWrap","gap","QueryKey","alignItems","textShadow","Code","Input","inputBackgroundColor","inputTextColor","lineHeight","Select","WebkitAppearance","backgroundImage","backgroundRepeat","backgroundPosition","backgroundSize"],"mappings":";;;;AAEO,MAAMA,KAAK,GAAGC,YAAM,CACzB,KAAK,EACL,CAACC,MAAM,EAAEC,KAAK,MAA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vw, 14px)',
|
|
5
|
-
fontFamily: `sans-serif`,
|
|
6
|
-
display: 'flex',
|
|
7
|
-
backgroundColor: theme.background,
|
|
8
|
-
color: theme.foreground
|
|
9
|
-
}), {
|
|
10
|
-
'(max-width: 700px)': {
|
|
11
|
-
flexDirection: 'column'
|
|
12
|
-
},
|
|
13
|
-
'(max-width: 600px)': {
|
|
14
|
-
fontSize: '.9em'
|
|
15
|
-
// flexDirection: 'column',
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
Panel.displayName = 'Panel';
|
|
20
|
-
const ActiveQueryPanel = styled('div', () => ({
|
|
21
|
-
flex: '1 1 500px',
|
|
22
|
-
display: 'flex',
|
|
23
|
-
flexDirection: 'column',
|
|
24
|
-
overflow: 'auto',
|
|
25
|
-
height: '100%'
|
|
26
|
-
}), {
|
|
27
|
-
'(max-width: 700px)': (_props, theme) => ({
|
|
28
|
-
borderTop: `2px solid ${theme.gray}`
|
|
29
|
-
})
|
|
30
|
-
});
|
|
31
|
-
ActiveQueryPanel.displayName = 'ActiveQueryPanel';
|
|
32
|
-
const Button = styled('button', (props, theme) => ({
|
|
33
|
-
appearance: 'none',
|
|
34
|
-
fontSize: '.9em',
|
|
35
|
-
fontWeight: 'bold',
|
|
36
|
-
background: theme.gray,
|
|
37
|
-
border: '0',
|
|
38
|
-
borderRadius: '.3em',
|
|
39
|
-
color: 'white',
|
|
40
|
-
padding: '.5em',
|
|
41
|
-
opacity: props.disabled ? '.5' : undefined,
|
|
42
|
-
cursor: 'pointer'
|
|
43
|
-
}));
|
|
44
|
-
Button.displayName = 'Button';
|
|
45
|
-
const QueryKeys = styled('span', {
|
|
46
|
-
display: 'flex',
|
|
47
|
-
flexWrap: 'wrap',
|
|
48
|
-
gap: '0.5em',
|
|
49
|
-
fontSize: '0.9em'
|
|
50
|
-
});
|
|
51
|
-
QueryKeys.displayName = 'QueryKeys';
|
|
52
|
-
const QueryKey = styled('span', {
|
|
53
|
-
display: 'inline-flex',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
padding: '.2em .4em',
|
|
56
|
-
fontWeight: 'bold',
|
|
57
|
-
textShadow: '0 0 10px black',
|
|
58
|
-
borderRadius: '.2em'
|
|
59
|
-
});
|
|
60
|
-
QueryKey.displayName = 'QueryKey';
|
|
61
|
-
const Code = styled('code', {
|
|
62
|
-
fontSize: '.9em',
|
|
63
|
-
color: 'inherit',
|
|
64
|
-
background: 'inherit'
|
|
65
|
-
});
|
|
66
|
-
Code.displayName = 'Code';
|
|
67
|
-
const Input = styled('input', (_props, theme) => ({
|
|
68
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
69
|
-
border: 0,
|
|
70
|
-
borderRadius: '.2em',
|
|
71
|
-
color: theme.inputTextColor,
|
|
72
|
-
fontSize: '.9em',
|
|
73
|
-
lineHeight: `1.3`,
|
|
74
|
-
padding: '.3em .4em'
|
|
75
|
-
}));
|
|
76
|
-
Input.displayName = 'Input';
|
|
77
|
-
const Select = styled('select', (_props, theme) => ({
|
|
78
|
-
display: `inline-block`,
|
|
79
|
-
fontSize: `.9em`,
|
|
80
|
-
fontFamily: `sans-serif`,
|
|
81
|
-
fontWeight: 'normal',
|
|
82
|
-
lineHeight: `1.3`,
|
|
83
|
-
padding: `.3em 1.5em .3em .5em`,
|
|
84
|
-
height: 'auto',
|
|
85
|
-
border: 0,
|
|
86
|
-
borderRadius: `.2em`,
|
|
87
|
-
appearance: `none`,
|
|
88
|
-
WebkitAppearance: 'none',
|
|
89
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
90
|
-
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,
|
|
91
|
-
backgroundRepeat: `no-repeat`,
|
|
92
|
-
backgroundPosition: `right .55em center`,
|
|
93
|
-
backgroundSize: `.65em auto, 100%`,
|
|
94
|
-
color: theme.inputTextColor
|
|
95
|
-
}), {
|
|
96
|
-
'(max-width: 500px)': {
|
|
97
|
-
display: 'none'
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
Select.displayName = 'Select';
|
|
101
|
-
|
|
102
|
-
export { ActiveQueryPanel, Button, Code, Input, Panel, QueryKey, QueryKeys, Select };
|
|
103
|
-
//# sourceMappingURL=styledComponents.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styledComponents.mjs","sources":["../../src/styledComponents.ts"],"sourcesContent":["import { styled } from './utils'\n\nexport const Panel = styled(\n 'div',\n (_props, theme) => ({\n fontSize: 'clamp(12px, 1.5vw, 14px)',\n fontFamily: `sans-serif`,\n display: 'flex',\n backgroundColor: theme.background,\n color: theme.foreground,\n }),\n {\n '(max-width: 700px)': {\n flexDirection: 'column',\n },\n '(max-width: 600px)': {\n fontSize: '.9em',\n // flexDirection: 'column',\n },\n },\n)\n\nPanel.displayName = 'Panel'\n\nexport const ActiveQueryPanel = styled(\n 'div',\n () => ({\n flex: '1 1 500px',\n display: 'flex',\n flexDirection: 'column',\n overflow: 'auto',\n height: '100%',\n }),\n {\n '(max-width: 700px)': (_props, theme) => ({\n borderTop: `2px solid ${theme.gray}`,\n }),\n },\n)\n\nActiveQueryPanel.displayName = 'ActiveQueryPanel'\n\nexport const Button = styled('button', (props, theme) => ({\n appearance: 'none',\n fontSize: '.9em',\n fontWeight: 'bold',\n background: theme.gray,\n border: '0',\n borderRadius: '.3em',\n color: 'white',\n padding: '.5em',\n opacity: props.disabled ? '.5' : undefined,\n cursor: 'pointer',\n}))\n\nButton.displayName = 'Button'\n\nexport const QueryKeys = styled('span', {\n display: 'flex',\n flexWrap: 'wrap',\n gap: '0.5em',\n fontSize: '0.9em',\n})\n\nQueryKeys.displayName = 'QueryKeys'\n\nexport const QueryKey = styled('span', {\n display: 'inline-flex',\n alignItems: 'center',\n padding: '.2em .4em',\n fontWeight: 'bold',\n textShadow: '0 0 10px black',\n borderRadius: '.2em',\n})\n\nQueryKey.displayName = 'QueryKey'\n\nexport const Code = styled('code', {\n fontSize: '.9em',\n color: 'inherit',\n background: 'inherit',\n})\n\nCode.displayName = 'Code'\n\nexport const Input = styled('input', (_props, theme) => ({\n backgroundColor: theme.inputBackgroundColor,\n border: 0,\n borderRadius: '.2em',\n color: theme.inputTextColor,\n fontSize: '.9em',\n lineHeight: `1.3`,\n padding: '.3em .4em',\n}))\n\nInput.displayName = 'Input'\n\nexport const Select = styled(\n 'select',\n (_props, theme) => ({\n display: `inline-block`,\n fontSize: `.9em`,\n fontFamily: `sans-serif`,\n fontWeight: 'normal',\n lineHeight: `1.3`,\n padding: `.3em 1.5em .3em .5em`,\n height: 'auto',\n border: 0,\n borderRadius: `.2em`,\n appearance: `none`,\n WebkitAppearance: 'none',\n backgroundColor: theme.inputBackgroundColor,\n backgroundImage: `url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>\")`,\n backgroundRepeat: `no-repeat`,\n backgroundPosition: `right .55em center`,\n backgroundSize: `.65em auto, 100%`,\n color: theme.inputTextColor,\n }),\n {\n '(max-width: 500px)': {\n display: 'none',\n },\n },\n)\n\nSelect.displayName = 'Select'\n"],"names":["Panel","styled","_props","theme","fontSize","fontFamily","display","backgroundColor","background","color","foreground","flexDirection","displayName","ActiveQueryPanel","flex","overflow","height","borderTop","gray","Button","props","appearance","fontWeight","border","borderRadius","padding","opacity","disabled","undefined","cursor","QueryKeys","flexWrap","gap","QueryKey","alignItems","textShadow","Code","Input","inputBackgroundColor","inputTextColor","lineHeight","Select","WebkitAppearance","backgroundImage","backgroundRepeat","backgroundPosition","backgroundSize"],"mappings":";;AAEO,MAAMA,KAAK,GAAGC,MAAM,CACzB,KAAK,EACL,CAACC,MAAM,EAAEC,KAAK,MAAM;AAClBC,EAAAA,QAAQ,EAAE,0BAA0B;AACpCC,EAAAA,UAAU,EAAG,CAAW,UAAA,CAAA;AACxBC,EAAAA,OAAO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,CAAA;AAEpB,MAAM6B,MAAM,GAAGxC,MAAM,CAC1B,QAAQ,EACR,CAACC,MAAM,EAAEC,KAAK,MAAM;AAClBG,EAAAA,OAAO,EAAG,CAAa,YAAA,CAAA;AACvBF,EAAAA,QAAQ,EAAG,CAAK,IAAA,CAAA;AAChBC,EAAAA,UAAU,EAAG,CAAW,UAAA,CAAA;AACxBiB,EAAAA,UAAU,EAAE,QAAQ;AACpBkB,EAAAA,UAAU,EAAG,CAAI,GAAA,CAAA;AACjBf,EAAAA,OAAO,EAAG,CAAqB,oBAAA,CAAA;AAC/BT,EAAAA,MAAM,EAAE,MAAM;AACdO,EAAAA,MAAM,EAAE,CAAC;AACTC,EAAAA,YAAY,EAAG,CAAK,IAAA,CAAA;AACpBH,EAAAA,UAAU,EAAG,CAAK,IAAA,CAAA;AAClBqB,EAAAA,gBAAgB,EAAE,MAAM;EACxBnC,eAAe,EAAEJ,KAAK,CAACmC,oBAAoB;AAC3CK,EAAAA,eAAe,EAAG,CAA6J,4JAAA,CAAA;AAC/KC,EAAAA,gBAAgB,EAAG,CAAU,SAAA,CAAA;AAC7BC,EAAAA,kBAAkB,EAAG,CAAmB,kBAAA,CAAA;AACxCC,EAAAA,cAAc,EAAG,CAAiB,gBAAA,CAAA;EAClCrC,KAAK,EAAEN,KAAK,CAACoC,cAAAA;AACf,CAAC,CAAC,EACF;AACE,EAAA,oBAAoB,EAAE;AACpBjC,IAAAA,OAAO,EAAE,MAAA;AACX,GAAA;AACF,CAAC,EACF;AAEDmC,MAAM,CAAC7B,WAAW,GAAG,QAAQ;;;;"}
|
package/build/lib/theme.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const defaultTheme: {
|
|
3
|
-
readonly background: "#0b1521";
|
|
4
|
-
readonly backgroundAlt: "#132337";
|
|
5
|
-
readonly foreground: "white";
|
|
6
|
-
readonly gray: "#3f4e60";
|
|
7
|
-
readonly grayAlt: "#222e3e";
|
|
8
|
-
readonly inputBackgroundColor: "#fff";
|
|
9
|
-
readonly inputTextColor: "#000";
|
|
10
|
-
readonly success: "#00ab52";
|
|
11
|
-
readonly danger: "#ff0085";
|
|
12
|
-
readonly active: "#006bff";
|
|
13
|
-
readonly paused: "#8c49eb";
|
|
14
|
-
readonly warning: "#ffb200";
|
|
15
|
-
};
|
|
16
|
-
export declare type Theme = typeof defaultTheme;
|
|
17
|
-
interface ProviderProps {
|
|
18
|
-
theme: Theme;
|
|
19
|
-
children?: React.ReactNode;
|
|
20
|
-
}
|
|
21
|
-
export declare function ThemeProvider({ theme, ...rest }: ProviderProps): JSX.Element;
|
|
22
|
-
export declare function useTheme(): {
|
|
23
|
-
readonly background: "#0b1521";
|
|
24
|
-
readonly backgroundAlt: "#132337";
|
|
25
|
-
readonly foreground: "white";
|
|
26
|
-
readonly gray: "#3f4e60";
|
|
27
|
-
readonly grayAlt: "#222e3e";
|
|
28
|
-
readonly inputBackgroundColor: "#fff";
|
|
29
|
-
readonly inputTextColor: "#000";
|
|
30
|
-
readonly success: "#00ab52";
|
|
31
|
-
readonly danger: "#ff0085";
|
|
32
|
-
readonly active: "#006bff";
|
|
33
|
-
readonly paused: "#8c49eb";
|
|
34
|
-
readonly warning: "#ffb200";
|
|
35
|
-
};
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=theme.d.ts.map
|
package/build/lib/theme.esm.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { extends as _extends } from './_virtual/_rollupPluginBabelHelpers.esm.js';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
const defaultTheme = {
|
|
6
|
-
background: '#0b1521',
|
|
7
|
-
backgroundAlt: '#132337',
|
|
8
|
-
foreground: 'white',
|
|
9
|
-
gray: '#3f4e60',
|
|
10
|
-
grayAlt: '#222e3e',
|
|
11
|
-
inputBackgroundColor: '#fff',
|
|
12
|
-
inputTextColor: '#000',
|
|
13
|
-
success: '#00ab52',
|
|
14
|
-
danger: '#ff0085',
|
|
15
|
-
active: '#006bff',
|
|
16
|
-
paused: '#8c49eb',
|
|
17
|
-
warning: '#ffb200'
|
|
18
|
-
};
|
|
19
|
-
const ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
|
|
20
|
-
function ThemeProvider({
|
|
21
|
-
theme,
|
|
22
|
-
...rest
|
|
23
|
-
}) {
|
|
24
|
-
return /*#__PURE__*/React.createElement(ThemeContext.Provider, _extends({
|
|
25
|
-
value: theme
|
|
26
|
-
}, rest));
|
|
27
|
-
}
|
|
28
|
-
function useTheme() {
|
|
29
|
-
return React.useContext(ThemeContext);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { ThemeProvider, defaultTheme, useTheme };
|
|
33
|
-
//# sourceMappingURL=theme.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.esm.js","sources":["../../src/theme.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nexport const defaultTheme = {\n background: '#0b1521',\n backgroundAlt: '#132337',\n foreground: 'white',\n gray: '#3f4e60',\n grayAlt: '#222e3e',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#00ab52',\n danger: '#ff0085',\n active: '#006bff',\n paused: '#8c49eb',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n"],"names":["background","backgroundAlt","foreground","gray","grayAlt","inputBackgroundColor","inputTextColor","success","danger","active","paused","warning"],"mappings":";;;;AAGO;AACLA;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAQA;AAEO;;;AAAuD;;AAC9B;AAAa;AAC7C;AAEO;AACL;AACF;;"}
|
package/build/lib/theme.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
'use strict';
|
|
3
|
-
|
|
4
|
-
var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
|
|
7
|
-
function _interopNamespaceDefault(e) {
|
|
8
|
-
var n = Object.create(null);
|
|
9
|
-
if (e) {
|
|
10
|
-
Object.keys(e).forEach(function (k) {
|
|
11
|
-
if (k !== 'default') {
|
|
12
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () { return e[k]; }
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
n.default = e;
|
|
21
|
-
return Object.freeze(n);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
|
-
|
|
26
|
-
const defaultTheme = {
|
|
27
|
-
background: '#0b1521',
|
|
28
|
-
backgroundAlt: '#132337',
|
|
29
|
-
foreground: 'white',
|
|
30
|
-
gray: '#3f4e60',
|
|
31
|
-
grayAlt: '#222e3e',
|
|
32
|
-
inputBackgroundColor: '#fff',
|
|
33
|
-
inputTextColor: '#000',
|
|
34
|
-
success: '#00ab52',
|
|
35
|
-
danger: '#ff0085',
|
|
36
|
-
active: '#006bff',
|
|
37
|
-
paused: '#8c49eb',
|
|
38
|
-
warning: '#ffb200'
|
|
39
|
-
};
|
|
40
|
-
const ThemeContext = /*#__PURE__*/React__namespace.createContext(defaultTheme);
|
|
41
|
-
function ThemeProvider({
|
|
42
|
-
theme,
|
|
43
|
-
...rest
|
|
44
|
-
}) {
|
|
45
|
-
return /*#__PURE__*/React__namespace.createElement(ThemeContext.Provider, _rollupPluginBabelHelpers.extends({
|
|
46
|
-
value: theme
|
|
47
|
-
}, rest));
|
|
48
|
-
}
|
|
49
|
-
function useTheme() {
|
|
50
|
-
return React__namespace.useContext(ThemeContext);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
exports.ThemeProvider = ThemeProvider;
|
|
54
|
-
exports.defaultTheme = defaultTheme;
|
|
55
|
-
exports.useTheme = useTheme;
|
|
56
|
-
//# sourceMappingURL=theme.js.map
|
package/build/lib/theme.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sources":["../../src/theme.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nexport const defaultTheme = {\n background: '#0b1521',\n backgroundAlt: '#132337',\n foreground: 'white',\n gray: '#3f4e60',\n grayAlt: '#222e3e',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#00ab52',\n danger: '#ff0085',\n active: '#006bff',\n paused: '#8c49eb',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n"],"names":["background","backgroundAlt","foreground","gray","grayAlt","inputBackgroundColor","inputTextColor","success","danger","active","paused","warning"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGO;AACLA;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAQA;AAEO;;;AAAuD;;AAC9B;AAAa;AAC7C;AAEO;AACL;AACF;;;;"}
|
package/build/lib/theme.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { extends as _extends } from './_virtual/_rollupPluginBabelHelpers.mjs';
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
|
|
5
|
-
const defaultTheme = {
|
|
6
|
-
background: '#0b1521',
|
|
7
|
-
backgroundAlt: '#132337',
|
|
8
|
-
foreground: 'white',
|
|
9
|
-
gray: '#3f4e60',
|
|
10
|
-
grayAlt: '#222e3e',
|
|
11
|
-
inputBackgroundColor: '#fff',
|
|
12
|
-
inputTextColor: '#000',
|
|
13
|
-
success: '#00ab52',
|
|
14
|
-
danger: '#ff0085',
|
|
15
|
-
active: '#006bff',
|
|
16
|
-
paused: '#8c49eb',
|
|
17
|
-
warning: '#ffb200'
|
|
18
|
-
};
|
|
19
|
-
const ThemeContext = /*#__PURE__*/React.createContext(defaultTheme);
|
|
20
|
-
function ThemeProvider({
|
|
21
|
-
theme,
|
|
22
|
-
...rest
|
|
23
|
-
}) {
|
|
24
|
-
return /*#__PURE__*/React.createElement(ThemeContext.Provider, _extends({
|
|
25
|
-
value: theme
|
|
26
|
-
}, rest));
|
|
27
|
-
}
|
|
28
|
-
function useTheme() {
|
|
29
|
-
return React.useContext(ThemeContext);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export { ThemeProvider, defaultTheme, useTheme };
|
|
33
|
-
//# sourceMappingURL=theme.mjs.map
|
package/build/lib/theme.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"theme.mjs","sources":["../../src/theme.tsx"],"sourcesContent":["'use client'\nimport * as React from 'react'\n\nexport const defaultTheme = {\n background: '#0b1521',\n backgroundAlt: '#132337',\n foreground: 'white',\n gray: '#3f4e60',\n grayAlt: '#222e3e',\n inputBackgroundColor: '#fff',\n inputTextColor: '#000',\n success: '#00ab52',\n danger: '#ff0085',\n active: '#006bff',\n paused: '#8c49eb',\n warning: '#ffb200',\n} as const\n\nexport type Theme = typeof defaultTheme\ninterface ProviderProps {\n theme: Theme\n children?: React.ReactNode\n}\n\nconst ThemeContext = React.createContext(defaultTheme)\n\nexport function ThemeProvider({ theme, ...rest }: ProviderProps) {\n return <ThemeContext.Provider value={theme} {...rest} />\n}\n\nexport function useTheme() {\n return React.useContext(ThemeContext)\n}\n"],"names":["background","backgroundAlt","foreground","gray","grayAlt","inputBackgroundColor","inputTextColor","success","danger","active","paused","warning"],"mappings":";;;;AAGO;AACLA;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAQA;AAEO;;;AAAuD;;AAC9B;AAAa;AAC7C;AAEO;AACL;AACF;;"}
|
package/build/lib/types.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { Query, DefaultError } from '@tanstack/react-query';
|
|
2
|
-
export interface DevToolsErrorType {
|
|
3
|
-
/**
|
|
4
|
-
* The name of the error.
|
|
5
|
-
*/
|
|
6
|
-
name: string;
|
|
7
|
-
/**
|
|
8
|
-
* How the error is initialized.
|
|
9
|
-
*/
|
|
10
|
-
initializer: (query: Query) => DefaultError;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
const getItem = key => {
|
|
4
|
-
try {
|
|
5
|
-
const itemValue = localStorage.getItem(key);
|
|
6
|
-
if (typeof itemValue === 'string') {
|
|
7
|
-
return JSON.parse(itemValue);
|
|
8
|
-
}
|
|
9
|
-
return undefined;
|
|
10
|
-
} catch {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
function useLocalStorage(key, defaultValue) {
|
|
15
|
-
const [value, setValue] = React.useState();
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
const initialValue = getItem(key);
|
|
18
|
-
if (typeof initialValue === 'undefined' || initialValue === null) {
|
|
19
|
-
setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
|
|
20
|
-
} else {
|
|
21
|
-
setValue(initialValue);
|
|
22
|
-
}
|
|
23
|
-
}, [defaultValue, key]);
|
|
24
|
-
const setter = React.useCallback(updater => {
|
|
25
|
-
setValue(old => {
|
|
26
|
-
let newVal = updater;
|
|
27
|
-
if (typeof updater == 'function') {
|
|
28
|
-
newVal = updater(old);
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
localStorage.setItem(key, JSON.stringify(newVal));
|
|
32
|
-
} catch {}
|
|
33
|
-
return newVal;
|
|
34
|
-
});
|
|
35
|
-
}, [key]);
|
|
36
|
-
return [value, setter];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { useLocalStorage as default };
|
|
40
|
-
//# sourceMappingURL=useLocalStorage.esm.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.esm.js","sources":["../../src/useLocalStorage.ts"],"sourcesContent":["import * as React from 'react'\n\nconst getItem = (key: string): unknown => {\n try {\n const itemValue = localStorage.getItem(key)\n if (typeof itemValue === 'string') {\n return JSON.parse(itemValue)\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\nexport default function useLocalStorage<T>(\n key: string,\n defaultValue: T | undefined,\n): [T | undefined, (newVal: T | ((prevVal: T) => T)) => void] {\n const [value, setValue] = React.useState<T>()\n\n React.useEffect(() => {\n const initialValue = getItem(key) as T | undefined\n\n if (typeof initialValue === 'undefined' || initialValue === null) {\n setValue(\n typeof defaultValue === 'function' ? defaultValue() : defaultValue,\n )\n } else {\n setValue(initialValue)\n }\n }, [defaultValue, key])\n\n const setter = React.useCallback(\n (updater: any) => {\n setValue((old) => {\n let newVal = updater\n\n if (typeof updater == 'function') {\n newVal = updater(old)\n }\n try {\n localStorage.setItem(key, JSON.stringify(newVal))\n } catch {}\n\n return newVal\n })\n },\n [key],\n )\n\n return [value, setter]\n}\n"],"names":["getItem","key","itemValue","localStorage","JSON","parse","undefined","useLocalStorage","defaultValue","value","setValue","React","useState","useEffect","initialValue","setter","useCallback","updater","old","newVal","setItem","stringify"],"mappings":";;AAEA,MAAMA,OAAO,GAAIC,GAAW,IAAc;EACxC,IAAI;AACF,I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AAA,OAAOA,MAAM,CAAA;AACf,KAAC,CAAC,CAAA;AACJ,GAAC,EACD,CAAClB,GAAG,CAAC,CACN,CAAA;AAED,EAAA,OAAO,CAACQ,KAAK,EAAEM,MAAM,CAAC,CAAA;AACxB;;;;"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
|
|
7
|
-
function _interopNamespaceDefault(e) {
|
|
8
|
-
var n = Object.create(null);
|
|
9
|
-
if (e) {
|
|
10
|
-
Object.keys(e).forEach(function (k) {
|
|
11
|
-
if (k !== 'default') {
|
|
12
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
get: function () { return e[k]; }
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
n.default = e;
|
|
21
|
-
return Object.freeze(n);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
|
-
|
|
26
|
-
const getItem = key => {
|
|
27
|
-
try {
|
|
28
|
-
const itemValue = localStorage.getItem(key);
|
|
29
|
-
if (typeof itemValue === 'string') {
|
|
30
|
-
return JSON.parse(itemValue);
|
|
31
|
-
}
|
|
32
|
-
return undefined;
|
|
33
|
-
} catch {
|
|
34
|
-
return undefined;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
function useLocalStorage(key, defaultValue) {
|
|
38
|
-
const [value, setValue] = React__namespace.useState();
|
|
39
|
-
React__namespace.useEffect(() => {
|
|
40
|
-
const initialValue = getItem(key);
|
|
41
|
-
if (typeof initialValue === 'undefined' || initialValue === null) {
|
|
42
|
-
setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
|
|
43
|
-
} else {
|
|
44
|
-
setValue(initialValue);
|
|
45
|
-
}
|
|
46
|
-
}, [defaultValue, key]);
|
|
47
|
-
const setter = React__namespace.useCallback(updater => {
|
|
48
|
-
setValue(old => {
|
|
49
|
-
let newVal = updater;
|
|
50
|
-
if (typeof updater == 'function') {
|
|
51
|
-
newVal = updater(old);
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
localStorage.setItem(key, JSON.stringify(newVal));
|
|
55
|
-
} catch {}
|
|
56
|
-
return newVal;
|
|
57
|
-
});
|
|
58
|
-
}, [key]);
|
|
59
|
-
return [value, setter];
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
exports.default = useLocalStorage;
|
|
63
|
-
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.js","sources":["../../src/useLocalStorage.ts"],"sourcesContent":["import * as React from 'react'\n\nconst getItem = (key: string): unknown => {\n try {\n const itemValue = localStorage.getItem(key)\n if (typeof itemValue === 'string') {\n return JSON.parse(itemValue)\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\nexport default function useLocalStorage<T>(\n key: string,\n defaultValue: T | undefined,\n): [T | undefined, (newVal: T | ((prevVal: T) => T)) => void] {\n const [value, setValue] = React.useState<T>()\n\n React.useEffect(() => {\n const initialValue = getItem(key) as T | undefined\n\n if (typeof initialValue === 'undefined' || initialValue === null) {\n setValue(\n typeof defaultValue === 'function' ? defaultValue() : defaultValue,\n )\n } else {\n setValue(initialValue)\n }\n }, [defaultValue, key])\n\n const setter = React.useCallback(\n (updater: any) => {\n setValue((old) => {\n let newVal = updater\n\n if (typeof updater == 'function') {\n newVal = updater(old)\n }\n try {\n localStorage.setItem(key, JSON.stringify(newVal))\n } catch {}\n\n return newVal\n })\n },\n [key],\n )\n\n return [value, setter]\n}\n"],"names":["getItem","key","itemValue","localStorage","JSON","parse","undefined","useLocalStorage","defaultValue","value","setValue","React","useState","useEffect","initialValue","setter","use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Ff,YAAY,CAACiB,OAAO,CAACnB,GAAG,EAAEG,IAAI,CAACiB,SAAS,CAACF,MAAM,CAAC,CAAC,CAAA;OAClD,CAAC,MAAM,EAAC;AAET,MAAA,OAAOA,MAAM,CAAA;AACf,KAAC,CAAC,CAAA;AACJ,GAAC,EACD,CAAClB,GAAG,CAAC,CACN,CAAA;AAED,EAAA,OAAO,CAACQ,KAAK,EAAEM,MAAM,CAAC,CAAA;AACxB;;;;"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
const getItem = key => {
|
|
4
|
-
try {
|
|
5
|
-
const itemValue = localStorage.getItem(key);
|
|
6
|
-
if (typeof itemValue === 'string') {
|
|
7
|
-
return JSON.parse(itemValue);
|
|
8
|
-
}
|
|
9
|
-
return undefined;
|
|
10
|
-
} catch {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
function useLocalStorage(key, defaultValue) {
|
|
15
|
-
const [value, setValue] = React.useState();
|
|
16
|
-
React.useEffect(() => {
|
|
17
|
-
const initialValue = getItem(key);
|
|
18
|
-
if (typeof initialValue === 'undefined' || initialValue === null) {
|
|
19
|
-
setValue(typeof defaultValue === 'function' ? defaultValue() : defaultValue);
|
|
20
|
-
} else {
|
|
21
|
-
setValue(initialValue);
|
|
22
|
-
}
|
|
23
|
-
}, [defaultValue, key]);
|
|
24
|
-
const setter = React.useCallback(updater => {
|
|
25
|
-
setValue(old => {
|
|
26
|
-
let newVal = updater;
|
|
27
|
-
if (typeof updater == 'function') {
|
|
28
|
-
newVal = updater(old);
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
localStorage.setItem(key, JSON.stringify(newVal));
|
|
32
|
-
} catch {}
|
|
33
|
-
return newVal;
|
|
34
|
-
});
|
|
35
|
-
}, [key]);
|
|
36
|
-
return [value, setter];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export { useLocalStorage as default };
|
|
40
|
-
//# sourceMappingURL=useLocalStorage.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.mjs","sources":["../../src/useLocalStorage.ts"],"sourcesContent":["import * as React from 'react'\n\nconst getItem = (key: string): unknown => {\n try {\n const itemValue = localStorage.getItem(key)\n if (typeof itemValue === 'string') {\n return JSON.parse(itemValue)\n }\n return undefined\n } catch {\n return undefined\n }\n}\n\nexport default function useLocalStorage<T>(\n key: string,\n defaultValue: T | undefined,\n): [T | undefined, (newVal: T | ((prevVal: T) => T)) => void] {\n const [value, setValue] = React.useState<T>()\n\n React.useEffect(() => {\n const initialValue = getItem(key) as T | undefined\n\n if (typeof initialValue === 'undefined' || initialValue === null) {\n setValue(\n typeof defaultValue === 'function' ? defaultValue() : defaultValue,\n )\n } else {\n setValue(initialValue)\n }\n }, [defaultValue, key])\n\n const setter = React.useCallback(\n (updater: any) => {\n setValue((old) => {\n let newVal = updater\n\n if (typeof updater == 'function') {\n newVal = updater(old)\n }\n try {\n localStorage.setItem(key, JSON.stringify(newVal))\n } catch {}\n\n return newVal\n })\n },\n [key],\n )\n\n return [value, setter]\n}\n"],"names":["getItem","key","itemValue","localStorage","JSON","parse","undefined","useLocalStorage","defaultValue","value","setValue","React","useState","useEffect","initialValue","setter","useCallback","updater","old","newVal","setItem","stringify"],"mappings":";;AAEA,MAAMA,OAAO,GAAIC,GAAW,IAAc;EACxC,IAAI;AACF,IAAA,MAAMC,SAAS,GAAGC,YAAY,CAACH,OAAO,CAACC,GAAG,CAAC,CAAA;AAC3C,IAAA,IAAI,OAAOC,SAAS,KAAK,QAAQ,EAAE;AACjC,MAAA,OAAOE,IAAI,CAACC,KAAK,CAACH,SAAS,CAAC,CAAA;AAC9B,KAAA;AACA,IAAA,OAAOI,SAAS,CAAA;AAClB,GAAC,CAAC,MAAM;AACN,IAAA,OAAOA,SAAS,CAAA;AAClB,GAAA;AACF,CAAC,CAAA;AAEc,SAASC,eAAe,CACrCN,GAAW,EACXO,YAA2B,EACiC;EAC5D,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,KAAK,CAACC,QAAQ,EAAK,CAAA;EAE7CD,KAAK,CAACE,SAAS,CAAC,MAAM;AACpB,IAAA,MAAMC,YAAY,GAAGd,OAAO,CAACC,GAAG,CAAkB,CAAA;IAElD,IAAI,OAAOa,YAAY,KAAK,WAAW,IAAIA,YAAY,KAAK,IAAI,EAAE;MAChEJ,QAAQ,CACN,OAAOF,YAAY,KAAK,UAAU,GAAGA,YAAY,EAAE,GAAGA,YAAY,CACnE,CAAA;AACH,KAAC,MAAM;MACLE,QAAQ,CAACI,YAAY,CAAC,CAAA;AACxB,KAAA;AACF,GAAC,EAAE,CAACN,YAAY,EAAEP,GAAG,CAAC,CAAC,CAAA;AAEvB,EAAA,MAAMc,MAAM,GAAGJ,KAAK,CAACK,WAAW,CAC7BC,OAAY,IAAK;IAChBP,QAAQ,CAAEQ,GAAG,IAAK;MAChB,IAAIC,MAAM,GAAGF,OAAO,CAAA;AAEpB,MAAA,IAAI,OAAOA,OAAO,IAAI,UAAU,EAAE;AAChCE,QAAAA,MAAM,GAAGF,OAAO,CAACC,GAAG,CAAC,CAAA;AACvB,OAAA;MACA,IAAI;QACFf,YAAY,CAACiB,OAAO,CAACnB,GAAG,EAAEG,IAAI,CAACiB,SAAS,CAACF,MAAM,CAAC,CAAC,CAAA;OAClD,CAAC,MAAM,EAAC;AAET,MAAA,OAAOA,MAAM,CAAA;AACf,KAAC,CAAC,CAAA;AACJ,GAAC,EACD,CAAClB,GAAG,CAAC,CACN,CAAA;AAED,EAAA,OAAO,CAACQ,KAAK,EAAEM,MAAM,CAAC,CAAA;AACxB;;;;"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
function useMediaQuery(query) {
|
|
4
|
-
// Keep track of the preference in state, start with the current match
|
|
5
|
-
const [isMatch, setIsMatch] = React.useState(() => {
|
|
6
|
-
if (typeof window !== 'undefined') {
|
|
7
|
-
return window.matchMedia(query).matches;
|
|
8
|
-
}
|
|
9
|
-
return;
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
// Watch for changes
|
|
13
|
-
React.useEffect(() => {
|
|
14
|
-
if (typeof window !== 'undefined') {
|
|
15
|
-
// Create a matcher
|
|
16
|
-
const matcher = window.matchMedia(query);
|
|
17
|
-
|
|
18
|
-
// Create our handler
|
|
19
|
-
const onChange = ({
|
|
20
|
-
matches
|
|
21
|
-
}) => setIsMatch(matches);
|
|
22
|
-
|
|
23
|
-
// Listen for changes
|
|
24
|
-
matcher.addListener(onChange);
|
|
25
|
-
return () => {
|
|
26
|
-
// Stop listening for changes
|
|
27
|
-
matcher.removeListener(onChange);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return;
|
|
31
|
-
}, [isMatch, query, setIsMatch]);
|
|
32
|
-
return isMatch;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export { useMediaQuery as default };
|
|
36
|
-
//# sourceMappingURL=useMediaQuery.esm.js.map
|