@sqlrooms/room-config 0.18.1 → 0.19.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/README.md +0 -29
- package/dist/BaseRoomConfig.d.ts +5 -5
- package/dist/BaseRoomConfig.js +1 -1
- package/dist/BaseRoomConfig.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/dist/LayoutConfig.d.ts +0 -64
- package/dist/LayoutConfig.d.ts.map +0 -1
- package/dist/LayoutConfig.js +0 -35
- package/dist/LayoutConfig.js.map +0 -1
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@ A central configuration and type definitions package that maintains base room co
|
|
|
4
4
|
|
|
5
5
|
- 📝 **Room Configuration**: Define and manage room configuration schemas
|
|
6
6
|
- 🔍 **Type Safety**: Strong TypeScript typing for configuration objects
|
|
7
|
-
- 🧩 **Layout Configuration**: Flexible layout configuration system
|
|
8
7
|
- ✅ **Validation**: Zod schemas for runtime validation of configuration
|
|
9
8
|
|
|
10
9
|
## Installation
|
|
@@ -83,34 +82,6 @@ function ConfigComponent() {
|
|
|
83
82
|
}
|
|
84
83
|
```
|
|
85
84
|
|
|
86
|
-
### Using Layout Configuration
|
|
87
|
-
|
|
88
|
-
```tsx
|
|
89
|
-
import {LayoutConfig} from '@sqlrooms/room-config';
|
|
90
|
-
|
|
91
|
-
// Define a layout configuration
|
|
92
|
-
const layoutConfig: LayoutConfig = {
|
|
93
|
-
layout: 'grid',
|
|
94
|
-
panels: [
|
|
95
|
-
{
|
|
96
|
-
id: 'editor',
|
|
97
|
-
type: 'sql-editor',
|
|
98
|
-
position: {x: 0, y: 0, width: 6, height: 4},
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: 'results',
|
|
102
|
-
type: 'data-table',
|
|
103
|
-
position: {x: 0, y: 4, width: 6, height: 4},
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
// Use the layout configuration in your application
|
|
109
|
-
function renderLayout(config: LayoutConfig) {
|
|
110
|
-
// Implementation...
|
|
111
|
-
}
|
|
112
|
-
```
|
|
113
|
-
|
|
114
85
|
## Advanced Features
|
|
115
86
|
|
|
116
87
|
- **Schema Extensions**: Extend base schemas for custom room types
|
package/dist/BaseRoomConfig.d.ts
CHANGED
|
@@ -5,17 +5,17 @@ export declare const BaseRoomConfig: z.ZodObject<{
|
|
|
5
5
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
6
6
|
layout: z.ZodDefault<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
7
7
|
type: z.ZodLiteral<"mosaic">;
|
|
8
|
-
nodes: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodType<import("
|
|
8
|
+
nodes: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodType<import("@sqlrooms/layout-config").MosaicLayoutParent, z.ZodTypeDef, import("@sqlrooms/layout-config").MosaicLayoutParent>]>>;
|
|
9
9
|
pinned: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
10
10
|
fixed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
11
11
|
}, "strip", z.ZodTypeAny, {
|
|
12
12
|
type: "mosaic";
|
|
13
|
-
nodes: string | import("
|
|
13
|
+
nodes: string | import("@sqlrooms/layout-config").MosaicLayoutParent | null;
|
|
14
14
|
pinned?: string[] | undefined;
|
|
15
15
|
fixed?: string[] | undefined;
|
|
16
16
|
}, {
|
|
17
17
|
type: "mosaic";
|
|
18
|
-
nodes: string | import("
|
|
18
|
+
nodes: string | import("@sqlrooms/layout-config").MosaicLayoutParent | null;
|
|
19
19
|
pinned?: string[] | undefined;
|
|
20
20
|
fixed?: string[] | undefined;
|
|
21
21
|
}>]>>;
|
|
@@ -275,7 +275,7 @@ export declare const BaseRoomConfig: z.ZodObject<{
|
|
|
275
275
|
title: string;
|
|
276
276
|
layout: {
|
|
277
277
|
type: "mosaic";
|
|
278
|
-
nodes: string | import("
|
|
278
|
+
nodes: string | import("@sqlrooms/layout-config").MosaicLayoutParent | null;
|
|
279
279
|
pinned?: string[] | undefined;
|
|
280
280
|
fixed?: string[] | undefined;
|
|
281
281
|
};
|
|
@@ -342,7 +342,7 @@ export declare const BaseRoomConfig: z.ZodObject<{
|
|
|
342
342
|
description?: string | null | undefined;
|
|
343
343
|
layout?: {
|
|
344
344
|
type: "mosaic";
|
|
345
|
-
nodes: string | import("
|
|
345
|
+
nodes: string | import("@sqlrooms/layout-config").MosaicLayoutParent | null;
|
|
346
346
|
pinned?: string[] | undefined;
|
|
347
347
|
fixed?: string[] | undefined;
|
|
348
348
|
} | undefined;
|
package/dist/BaseRoomConfig.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { DataSource } from './DataSource';
|
|
3
|
-
import
|
|
3
|
+
import { DEFAULT_MOSAIC_LAYOUT, LayoutConfig } from '@sqlrooms/layout-config';
|
|
4
4
|
export const DEFAULT_ROOM_TITLE = 'Untitled room';
|
|
5
5
|
export const BaseRoomConfig = z
|
|
6
6
|
.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseRoomConfig.js","sourceRoot":"","sources":["../src/BaseRoomConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,
|
|
1
|
+
{"version":3,"file":"BaseRoomConfig.js","sourceRoot":"","sources":["../src/BaseRoomConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,qBAAqB,EAAE,YAAY,EAAC,MAAM,yBAAyB,CAAC;AAE5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAElD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC;KAC5B,MAAM,CAAC;IACN,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;IACrE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;IAC3E,MAAM,EAAE,YAAY,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAC1D,wDAAwD,CACzD;IACD,WAAW,EAAE,CAAC;SACX,KAAK,CAAC,UAAU,CAAC;SACjB,OAAO,CAAC,EAAE,CAAC;SACX,QAAQ,CAAC,8DAA8D,CAAC;CAC5E,CAAC;KACD,QAAQ,CAAC,qBAAqB,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\nimport {DataSource} from './DataSource';\nimport {DEFAULT_MOSAIC_LAYOUT, LayoutConfig} from '@sqlrooms/layout-config';\n\nexport const DEFAULT_ROOM_TITLE = 'Untitled room';\n\nexport const BaseRoomConfig = z\n .object({\n title: z.string().default(DEFAULT_ROOM_TITLE).describe('Room title.'),\n description: z.string().nullable().optional().describe('Room description.'),\n layout: LayoutConfig.default(DEFAULT_MOSAIC_LAYOUT).describe(\n 'Layout specifies how views are arranged on the screen.',\n ),\n dataSources: z\n .array(DataSource)\n .default([])\n .describe('Data sources. Each data source must have a unique tableName.'),\n })\n .describe('Room configuration.');\n\nexport type BaseRoomConfig = z.infer<typeof BaseRoomConfig>;\n"]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAE9B,cAAc,yBAAyB,CAAC","sourcesContent":["/**\n * {@include ../README.md}\n * @packageDocumentation\n */\n\nexport * from './BaseRoomConfig';\nexport * from './DataSource';\nexport * from './LoadOptions';\n\nexport * from '@sqlrooms/layout-config';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqlrooms/room-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@sqlrooms/layout-config": "0.19.1",
|
|
21
22
|
"zod": "^3.25.57"
|
|
22
23
|
},
|
|
23
24
|
"peerDependencies": {
|
|
@@ -30,5 +31,5 @@
|
|
|
30
31
|
"typecheck": "tsc --noEmit",
|
|
31
32
|
"typedoc": "typedoc"
|
|
32
33
|
},
|
|
33
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "9cd7bbec3d915fa8b3997af840574a8430f74523"
|
|
34
35
|
}
|
package/dist/LayoutConfig.d.ts
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** Main view room panel key */
|
|
3
|
-
export declare const MAIN_VIEW = "main";
|
|
4
|
-
export declare const LayoutTypes: z.ZodEnum<["mosaic"]>;
|
|
5
|
-
export type LayoutTypes = z.infer<typeof MosaicLayoutDirection>;
|
|
6
|
-
export declare const MosaicLayoutDirection: z.ZodEnum<["row", "column"]>;
|
|
7
|
-
export type MosaicLayoutDirection = z.infer<typeof MosaicLayoutDirection>;
|
|
8
|
-
declare const BaseMosaicLayoutParent: z.ZodObject<{
|
|
9
|
-
direction: z.ZodEnum<["row", "column"]>;
|
|
10
|
-
splitPercentage: z.ZodOptional<z.ZodNumber>;
|
|
11
|
-
}, "strip", z.ZodTypeAny, {
|
|
12
|
-
direction: "row" | "column";
|
|
13
|
-
splitPercentage?: number | undefined;
|
|
14
|
-
}, {
|
|
15
|
-
direction: "row" | "column";
|
|
16
|
-
splitPercentage?: number | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
export declare const MosaicLayoutParent: z.ZodType<MosaicLayoutParent>;
|
|
19
|
-
export type MosaicLayoutParent = z.infer<typeof BaseMosaicLayoutParent> & {
|
|
20
|
-
first: MosaicLayoutNode;
|
|
21
|
-
second: MosaicLayoutNode;
|
|
22
|
-
};
|
|
23
|
-
export declare function isMosaicLayoutParent(node: MosaicLayoutNode | null | undefined): node is MosaicLayoutParent;
|
|
24
|
-
export declare const MosaicLayoutNodeKey: z.ZodString;
|
|
25
|
-
export type MosaicLayoutNodeKey = z.infer<typeof MosaicLayoutNodeKey>;
|
|
26
|
-
export type MosaicLayoutNode = z.infer<typeof MosaicLayoutNode>;
|
|
27
|
-
export declare const MosaicLayoutNode: z.ZodUnion<[z.ZodString, z.ZodType<MosaicLayoutParent, z.ZodTypeDef, MosaicLayoutParent>]>;
|
|
28
|
-
export declare const MosaicLayoutConfig: z.ZodObject<{
|
|
29
|
-
type: z.ZodLiteral<"mosaic">;
|
|
30
|
-
nodes: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodType<MosaicLayoutParent, z.ZodTypeDef, MosaicLayoutParent>]>>;
|
|
31
|
-
pinned: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
-
fixed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
33
|
-
}, "strip", z.ZodTypeAny, {
|
|
34
|
-
type: "mosaic";
|
|
35
|
-
nodes: string | MosaicLayoutParent | null;
|
|
36
|
-
pinned?: string[] | undefined;
|
|
37
|
-
fixed?: string[] | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
type: "mosaic";
|
|
40
|
-
nodes: string | MosaicLayoutParent | null;
|
|
41
|
-
pinned?: string[] | undefined;
|
|
42
|
-
fixed?: string[] | undefined;
|
|
43
|
-
}>;
|
|
44
|
-
export type MosaicLayoutConfig = z.infer<typeof MosaicLayoutConfig>;
|
|
45
|
-
export declare const LayoutConfig: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
46
|
-
type: z.ZodLiteral<"mosaic">;
|
|
47
|
-
nodes: z.ZodNullable<z.ZodUnion<[z.ZodString, z.ZodType<MosaicLayoutParent, z.ZodTypeDef, MosaicLayoutParent>]>>;
|
|
48
|
-
pinned: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
49
|
-
fixed: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
type: "mosaic";
|
|
52
|
-
nodes: string | MosaicLayoutParent | null;
|
|
53
|
-
pinned?: string[] | undefined;
|
|
54
|
-
fixed?: string[] | undefined;
|
|
55
|
-
}, {
|
|
56
|
-
type: "mosaic";
|
|
57
|
-
nodes: string | MosaicLayoutParent | null;
|
|
58
|
-
pinned?: string[] | undefined;
|
|
59
|
-
fixed?: string[] | undefined;
|
|
60
|
-
}>]>;
|
|
61
|
-
export declare const DEFAULT_MOSAIC_LAYOUT: MosaicLayoutConfig;
|
|
62
|
-
export type LayoutConfig = z.infer<typeof LayoutConfig>;
|
|
63
|
-
export default LayoutConfig;
|
|
64
|
-
//# sourceMappingURL=LayoutConfig.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutConfig.d.ts","sourceRoot":"","sources":["../src/LayoutConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,+BAA+B;AAC/B,eAAO,MAAM,SAAS,SAAS,CAAC;AAEhC,eAAO,MAAM,WAAW,uBAAqB,CAAC;AAC9C,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEhE,eAAO,MAAM,qBAAqB,8BAA4B,CAAC;AAC/D,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAE1E,QAAA,MAAM,sBAAsB;;;;;;;;;EAG1B,CAAC;AAGH,eAAO,MAAM,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAIzD,CAAC;AACL,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,GAAG;IACxE,KAAK,EAAE,gBAAgB,CAAC;IACxB,MAAM,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GACxC,IAAI,IAAI,kBAAkB,CAE5B;AAED,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAC9C,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEtE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAChE,eAAO,MAAM,gBAAgB,4FAG3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEpE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;IAAqD,CAAC;AAE/E,eAAO,MAAM,qBAAqB,EAAE,kBAGnC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAExD,eAAe,YAAY,CAAC"}
|
package/dist/LayoutConfig.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/** Main view room panel key */
|
|
3
|
-
export const MAIN_VIEW = 'main';
|
|
4
|
-
export const LayoutTypes = z.enum(['mosaic']);
|
|
5
|
-
export const MosaicLayoutDirection = z.enum(['row', 'column']);
|
|
6
|
-
const BaseMosaicLayoutParent = z.object({
|
|
7
|
-
direction: MosaicLayoutDirection,
|
|
8
|
-
splitPercentage: z.number().optional(),
|
|
9
|
-
});
|
|
10
|
-
// See https://zod.dev/?id=recursive-types
|
|
11
|
-
export const MosaicLayoutParent = BaseMosaicLayoutParent.extend({
|
|
12
|
-
first: z.lazy(() => MosaicLayoutNode),
|
|
13
|
-
second: z.lazy(() => MosaicLayoutNode),
|
|
14
|
-
});
|
|
15
|
-
export function isMosaicLayoutParent(node) {
|
|
16
|
-
return typeof node !== 'string';
|
|
17
|
-
}
|
|
18
|
-
export const MosaicLayoutNodeKey = z.string();
|
|
19
|
-
export const MosaicLayoutNode = z.union([
|
|
20
|
-
MosaicLayoutNodeKey,
|
|
21
|
-
MosaicLayoutParent,
|
|
22
|
-
]);
|
|
23
|
-
export const MosaicLayoutConfig = z.object({
|
|
24
|
-
type: z.literal(LayoutTypes.enum.mosaic),
|
|
25
|
-
nodes: MosaicLayoutNode.nullable(),
|
|
26
|
-
pinned: z.array(MosaicLayoutNodeKey).optional(),
|
|
27
|
-
fixed: z.array(MosaicLayoutNodeKey).optional(),
|
|
28
|
-
});
|
|
29
|
-
export const LayoutConfig = z.discriminatedUnion('type', [MosaicLayoutConfig]);
|
|
30
|
-
export const DEFAULT_MOSAIC_LAYOUT = {
|
|
31
|
-
type: LayoutTypes.enum.mosaic,
|
|
32
|
-
nodes: MAIN_VIEW,
|
|
33
|
-
};
|
|
34
|
-
export default LayoutConfig;
|
|
35
|
-
//# sourceMappingURL=LayoutConfig.js.map
|
package/dist/LayoutConfig.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutConfig.js","sourceRoot":"","sources":["../src/LayoutConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,+BAA+B;AAC/B,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC;AAEhC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;AAG9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC;AAG/D,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,qBAAqB;IAChC,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,0CAA0C;AAC1C,MAAM,CAAC,MAAM,kBAAkB,GAC7B,sBAAsB,CAAC,MAAM,CAAC;IAC5B,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC;IACrC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC;CACvC,CAAC,CAAC;AAML,MAAM,UAAU,oBAAoB,CAClC,IAAyC;IAEzC,OAAO,OAAO,IAAI,KAAK,QAAQ,CAAC;AAClC,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAI9C,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC;IACtC,mBAAmB;IACnB,kBAAkB;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,gBAAgB,CAAC,QAAQ,EAAE;IAClC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;IAC/C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAuB;IACvD,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM;IAC7B,KAAK,EAAE,SAAS;CACjB,CAAC;AAIF,eAAe,YAAY,CAAC","sourcesContent":["import {z} from 'zod';\n\n/** Main view room panel key */\nexport const MAIN_VIEW = 'main';\n\nexport const LayoutTypes = z.enum(['mosaic']);\nexport type LayoutTypes = z.infer<typeof MosaicLayoutDirection>;\n\nexport const MosaicLayoutDirection = z.enum(['row', 'column']);\nexport type MosaicLayoutDirection = z.infer<typeof MosaicLayoutDirection>;\n\nconst BaseMosaicLayoutParent = z.object({\n direction: MosaicLayoutDirection,\n splitPercentage: z.number().optional(),\n});\n\n// See https://zod.dev/?id=recursive-types\nexport const MosaicLayoutParent: z.ZodType<MosaicLayoutParent> =\n BaseMosaicLayoutParent.extend({\n first: z.lazy(() => MosaicLayoutNode),\n second: z.lazy(() => MosaicLayoutNode),\n });\nexport type MosaicLayoutParent = z.infer<typeof BaseMosaicLayoutParent> & {\n first: MosaicLayoutNode;\n second: MosaicLayoutNode;\n};\n\nexport function isMosaicLayoutParent(\n node: MosaicLayoutNode | null | undefined,\n): node is MosaicLayoutParent {\n return typeof node !== 'string';\n}\n\nexport const MosaicLayoutNodeKey = z.string();\nexport type MosaicLayoutNodeKey = z.infer<typeof MosaicLayoutNodeKey>;\n\nexport type MosaicLayoutNode = z.infer<typeof MosaicLayoutNode>;\nexport const MosaicLayoutNode = z.union([\n MosaicLayoutNodeKey,\n MosaicLayoutParent,\n]);\n\nexport const MosaicLayoutConfig = z.object({\n type: z.literal(LayoutTypes.enum.mosaic),\n nodes: MosaicLayoutNode.nullable(),\n pinned: z.array(MosaicLayoutNodeKey).optional(),\n fixed: z.array(MosaicLayoutNodeKey).optional(),\n});\nexport type MosaicLayoutConfig = z.infer<typeof MosaicLayoutConfig>;\n\nexport const LayoutConfig = z.discriminatedUnion('type', [MosaicLayoutConfig]);\n\nexport const DEFAULT_MOSAIC_LAYOUT: MosaicLayoutConfig = {\n type: LayoutTypes.enum.mosaic,\n nodes: MAIN_VIEW,\n};\n\nexport type LayoutConfig = z.infer<typeof LayoutConfig>;\n\nexport default LayoutConfig;\n"]}
|