@prisma/studio-core 0.0.0-dev.202505151603 → 0.0.0-dev.202505160133

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/dist/ui/index.css CHANGED
@@ -694,21 +694,36 @@ video {
694
694
  .ps-mb-1 {
695
695
  margin-bottom: 0.25rem;
696
696
  }
697
+ .ps-mb-4 {
698
+ margin-bottom: 1rem;
699
+ }
697
700
  .ps-ml-1 {
698
701
  margin-left: 0.25rem;
699
702
  }
703
+ .ps-ml-2 {
704
+ margin-left: 0.5rem;
705
+ }
700
706
  .ps-ml-6 {
701
707
  margin-left: 1.5rem;
702
708
  }
703
709
  .ps-ml-auto {
704
710
  margin-left: auto;
705
711
  }
712
+ .ps-mr-1 {
713
+ margin-right: 0.25rem;
714
+ }
715
+ .ps-mr-2 {
716
+ margin-right: 0.5rem;
717
+ }
706
718
  .ps-mt-0 {
707
719
  margin-top: 0px;
708
720
  }
709
721
  .ps-mt-1 {
710
722
  margin-top: 0.25rem;
711
723
  }
724
+ .ps-mt-2 {
725
+ margin-top: 0.5rem;
726
+ }
712
727
  .ps-mt-4 {
713
728
  margin-top: 1rem;
714
729
  }
@@ -802,6 +817,9 @@ video {
802
817
  .ps-h-px {
803
818
  height: 1px;
804
819
  }
820
+ .ps-max-h-10 {
821
+ max-height: 2.5rem;
822
+ }
805
823
  .ps-max-h-32 {
806
824
  max-height: 8rem;
807
825
  }
@@ -853,6 +871,9 @@ video {
853
871
  .ps-w-28 {
854
872
  width: 7rem;
855
873
  }
874
+ .ps-w-3 {
875
+ width: 0.75rem;
876
+ }
856
877
  .ps-w-3\.5 {
857
878
  width: 0.875rem;
858
879
  }
@@ -1147,6 +1168,9 @@ video {
1147
1168
  .ps-overflow-clip {
1148
1169
  overflow: clip;
1149
1170
  }
1171
+ .ps-overflow-x-auto {
1172
+ overflow-x: auto;
1173
+ }
1150
1174
  .ps-overflow-y-auto {
1151
1175
  overflow-y: auto;
1152
1176
  }
@@ -1167,6 +1191,9 @@ video {
1167
1191
  .ps-whitespace-nowrap {
1168
1192
  white-space: nowrap;
1169
1193
  }
1194
+ .ps-whitespace-pre-wrap {
1195
+ white-space: pre-wrap;
1196
+ }
1170
1197
  .ps-rounded-full {
1171
1198
  border-radius: 9999px;
1172
1199
  }
@@ -1182,6 +1209,9 @@ video {
1182
1209
  .ps-rounded-sm {
1183
1210
  border-radius: calc(var(--radius) - 4px);
1184
1211
  }
1212
+ .ps-rounded-xl {
1213
+ border-radius: 0.75rem;
1214
+ }
1185
1215
  .ps-rounded-b-lg {
1186
1216
  border-bottom-right-radius: var(--radius);
1187
1217
  border-bottom-left-radius: var(--radius);
@@ -1229,9 +1259,17 @@ video {
1229
1259
  .\!ps-border-\[hsl\(var\(--studio-border\)\)\] {
1230
1260
  border-color: hsl(var(--studio-border)) !important;
1231
1261
  }
1262
+ .ps-border-blue-200 {
1263
+ --tw-border-opacity: 1;
1264
+ border-color: rgb(191 219 254 / var(--tw-border-opacity, 1));
1265
+ }
1232
1266
  .ps-border-border {
1233
1267
  border-color: hsl(var(--border));
1234
1268
  }
1269
+ .ps-border-green-500 {
1270
+ --tw-border-opacity: 1;
1271
+ border-color: rgb(34 197 94 / var(--tw-border-opacity, 1));
1272
+ }
1235
1273
  .ps-border-input {
1236
1274
  border-color: hsl(var(--input));
1237
1275
  }
@@ -1242,6 +1280,14 @@ video {
1242
1280
  .ps-border-primary {
1243
1281
  border-color: hsl(var(--primary));
1244
1282
  }
1283
+ .ps-border-red-200 {
1284
+ --tw-border-opacity: 1;
1285
+ border-color: rgb(254 202 202 / var(--tw-border-opacity, 1));
1286
+ }
1287
+ .ps-border-red-500 {
1288
+ --tw-border-opacity: 1;
1289
+ border-color: rgb(239 68 68 / var(--tw-border-opacity, 1));
1290
+ }
1245
1291
  .ps-border-table-border {
1246
1292
  border-color: hsl(var(--table-border));
1247
1293
  }
@@ -1264,6 +1310,10 @@ video {
1264
1310
  .ps-bg-black\/80 {
1265
1311
  background-color: rgb(0 0 0 / 0.8);
1266
1312
  }
1313
+ .ps-bg-blue-50 {
1314
+ --tw-bg-opacity: 1;
1315
+ background-color: rgb(239 246 255 / var(--tw-bg-opacity, 1));
1316
+ }
1267
1317
  .ps-bg-border {
1268
1318
  background-color: hsl(var(--border));
1269
1319
  }
@@ -1303,6 +1353,10 @@ video {
1303
1353
  .ps-bg-primary {
1304
1354
  background-color: hsl(var(--primary));
1305
1355
  }
1356
+ .ps-bg-red-50 {
1357
+ --tw-bg-opacity: 1;
1358
+ background-color: rgb(254 242 242 / var(--tw-bg-opacity, 1));
1359
+ }
1306
1360
  .ps-bg-secondary {
1307
1361
  background-color: hsl(var(--secondary));
1308
1362
  }
@@ -1336,6 +1390,9 @@ video {
1336
1390
  .ps-p-2 {
1337
1391
  padding: 0.5rem;
1338
1392
  }
1393
+ .ps-p-3 {
1394
+ padding: 0.75rem;
1395
+ }
1339
1396
  .ps-p-4 {
1340
1397
  padding: 1rem;
1341
1398
  }
@@ -1434,6 +1491,9 @@ video {
1434
1491
  .ps-pr-\[var\(--studio-cell-spacing\)\] {
1435
1492
  padding-right: var(--studio-cell-spacing);
1436
1493
  }
1494
+ .ps-pt-0 {
1495
+ padding-top: 0px;
1496
+ }
1437
1497
  .ps-pt-3 {
1438
1498
  padding-top: 0.75rem;
1439
1499
  }
@@ -1532,6 +1592,10 @@ video {
1532
1592
  --tw-text-opacity: 1;
1533
1593
  color: rgb(107 114 128 / var(--tw-text-opacity, 1));
1534
1594
  }
1595
+ .ps-text-green-500 {
1596
+ --tw-text-opacity: 1;
1597
+ color: rgb(34 197 94 / var(--tw-text-opacity, 1));
1598
+ }
1535
1599
  .ps-text-muted-foreground {
1536
1600
  color: hsl(var(--muted-foreground));
1537
1601
  }
@@ -1562,6 +1626,14 @@ video {
1562
1626
  .ps-text-primary-foreground {
1563
1627
  color: hsl(var(--primary-foreground));
1564
1628
  }
1629
+ .ps-text-red-500 {
1630
+ --tw-text-opacity: 1;
1631
+ color: rgb(239 68 68 / var(--tw-text-opacity, 1));
1632
+ }
1633
+ .ps-text-red-700 {
1634
+ --tw-text-opacity: 1;
1635
+ color: rgb(185 28 28 / var(--tw-text-opacity, 1));
1636
+ }
1565
1637
  .ps-text-secondary-foreground {
1566
1638
  color: hsl(var(--secondary-foreground));
1567
1639
  }
@@ -1,27 +1,79 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { A as Adapter } from '../adapter-Bt_0JnjE.cjs';
2
+ import { A as Adapter, Q as Query, b as AdapterError } from '../query-Q-ZKX_Vr.cjs';
3
+ import { UseQueryStateOptions, UseQueryStateReturn, Options, UseQueryStatesOptions, UseQueryStatesReturn, Parser } from 'nuqs';
4
+ export * from 'nuqs';
5
+ import 'kysely';
3
6
 
4
- type StudioTelemetryEvent = {
5
- event: "studio_launched";
7
+ type StudioLaunchedEventBase = {
8
+ name: "studio_launched";
6
9
  payload: {
7
- event_id: string;
8
- timestamp: string;
9
- user_id?: string;
10
- workspace_id?: string;
11
- organization_id?: string;
12
- embedding_type?: string;
13
- vendor_id?: string;
14
- table_count: number;
10
+ embeddingType?: string;
11
+ vendorId?: string;
12
+ tableCount: number;
15
13
  };
16
14
  };
15
+ type StudioOperationErrorEventBase = {
16
+ name: "studio_operation_error";
17
+ payload: {
18
+ operation: string;
19
+ query: Query | undefined;
20
+ error: AdapterError;
21
+ };
22
+ };
23
+ type StudioOperationSuccessEventBase = {
24
+ name: "studio_operation_success";
25
+ payload: {
26
+ operation: string;
27
+ query: Query;
28
+ error: undefined;
29
+ };
30
+ };
31
+ type StudioOperationEventBase = StudioOperationSuccessEventBase | StudioOperationErrorEventBase;
32
+ type StudioEventBase = StudioLaunchedEventBase | StudioOperationEventBase;
33
+ type StudioEvent = StudioEventBase & {
34
+ eventId: string;
35
+ timestamp: string;
36
+ };
17
37
  interface StudioProps {
18
38
  adapter: Adapter;
19
- onError?: (error: Error) => void;
20
- onTelemetryEvent?: (args: StudioTelemetryEvent) => void;
39
+ onEvent?: (error: StudioEvent) => void;
21
40
  }
22
41
  /**
23
42
  * Main Studio component that provides database visualization and management
24
43
  */
25
44
  declare function Studio(props: StudioProps): react_jsx_runtime.JSX.Element;
26
45
 
27
- export { Studio, type StudioProps };
46
+ type StateKey = "pageIndex" | "pageSize" | "table" | "sort" | "schema" | "test" | "filter" | "view";
47
+ type Exact<A, W> = (A extends unknown ? W extends A ? {
48
+ [K in keyof A]: Exact<A[K], W[K]>;
49
+ } : W : never) | (A extends string | number | bigint | boolean | [] ? A : never);
50
+ declare function keyMap<const Map extends Partial<Record<StateKey, any>>>(keyMap: Exact<Map, Partial<Record<StateKey, any>>>): BrandedKeyMap<Map>;
51
+ declare function urlKeys<const Map extends Partial<Record<StateKey, string>>>(urlKeys: Exact<Map, Partial<Record<StateKey, string>>>): BrandedKeyMap<Map>;
52
+ declare const _BRAND_SYMBOL: unique symbol;
53
+ type BrandedKeyMap<Map> = Map & {
54
+ [K in typeof _BRAND_SYMBOL]: never;
55
+ };
56
+ /**
57
+ * @see {@link useQueryStateOriginal}
58
+ */
59
+ declare function useQueryState<T>(key: StateKey, options: UseQueryStateOptions<T> & {
60
+ defaultValue: T;
61
+ }): UseQueryStateReturn<NonNullable<ReturnType<typeof options.parse>>, typeof options.defaultValue>;
62
+ declare function useQueryState<T>(key: StateKey, options: UseQueryStateOptions<T>): UseQueryStateReturn<NonNullable<ReturnType<typeof options.parse>>, undefined>;
63
+ declare function useQueryState(key: StateKey, options: Options & {
64
+ defaultValue: string;
65
+ }): UseQueryStateReturn<string, typeof options.defaultValue>;
66
+ declare function useQueryState(key: StateKey, options: Pick<UseQueryStateOptions<string>, keyof Options>): UseQueryStateReturn<string, undefined>;
67
+ declare function useQueryState(key: StateKey): UseQueryStateReturn<string, undefined>;
68
+ type UseQueryStatesKeysMap<Map extends Partial<Record<StateKey, any>> = Partial<Record<StateKey, any>>> = {
69
+ [Key in keyof Map]: KeyMapValue<Map[Key]>;
70
+ };
71
+ type KeyMapValue<Type> = Parser<Type> & Options & {
72
+ defaultValue?: Type;
73
+ };
74
+ /**
75
+ * @see {@link useQueryStatesOriginal}
76
+ */
77
+ declare function useQueryStates<KeyMap extends UseQueryStatesKeysMap>(keyMap: BrandedKeyMap<KeyMap>, options?: Partial<UseQueryStatesOptions<KeyMap>>): UseQueryStatesReturn<KeyMap>;
78
+
79
+ export { type StateKey, Studio, type StudioProps, keyMap, urlKeys, useQueryState, useQueryStates };
@@ -1,27 +1,79 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { A as Adapter } from '../adapter-Bt_0JnjE.js';
2
+ import { A as Adapter, Q as Query, b as AdapterError } from '../query-Q-ZKX_Vr.js';
3
+ import { UseQueryStateOptions, UseQueryStateReturn, Options, UseQueryStatesOptions, UseQueryStatesReturn, Parser } from 'nuqs';
4
+ export * from 'nuqs';
5
+ import 'kysely';
3
6
 
4
- type StudioTelemetryEvent = {
5
- event: "studio_launched";
7
+ type StudioLaunchedEventBase = {
8
+ name: "studio_launched";
6
9
  payload: {
7
- event_id: string;
8
- timestamp: string;
9
- user_id?: string;
10
- workspace_id?: string;
11
- organization_id?: string;
12
- embedding_type?: string;
13
- vendor_id?: string;
14
- table_count: number;
10
+ embeddingType?: string;
11
+ vendorId?: string;
12
+ tableCount: number;
15
13
  };
16
14
  };
15
+ type StudioOperationErrorEventBase = {
16
+ name: "studio_operation_error";
17
+ payload: {
18
+ operation: string;
19
+ query: Query | undefined;
20
+ error: AdapterError;
21
+ };
22
+ };
23
+ type StudioOperationSuccessEventBase = {
24
+ name: "studio_operation_success";
25
+ payload: {
26
+ operation: string;
27
+ query: Query;
28
+ error: undefined;
29
+ };
30
+ };
31
+ type StudioOperationEventBase = StudioOperationSuccessEventBase | StudioOperationErrorEventBase;
32
+ type StudioEventBase = StudioLaunchedEventBase | StudioOperationEventBase;
33
+ type StudioEvent = StudioEventBase & {
34
+ eventId: string;
35
+ timestamp: string;
36
+ };
17
37
  interface StudioProps {
18
38
  adapter: Adapter;
19
- onError?: (error: Error) => void;
20
- onTelemetryEvent?: (args: StudioTelemetryEvent) => void;
39
+ onEvent?: (error: StudioEvent) => void;
21
40
  }
22
41
  /**
23
42
  * Main Studio component that provides database visualization and management
24
43
  */
25
44
  declare function Studio(props: StudioProps): react_jsx_runtime.JSX.Element;
26
45
 
27
- export { Studio, type StudioProps };
46
+ type StateKey = "pageIndex" | "pageSize" | "table" | "sort" | "schema" | "test" | "filter" | "view";
47
+ type Exact<A, W> = (A extends unknown ? W extends A ? {
48
+ [K in keyof A]: Exact<A[K], W[K]>;
49
+ } : W : never) | (A extends string | number | bigint | boolean | [] ? A : never);
50
+ declare function keyMap<const Map extends Partial<Record<StateKey, any>>>(keyMap: Exact<Map, Partial<Record<StateKey, any>>>): BrandedKeyMap<Map>;
51
+ declare function urlKeys<const Map extends Partial<Record<StateKey, string>>>(urlKeys: Exact<Map, Partial<Record<StateKey, string>>>): BrandedKeyMap<Map>;
52
+ declare const _BRAND_SYMBOL: unique symbol;
53
+ type BrandedKeyMap<Map> = Map & {
54
+ [K in typeof _BRAND_SYMBOL]: never;
55
+ };
56
+ /**
57
+ * @see {@link useQueryStateOriginal}
58
+ */
59
+ declare function useQueryState<T>(key: StateKey, options: UseQueryStateOptions<T> & {
60
+ defaultValue: T;
61
+ }): UseQueryStateReturn<NonNullable<ReturnType<typeof options.parse>>, typeof options.defaultValue>;
62
+ declare function useQueryState<T>(key: StateKey, options: UseQueryStateOptions<T>): UseQueryStateReturn<NonNullable<ReturnType<typeof options.parse>>, undefined>;
63
+ declare function useQueryState(key: StateKey, options: Options & {
64
+ defaultValue: string;
65
+ }): UseQueryStateReturn<string, typeof options.defaultValue>;
66
+ declare function useQueryState(key: StateKey, options: Pick<UseQueryStateOptions<string>, keyof Options>): UseQueryStateReturn<string, undefined>;
67
+ declare function useQueryState(key: StateKey): UseQueryStateReturn<string, undefined>;
68
+ type UseQueryStatesKeysMap<Map extends Partial<Record<StateKey, any>> = Partial<Record<StateKey, any>>> = {
69
+ [Key in keyof Map]: KeyMapValue<Map[Key]>;
70
+ };
71
+ type KeyMapValue<Type> = Parser<Type> & Options & {
72
+ defaultValue?: Type;
73
+ };
74
+ /**
75
+ * @see {@link useQueryStatesOriginal}
76
+ */
77
+ declare function useQueryStates<KeyMap extends UseQueryStatesKeysMap>(keyMap: BrandedKeyMap<KeyMap>, options?: Partial<UseQueryStatesOptions<KeyMap>>): UseQueryStatesReturn<KeyMap>;
78
+
79
+ export { type StateKey, Studio, type StudioProps, keyMap, urlKeys, useQueryState, useQueryStates };