@object-ui/types 0.5.0 → 3.0.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 (127) hide show
  1. package/README.md +1 -1
  2. package/dist/ai.d.ts +376 -0
  3. package/dist/ai.d.ts.map +1 -0
  4. package/dist/ai.js +8 -0
  5. package/dist/app.d.ts +2 -2
  6. package/dist/complex.d.ts +2 -0
  7. package/dist/complex.d.ts.map +1 -1
  8. package/dist/crud.d.ts +3 -0
  9. package/dist/crud.d.ts.map +1 -1
  10. package/dist/data-display.d.ts +40 -0
  11. package/dist/data-display.d.ts.map +1 -1
  12. package/dist/data-protocol.d.ts +19 -19
  13. package/dist/data.d.ts +77 -0
  14. package/dist/data.d.ts.map +1 -1
  15. package/dist/designer.d.ts +473 -0
  16. package/dist/designer.d.ts.map +1 -0
  17. package/dist/designer.js +8 -0
  18. package/dist/form.d.ts +35 -1
  19. package/dist/form.d.ts.map +1 -1
  20. package/dist/index.d.ts +46 -8
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +18 -0
  23. package/dist/layout.d.ts +63 -8
  24. package/dist/layout.d.ts.map +1 -1
  25. package/dist/mobile.d.ts +186 -0
  26. package/dist/mobile.d.ts.map +1 -0
  27. package/dist/mobile.js +8 -0
  28. package/dist/objectql.d.ts +341 -88
  29. package/dist/objectql.d.ts.map +1 -1
  30. package/dist/permissions.d.ts +150 -0
  31. package/dist/permissions.d.ts.map +1 -0
  32. package/dist/permissions.js +8 -0
  33. package/dist/tenant.d.ts +138 -0
  34. package/dist/tenant.d.ts.map +1 -0
  35. package/dist/tenant.js +8 -0
  36. package/dist/theme.d.ts +115 -224
  37. package/dist/theme.d.ts.map +1 -1
  38. package/dist/ui-action.d.ts +126 -11
  39. package/dist/ui-action.d.ts.map +1 -1
  40. package/dist/views.d.ts +20 -0
  41. package/dist/views.d.ts.map +1 -1
  42. package/dist/widget.d.ts +181 -0
  43. package/dist/widget.d.ts.map +1 -0
  44. package/dist/widget.js +8 -0
  45. package/dist/workflow.d.ts +340 -0
  46. package/dist/workflow.d.ts.map +1 -0
  47. package/dist/workflow.js +8 -0
  48. package/dist/zod/blocks.zod.d.ts +2 -2
  49. package/dist/zod/blocks.zod.d.ts.map +1 -1
  50. package/dist/zod/blocks.zod.js +1 -1
  51. package/dist/zod/complex.zod.d.ts +6 -6
  52. package/dist/zod/complex.zod.d.ts.map +1 -1
  53. package/dist/zod/complex.zod.js +1 -1
  54. package/dist/zod/crud.zod.d.ts +5 -5
  55. package/dist/zod/data-display.zod.d.ts +2 -2
  56. package/dist/zod/data-display.zod.d.ts.map +1 -1
  57. package/dist/zod/data-display.zod.js +1 -1
  58. package/dist/zod/disclosure.zod.d.ts +2 -2
  59. package/dist/zod/disclosure.zod.d.ts.map +1 -1
  60. package/dist/zod/disclosure.zod.js +1 -1
  61. package/dist/zod/feedback.zod.d.ts +12 -12
  62. package/dist/zod/feedback.zod.d.ts.map +1 -1
  63. package/dist/zod/feedback.zod.js +1 -1
  64. package/dist/zod/form.zod.d.ts +6 -6
  65. package/dist/zod/form.zod.d.ts.map +1 -1
  66. package/dist/zod/form.zod.js +1 -1
  67. package/dist/zod/index.zod.d.ts +337 -146
  68. package/dist/zod/index.zod.d.ts.map +1 -1
  69. package/dist/zod/index.zod.js +4 -4
  70. package/dist/zod/layout.zod.d.ts +134 -2
  71. package/dist/zod/layout.zod.d.ts.map +1 -1
  72. package/dist/zod/layout.zod.js +35 -1
  73. package/dist/zod/navigation.zod.d.ts +2 -2
  74. package/dist/zod/navigation.zod.d.ts.map +1 -1
  75. package/dist/zod/navigation.zod.js +1 -1
  76. package/dist/zod/objectql.zod.d.ts +32 -16
  77. package/dist/zod/objectql.zod.d.ts.map +1 -1
  78. package/dist/zod/objectql.zod.js +8 -0
  79. package/dist/zod/overlay.zod.d.ts +2 -2
  80. package/dist/zod/overlay.zod.d.ts.map +1 -1
  81. package/dist/zod/overlay.zod.js +1 -1
  82. package/dist/zod/reports.zod.d.ts +19 -19
  83. package/dist/zod/reports.zod.d.ts.map +1 -1
  84. package/dist/zod/reports.zod.js +1 -1
  85. package/dist/zod/theme.zod.d.ts +948 -267
  86. package/dist/zod/theme.zod.d.ts.map +1 -1
  87. package/dist/zod/theme.zod.js +175 -45
  88. package/dist/zod/views.zod.d.ts +22 -22
  89. package/dist/zod/views.zod.d.ts.map +1 -1
  90. package/dist/zod/views.zod.js +1 -1
  91. package/package.json +3 -2
  92. package/src/__tests__/namespace-exports.test.ts +23 -68
  93. package/src/__tests__/phase2-schemas.test.ts +8 -13
  94. package/src/ai.ts +454 -0
  95. package/src/app.ts +2 -2
  96. package/src/complex.ts +2 -0
  97. package/src/crud.ts +3 -0
  98. package/src/data-display.ts +36 -0
  99. package/src/data-protocol.ts +19 -19
  100. package/src/data.ts +91 -0
  101. package/src/designer.ts +509 -0
  102. package/src/form.ts +35 -1
  103. package/src/index.ts +397 -8
  104. package/src/layout.ts +66 -8
  105. package/src/mobile.ts +205 -0
  106. package/src/objectql.ts +419 -93
  107. package/src/permissions.ts +166 -0
  108. package/src/tenant.ts +153 -0
  109. package/src/theme.ts +147 -260
  110. package/src/ui-action.ts +166 -27
  111. package/src/views.ts +17 -0
  112. package/src/widget.ts +197 -0
  113. package/src/workflow.ts +409 -0
  114. package/src/zod/blocks.zod.ts +1 -1
  115. package/src/zod/complex.zod.ts +1 -1
  116. package/src/zod/data-display.zod.ts +1 -1
  117. package/src/zod/disclosure.zod.ts +1 -1
  118. package/src/zod/feedback.zod.ts +1 -1
  119. package/src/zod/form.zod.ts +1 -1
  120. package/src/zod/index.zod.ts +14 -3
  121. package/src/zod/layout.zod.ts +39 -1
  122. package/src/zod/navigation.zod.ts +1 -1
  123. package/src/zod/objectql.zod.ts +8 -0
  124. package/src/zod/overlay.zod.ts +1 -1
  125. package/src/zod/reports.zod.ts +1 -1
  126. package/src/zod/theme.zod.ts +189 -48
  127. package/src/zod/views.zod.ts +1 -1
package/src/mobile.ts ADDED
@@ -0,0 +1,205 @@
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 - Mobile Optimization Types
11
+ *
12
+ * Type definitions for mobile-responsive components, PWA support,
13
+ * and touch gesture handling.
14
+ *
15
+ * @module mobile
16
+ * @packageDocumentation
17
+ */
18
+
19
+ // ============================================================================
20
+ // Responsive Configuration
21
+ // ============================================================================
22
+
23
+ /** Breakpoint names */
24
+ export type BreakpointName = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
25
+
26
+ /** Responsive value - different values for different breakpoints */
27
+ export type ResponsiveValue<T> = T | Partial<Record<BreakpointName, T>>;
28
+
29
+ /** Responsive layout configuration */
30
+ export interface ResponsiveConfig {
31
+ /** Number of columns at each breakpoint */
32
+ columns?: ResponsiveValue<number>;
33
+ /** Whether to stack vertically on mobile */
34
+ stackOnMobile?: boolean;
35
+ /** Breakpoint at which to stack */
36
+ stackBreakpoint?: BreakpointName;
37
+ /** Gap between items at each breakpoint */
38
+ gap?: ResponsiveValue<string | number>;
39
+ /** Padding at each breakpoint */
40
+ padding?: ResponsiveValue<string | number>;
41
+ /** Whether to hide on specific breakpoints */
42
+ hidden?: BreakpointName[];
43
+ /** Whether to show only on specific breakpoints */
44
+ showOnly?: BreakpointName[];
45
+ }
46
+
47
+ /** Mobile-specific component overrides */
48
+ export interface MobileOverrides {
49
+ /** Simplified layout for mobile */
50
+ layout?: 'stack' | 'tabs' | 'accordion' | 'carousel';
51
+ /** Reduced columns for forms */
52
+ columns?: number;
53
+ /** Whether to use bottom sheet instead of modal */
54
+ useBottomSheet?: boolean;
55
+ /** Whether to use full-screen mode */
56
+ fullScreen?: boolean;
57
+ /** Touch-friendly sizing */
58
+ touchTarget?: 'default' | 'large' | 'xlarge';
59
+ /** Simplified navigation */
60
+ navigation?: 'bottom-tabs' | 'hamburger' | 'drawer';
61
+ }
62
+
63
+ // ============================================================================
64
+ // PWA Support
65
+ // ============================================================================
66
+
67
+ /** PWA configuration */
68
+ export interface PWAConfig {
69
+ /** Enable PWA support */
70
+ enabled: boolean;
71
+ /** App name */
72
+ name: string;
73
+ /** Short name for home screen */
74
+ shortName: string;
75
+ /** App description */
76
+ description?: string;
77
+ /** Theme color */
78
+ themeColor?: string;
79
+ /** Background color */
80
+ backgroundColor?: string;
81
+ /** Display mode */
82
+ display?: 'standalone' | 'fullscreen' | 'minimal-ui' | 'browser';
83
+ /** App icons */
84
+ icons?: PWAIcon[];
85
+ /** Start URL */
86
+ startUrl?: string;
87
+ /** Scope */
88
+ scope?: string;
89
+ /** Orientation */
90
+ orientation?: 'any' | 'portrait' | 'landscape';
91
+ }
92
+
93
+ /** PWA icon definition */
94
+ export interface PWAIcon {
95
+ /** Icon URL */
96
+ src: string;
97
+ /** Icon sizes (e.g., '192x192') */
98
+ sizes: string;
99
+ /** MIME type */
100
+ type?: string;
101
+ /** Purpose */
102
+ purpose?: 'any' | 'maskable' | 'monochrome';
103
+ }
104
+
105
+ /** Offline caching strategy */
106
+ export type CacheStrategy = 'cache-first' | 'network-first' | 'stale-while-revalidate' | 'network-only' | 'cache-only';
107
+
108
+ /** Offline configuration */
109
+ export interface OfflineConfig {
110
+ /** Enable offline support */
111
+ enabled: boolean;
112
+ /** Default caching strategy */
113
+ defaultStrategy: CacheStrategy;
114
+ /** Routes with specific caching strategies */
115
+ routes?: OfflineRoute[];
116
+ /** Maximum cache size in bytes */
117
+ maxCacheSize?: number;
118
+ /** Cache expiration in seconds */
119
+ cacheExpiration?: number;
120
+ /** Objects to cache for offline access */
121
+ offlineObjects?: string[];
122
+ /** Sync strategy when back online */
123
+ syncStrategy?: 'immediate' | 'background' | 'manual';
124
+ /** Conflict resolution strategy */
125
+ conflictResolution?: 'server-wins' | 'client-wins' | 'manual';
126
+ }
127
+
128
+ /** Offline route configuration */
129
+ export interface OfflineRoute {
130
+ /** URL pattern (glob or regex) */
131
+ pattern: string;
132
+ /** Caching strategy for this route */
133
+ strategy: CacheStrategy;
134
+ /** Cache name */
135
+ cacheName?: string;
136
+ /** Cache expiration override */
137
+ expiration?: number;
138
+ }
139
+
140
+ // ============================================================================
141
+ // Touch Gestures
142
+ // ============================================================================
143
+
144
+ /** Touch gesture types */
145
+ export type GestureType = 'tap' | 'double-tap' | 'long-press' | 'swipe-left' | 'swipe-right' | 'swipe-up' | 'swipe-down' | 'pinch' | 'rotate' | 'pan';
146
+
147
+ /** Gesture handler configuration */
148
+ export interface GestureConfig {
149
+ /** Gesture type */
150
+ type: GestureType;
151
+ /** Action to execute */
152
+ action: string;
153
+ /** Minimum distance for swipe gestures (pixels) */
154
+ threshold?: number;
155
+ /** Duration for long-press (milliseconds) */
156
+ duration?: number;
157
+ /** Whether to prevent default browser behavior */
158
+ preventDefault?: boolean;
159
+ /** Whether gesture is enabled */
160
+ enabled?: boolean;
161
+ }
162
+
163
+ /** Touch gesture context */
164
+ export interface GestureContext {
165
+ /** Gesture type that was detected */
166
+ type: GestureType;
167
+ /** Start position */
168
+ startPosition: { x: number; y: number };
169
+ /** End position */
170
+ endPosition: { x: number; y: number };
171
+ /** Distance traveled */
172
+ distance: number;
173
+ /** Direction of movement */
174
+ direction?: 'up' | 'down' | 'left' | 'right';
175
+ /** Duration of gesture in milliseconds */
176
+ duration: number;
177
+ /** Velocity (pixels per millisecond) */
178
+ velocity: number;
179
+ /** Scale for pinch gestures */
180
+ scale?: number;
181
+ /** Rotation angle for rotate gestures */
182
+ rotation?: number;
183
+ }
184
+
185
+ /** Mobile component schema extension */
186
+ export interface MobileComponentConfig {
187
+ /** Responsive configuration */
188
+ responsive?: ResponsiveConfig;
189
+ /** Mobile-specific overrides */
190
+ mobileOverrides?: MobileOverrides;
191
+ /** Touch gesture handlers */
192
+ gestures?: GestureConfig[];
193
+ /** Pull-to-refresh configuration */
194
+ pullToRefresh?: {
195
+ enabled: boolean;
196
+ threshold?: number;
197
+ onRefresh?: string;
198
+ };
199
+ /** Infinite scroll configuration */
200
+ infiniteScroll?: {
201
+ enabled: boolean;
202
+ threshold?: number;
203
+ loadMore?: string;
204
+ };
205
+ }