@object-ui/types 0.3.0 → 0.5.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.
Files changed (169) hide show
  1. package/README.md +19 -11
  2. package/dist/api-types.d.ts +7 -0
  3. package/dist/api-types.d.ts.map +1 -1
  4. package/dist/api-types.js +4 -6
  5. package/dist/app.d.ts +17 -0
  6. package/dist/app.d.ts.map +1 -1
  7. package/dist/app.js +4 -3
  8. package/dist/base.d.ts +7 -0
  9. package/dist/base.d.ts.map +1 -1
  10. package/dist/base.js +4 -6
  11. package/dist/blocks.d.ts +332 -0
  12. package/dist/blocks.d.ts.map +1 -0
  13. package/dist/blocks.js +8 -0
  14. package/dist/complex.d.ts +68 -1
  15. package/dist/complex.d.ts.map +1 -1
  16. package/dist/complex.js +4 -5
  17. package/dist/crud.d.ts +181 -3
  18. package/dist/crud.d.ts.map +1 -1
  19. package/dist/crud.js +4 -6
  20. package/dist/data-display.d.ts +54 -2
  21. package/dist/data-display.d.ts.map +1 -1
  22. package/dist/data-display.js +4 -5
  23. package/dist/data-protocol.d.ts +1268 -0
  24. package/dist/data-protocol.d.ts.map +1 -0
  25. package/dist/data-protocol.js +8 -0
  26. package/dist/data.d.ts +22 -1
  27. package/dist/data.d.ts.map +1 -1
  28. package/dist/data.js +4 -6
  29. package/dist/disclosure.d.ts +70 -1
  30. package/dist/disclosure.d.ts.map +1 -1
  31. package/dist/disclosure.js +4 -5
  32. package/dist/feedback.d.ts +68 -1
  33. package/dist/feedback.d.ts.map +1 -1
  34. package/dist/feedback.js +4 -5
  35. package/dist/field-types.d.ts +728 -0
  36. package/dist/field-types.d.ts.map +1 -0
  37. package/dist/field-types.js +8 -0
  38. package/dist/form.d.ts +123 -1
  39. package/dist/form.d.ts.map +1 -1
  40. package/dist/form.js +4 -5
  41. package/dist/index.d.ts +48 -13
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +4 -37
  44. package/dist/layout.d.ts +66 -16
  45. package/dist/layout.d.ts.map +1 -1
  46. package/dist/layout.js +4 -6
  47. package/dist/navigation.d.ts +102 -2
  48. package/dist/navigation.d.ts.map +1 -1
  49. package/dist/navigation.js +4 -5
  50. package/dist/objectql.d.ts +491 -54
  51. package/dist/objectql.d.ts.map +1 -1
  52. package/dist/objectql.js +4 -6
  53. package/dist/overlay.d.ts +31 -1
  54. package/dist/overlay.d.ts.map +1 -1
  55. package/dist/overlay.js +4 -5
  56. package/dist/plugin-scope.d.ts +194 -0
  57. package/dist/plugin-scope.d.ts.map +1 -0
  58. package/dist/plugin-scope.js +8 -0
  59. package/dist/registry.d.ts +7 -0
  60. package/dist/registry.d.ts.map +1 -1
  61. package/dist/registry.js +7 -0
  62. package/dist/reports.d.ts +336 -0
  63. package/dist/reports.d.ts.map +1 -0
  64. package/dist/reports.js +8 -0
  65. package/dist/theme.d.ts +289 -0
  66. package/dist/theme.d.ts.map +1 -0
  67. package/dist/theme.js +8 -0
  68. package/dist/ui-action.d.ts +175 -0
  69. package/dist/ui-action.d.ts.map +1 -0
  70. package/dist/ui-action.js +8 -0
  71. package/dist/views.d.ts +417 -0
  72. package/dist/views.d.ts.map +1 -0
  73. package/dist/views.js +8 -0
  74. package/dist/zod/app.zod.d.ts +120 -0
  75. package/dist/zod/app.zod.d.ts.map +1 -0
  76. package/dist/zod/app.zod.js +60 -0
  77. package/dist/zod/base.zod.d.ts +202 -0
  78. package/dist/zod/base.zod.d.ts.map +1 -0
  79. package/dist/zod/base.zod.js +198 -0
  80. package/dist/zod/blocks.zod.d.ts +834 -0
  81. package/dist/zod/blocks.zod.d.ts.map +1 -0
  82. package/dist/zod/blocks.zod.js +145 -0
  83. package/dist/zod/complex.zod.d.ts +742 -0
  84. package/dist/zod/complex.zod.d.ts.map +1 -0
  85. package/dist/zod/complex.zod.js +233 -0
  86. package/dist/zod/crud.zod.d.ts +598 -0
  87. package/dist/zod/crud.zod.d.ts.map +1 -0
  88. package/dist/zod/crud.zod.js +230 -0
  89. package/dist/zod/data-display.zod.d.ts +996 -0
  90. package/dist/zod/data-display.zod.d.ts.map +1 -0
  91. package/dist/zod/data-display.zod.js +266 -0
  92. package/dist/zod/disclosure.zod.d.ts +267 -0
  93. package/dist/zod/disclosure.zod.d.ts.map +1 -0
  94. package/dist/zod/disclosure.zod.js +84 -0
  95. package/dist/zod/feedback.zod.d.ts +538 -0
  96. package/dist/zod/feedback.zod.d.ts.map +1 -0
  97. package/dist/zod/feedback.zod.js +127 -0
  98. package/dist/zod/form.zod.d.ts +1308 -0
  99. package/dist/zod/form.zod.d.ts.map +1 -0
  100. package/dist/zod/form.zod.js +406 -0
  101. package/dist/zod/index.zod.d.ts +4985 -0
  102. package/dist/zod/index.zod.d.ts.map +1 -0
  103. package/dist/zod/index.zod.js +183 -0
  104. package/dist/zod/layout.zod.d.ts +1048 -0
  105. package/dist/zod/layout.zod.d.ts.map +1 -0
  106. package/dist/zod/layout.zod.js +241 -0
  107. package/dist/zod/navigation.zod.d.ts +486 -0
  108. package/dist/zod/navigation.zod.d.ts.map +1 -0
  109. package/dist/zod/navigation.zod.js +142 -0
  110. package/dist/zod/objectql.zod.d.ts +1261 -0
  111. package/dist/zod/objectql.zod.d.ts.map +1 -0
  112. package/dist/zod/objectql.zod.js +248 -0
  113. package/dist/zod/overlay.zod.d.ts +691 -0
  114. package/dist/zod/overlay.zod.d.ts.map +1 -0
  115. package/dist/zod/overlay.zod.js +179 -0
  116. package/dist/zod/reports.zod.d.ts +1628 -0
  117. package/dist/zod/reports.zod.d.ts.map +1 -0
  118. package/dist/zod/reports.zod.js +152 -0
  119. package/dist/zod/theme.zod.d.ts +611 -0
  120. package/dist/zod/theme.zod.d.ts.map +1 -0
  121. package/dist/zod/theme.zod.js +130 -0
  122. package/dist/zod/views.zod.d.ts +675 -0
  123. package/dist/zod/views.zod.d.ts.map +1 -0
  124. package/dist/zod/views.zod.js +159 -0
  125. package/package.json +9 -1
  126. package/src/__tests__/namespace-exports.test.ts +80 -0
  127. package/src/__tests__/phase2-schemas.test.ts +639 -0
  128. package/src/api-types.ts +8 -0
  129. package/src/app.ts +20 -0
  130. package/src/base.ts +8 -0
  131. package/src/blocks.ts +405 -0
  132. package/src/complex.ts +69 -1
  133. package/src/crud.ts +185 -3
  134. package/src/data-display.ts +60 -2
  135. package/src/data-protocol.ts +1679 -0
  136. package/src/data.ts +21 -1
  137. package/src/disclosure.ts +74 -1
  138. package/src/feedback.ts +76 -2
  139. package/src/field-types.ts +846 -0
  140. package/src/form.ts +131 -1
  141. package/src/index.ts +305 -8
  142. package/src/layout.ts +70 -15
  143. package/src/navigation.ts +109 -2
  144. package/src/objectql.ts +563 -59
  145. package/src/overlay.ts +35 -1
  146. package/src/plugin-scope.ts +210 -0
  147. package/src/registry.ts +8 -0
  148. package/src/reports.ts +408 -0
  149. package/src/theme.ts +351 -0
  150. package/src/ui-action.ts +276 -0
  151. package/src/views.ts +429 -0
  152. package/src/zod/README.md +329 -0
  153. package/src/zod/app.zod.ts +72 -0
  154. package/src/zod/base.zod.ts +229 -0
  155. package/src/zod/blocks.zod.ts +170 -0
  156. package/src/zod/complex.zod.ts +258 -0
  157. package/src/zod/crud.zod.ts +259 -0
  158. package/src/zod/data-display.zod.ts +290 -0
  159. package/src/zod/disclosure.zod.ts +92 -0
  160. package/src/zod/feedback.zod.ts +138 -0
  161. package/src/zod/form.zod.ts +434 -0
  162. package/src/zod/index.zod.ts +425 -0
  163. package/src/zod/layout.zod.ts +262 -0
  164. package/src/zod/navigation.zod.ts +159 -0
  165. package/src/zod/objectql.zod.ts +268 -0
  166. package/src/zod/overlay.zod.ts +196 -0
  167. package/src/zod/reports.zod.ts +183 -0
  168. package/src/zod/theme.zod.ts +155 -0
  169. package/src/zod/views.zod.ts +182 -0
@@ -0,0 +1,170 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ /**
10
+ * @object-ui/types/zod - Block Schema Zod Validators
11
+ *
12
+ * Zod validation schemas for reusable component blocks.
13
+ * Following @objectstack/spec UI specification format.
14
+ *
15
+ * @module zod/blocks
16
+ * @packageDocumentation
17
+ */
18
+
19
+ import { z } from 'zod';
20
+ import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
21
+
22
+ /**
23
+ * Block Variable Schema
24
+ */
25
+ export const BlockVariableSchema = z.object({
26
+ name: z.string().describe('Variable name'),
27
+ label: z.string().optional().describe('Display label'),
28
+ type: z.enum(['string', 'number', 'boolean', 'object', 'array', 'component']).optional().describe('Variable type'),
29
+ defaultValue: z.any().optional().describe('Default value'),
30
+ description: z.string().optional().describe('Description/help text'),
31
+ required: z.boolean().optional().describe('Whether this variable is required'),
32
+ validation: z.any().optional().describe('Validation rules'),
33
+ enum: z.array(z.any()).optional().describe('Enum options (for string/number types)'),
34
+ });
35
+
36
+ /**
37
+ * Block Slot Schema
38
+ */
39
+ export const BlockSlotSchema = z.object({
40
+ name: z.string().describe('Slot name'),
41
+ label: z.string().optional().describe('Display label'),
42
+ description: z.string().optional().describe('Description'),
43
+ defaultContent: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Default content'),
44
+ allowedTypes: z.array(z.string()).optional().describe('Allowed component types'),
45
+ maxChildren: z.number().optional().describe('Maximum number of children'),
46
+ required: z.boolean().optional().describe('Whether this slot is required'),
47
+ });
48
+
49
+ /**
50
+ * Block Metadata Schema
51
+ */
52
+ export const BlockMetadataSchema = z.object({
53
+ name: z.string().describe('Block name/identifier'),
54
+ label: z.string().optional().describe('Display label'),
55
+ description: z.string().optional().describe('Block description'),
56
+ category: z.string().optional().describe('Block category'),
57
+ icon: z.string().optional().describe('Block icon'),
58
+ tags: z.array(z.string()).optional().describe('Block tags for search'),
59
+ author: z.string().optional().describe('Author/creator'),
60
+ version: z.string().optional().describe('Version'),
61
+ license: z.string().optional().describe('License'),
62
+ repository: z.string().optional().describe('Repository URL'),
63
+ preview: z.string().optional().describe('Preview image URL'),
64
+ premium: z.boolean().optional().describe('Is this a premium/paid block'),
65
+ });
66
+
67
+ /**
68
+ * Block Schema
69
+ */
70
+ export const BlockSchema = BaseSchema.extend({
71
+ type: z.literal('block'),
72
+ meta: BlockMetadataSchema.optional().describe('Block metadata'),
73
+ variables: z.array(BlockVariableSchema).optional().describe('Block variables/props'),
74
+ slots: z.array(BlockSlotSchema).optional().describe('Block slots for content injection'),
75
+ template: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Block template (component tree)'),
76
+ values: z.record(z.string(), z.any()).optional().describe('Variable values (when using a block)'),
77
+ slotContent: z.record(z.string(), z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)])).optional().describe('Slot content (when using a block)'),
78
+ blockRef: z.string().optional().describe('Block reference (for reusing saved blocks)'),
79
+ editable: z.boolean().optional().describe('Enable edit mode'),
80
+ });
81
+
82
+ /**
83
+ * Block Library Item Schema
84
+ */
85
+ export const BlockLibraryItemSchema = z.object({
86
+ id: z.string().describe('Unique identifier'),
87
+ meta: BlockMetadataSchema.describe('Block metadata'),
88
+ schema: BlockSchema.describe('Block schema'),
89
+ installs: z.number().optional().describe('Installation count'),
90
+ rating: z.number().optional().describe('Rating (1-5)'),
91
+ ratingCount: z.number().optional().describe('Number of ratings'),
92
+ updatedAt: z.string().optional().describe('Last updated timestamp'),
93
+ createdAt: z.string().optional().describe('Created timestamp'),
94
+ });
95
+
96
+ /**
97
+ * Block Library Schema
98
+ */
99
+ export const BlockLibrarySchema = BaseSchema.extend({
100
+ type: z.literal('block-library'),
101
+ apiEndpoint: z.string().optional().describe('Library API endpoint'),
102
+ category: z.string().optional().describe('Filter by category'),
103
+ searchQuery: z.string().optional().describe('Search query'),
104
+ tags: z.array(z.string()).optional().describe('Filter by tags'),
105
+ showPremium: z.boolean().optional().describe('Show premium blocks'),
106
+ blocks: z.array(BlockLibraryItemSchema).optional().describe('Blocks to display'),
107
+ loading: z.boolean().optional().describe('Loading state'),
108
+ onInstall: z.string().optional().describe('Install callback'),
109
+ onPreview: z.string().optional().describe('Preview callback'),
110
+ });
111
+
112
+ /**
113
+ * Block Editor Schema
114
+ */
115
+ export const BlockEditorSchema = BaseSchema.extend({
116
+ type: z.literal('block-editor'),
117
+ block: BlockSchema.optional().describe('Block being edited'),
118
+ showVariables: z.boolean().optional().describe('Show variable editor'),
119
+ showSlots: z.boolean().optional().describe('Show slot editor'),
120
+ showTemplate: z.boolean().optional().describe('Show template editor'),
121
+ showPreview: z.boolean().optional().describe('Show preview'),
122
+ onSave: z.string().optional().describe('Save callback'),
123
+ onCancel: z.string().optional().describe('Cancel callback'),
124
+ });
125
+
126
+ /**
127
+ * Block Instance Schema
128
+ */
129
+ export const BlockInstanceSchema = BaseSchema.extend({
130
+ type: z.literal('block-instance'),
131
+ blockId: z.string().describe('Block reference ID'),
132
+ blockName: z.string().optional().describe('Block name (for local blocks)'),
133
+ values: z.record(z.string(), z.any()).optional().describe('Variable values'),
134
+ slotContent: z.record(z.string(), z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)])).optional().describe('Slot content'),
135
+ overrideStyles: z.boolean().optional().describe('Override styles'),
136
+ });
137
+
138
+ /**
139
+ * Component Schema
140
+ */
141
+ export const ComponentSchema = BaseSchema.extend({
142
+ type: z.literal('component'),
143
+ componentName: z.string().optional().describe('Component name/identifier'),
144
+ props: z.record(z.string(), z.any()).optional().describe('Component props'),
145
+ children: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Component children'),
146
+ });
147
+
148
+ /**
149
+ * Union of all block schemas
150
+ */
151
+ export const BlockComponentSchema = z.union([
152
+ BlockSchema,
153
+ BlockLibrarySchema,
154
+ BlockEditorSchema,
155
+ BlockInstanceSchema,
156
+ ComponentSchema,
157
+ ]);
158
+
159
+ /**
160
+ * Export type inference helpers
161
+ */
162
+ export type BlockVariableSchemaType = z.infer<typeof BlockVariableSchema>;
163
+ export type BlockSlotSchemaType = z.infer<typeof BlockSlotSchema>;
164
+ export type BlockMetadataSchemaType = z.infer<typeof BlockMetadataSchema>;
165
+ export type BlockSchemaType = z.infer<typeof BlockSchema>;
166
+ export type BlockLibraryItemSchemaType = z.infer<typeof BlockLibraryItemSchema>;
167
+ export type BlockLibrarySchemaType = z.infer<typeof BlockLibrarySchema>;
168
+ export type BlockEditorSchemaType = z.infer<typeof BlockEditorSchema>;
169
+ export type BlockInstanceSchemaType = z.infer<typeof BlockInstanceSchema>;
170
+ export type ComponentSchemaType = z.infer<typeof ComponentSchema>;
@@ -0,0 +1,258 @@
1
+ /**
2
+ * ObjectUI
3
+ * Copyright (c) 2024-present ObjectStack Inc.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
9
+ /**
10
+ * @object-ui/types/zod - Complex Component Zod Validators
11
+ *
12
+ * Zod validation schemas for advanced/composite components.
13
+ * Following @objectstack/spec UI specification format.
14
+ *
15
+ * @module zod/complex
16
+ * @packageDocumentation
17
+ */
18
+
19
+ import { z } from 'zod';
20
+ import { BaseSchema, SchemaNodeSchema } from './base.zod.js';
21
+
22
+ /**
23
+ * Kanban Card Schema
24
+ */
25
+ export const KanbanCardSchema = z.object({
26
+ id: z.string().describe('Card ID'),
27
+ title: z.string().describe('Card title'),
28
+ description: z.string().optional().describe('Card description'),
29
+ labels: z.array(z.string()).optional().describe('Card labels'),
30
+ assignees: z.array(z.string()).optional().describe('Card assignees'),
31
+ dueDate: z.union([z.string(), z.date()]).optional().describe('Due date'),
32
+ priority: z.enum(['low', 'medium', 'high', 'critical']).optional().describe('Card priority'),
33
+ content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).optional().describe('Custom content'),
34
+ data: z.any().optional().describe('Custom card data'),
35
+ });
36
+
37
+ /**
38
+ * Kanban Column Schema
39
+ */
40
+ export const KanbanColumnSchema = z.object({
41
+ id: z.string().describe('Column ID'),
42
+ title: z.string().describe('Column title'),
43
+ items: z.array(KanbanCardSchema).describe('Column cards'),
44
+ color: z.string().optional().describe('Column color'),
45
+ limit: z.number().optional().describe('Card limit'),
46
+ collapsed: z.boolean().optional().describe('Whether column is collapsed'),
47
+ });
48
+
49
+ /**
50
+ * Kanban Schema - Kanban board component
51
+ */
52
+ export const KanbanSchema = BaseSchema.extend({
53
+ type: z.literal('kanban'),
54
+ columns: z.array(KanbanColumnSchema).describe('Kanban columns'),
55
+ draggable: z.boolean().optional().describe('Whether cards are draggable'),
56
+ onCardMove: z.function().optional().describe('Card move handler'),
57
+ onCardClick: z.function().optional().describe('Card click handler'),
58
+ onColumnAdd: z.function().optional().describe('Column add handler'),
59
+ onCardAdd: z.function().optional().describe('Card add handler'),
60
+ });
61
+
62
+ /**
63
+ * Calendar View Mode
64
+ */
65
+ export const CalendarViewModeSchema = z.enum(['month', 'week', 'day', 'agenda']);
66
+
67
+ /**
68
+ * Calendar Event Schema
69
+ */
70
+ export const CalendarEventSchema = z.object({
71
+ id: z.string().describe('Event ID'),
72
+ title: z.string().describe('Event title'),
73
+ description: z.string().optional().describe('Event description'),
74
+ start: z.union([z.string(), z.date()]).describe('Event start time'),
75
+ end: z.union([z.string(), z.date()]).describe('Event end time'),
76
+ allDay: z.boolean().optional().describe('Whether event is all-day'),
77
+ color: z.string().optional().describe('Event color'),
78
+ data: z.any().optional().describe('Custom event data'),
79
+ });
80
+
81
+ /**
82
+ * Calendar View Schema - Calendar component
83
+ */
84
+ export const CalendarViewSchema = BaseSchema.extend({
85
+ type: z.literal('calendar-view'),
86
+ events: z.array(CalendarEventSchema).describe('Calendar events'),
87
+ defaultView: CalendarViewModeSchema.optional().describe('Default view mode'),
88
+ view: CalendarViewModeSchema.optional().describe('Controlled view mode'),
89
+ defaultDate: z.union([z.string(), z.date()]).optional().describe('Default date'),
90
+ date: z.union([z.string(), z.date()]).optional().describe('Controlled date'),
91
+ views: z.array(CalendarViewModeSchema).optional().describe('Available views'),
92
+ editable: z.boolean().optional().describe('Whether events are editable'),
93
+ onEventClick: z.function().optional().describe('Event click handler'),
94
+ onEventCreate: z.function().optional().describe('Event create handler'),
95
+ onEventUpdate: z.function().optional().describe('Event update handler'),
96
+ onDateChange: z.function().optional().describe('Date change handler'),
97
+ onViewChange: z.function().optional().describe('View change handler'),
98
+ });
99
+
100
+ /**
101
+ * Filter Operator Enum
102
+ */
103
+ export const FilterOperatorSchema = z.enum([
104
+ 'equals',
105
+ 'not_equals',
106
+ 'contains',
107
+ 'not_contains',
108
+ 'starts_with',
109
+ 'ends_with',
110
+ 'greater_than',
111
+ 'greater_than_or_equal',
112
+ 'less_than',
113
+ 'less_than_or_equal',
114
+ 'in',
115
+ 'not_in',
116
+ 'is_null',
117
+ 'is_not_null',
118
+ ]);
119
+
120
+ /**
121
+ * Filter Condition Schema
122
+ */
123
+ export const FilterConditionSchema: z.ZodType<any> = z.lazy(() =>
124
+ z.object({
125
+ field: z.string().describe('Field name'),
126
+ operator: FilterOperatorSchema.describe('Filter operator'),
127
+ value: z.any().optional().describe('Filter value'),
128
+ })
129
+ );
130
+
131
+ /**
132
+ * Filter Group Schema
133
+ */
134
+ export const FilterGroupSchema: z.ZodType<any> = z.lazy(() =>
135
+ z.object({
136
+ operator: z.enum(['and', 'or']).describe('Group operator'),
137
+ conditions: z.array(z.union([FilterConditionSchema, FilterGroupSchema])).describe('Conditions or sub-groups'),
138
+ })
139
+ );
140
+
141
+ /**
142
+ * Filter Field Schema
143
+ */
144
+ export const FilterFieldSchema = z.object({
145
+ name: z.string().describe('Field name'),
146
+ label: z.string().describe('Field label'),
147
+ type: z.enum(['string', 'number', 'date', 'boolean', 'select']).describe('Field type'),
148
+ operators: z.array(FilterOperatorSchema).optional().describe('Available operators'),
149
+ options: z.array(z.object({
150
+ label: z.string(),
151
+ value: z.any(),
152
+ })).optional().describe('Options for select type'),
153
+ });
154
+
155
+ /**
156
+ * Filter Builder Schema - Filter builder component
157
+ */
158
+ export const FilterBuilderSchema = BaseSchema.extend({
159
+ type: z.literal('filter-builder'),
160
+ fields: z.array(FilterFieldSchema).describe('Available filter fields'),
161
+ defaultValue: z.union([FilterConditionSchema, FilterGroupSchema]).optional().describe('Default filter value'),
162
+ value: z.union([FilterConditionSchema, FilterGroupSchema]).optional().describe('Controlled filter value'),
163
+ onChange: z.function().optional().describe('Change handler'),
164
+ allowGroups: z.boolean().optional().describe('Allow grouped conditions'),
165
+ maxDepth: z.number().optional().describe('Maximum nesting depth'),
166
+ });
167
+
168
+ /**
169
+ * Carousel Item Schema
170
+ */
171
+ export const CarouselItemSchema = z.object({
172
+ id: z.string().optional().describe('Item ID'),
173
+ content: z.union([SchemaNodeSchema, z.array(SchemaNodeSchema)]).describe('Item content'),
174
+ });
175
+
176
+ /**
177
+ * Carousel Schema - Carousel component
178
+ */
179
+ export const CarouselSchema = BaseSchema.extend({
180
+ type: z.literal('carousel'),
181
+ items: z.array(CarouselItemSchema).describe('Carousel items'),
182
+ autoPlay: z.number().optional().describe('Auto-play interval (ms)'),
183
+ showArrows: z.boolean().optional().describe('Show navigation arrows'),
184
+ showDots: z.boolean().optional().describe('Show navigation dots'),
185
+ loop: z.boolean().optional().describe('Enable infinite loop'),
186
+ itemsPerView: z.number().optional().describe('Items per view'),
187
+ gap: z.number().optional().describe('Gap between items'),
188
+ onSlideChange: z.function().optional().describe('Slide change handler'),
189
+ });
190
+
191
+ /**
192
+ * Chat Message Schema
193
+ */
194
+ export const ChatMessageSchema = z.object({
195
+ id: z.string().describe('Message ID'),
196
+ role: z.enum(['user', 'assistant', 'system']).describe('Message role'),
197
+ content: z.string().describe('Message content'),
198
+ timestamp: z.union([z.string(), z.date()]).optional().describe('Message timestamp'),
199
+ metadata: z.record(z.string(), z.any()).optional().describe('Custom metadata'),
200
+ });
201
+
202
+ /**
203
+ * Chatbot Schema - Chatbot component
204
+ */
205
+ export const ChatbotSchema = BaseSchema.extend({
206
+ type: z.literal('chatbot'),
207
+ messages: z.array(ChatMessageSchema).describe('Chat messages'),
208
+ placeholder: z.string().optional().describe('Input placeholder'),
209
+ loading: z.boolean().optional().describe('Whether chat is loading'),
210
+ onSendMessage: z.function().optional().describe('Send message handler'),
211
+ showAvatars: z.boolean().optional().describe('Show user avatars'),
212
+ userAvatar: z.string().optional().describe('User avatar URL'),
213
+ assistantAvatar: z.string().optional().describe('Assistant avatar URL'),
214
+ markdown: z.boolean().optional().describe('Enable markdown rendering'),
215
+ height: z.union([z.string(), z.number()]).optional().describe('Chatbot height'),
216
+ });
217
+
218
+ /**
219
+ * Dashboard Widget Layout Schema
220
+ */
221
+ export const DashboardWidgetLayoutSchema = z.object({
222
+ x: z.number().describe('Grid x position'),
223
+ y: z.number().describe('Grid y position'),
224
+ w: z.number().describe('Grid width'),
225
+ h: z.number().describe('Grid height'),
226
+ });
227
+
228
+ /**
229
+ * Dashboard Widget Schema
230
+ */
231
+ export const DashboardWidgetSchema = z.object({
232
+ id: z.string().describe('Widget ID'),
233
+ title: z.string().optional().describe('Widget Title'),
234
+ component: SchemaNodeSchema.describe('Widget Component'),
235
+ layout: DashboardWidgetLayoutSchema.optional().describe('Widget Layout'),
236
+ });
237
+
238
+ /**
239
+ * Dashboard Schema - Dashboard component
240
+ */
241
+ export const DashboardSchema = BaseSchema.extend({
242
+ type: z.literal('dashboard'),
243
+ columns: z.number().optional().describe('Number of columns'),
244
+ gap: z.number().optional().describe('Grid gap'),
245
+ widgets: z.array(DashboardWidgetSchema).describe('Dashboard widgets'),
246
+ });
247
+
248
+ /**
249
+ * Complex Schema Union - All complex component schemas
250
+ */
251
+ export const ComplexSchema = z.union([
252
+ KanbanSchema,
253
+ CalendarViewSchema,
254
+ FilterBuilderSchema,
255
+ CarouselSchema,
256
+ ChatbotSchema,
257
+ DashboardSchema,
258
+ ]);