-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.ts
More file actions
1200 lines (1130 loc) · 33.5 KB
/
Copy pathindex.ts
File metadata and controls
1200 lines (1130 loc) · 33.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* ObjectUI
* Copyright (c) 2024-present ObjectStack Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @object-ui/types
*
* Pure TypeScript type definitions for Object UI - The Protocol Layer.
*
* This package contains ZERO runtime dependencies and defines the complete
* JSON schema protocol for the Object UI ecosystem.
*
* ## Philosophy
*
* Object UI follows a "Schema First" approach where:
* 1. Types define the protocol (this package)
* 2. Core implements the engine (@object-ui/core)
* 3. React provides the framework bindings (@object-ui/react)
* 4. Components provide the UI implementation (@object-ui/components)
*
* ## Design Principles
*
* - **Protocol Agnostic**: Works with any backend (REST, GraphQL, ObjectQL)
* - **Framework Agnostic**: Types can be used with React, Vue, or vanilla JS
* - **Zero Dependencies**: Pure TypeScript with no runtime dependencies
* - **Tailwind Native**: Designed for Tailwind CSS styling via className
* - **Type Safe**: Full TypeScript support with strict typing
*
* ## Usage
*
* ```typescript
* import type { InputSchema, FormSchema, ButtonSchema } from '@object-ui/types';
*
* const loginForm: FormSchema = {
* type: 'form',
* fields: [
* { name: 'email', type: 'input', inputType: 'email', required: true },
* { name: 'password', type: 'input', inputType: 'password', required: true }
* ]
* };
* ```
*
* @packageDocumentation
*/
// ============================================================================
// Application - Global Configuration
// ============================================================================
export type {
AppSchema,
AppAction,
NavigationItem,
NavigationItemType,
NavigationArea,
MenuItem as AppMenuItem,
AppWizardStepId,
AppWizardStep,
BrandingConfig,
ObjectSelection,
AppWizardDraft,
EditorMode,
} from './app';
export { menuItemToNavigationItem, isValidAppName, wizardDraftToAppSchema } from './app';
// Object-level semantic-role readers (ADR-0085), shared across surfaces.
export { detectStatusField } from './record-semantics';
export type { StatusFieldSource } from './record-semantics';
// ============================================================================
// Base Types - The Foundation
// ============================================================================
export type {
BaseSchema,
SchemaNode,
ComponentRendererProps,
ComponentInput,
ComponentMeta,
ComponentConfig,
HTMLAttributes,
EventHandlers,
StyleProps,
} from './base';
// ============================================================================
// Layout Components - Structure & Organization
// ============================================================================
export type {
DivSchema,
SpanSchema,
TextSchema,
ImageSchema,
IconSchema,
SeparatorSchema,
ContainerSchema,
FlexSchema,
StackSchema,
GridSchema,
CardSchema,
TabsSchema,
TabItem,
ScrollAreaSchema,
ResizableSchema,
ResizablePanel,
AspectRatioSchema,
LayoutSchema,
PageSchema,
PageSlotMap,
PageType,
PageRegion,
PageRegionWidth,
PageVariable,
} from './layout';
// ============================================================================
// Form Components - User Input & Interaction
// ============================================================================
export type {
ButtonSchema,
InputSchema,
TextareaSchema,
SelectSchema,
SelectOption,
CheckboxSchema,
RadioGroupSchema,
RadioOption,
SwitchSchema,
SliderSchema,
FileUploadSchema,
DatePickerSchema,
CalendarSchema,
ValidationRule,
FieldCondition,
FormField,
FormFieldTab,
ComboboxSchema,
CommandSchema,
InputOTPSchema,
ToggleSchema,
FormSchema,
LabelSchema,
FormComponentSchema,
} from './form';
// ============================================================================
// Data Display Components - Information Presentation
// ============================================================================
export type {
AlertSchema,
BadgeSchema,
AvatarSchema,
ListSchema,
ListItem,
TableColumn,
TableSchema,
DataTableSchema,
MarkdownSchema,
TreeNode,
TreeViewSchema,
ChartType,
ChartSeries,
ChartSchema,
PivotAggregation,
PivotTableSchema,
DrillDownConfig,
TimelineEvent,
TimelineSchema,
KbdSchema,
HtmlSchema,
StatisticSchema,
DataDisplaySchema,
} from './data-display';
// ============================================================================
// Feedback Components - Status & Progress Indication
// ============================================================================
export type {
SpinnerSchema,
LoadingSchema,
ProgressSchema,
SkeletonSchema,
ToastSchema,
EmptySchema,
SonnerSchema,
ToasterSchema,
FeedbackSchema,
} from './feedback';
// ============================================================================
// Disclosure Components - Collapsible Content
// ============================================================================
export type {
AccordionItem,
ToggleGroupSchema,
AccordionSchema,
CollapsibleSchema,
DisclosureSchema,
} from './disclosure';
// ============================================================================
// Overlay Components - Modals & Popovers
// ============================================================================
export type {
OverlayPosition,
OverlayAlignment,
DialogSchema,
AlertDialogSchema,
SheetSchema,
DrawerSchema,
PopoverSchema,
TooltipSchema,
HoverCardSchema,
MenuItem,
MenubarSchema,
DropdownMenuSchema,
ContextMenuSchema,
OverlaySchema,
} from './overlay';
// ============================================================================
// Navigation Components - Menus & Navigation
// ============================================================================
export type {
NavLink,
HeaderBarSchema,
SidebarSchema,
BreadcrumbItem,
BreadcrumbSchema,
ButtonGroupSchema,
NavigationMenuSchema,
NavigationSchema,
PaginationSchema,
} from './navigation';
// ============================================================================
// Complex Components - Advanced/Composite Components
// ============================================================================
export type {
KanbanColumn,
KanbanCard,
KanbanSchema,
CalendarViewMode,
CalendarEvent,
CalendarViewSchema,
FilterOperator,
FilterCondition,
FilterGroup,
FilterBuilderSchema,
FilterField,
CarouselItem,
CarouselSchema,
DashboardWidgetLayout,
DashboardWidgetSchema,
DashboardSchema,
ChatMessage,
ChatMessageSource,
ChatToolInvocation,
ChatbotSchema,
FloatingChatbotConfig,
ComplexSchema,
} from './complex';
// ============================================================================
// Data Management - Backend Integration
// ============================================================================
export type {
QueryParams,
QueryResult,
DataSource,
GlobalSearchHit,
GlobalSearchResult,
BatchRef,
BatchTransactionOperation,
DataScope,
DataContext,
DataBinding,
ValidationError,
APIError,
FileUploadResult,
AggregateParams,
AggregateResult,
MutationEvent,
ExportJobStatus,
ExportJobFormat,
CreateExportJobRequest,
CreateExportJobResult,
ExportJobProgressInfo,
ImportWriteMode,
ImportFieldMappingEntry,
ImportRequestOptions,
ImportRowResult,
ImportRecordsResult,
ImportJobStatus,
CreateImportJobResult,
ImportJobProgressInfo,
ImportJobResultsInfo,
ImportJobSummaryInfo,
ImportJobUndoResult,
ListImportJobsOptions,
ExportDownloadRequest,
} from './data';
// ============================================================================
// CRUD Components - Create, Read, Update, Delete Operations
// ============================================================================
export type {
ActionSchema,
CRUDOperation,
CRUDFilter,
CRUDToolbar,
CRUDPagination,
CRUDSchema,
DetailSchema,
CRUDDialogSchema,
CRUDComponentSchema,
} from './crud';
// ============================================================================
// ObjectQL Components - ObjectQL-specific components
// ============================================================================
export type {
// Schema types aligned with @objectstack/spec
HttpMethod,
HttpRequest,
ViewData,
ListColumn,
SelectionConfig,
PaginationConfig,
KanbanConfig,
CalendarConfig,
GanttConfig,
ListViewGalleryConfig,
ListViewTimelineConfig,
SortConfig,
// ConditionalFormatting dual-format types
ObjectUIConditionalFormattingRule,
SpecConditionalFormattingRule,
ConditionalFormattingRule,
// Component schemas
ObjectMapSchema,
ObjectGanttSchema,
ObjectCalendarSchema,
ObjectKanbanSchema,
KanbanConditionalFormattingRule,
KanbanNativeConditionalFormattingRule,
ObjectChartSchema,
ListViewSchema,
ObjectGridSchema,
ObjectFormSchema,
ObjectFormSection,
SubmitBehavior,
ObjectViewSchema,
NamedListView,
ViewNavigationConfig,
ViewTabBarConfig,
ObjectQLComponentSchema,
BulkActionDef,
BulkActionParam,
BulkActionOperation,
} from './objectql';
// ============================================================================
// Record Components - Spec-aligned record:* page component props
// ============================================================================
export type {
RecordComponentAriaProps,
RecordDetailsComponentProps,
RecordHighlightsComponentProps,
RecordRelatedListComponentProps,
RecordActivityComponentProps,
RecordChatterComponentProps,
RecordPathComponentProps,
} from './record-components';
// ============================================================================
// Field Types - ObjectQL Field Type System
// ============================================================================
export type {
BaseFieldMetadata,
VisibilityCondition,
ValidationFunction as FieldValidationFunction,
TextFieldMetadata,
TextareaFieldMetadata,
MarkdownFieldMetadata,
HtmlFieldMetadata,
NumberFieldMetadata,
CurrencyFieldMetadata,
PercentFieldMetadata,
BooleanFieldMetadata,
DateFieldMetadata,
DateTimeFieldMetadata,
TimeFieldMetadata,
SelectFieldMetadata,
SelectOptionMetadata,
EmailFieldMetadata,
PhoneFieldMetadata,
UrlFieldMetadata,
PasswordFieldMetadata,
FileFieldMetadata,
FileMetadata,
ImageFieldMetadata,
LocationFieldMetadata,
LookupFieldMetadata,
LookupColumnDef,
LookupFilterDef,
FormulaFieldMetadata,
SummaryFieldMetadata,
AutoNumberFieldMetadata,
UserFieldMetadata,
ObjectFieldMetadata,
VectorFieldMetadata,
GridFieldMetadata,
GridColumnDefinition,
ColorFieldMetadata,
CodeFieldMetadata,
AvatarFieldMetadata,
SignatureFieldMetadata,
QRCodeFieldMetadata,
AddressFieldMetadata,
GeolocationFieldMetadata,
SliderFieldMetadata,
RatingFieldMetadata,
MasterDetailFieldMetadata,
FieldMetadata,
ObjectTrigger,
ObjectPermission,
SharingRule,
ObjectSchemaMetadata,
ObjectIndex,
ObjectRelationship,
} from './field-types';
// System / audit / ownership field classification — runtime helper + name set,
// used by default list-column derivation to keep framework-injected fields
// (notably `owner_id`) out of the leading business columns.
export { SYSTEM_MANAGED_FIELD_NAMES, isSystemManagedField } from './system-fields';
export { MANAGED_BY_BUCKETS } from './managed-by';
export type { ManagedByBucket } from './managed-by';
// ============================================================================
// Phase 3: Data Protocol Advanced Types
// ============================================================================
export type {
// Query AST (Phase 3.3)
QueryASTNodeType,
QueryASTNode,
SelectNode,
FromNode,
WhereNode,
JoinNode,
JoinStrategy,
GroupByNode,
OrderByNode,
LimitNode,
OffsetNode,
SubqueryNode,
AggregateNode,
WindowNode,
WindowFunction,
WindowFrame,
WindowFrameUnit,
WindowFrameBoundary,
FieldNode,
LiteralNode,
OperatorNode,
FunctionNode,
ComparisonOperator,
LogicalOperator,
QueryAST,
QuerySchema,
QuerySortConfig,
JoinConfig,
AggregationConfig,
WindowConfig,
// Filter Schema (Phase 3.4)
AdvancedFilterSchema,
AdvancedFilterCondition,
AdvancedFilterOperator,
DateRangeFilter,
DateRangePreset,
FilterBuilderConfig,
FilterFieldConfig,
// Validation Schema (Phase 3.5)
AdvancedValidationSchema,
AdvancedValidationRule,
ValidationRuleType,
ValidationFunction,
AsyncValidationFunction,
ValidationContext,
AdvancedValidationResult,
AdvancedValidationError,
// ObjectStack Spec v2.0.1 Validation
BaseValidation,
ScriptValidation,
UniquenessValidation,
StateMachineValidation,
CrossFieldValidation,
AsyncValidation,
ConditionalValidation,
FormatValidation,
RangeValidation,
ObjectValidationRule,
// Driver Interface (Phase 3.6)
DriverInterface,
ConnectionConfig,
DriverQueryResult,
BatchOperation,
BatchResult,
TransactionContext,
CacheManager,
ConnectionPool,
// Datasource Schema (Phase 3.7)
DatasourceSchema,
DatasourceType,
DatasourceMetric,
DatasourceAlert,
DatasourceManager,
HealthCheckResult,
DatasourceMetrics,
} from './data-protocol';
// ============================================================================
// Permission & RBAC Types (Q2 2026)
// ============================================================================
export type {
PermissionAction,
PermissionEffect,
RoleDefinition,
ObjectLevelPermission,
FieldLevelPermission,
RowLevelPermission,
PermissionCondition,
ObjectPermissionConfig,
SharingRuleConfig,
PermissionCheckResult,
PermissionContext,
PermissionGuardConfig,
} from './permissions';
// ============================================================================
// Mobile Optimization Types (Q2 2026)
// ============================================================================
export type {
BreakpointName,
ResponsiveValue,
ResponsiveConfig,
MobileOverrides,
PWAConfig,
PWAIcon,
CacheStrategy,
OfflineConfig,
OfflineRoute,
GestureType,
GestureConfig,
GestureContext,
MobileComponentConfig,
} from './mobile';
// ============================================================================
// Visual Designer Types (Q2 2026)
// ============================================================================
export type {
DesignerPosition,
DesignerCanvasConfig,
DesignerComponent,
PageDesignerSchema,
DesignerPaletteCategory,
DesignerPaletteItem,
DataModelEntity,
DataModelField,
DataModelRelationship,
DataModelDesignerSchema,
BPMNNodeType,
BPMNNode,
BPMNEdge,
BPMNLane,
ProcessDesignerSchema,
ReportSectionType,
ReportDesignerElement,
ReportDesignerSection,
ReportDesignerSchema,
CollaborationPresence,
CollaborationOperation,
CollaborationConfig,
ViewColumnConfig,
UnifiedViewType,
UnifiedViewConfig,
DashboardColorVariant,
DashboardWidgetType,
DashboardWidgetConfig,
DashboardConfig,
ObjectDefinition,
ObjectDefinitionRelationship,
ObjectManagerSchema,
DesignerFieldType,
DesignerFieldOption,
DesignerValidationRule,
DesignerFieldDefinition,
FieldDesignerSchema,
} from './designer';
export {
DASHBOARD_COLOR_VARIANTS,
DASHBOARD_WIDGET_TYPES,
} from './designer';
// ============================================================================
// API and Events - API Integration and Event Handling
// ============================================================================
export type {
HTTPMethod,
APIRequest,
APIConfig,
EventHandler,
EventableSchema,
DataFetchConfig,
DataFetchableSchema,
ExpressionContext,
ExpressionSchema,
APISchema,
} from './api-types';
// ============================================================================
// Union Types - Discriminated Unions for All Schemas
// ============================================================================
import type { BaseSchema, SchemaNode } from './base';
import type { LayoutSchema, PageSchema } from './layout';
import type { FormComponentSchema } from './form';
import type { DataDisplaySchema } from './data-display';
import type { FeedbackSchema } from './feedback';
import type { DisclosureSchema } from './disclosure';
import type { OverlaySchema } from './overlay';
import type { NavigationSchema } from './navigation';
import type { ComplexSchema, DashboardSchema } from './complex';
import type { CRUDComponentSchema } from './crud';
import type { ObjectQLComponentSchema, ListViewSchema } from './objectql';
import type { AppSchema } from './app';
// ============================================================================
// Phase 2 Schemas - New Additions
// ============================================================================
export type {
// Theme System (aligned with @objectstack/spec)
Theme,
ThemeSchema,
ThemeMode,
ColorPalette,
Typography,
BorderRadius,
Shadow,
Animation,
ZIndex,
ThemeSwitcherSchema,
ThemePreviewSchema,
// Legacy aliases
ThemeDefinition,
} from './theme';
export type {
// Report Presentation Layer (ObjectUI-specific UX enhancements:
// sections, schedule, export presets, conditional formatting, etc.).
// For the protocol-level Report definition, use `Spec*` exports below.
ReportSchema,
ReportType,
ReportExportFormat,
ReportScheduleFrequency,
ReportAggregationType,
ReportField,
ReportFilter,
ReportGroupBy,
ReportSection,
ReportSchedule,
ReportExportConfig,
ReportBuilderSchema,
ReportViewerSchema,
} from './reports';
// ---------------------------------------------------------------------------
// Spec Report Bridge
//
// Authoritative report protocol from @objectstack/spec, re-exported under
// `Spec*` names so they coexist with the legacy presentation `ReportSchema`.
// See `./spec-report.ts` for the layering rationale.
// ---------------------------------------------------------------------------
export type {
SpecReportInput,
SpecReportChart,
SpecReportChartInput,
SpecReportTypeName,
SpecReportAggregate,
SpecReportDateGranularity,
QLAggregationFunction,
LegacyReportPresentationLike,
JoinedReportBlock,
JoinedSpecReport,
} from './spec-report';
export {
SpecReportSchema,
SpecReportChartSchema,
SpecReportTypeEnum,
SpecReport,
mapAggregateToQL,
specReportToPresentation,
isSpecReport,
isJoinedSpecReport,
} from './spec-report';
// Workflow / Flow Designer schemas removed in 9.0 — they backed the retired
// `@object-ui/plugin-workflow` designers, whose BPMN-style node vocabulary the
// ObjectStack automation engine does not execute (ADR-0020, ADR-0031). The
// supported flow designer is the Studio's metadata-admin FlowCanvas in
// `@object-ui/app-shell`, which models nodes/edges locally against the
// `@objectstack/spec` flow schema.
export type {
// AI System
AIProvider,
AIModelType,
AIConfig,
AIFieldSuggestion,
AIFormAssistSchema,
AIRecommendationItem,
AIRecommendationsSchema,
NLQueryResult,
NLQuerySchema,
AIInsightsSchema,
} from './ai';
export type {
// Block System
BlockSchema,
BlockMetadata,
BlockVariable,
BlockSlot,
BlockLibraryItem,
BlockLibrarySchema,
BlockEditorSchema,
BlockInstanceSchema,
ComponentSchema,
} from './blocks';
export type {
// View System Enhancements
ViewType,
DetailViewSchema,
DetailViewField,
DetailViewSection,
DetailViewTab,
SectionGroup,
HighlightField,
ViewSwitcherSchema,
FilterUISchema,
SortUISchema,
ViewComponentSchema,
CommentEntry,
MentionNotification,
CommentSearchResult,
ActivityEntry,
// Feed / Chatter Protocol Types
FeedItemType,
FeedItem,
FieldChangeEntry,
Mention,
Reaction,
RecordSubscription,
} from './views';
export type {
// Enhanced Action System (Phase 2)
ActionExecutionMode,
ActionCallback,
ActionCondition,
} from './crud';
/**
* Union of all component schemas.
* Use this for generic component rendering where the type is determined at runtime.
*/
export type AnySchema =
| AppSchema
| BaseSchema
| LayoutSchema
| PageSchema
| FormComponentSchema
| DataDisplaySchema
| FeedbackSchema
| DisclosureSchema
| OverlaySchema
| NavigationSchema
| ComplexSchema
| DashboardSchema
| CRUDComponentSchema
| ObjectQLComponentSchema
| ListViewSchema;
/**
* Utility type to extract the schema type from a type string.
* Useful for type narrowing in renderers.
*
* @example
* ```typescript
* function renderComponent<T extends string>(schema: SchemaByType<T>) {
* // schema is now typed based on the type string
* }
* ```
*/
export type SchemaByType<T extends string> = Extract<AnySchema, { type: T }>;
/**
* Utility type to make all properties optional except the type.
* Useful for partial schema definitions in editors.
*/
export type PartialSchema<T extends BaseSchema> = {
type: T['type'];
} & Partial<Omit<T, 'type'>>;
/**
* Schema with required children (for container components).
*/
export type ContainerSchemaWithChildren = BaseSchema & {
children: SchemaNode | SchemaNode[];
};
/**
* Version information
*/
export const VERSION = '0.1.0';
/**
* Schema version for compatibility checking
*/
export const SCHEMA_VERSION = '1.0.0';
// ============================================================================
// Schema Registry - The Type Map
// ============================================================================
export type {
SchemaRegistry,
ComponentType,
} from './registry';
// ============================================================================
// Plugin Scope Isolation - Section 3.3
// ============================================================================
export type {
PluginScope,
PluginScopeConfig,
AppPluginContext,
AppMetadataPlugin,
ComponentMeta as PluginComponentMeta,
ComponentInput as PluginComponentInput,
PluginEventHandler,
} from './plugin-scope';
// ============================================================================
// UI Actions - Enhanced Action Schema (ObjectStack Spec v2.0.1)
// ============================================================================
/**
* Enhanced action schema with location-based placement, parameter collection,
* conditional visibility, and rich feedback mechanisms.
*/
export type {
ActionLocation,
ActionComponent,
ActionType,
ObjectUiLocalActionType,
RunnableActionType,
ActionParamFieldType,
ObjectUiLocalParamFieldType,
ResolvableParamFieldType,
ActionParam,
ActionSchema as UIActionSchema,
ActionGroup,
ActionContext,
ActionResult,
ActionExecutor,
BatchOperationConfig,
BatchOperationResult,
TransactionIsolationLevel,
TransactionConfig,
TransactionResult,
UndoRedoEntry,
UndoRedoConfig,
UndoRedoState,
} from './ui-action';
export {
ACTION_LOCATIONS,
ActionLocationSchema,
OBJECTUI_LOCAL_ACTION_TYPES,
OBJECTUI_LOCAL_PARAM_FIELD_TYPES,
ACTION_PARAM_FIELD_TYPES,
} from './ui-action';
// ============================================================================
// ObjectStack Protocol Namespaces - Protocol Re-exports
// ============================================================================
/**
* Re-export ObjectStack Protocol namespaces for convenience.
*
* This allows consumers to access the full ObjectStack protocol through
* @object-ui/types without needing to install @objectstack/spec separately.
*
* @example
* ```typescript
* import { Data, UI, System, AI, API, Kernel } from '@object-ui/types';
*
* const field: Data.Field = { name: 'task_name', type: 'text' };
* const view: UI.ListView = { name: 'all', label: 'All Records', ... };
* ```
*/
export type * as Data from '@objectstack/spec/data';
export type * as UI from '@objectstack/spec/ui';
export type * as System from '@objectstack/spec/system';
export type * as AI from '@objectstack/spec/ai';
export type * as API from '@objectstack/spec/api';
export type * as Cloud from '@objectstack/spec/cloud';
export type * as Automation from '@objectstack/spec/automation';
export type * as Shared from '@objectstack/spec/shared';
export type * as QA from '@objectstack/spec/qa';
export type * as Kernel from '@objectstack/spec/kernel';
export type * as Contracts from '@objectstack/spec/contracts';
export type * as Integration from '@objectstack/spec/integration';
export type * as Studio from '@objectstack/spec/studio';
export type * as Identity from '@objectstack/spec/identity';
export type * as Security from '@objectstack/spec/security';
// ============================================================================
// ObjectStack Protocol Utilities - defineStack
// ============================================================================
/**
* Re-export ObjectStack Protocol utility functions and top-level types.
*
* @example
* ```typescript
* import { defineStack } from '@object-ui/types';
*
* export default defineStack({
* manifest: { id: 'com.example.app', version: '1.0.0', type: 'app', name: 'My App' },
* objects: [],
* apps: [],
* });
* ```
*/
export {
defineStack,
ObjectStackSchema,
ObjectStackDefinitionSchema,
} from '@objectstack/spec';
export type {
PluginContext,
ObjectStack,
ObjectStackDefinition,
} from '@objectstack/spec';
// ----------------------------------------------------------------------------
// NOTE (#2561): the `@objectstack/spec/ui` blocks below re-export the inferred
// *types* only. The companion zod validators (`…Schema`) are deliberately NOT
// re-exported: inside `export type { … }` they were value-erased, so importing
// one as a value from `@object-ui/types` silently yielded `undefined` at
// runtime. Consumers that need the runtime validators must import them from
// `@objectstack/spec/ui` directly. Guardrail:
// `src/__tests__/spec-ui-schema-reexports.test.ts`.
// ----------------------------------------------------------------------------
// ============================================================================
// v2.0.7 Spec UI Types — Drag and Drop
// ============================================================================
export type {
DndConfig,
DragItem,
DropZone,
DragConstraint,
DragHandle,
DropEffect,
} from '@objectstack/spec/ui';
// ============================================================================
// v2.0.7 Spec UI Types — Focus & Keyboard Navigation
// ============================================================================
export type {
FocusManagement,
FocusTrapConfig,
KeyboardNavigationConfig,
KeyboardShortcut,
} from '@objectstack/spec/ui';
// ============================================================================
// v2.0.7 Spec UI Types — Animation & Motion
// ============================================================================
export type {
ComponentAnimation,
AnimationTrigger,
MotionConfig,