@upstash/react-redis-browser 0.1.11-canary-2 → 0.2.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/README.md +28 -13
- package/dist/index.css +49 -52
- package/dist/index.d.mts +21 -2
- package/dist/index.d.ts +21 -2
- package/dist/index.js +407 -241
- package/dist/index.mjs +427 -261
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Redis Browser for Upstash Redis - [Preview](https://react-redis-browser.vercel.app/)
|
|
2
2
|
`@upstash/react-redis-browser` is a React component that provides a UI for browsing and editing data in your Upstash Redis instances.
|
|
3
3
|
|
|
4
|
-
<img src="
|
|
4
|
+
<img src="https://github.com/user-attachments/assets/1b714616-310b-4250-9f92-cc28ed9881cd" width="640px" />
|
|
5
5
|
|
|
6
6
|
### Install
|
|
7
7
|
|
|
@@ -19,19 +19,34 @@ Here's a basic example of how to use the component:
|
|
|
19
19
|
import { RedisBrowser } from "@upstash/react-redis-browser"
|
|
20
20
|
import "@upstash/react-redis-browser/dist/index.css"
|
|
21
21
|
|
|
22
|
-
export default function
|
|
22
|
+
export default function Page() {
|
|
23
23
|
return (
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</main>
|
|
24
|
+
<RedisBrowser
|
|
25
|
+
url={UPSTASH_REDIS_REST_URL}
|
|
26
|
+
token={UPSTASH_REDIS_REST_TOKEN}
|
|
27
|
+
/>
|
|
29
28
|
)
|
|
30
29
|
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Persistance
|
|
33
|
+
|
|
34
|
+
The state of the databrowser can be persisted using the `storage` property.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
import { RedisBrowser } from "@upstash/react-redis-browser"
|
|
38
|
+
import "@upstash/react-redis-browser/dist/index.css"
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
export default function Page() {
|
|
41
|
+
return (
|
|
42
|
+
<RedisBrowser
|
|
43
|
+
url={UPSTASH_REDIS_REST_URL}
|
|
44
|
+
token={UPSTASH_REDIS_REST_TOKEN}
|
|
45
|
+
storage={{
|
|
46
|
+
get: () => localStorage.getItem("databrowser") || "",
|
|
47
|
+
set: (value) => localStorage.setItem("databrowser", value),
|
|
48
|
+
}}
|
|
49
|
+
/>
|
|
50
|
+
)
|
|
37
51
|
}
|
|
52
|
+
```
|
package/dist/index.css
CHANGED
|
@@ -447,6 +447,10 @@
|
|
|
447
447
|
margin-left: -0.25rem;
|
|
448
448
|
margin-right: -0.25rem;
|
|
449
449
|
}
|
|
450
|
+
.ups-db .mx-auto {
|
|
451
|
+
margin-left: auto;
|
|
452
|
+
margin-right: auto;
|
|
453
|
+
}
|
|
450
454
|
.ups-db .my-1 {
|
|
451
455
|
margin-top: 0.25rem;
|
|
452
456
|
margin-bottom: 0.25rem;
|
|
@@ -457,6 +461,9 @@
|
|
|
457
461
|
.ups-db .mb-3 {
|
|
458
462
|
margin-bottom: 0.75rem;
|
|
459
463
|
}
|
|
464
|
+
.ups-db .mb-4 {
|
|
465
|
+
margin-bottom: 1rem;
|
|
466
|
+
}
|
|
460
467
|
.ups-db .ml-1 {
|
|
461
468
|
margin-left: 0.25rem;
|
|
462
469
|
}
|
|
@@ -484,6 +491,9 @@
|
|
|
484
491
|
.ups-db .mt-6 {
|
|
485
492
|
margin-top: 1.5rem;
|
|
486
493
|
}
|
|
494
|
+
.ups-db .mt-\[150px\] {
|
|
495
|
+
margin-top: 150px;
|
|
496
|
+
}
|
|
487
497
|
.ups-db .mt-\[1px\] {
|
|
488
498
|
margin-top: 1px;
|
|
489
499
|
}
|
|
@@ -573,18 +583,12 @@
|
|
|
573
583
|
.ups-db .min-h-10 {
|
|
574
584
|
min-height: 2.5rem;
|
|
575
585
|
}
|
|
576
|
-
.ups-db .min-h-\[60px\] {
|
|
577
|
-
min-height: 60px;
|
|
578
|
-
}
|
|
579
586
|
.ups-db .\!w-auto {
|
|
580
587
|
width: auto !important;
|
|
581
588
|
}
|
|
582
589
|
.ups-db .w-0 {
|
|
583
590
|
width: 0px;
|
|
584
591
|
}
|
|
585
|
-
.ups-db .w-1\.5 {
|
|
586
|
-
width: 0.375rem;
|
|
587
|
-
}
|
|
588
592
|
.ups-db .w-10 {
|
|
589
593
|
width: 2.5rem;
|
|
590
594
|
}
|
|
@@ -594,6 +598,9 @@
|
|
|
594
598
|
.ups-db .w-24 {
|
|
595
599
|
width: 6rem;
|
|
596
600
|
}
|
|
601
|
+
.ups-db .w-3 {
|
|
602
|
+
width: 0.75rem;
|
|
603
|
+
}
|
|
597
604
|
.ups-db .w-3\.5 {
|
|
598
605
|
width: 0.875rem;
|
|
599
606
|
}
|
|
@@ -666,9 +673,6 @@
|
|
|
666
673
|
.ups-db .grow {
|
|
667
674
|
flex-grow: 1;
|
|
668
675
|
}
|
|
669
|
-
.ups-db .caption-bottom {
|
|
670
|
-
caption-side: bottom;
|
|
671
|
-
}
|
|
672
676
|
.ups-db .origin-\[--radix-dropdown-menu-content-transform-origin\] {
|
|
673
677
|
transform-origin: var(--radix-dropdown-menu-content-transform-origin);
|
|
674
678
|
}
|
|
@@ -790,9 +794,6 @@
|
|
|
790
794
|
border-top-width: calc(1px * calc(1 - var(--tw-divide-y-reverse)));
|
|
791
795
|
border-bottom-width: calc(1px * var(--tw-divide-y-reverse));
|
|
792
796
|
}
|
|
793
|
-
.ups-db .overflow-auto {
|
|
794
|
-
overflow: auto;
|
|
795
|
-
}
|
|
796
797
|
.ups-db .overflow-hidden {
|
|
797
798
|
overflow: hidden;
|
|
798
799
|
}
|
|
@@ -898,6 +899,10 @@
|
|
|
898
899
|
--tw-border-opacity: 1;
|
|
899
900
|
border-color: rgb(192 132 252 / var(--tw-border-opacity));
|
|
900
901
|
}
|
|
902
|
+
.ups-db .border-red-400 {
|
|
903
|
+
--tw-border-opacity: 1;
|
|
904
|
+
border-color: rgb(248 113 113 / var(--tw-border-opacity));
|
|
905
|
+
}
|
|
901
906
|
.ups-db .border-red-500 {
|
|
902
907
|
--tw-border-opacity: 1;
|
|
903
908
|
border-color: rgb(239 68 68 / var(--tw-border-opacity));
|
|
@@ -995,6 +1000,10 @@
|
|
|
995
1000
|
--tw-bg-opacity: 1;
|
|
996
1001
|
background-color: rgb(233 213 255 / var(--tw-bg-opacity));
|
|
997
1002
|
}
|
|
1003
|
+
.ups-db .bg-red-50 {
|
|
1004
|
+
--tw-bg-opacity: 1;
|
|
1005
|
+
background-color: rgb(254 242 242 / var(--tw-bg-opacity));
|
|
1006
|
+
}
|
|
998
1007
|
.ups-db .bg-red-500 {
|
|
999
1008
|
--tw-bg-opacity: 1;
|
|
1000
1009
|
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
|
|
@@ -1082,6 +1091,10 @@
|
|
|
1082
1091
|
padding-top: 0.5rem;
|
|
1083
1092
|
padding-bottom: 0.5rem;
|
|
1084
1093
|
}
|
|
1094
|
+
.ups-db .py-3 {
|
|
1095
|
+
padding-top: 0.75rem;
|
|
1096
|
+
padding-bottom: 0.75rem;
|
|
1097
|
+
}
|
|
1085
1098
|
.ups-db .py-6 {
|
|
1086
1099
|
padding-top: 1.5rem;
|
|
1087
1100
|
padding-bottom: 1.5rem;
|
|
@@ -1129,9 +1142,6 @@
|
|
|
1129
1142
|
.ups-db .text-right {
|
|
1130
1143
|
text-align: right;
|
|
1131
1144
|
}
|
|
1132
|
-
.ups-db .align-middle {
|
|
1133
|
-
vertical-align: middle;
|
|
1134
|
-
}
|
|
1135
1145
|
.ups-db .text-\[13px\] {
|
|
1136
1146
|
font-size: 13px;
|
|
1137
1147
|
}
|
|
@@ -1147,6 +1157,10 @@
|
|
|
1147
1157
|
font-size: 0.875rem;
|
|
1148
1158
|
line-height: 1.25rem;
|
|
1149
1159
|
}
|
|
1160
|
+
.ups-db .text-xl {
|
|
1161
|
+
font-size: 1.25rem;
|
|
1162
|
+
line-height: 1.75rem;
|
|
1163
|
+
}
|
|
1150
1164
|
.ups-db .text-xs {
|
|
1151
1165
|
font-size: 0.75rem;
|
|
1152
1166
|
line-height: 1rem;
|
|
@@ -1262,6 +1276,10 @@
|
|
|
1262
1276
|
--tw-text-opacity: 1;
|
|
1263
1277
|
color: rgb(220 38 38 / var(--tw-text-opacity));
|
|
1264
1278
|
}
|
|
1279
|
+
.ups-db .text-red-700 {
|
|
1280
|
+
--tw-text-opacity: 1;
|
|
1281
|
+
color: rgb(185 28 28 / var(--tw-text-opacity));
|
|
1282
|
+
}
|
|
1265
1283
|
.ups-db .text-sky-800 {
|
|
1266
1284
|
--tw-text-opacity: 1;
|
|
1267
1285
|
color: rgb(7 89 133 / var(--tw-text-opacity));
|
|
@@ -1485,9 +1503,6 @@
|
|
|
1485
1503
|
--tw-bg-opacity: 1;
|
|
1486
1504
|
background-color: rgb(244 244 245 / var(--tw-bg-opacity));
|
|
1487
1505
|
}
|
|
1488
|
-
.ups-db .hover\:bg-zinc-100\/50:hover {
|
|
1489
|
-
background-color: rgb(244 244 245 / 0.5);
|
|
1490
|
-
}
|
|
1491
1506
|
.ups-db .hover\:bg-zinc-50:hover {
|
|
1492
1507
|
--tw-bg-opacity: 1;
|
|
1493
1508
|
background-color: rgb(250 250 250 / var(--tw-bg-opacity));
|
|
@@ -1518,10 +1533,18 @@
|
|
|
1518
1533
|
--tw-bg-opacity: 1;
|
|
1519
1534
|
background-color: rgb(245 245 245 / var(--tw-bg-opacity));
|
|
1520
1535
|
}
|
|
1536
|
+
.ups-db .focus\:bg-red-500:focus {
|
|
1537
|
+
--tw-bg-opacity: 1;
|
|
1538
|
+
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
|
|
1539
|
+
}
|
|
1521
1540
|
.ups-db .focus\:text-neutral-900:focus {
|
|
1522
1541
|
--tw-text-opacity: 1;
|
|
1523
1542
|
color: rgb(23 23 23 / var(--tw-text-opacity));
|
|
1524
1543
|
}
|
|
1544
|
+
.ups-db .focus\:text-white:focus {
|
|
1545
|
+
--tw-text-opacity: 1;
|
|
1546
|
+
color: rgb(255 255 255 / var(--tw-text-opacity));
|
|
1547
|
+
}
|
|
1525
1548
|
.ups-db .focus\:opacity-100:focus {
|
|
1526
1549
|
opacity: 1;
|
|
1527
1550
|
}
|
|
@@ -1568,14 +1591,6 @@
|
|
|
1568
1591
|
var(--tw-ring-shadow),
|
|
1569
1592
|
var(--tw-shadow, 0 0 #0000);
|
|
1570
1593
|
}
|
|
1571
|
-
.ups-db .focus-visible\:ring-1:focus-visible {
|
|
1572
|
-
--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
|
|
1573
|
-
--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
|
|
1574
|
-
box-shadow:
|
|
1575
|
-
var(--tw-ring-offset-shadow),
|
|
1576
|
-
var(--tw-ring-shadow),
|
|
1577
|
-
var(--tw-shadow, 0 0 #0000);
|
|
1578
|
-
}
|
|
1579
1594
|
.ups-db .focus-visible\:ring-zinc-950:focus-visible {
|
|
1580
1595
|
--tw-ring-opacity: 1;
|
|
1581
1596
|
--tw-ring-color: rgb(9 9 11 / var(--tw-ring-opacity));
|
|
@@ -1595,9 +1610,9 @@
|
|
|
1595
1610
|
.ups-db .group\/editor:hover .group-hover\/editor\:flex {
|
|
1596
1611
|
display: flex;
|
|
1597
1612
|
}
|
|
1598
|
-
.ups-db .group:hover .group-hover\:border-zinc-
|
|
1613
|
+
.ups-db .group:hover .group-hover\:border-zinc-500 {
|
|
1599
1614
|
--tw-border-opacity: 1;
|
|
1600
|
-
border-color: rgb(
|
|
1615
|
+
border-color: rgb(113 113 122 / var(--tw-border-opacity));
|
|
1601
1616
|
}
|
|
1602
1617
|
.ups-db .group:hover .group-hover\:opacity-100 {
|
|
1603
1618
|
opacity: 1;
|
|
@@ -1635,6 +1650,12 @@
|
|
|
1635
1650
|
.ups-db .group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus {
|
|
1636
1651
|
--tw-ring-offset-color: #dc2626;
|
|
1637
1652
|
}
|
|
1653
|
+
.ups-db .peer:disabled ~ .peer-disabled\:cursor-not-allowed {
|
|
1654
|
+
cursor: not-allowed;
|
|
1655
|
+
}
|
|
1656
|
+
.ups-db .peer:disabled ~ .peer-disabled\:opacity-70 {
|
|
1657
|
+
opacity: 0.7;
|
|
1658
|
+
}
|
|
1638
1659
|
.ups-db .data-\[disabled\]\:pointer-events-none[data-disabled] {
|
|
1639
1660
|
pointer-events: none;
|
|
1640
1661
|
}
|
|
@@ -1674,10 +1695,6 @@
|
|
|
1674
1695
|
--tw-bg-opacity: 1;
|
|
1675
1696
|
background-color: rgb(244 244 245 / var(--tw-bg-opacity));
|
|
1676
1697
|
}
|
|
1677
|
-
.ups-db .data-\[state\=selected\]\:bg-zinc-100[data-state=selected] {
|
|
1678
|
-
--tw-bg-opacity: 1;
|
|
1679
|
-
background-color: rgb(244 244 245 / var(--tw-bg-opacity));
|
|
1680
|
-
}
|
|
1681
1698
|
.ups-db .data-\[state\=open\]\:text-neutral-900[data-state=open] {
|
|
1682
1699
|
--tw-text-opacity: 1;
|
|
1683
1700
|
color: rgb(23 23 23 / var(--tw-text-opacity));
|
|
@@ -1877,9 +1894,6 @@
|
|
|
1877
1894
|
--tw-bg-opacity: 1;
|
|
1878
1895
|
background-color: rgb(39 39 42 / var(--tw-bg-opacity));
|
|
1879
1896
|
}
|
|
1880
|
-
.ups-db .dark\:hover\:bg-zinc-800\/50:hover:is(.dark *) {
|
|
1881
|
-
background-color: rgb(39 39 42 / 0.5);
|
|
1882
|
-
}
|
|
1883
1897
|
.ups-db .dark\:hover\:text-gray-100:hover:is(.dark *) {
|
|
1884
1898
|
--tw-text-opacity: 1;
|
|
1885
1899
|
color: rgb(243 244 246 / var(--tw-text-opacity));
|
|
@@ -1934,10 +1948,6 @@
|
|
|
1934
1948
|
--tw-bg-opacity: 1;
|
|
1935
1949
|
background-color: rgb(39 39 42 / var(--tw-bg-opacity));
|
|
1936
1950
|
}
|
|
1937
|
-
.ups-db .dark\:data-\[state\=selected\]\:bg-zinc-800[data-state=selected]:is(.dark *) {
|
|
1938
|
-
--tw-bg-opacity: 1;
|
|
1939
|
-
background-color: rgb(39 39 42 / var(--tw-bg-opacity));
|
|
1940
|
-
}
|
|
1941
1951
|
.ups-db .dark\:data-\[state\=open\]\:text-neutral-50[data-state=open]:is(.dark *) {
|
|
1942
1952
|
--tw-text-opacity: 1;
|
|
1943
1953
|
color: rgb(250 250 250 / var(--tw-text-opacity));
|
|
@@ -1989,13 +1999,6 @@
|
|
|
1989
1999
|
.ups-db .\[\&\:\:-webkit-scrollbar\]\:hidden::-webkit-scrollbar {
|
|
1990
2000
|
display: none;
|
|
1991
2001
|
}
|
|
1992
|
-
.ups-db .\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]) {
|
|
1993
|
-
padding-right: 0px;
|
|
1994
|
-
}
|
|
1995
|
-
.ups-db .\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\] > [role=checkbox] {
|
|
1996
|
-
--tw-translate-y: 2px;
|
|
1997
|
-
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
1998
|
-
}
|
|
1999
2002
|
.ups-db .\[\&\>div\]\:\!block > div {
|
|
2000
2003
|
display: block !important;
|
|
2001
2004
|
}
|
|
@@ -2016,9 +2019,3 @@
|
|
|
2016
2019
|
.ups-db .\[\&_svg\]\:shrink-0 svg {
|
|
2017
2020
|
flex-shrink: 0;
|
|
2018
2021
|
}
|
|
2019
|
-
.ups-db .\[\&_tr\:last-child\]\:border-0 tr:last-child {
|
|
2020
|
-
border-width: 0px;
|
|
2021
|
-
}
|
|
2022
|
-
.ups-db .\[\&_tr\]\:border-b tr {
|
|
2023
|
-
border-bottom-width: 1px;
|
|
2024
|
-
}
|
package/dist/index.d.mts
CHANGED
|
@@ -5,8 +5,27 @@ type RedisCredentials = {
|
|
|
5
5
|
token?: string;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Persistence storage interface for the Databrowser.
|
|
10
|
+
*/
|
|
11
|
+
type RedisBrowserStorage = {
|
|
12
|
+
set: (value: string) => void;
|
|
13
|
+
get: () => string | null;
|
|
14
|
+
};
|
|
15
|
+
declare const RedisBrowser: ({ token, url, hideTabs, storage, }: RedisCredentials & {
|
|
9
16
|
hideTabs?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Persistence storage for the Databrowser.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <RedisBrowser storage={{
|
|
23
|
+
* set: (value: string) => localStorage.setItem("redis-browser-data", value),
|
|
24
|
+
* get: () => localStorage.getItem("redis-browser-data") || "",
|
|
25
|
+
* }} />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
storage?: RedisBrowserStorage;
|
|
10
29
|
}) => react_jsx_runtime.JSX.Element;
|
|
11
30
|
|
|
12
|
-
export { RedisBrowser };
|
|
31
|
+
export { RedisBrowser, type RedisBrowserStorage };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,27 @@ type RedisCredentials = {
|
|
|
5
5
|
token?: string;
|
|
6
6
|
};
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Persistence storage interface for the Databrowser.
|
|
10
|
+
*/
|
|
11
|
+
type RedisBrowserStorage = {
|
|
12
|
+
set: (value: string) => void;
|
|
13
|
+
get: () => string | null;
|
|
14
|
+
};
|
|
15
|
+
declare const RedisBrowser: ({ token, url, hideTabs, storage, }: RedisCredentials & {
|
|
9
16
|
hideTabs?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Persistence storage for the Databrowser.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <RedisBrowser storage={{
|
|
23
|
+
* set: (value: string) => localStorage.setItem("redis-browser-data", value),
|
|
24
|
+
* get: () => localStorage.getItem("redis-browser-data") || "",
|
|
25
|
+
* }} />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
storage?: RedisBrowserStorage;
|
|
10
29
|
}) => react_jsx_runtime.JSX.Element;
|
|
11
30
|
|
|
12
|
-
export { RedisBrowser };
|
|
31
|
+
export { RedisBrowser, type RedisBrowserStorage };
|