@instantdb/components 0.22.89-experimental.drewh-use-env-for-explorer-demo.20280152775.1 → 0.22.89-experimental.drewh-ssr.20280366757.1
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/.turbo/turbo-build.log +5 -5
- package/dist/components/explorer/index.d.ts.map +1 -1
- package/dist/components/explorer/inner-explorer.d.ts.map +1 -1
- package/dist/components/explorer/view-settings.d.ts.map +1 -1
- package/dist/components/ui.d.ts +3 -2
- package/dist/components/ui.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +812 -796
- package/package.json +9 -8
- package/src/components/explorer/explorer-layout.tsx +2 -2
- package/src/components/explorer/index.tsx +8 -0
- package/src/components/explorer/inner-explorer.tsx +4 -0
- package/src/components/explorer/view-settings.tsx +1 -0
- package/src/components/ui.tsx +9 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instantdb/components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.22.89-experimental.drewh-
|
|
4
|
+
"version": "0.22.89-experimental.drewh-ssr.20280366757.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Instant's UI components",
|
|
7
7
|
"homepage": "https://github.com/instantdb/instant/tree/main/client/packages/components",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"vitest": "^1.6.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"react": "^18.3.1",
|
|
58
|
-
"react-dom": "^18.3.1"
|
|
57
|
+
"react": "^18.3.1 || ^19.0.0",
|
|
58
|
+
"react-dom": "^18.3.1 || ^19.0.0"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@babel/parser": "^8.0.0-beta.0",
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
"@radix-ui/react-switch": "^1.2.6",
|
|
75
75
|
"@radix-ui/react-toggle-group": "^1.0.4",
|
|
76
76
|
"@radix-ui/react-tooltip": "^1.1.7",
|
|
77
|
+
"@radix-ui/react-visually-hidden": "^1.2.4",
|
|
77
78
|
"@tanstack/react-table": "^8.21.3",
|
|
78
79
|
"clsx": "^2.1.0",
|
|
79
80
|
"copy-to-clipboard": "^3.3.3",
|
|
@@ -92,11 +93,11 @@
|
|
|
92
93
|
"swr": "^2.2.4",
|
|
93
94
|
"tailwind-merge": "^2.2.1",
|
|
94
95
|
"uuid": "^11.1.0",
|
|
95
|
-
"@instantdb/
|
|
96
|
-
"@instantdb/
|
|
97
|
-
"@instantdb/react": "0.22.89-experimental.drewh-
|
|
98
|
-
"@instantdb/
|
|
99
|
-
"@instantdb/
|
|
96
|
+
"@instantdb/admin": "0.22.89-experimental.drewh-ssr.20280366757.1",
|
|
97
|
+
"@instantdb/core": "0.22.89-experimental.drewh-ssr.20280366757.1",
|
|
98
|
+
"@instantdb/react": "0.22.89-experimental.drewh-ssr.20280366757.1",
|
|
99
|
+
"@instantdb/platform": "0.22.89-experimental.drewh-ssr.20280366757.1",
|
|
100
|
+
"@instantdb/version": "0.22.89-experimental.drewh-ssr.20280366757.1"
|
|
100
101
|
},
|
|
101
102
|
"scripts": {
|
|
102
103
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -55,10 +55,10 @@ export const ExplorerLayout = ({
|
|
|
55
55
|
props.className,
|
|
56
56
|
)}
|
|
57
57
|
>
|
|
58
|
-
<Dialog {...recentlyDeletedNsDialog}>
|
|
58
|
+
<Dialog title="Recently Deleted Namespaces" {...recentlyDeletedNsDialog}>
|
|
59
59
|
<RecentlyDeletedNamespaces appId={props.appId} db={db} />
|
|
60
60
|
</Dialog>
|
|
61
|
-
<Dialog {...newNsDialog}>
|
|
61
|
+
<Dialog title="New Namespace" {...newNsDialog}>
|
|
62
62
|
<NewNamespaceDialog
|
|
63
63
|
db={db}
|
|
64
64
|
onClose={(p) => {
|
|
@@ -120,12 +120,20 @@ export const Explorer = (_props: WithOptional<ExplorerProps>) => {
|
|
|
120
120
|
const [_explorerState, _setExplorerState] = useState<ExplorerNav | null>(
|
|
121
121
|
null,
|
|
122
122
|
);
|
|
123
|
+
|
|
123
124
|
const props: WithDefaults<ExplorerProps> = fillPropsWithDefaults(
|
|
124
125
|
_props,
|
|
125
126
|
_explorerState,
|
|
126
127
|
_setExplorerState,
|
|
127
128
|
);
|
|
128
129
|
|
|
130
|
+
if (!props.adminToken) {
|
|
131
|
+
throw new Error('adminToken is required for explorer');
|
|
132
|
+
}
|
|
133
|
+
if (!props.appId) {
|
|
134
|
+
throw new Error('appId is required for explorer');
|
|
135
|
+
}
|
|
136
|
+
|
|
129
137
|
// inside the component avoid setting explorer state directly
|
|
130
138
|
// if change could be useful for history
|
|
131
139
|
const { explorerState, setExplorerState } = props;
|
|
@@ -830,6 +830,7 @@ export const InnerExplorer: React.FC<{
|
|
|
830
830
|
return (
|
|
831
831
|
<>
|
|
832
832
|
<Dialog
|
|
833
|
+
title="Delete Rows"
|
|
833
834
|
open={deleteDataConfirmationOpen}
|
|
834
835
|
onClose={() => setDeleteDataConfirmationOpen(false)}
|
|
835
836
|
>
|
|
@@ -900,6 +901,7 @@ export const InnerExplorer: React.FC<{
|
|
|
900
901
|
) : null}
|
|
901
902
|
</Dialog>
|
|
902
903
|
<Dialog
|
|
904
|
+
title="Edit Row"
|
|
903
905
|
open={addItemDialogOpen}
|
|
904
906
|
onClose={() => setAddItemDialogOpen(false)}
|
|
905
907
|
>
|
|
@@ -913,6 +915,7 @@ export const InnerExplorer: React.FC<{
|
|
|
913
915
|
) : null}
|
|
914
916
|
</Dialog>
|
|
915
917
|
<Dialog
|
|
918
|
+
title="Edit Row"
|
|
916
919
|
open={!!selectedEditableItem}
|
|
917
920
|
onClose={() => setEditableRowId(null)}
|
|
918
921
|
>
|
|
@@ -926,6 +929,7 @@ export const InnerExplorer: React.FC<{
|
|
|
926
929
|
) : null}
|
|
927
930
|
</Dialog>
|
|
928
931
|
<Dialog
|
|
932
|
+
title="Edit Namespace"
|
|
929
933
|
stopFocusPropagation={true}
|
|
930
934
|
open={Boolean(editNs)}
|
|
931
935
|
onClose={() => setEditNs(null)}
|
package/src/components/ui.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { Toaster, toast } from 'sonner';
|
|
3
|
+
import { VisuallyHidden } from '@radix-ui/react-visually-hidden';
|
|
3
4
|
import { Editor, Monaco, OnMount } from '@monaco-editor/react';
|
|
4
5
|
import type { ClassValue } from 'clsx';
|
|
5
6
|
import clsx from 'clsx';
|
|
@@ -635,6 +636,7 @@ function DialogContent({
|
|
|
635
636
|
className,
|
|
636
637
|
children,
|
|
637
638
|
showCloseButton = false,
|
|
639
|
+
title,
|
|
638
640
|
...props
|
|
639
641
|
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
|
|
640
642
|
showCloseButton?: boolean;
|
|
@@ -654,6 +656,9 @@ function DialogContent({
|
|
|
654
656
|
)}
|
|
655
657
|
{...props}
|
|
656
658
|
>
|
|
659
|
+
<VisuallyHidden>
|
|
660
|
+
<DialogTitle>{title}</DialogTitle>
|
|
661
|
+
</VisuallyHidden>
|
|
657
662
|
{children}
|
|
658
663
|
{showCloseButton && (
|
|
659
664
|
<DialogPrimitive.Close
|
|
@@ -677,11 +682,13 @@ export function Dialog({
|
|
|
677
682
|
children,
|
|
678
683
|
onClose,
|
|
679
684
|
className,
|
|
685
|
+
title,
|
|
680
686
|
stopFocusPropagation = false,
|
|
681
687
|
hideCloseButton = false,
|
|
682
688
|
}: {
|
|
683
689
|
open: boolean;
|
|
684
690
|
children: React.ReactNode;
|
|
691
|
+
title: string;
|
|
685
692
|
onClose: () => void;
|
|
686
693
|
className?: string;
|
|
687
694
|
stopFocusPropagation?: boolean;
|
|
@@ -697,6 +704,7 @@ export function Dialog({
|
|
|
697
704
|
open={open}
|
|
698
705
|
>
|
|
699
706
|
<DialogContent
|
|
707
|
+
title={title}
|
|
700
708
|
onFocusCapture={(e) => {
|
|
701
709
|
if (stopFocusPropagation) {
|
|
702
710
|
e.stopPropagation();
|
|
@@ -1533,6 +1541,7 @@ export function Fence({
|
|
|
1533
1541
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
1534
1542
|
import { rosePineDawnTheme } from './rosePineDawnTheme';
|
|
1535
1543
|
import { useShadowRoot, useShadowDarkMode } from './StyleMe';
|
|
1544
|
+
import { DialogTitle } from '@radix-ui/react-dialog';
|
|
1536
1545
|
function Switch({
|
|
1537
1546
|
className,
|
|
1538
1547
|
...props
|