@instantdb/components 1.0.37 → 1.0.38
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/edit-namespace-dialog.d.ts +5 -2
- package/dist/components/explorer/edit-namespace-dialog.d.ts.map +1 -1
- package/dist/components/explorer/explorer-layout.d.ts.map +1 -1
- package/dist/components/explorer/index.d.ts +82 -1
- package/dist/components/explorer/index.d.ts.map +1 -1
- package/dist/components/explorer/inner-explorer.d.ts.map +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2207 -2168
- package/package.json +6 -6
- package/src/components/explorer/edit-namespace-dialog.tsx +177 -176
- package/src/components/explorer/explorer-layout.tsx +29 -16
- package/src/components/explorer/index.tsx +48 -4
- package/src/components/explorer/inner-explorer.tsx +28 -14
- package/src/index.tsx +5 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @instantdb/components@1.0.
|
|
2
|
+
> @instantdb/components@1.0.38 build /home/runner/work/instant/instant/client/packages/components
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v5.4.14 [32mbuilding for production...[36m[39m
|
|
@@ -12,9 +12,9 @@ rendering chunks...
|
|
|
12
12
|
[36m[unplugin:dts][32m Start generate declaration files...[39m
|
|
13
13
|
computing gzip size...
|
|
14
14
|
[2mdist/[22m[35mstyle.css [39m[1m[2m 60.47 kB[22m[1m[22m[2m │ gzip: 10.55 kB[22m
|
|
15
|
-
[2mdist/[22m[36mindex.js [39m[1m[
|
|
16
|
-
[32m[36m[unplugin:dts][32m Declaration files built in
|
|
15
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m381.64 kB[22m[1m[22m[2m │ gzip: 93.81 kB[22m
|
|
16
|
+
[32m[36m[unplugin:dts][32m Declaration files built in 8799ms.
|
|
17
17
|
[39m
|
|
18
18
|
[2mdist/[22m[35mstyle.css [39m[1m[2m 60.47 kB[22m[1m[22m[2m │ gzip: 10.55 kB[22m
|
|
19
|
-
[2mdist/[22m[36mindex.cjs [39m[1m[
|
|
20
|
-
[32m✓ built in 9.
|
|
19
|
+
[2mdist/[22m[36mindex.cjs [39m[1m[2m263.36 kB[22m[1m[22m[2m │ gzip: 74.35 kB[22m
|
|
20
|
+
[32m✓ built in 9.80s[39m
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { InstantReactWebDatabase } from '@instantdb/react';
|
|
3
3
|
import { SchemaNamespace } from '../../types';
|
|
4
|
-
|
|
4
|
+
import { EditSchemaScreen } from './index';
|
|
5
|
+
export declare function EditNamespaceDialog({ db, namespace, namespaces, onClose, isSystemCatalogNs, screen, onScreenChange, }: {
|
|
5
6
|
db: InstantReactWebDatabase<any>;
|
|
6
7
|
namespace: SchemaNamespace;
|
|
7
8
|
namespaces: SchemaNamespace[];
|
|
@@ -10,5 +11,7 @@ export declare function EditNamespaceDialog({ db, namespace, namespaces, onClose
|
|
|
10
11
|
}) => void;
|
|
11
12
|
readOnly: boolean;
|
|
12
13
|
isSystemCatalogNs: boolean;
|
|
13
|
-
|
|
14
|
+
screen: EditSchemaScreen;
|
|
15
|
+
onScreenChange: (screen: EditSchemaScreen) => void;
|
|
16
|
+
}): React.JSX.Element | null;
|
|
14
17
|
//# sourceMappingURL=edit-namespace-dialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-namespace-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/explorer/edit-namespace-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAsC3D,OAAO,EAML,eAAe,EAChB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"edit-namespace-dialog.d.ts","sourceRoot":"","sources":["../../../src/components/explorer/edit-namespace-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAsC3D,OAAO,EAML,eAAe,EAChB,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,gBAAgB,EAAsC,MAAM,SAAS,CAAC;AAW/E,wBAAgB,mBAAmB,CAAC,EAClC,EAAE,EACF,SAAS,EACT,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,cAAc,GACf,EAAE;IACD,EAAE,EAAE,uBAAuB,CAAC,GAAG,CAAC,CAAC;IACjC,SAAS,EAAE,eAAe,CAAC;IAC3B,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE;QAAE,EAAE,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,cAAc,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACpD,4BA8NA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explorer-layout.d.ts","sourceRoot":"","sources":["../../../src/components/explorer/explorer-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAM7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAYrD,eAAO,MAAM,cAAc,GAAI,4BAI5B;IACD,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,EAAE,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,
|
|
1
|
+
{"version":3,"file":"explorer-layout.d.ts","sourceRoot":"","sources":["../../../src/components/explorer/explorer-layout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAM7C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAYrD,eAAO,MAAM,cAAc,GAAI,4BAI5B;IACD,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,EAAE,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;CACf,sBAuKA,CAAC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { HasDefault, WithDefaults, WithOptional } from '../../types';
|
|
3
|
+
export type SetExplorerStateOptions = {
|
|
4
|
+
history?: 'push' | 'replace';
|
|
5
|
+
};
|
|
6
|
+
export type SetExplorerState = (action: React.SetStateAction<ExplorerNav | null>, options?: SetExplorerStateOptions) => void;
|
|
3
7
|
interface ExplorerProps {
|
|
4
8
|
appId: string;
|
|
5
9
|
adminToken: string;
|
|
@@ -8,7 +12,7 @@ interface ExplorerProps {
|
|
|
8
12
|
darkMode: HasDefault<boolean>;
|
|
9
13
|
className?: string;
|
|
10
14
|
explorerState: HasDefault<ExplorerNav | null | undefined>;
|
|
11
|
-
setExplorerState: HasDefault<
|
|
15
|
+
setExplorerState: HasDefault<SetExplorerState>;
|
|
12
16
|
useShadowDOM: HasDefault<boolean>;
|
|
13
17
|
}
|
|
14
18
|
export declare const useExplorerProps: () => WithDefaults<ExplorerProps>;
|
|
@@ -21,6 +25,30 @@ export declare const useExplorerState: () => {
|
|
|
21
25
|
filters?: [string, SearchFilterOp, any][] | undefined;
|
|
22
26
|
limit?: number | undefined;
|
|
23
27
|
page?: number | undefined;
|
|
28
|
+
dialog?: {
|
|
29
|
+
type: "add-row";
|
|
30
|
+
} | {
|
|
31
|
+
type: "edit-row";
|
|
32
|
+
rowId: string;
|
|
33
|
+
} | {
|
|
34
|
+
type: "edit-schema";
|
|
35
|
+
screen: {
|
|
36
|
+
kind: "main";
|
|
37
|
+
} | {
|
|
38
|
+
kind: "rename";
|
|
39
|
+
} | {
|
|
40
|
+
kind: "add-attr";
|
|
41
|
+
attrKind: "data" | "link";
|
|
42
|
+
} | {
|
|
43
|
+
kind: "edit-attr";
|
|
44
|
+
attrId: string;
|
|
45
|
+
isForward: boolean;
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
type: "new-namespace";
|
|
49
|
+
} | {
|
|
50
|
+
type: "recently-deleted-ns";
|
|
51
|
+
} | null | undefined;
|
|
24
52
|
};
|
|
25
53
|
history: {
|
|
26
54
|
push: (filter: React.SetStateAction<ExplorerNav>, replace?: boolean) => void;
|
|
@@ -28,8 +56,60 @@ export declare const useExplorerState: () => {
|
|
|
28
56
|
items: ExplorerNav[];
|
|
29
57
|
};
|
|
30
58
|
};
|
|
59
|
+
export declare const useExplorerDialog: () => {
|
|
60
|
+
dialog: {
|
|
61
|
+
type: "add-row";
|
|
62
|
+
} | {
|
|
63
|
+
type: "edit-row";
|
|
64
|
+
rowId: string;
|
|
65
|
+
} | {
|
|
66
|
+
type: "edit-schema";
|
|
67
|
+
screen: {
|
|
68
|
+
kind: "main";
|
|
69
|
+
} | {
|
|
70
|
+
kind: "rename";
|
|
71
|
+
} | {
|
|
72
|
+
kind: "add-attr";
|
|
73
|
+
attrKind: "data" | "link";
|
|
74
|
+
} | {
|
|
75
|
+
kind: "edit-attr";
|
|
76
|
+
attrId: string;
|
|
77
|
+
isForward: boolean;
|
|
78
|
+
};
|
|
79
|
+
} | {
|
|
80
|
+
type: "new-namespace";
|
|
81
|
+
} | {
|
|
82
|
+
type: "recently-deleted-ns";
|
|
83
|
+
} | null;
|
|
84
|
+
setDialog: (d: ExplorerDialog | null, options?: SetExplorerStateOptions) => void;
|
|
85
|
+
};
|
|
31
86
|
export type SearchFilterOp = '=' | '$ilike' | '$like' | '$gt' | '$lt' | '$isNull';
|
|
32
87
|
export type SearchFilter = [string, SearchFilterOp, any];
|
|
88
|
+
export type EditSchemaScreen = {
|
|
89
|
+
kind: 'main';
|
|
90
|
+
} | {
|
|
91
|
+
kind: 'rename';
|
|
92
|
+
} | {
|
|
93
|
+
kind: 'add-attr';
|
|
94
|
+
attrKind: 'data' | 'link';
|
|
95
|
+
} | {
|
|
96
|
+
kind: 'edit-attr';
|
|
97
|
+
attrId: string;
|
|
98
|
+
isForward: boolean;
|
|
99
|
+
};
|
|
100
|
+
export type ExplorerDialog = {
|
|
101
|
+
type: 'add-row';
|
|
102
|
+
} | {
|
|
103
|
+
type: 'edit-row';
|
|
104
|
+
rowId: string;
|
|
105
|
+
} | {
|
|
106
|
+
type: 'edit-schema';
|
|
107
|
+
screen: EditSchemaScreen;
|
|
108
|
+
} | {
|
|
109
|
+
type: 'new-namespace';
|
|
110
|
+
} | {
|
|
111
|
+
type: 'recently-deleted-ns';
|
|
112
|
+
};
|
|
33
113
|
export interface ExplorerNav {
|
|
34
114
|
namespace: string;
|
|
35
115
|
where?: [string, any];
|
|
@@ -38,6 +118,7 @@ export interface ExplorerNav {
|
|
|
38
118
|
filters?: SearchFilter[];
|
|
39
119
|
limit?: number;
|
|
40
120
|
page?: number;
|
|
121
|
+
dialog?: ExplorerDialog | null;
|
|
41
122
|
}
|
|
42
123
|
export declare const Explorer: (_props: WithOptional<ExplorerProps>) => React.JSX.Element;
|
|
43
124
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/explorer/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAOzE,UAAU,aAAa;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,UAA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