@thewhateverapp/tile-sdk 0.13.31 → 0.13.33

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 (102) hide show
  1. package/dist/react/index.d.ts.map +1 -1
  2. package/dist/react/index.js +1 -0
  3. package/dist/spec/host/OverlayHost.d.ts +68 -0
  4. package/dist/spec/host/OverlayHost.d.ts.map +1 -0
  5. package/dist/spec/host/OverlayHost.js +143 -0
  6. package/dist/spec/host/index.d.ts +7 -0
  7. package/dist/spec/host/index.d.ts.map +1 -0
  8. package/dist/spec/host/index.js +6 -0
  9. package/dist/spec/index.d.ts +29 -0
  10. package/dist/spec/index.d.ts.map +1 -0
  11. package/dist/spec/index.js +81 -0
  12. package/dist/spec/registry/ComponentRegistry.d.ts +208 -0
  13. package/dist/spec/registry/ComponentRegistry.d.ts.map +1 -0
  14. package/dist/spec/registry/ComponentRegistry.js +227 -0
  15. package/dist/spec/registry/composites/BottomSheet.d.ts +33 -0
  16. package/dist/spec/registry/composites/BottomSheet.d.ts.map +1 -0
  17. package/dist/spec/registry/composites/BottomSheet.js +98 -0
  18. package/dist/spec/registry/composites/CountdownCTA.d.ts +35 -0
  19. package/dist/spec/registry/composites/CountdownCTA.d.ts.map +1 -0
  20. package/dist/spec/registry/composites/CountdownCTA.js +91 -0
  21. package/dist/spec/registry/composites/Poll.d.ts +39 -0
  22. package/dist/spec/registry/composites/Poll.d.ts.map +1 -0
  23. package/dist/spec/registry/composites/Poll.js +76 -0
  24. package/dist/spec/registry/composites/Prediction.d.ts +37 -0
  25. package/dist/spec/registry/composites/Prediction.d.ts.map +1 -0
  26. package/dist/spec/registry/composites/Prediction.js +116 -0
  27. package/dist/spec/registry/composites/index.d.ts +33 -0
  28. package/dist/spec/registry/composites/index.d.ts.map +1 -0
  29. package/dist/spec/registry/composites/index.js +36 -0
  30. package/dist/spec/registry/index.d.ts +15 -0
  31. package/dist/spec/registry/index.d.ts.map +1 -0
  32. package/dist/spec/registry/index.js +24 -0
  33. package/dist/spec/registry/primitives/Button.d.ts +30 -0
  34. package/dist/spec/registry/primitives/Button.d.ts.map +1 -0
  35. package/dist/spec/registry/primitives/Button.js +62 -0
  36. package/dist/spec/registry/primitives/Divider.d.ts +22 -0
  37. package/dist/spec/registry/primitives/Divider.d.ts.map +1 -0
  38. package/dist/spec/registry/primitives/Divider.js +56 -0
  39. package/dist/spec/registry/primitives/Image.d.ts +27 -0
  40. package/dist/spec/registry/primitives/Image.d.ts.map +1 -0
  41. package/dist/spec/registry/primitives/Image.js +36 -0
  42. package/dist/spec/registry/primitives/ProgressBar.d.ts +28 -0
  43. package/dist/spec/registry/primitives/ProgressBar.d.ts.map +1 -0
  44. package/dist/spec/registry/primitives/ProgressBar.js +50 -0
  45. package/dist/spec/registry/primitives/Row.d.ts +26 -0
  46. package/dist/spec/registry/primitives/Row.d.ts.map +1 -0
  47. package/dist/spec/registry/primitives/Row.js +50 -0
  48. package/dist/spec/registry/primitives/Spacer.d.ts +18 -0
  49. package/dist/spec/registry/primitives/Spacer.d.ts.map +1 -0
  50. package/dist/spec/registry/primitives/Spacer.js +25 -0
  51. package/dist/spec/registry/primitives/Stack.d.ts +22 -0
  52. package/dist/spec/registry/primitives/Stack.d.ts.map +1 -0
  53. package/dist/spec/registry/primitives/Stack.js +41 -0
  54. package/dist/spec/registry/primitives/Text.d.ts +26 -0
  55. package/dist/spec/registry/primitives/Text.d.ts.map +1 -0
  56. package/dist/spec/registry/primitives/Text.js +33 -0
  57. package/dist/spec/registry/primitives/index.d.ts +45 -0
  58. package/dist/spec/registry/primitives/index.d.ts.map +1 -0
  59. package/dist/spec/registry/primitives/index.js +55 -0
  60. package/dist/spec/renderer/BindingResolver.d.ts +35 -0
  61. package/dist/spec/renderer/BindingResolver.d.ts.map +1 -0
  62. package/dist/spec/renderer/BindingResolver.js +131 -0
  63. package/dist/spec/renderer/CaptionTrack.d.ts +22 -0
  64. package/dist/spec/renderer/CaptionTrack.d.ts.map +1 -0
  65. package/dist/spec/renderer/CaptionTrack.js +83 -0
  66. package/dist/spec/renderer/LayoutRenderer.d.ts +24 -0
  67. package/dist/spec/renderer/LayoutRenderer.d.ts.map +1 -0
  68. package/dist/spec/renderer/LayoutRenderer.js +66 -0
  69. package/dist/spec/renderer/OverlayCue.d.ts +20 -0
  70. package/dist/spec/renderer/OverlayCue.d.ts.map +1 -0
  71. package/dist/spec/renderer/OverlayCue.js +161 -0
  72. package/dist/spec/renderer/index.d.ts +10 -0
  73. package/dist/spec/renderer/index.d.ts.map +1 -0
  74. package/dist/spec/renderer/index.js +13 -0
  75. package/dist/spec/runtime/ActionRouter.d.ts +33 -0
  76. package/dist/spec/runtime/ActionRouter.d.ts.map +1 -0
  77. package/dist/spec/runtime/ActionRouter.js +84 -0
  78. package/dist/spec/runtime/OverlayRuntime.d.ts +84 -0
  79. package/dist/spec/runtime/OverlayRuntime.d.ts.map +1 -0
  80. package/dist/spec/runtime/OverlayRuntime.js +216 -0
  81. package/dist/spec/runtime/StateManager.d.ts +31 -0
  82. package/dist/spec/runtime/StateManager.d.ts.map +1 -0
  83. package/dist/spec/runtime/StateManager.js +60 -0
  84. package/dist/spec/runtime/TimeSync.d.ts +47 -0
  85. package/dist/spec/runtime/TimeSync.d.ts.map +1 -0
  86. package/dist/spec/runtime/TimeSync.js +140 -0
  87. package/dist/spec/runtime/index.d.ts +10 -0
  88. package/dist/spec/runtime/index.d.ts.map +1 -0
  89. package/dist/spec/runtime/index.js +13 -0
  90. package/dist/spec/schema.d.ts +889 -0
  91. package/dist/spec/schema.d.ts.map +1 -0
  92. package/dist/spec/schema.js +284 -0
  93. package/dist/spec/theme/ThemeProvider.d.ts +151 -0
  94. package/dist/spec/theme/ThemeProvider.d.ts.map +1 -0
  95. package/dist/spec/theme/ThemeProvider.js +227 -0
  96. package/dist/spec/theme/index.d.ts +7 -0
  97. package/dist/spec/theme/index.d.ts.map +1 -0
  98. package/dist/spec/theme/index.js +12 -0
  99. package/dist/spec/types.d.ts +322 -0
  100. package/dist/spec/types.d.ts.map +1 -0
  101. package/dist/spec/types.js +36 -0
  102. package/package.json +8 -1
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Theme Module Index
3
+ *
4
+ * Exports theme provider and presets for overlay styling.
5
+ */
6
+ export {
7
+ // Provider
8
+ ThemeProvider, useTheme, useThemeColors, useThemeColor, generateThemeCSS,
9
+ // Default theme
10
+ defaultTheme,
11
+ // Preset themes
12
+ darkTheme, lightTheme, neonTheme, warmTheme, coolTheme, } from './ThemeProvider';
@@ -0,0 +1,322 @@
1
+ /**
2
+ * Overlay Spec Types
3
+ *
4
+ * A declarative, time-synced UI protocol for hybrid video tiles.
5
+ * Specs describe what to show and when, the host runtime handles rendering.
6
+ */
7
+ export interface OverlaySpec {
8
+ /** Spec format version */
9
+ specVersion: '1.0';
10
+ /** Unique spec identifier */
11
+ id: string;
12
+ /** Target surface */
13
+ surface: 'tile' | 'full';
14
+ /** Optional metadata */
15
+ meta?: SpecMeta;
16
+ /** Time synchronization config */
17
+ sync: SyncConfig;
18
+ /** Local state initialization */
19
+ state: StateConfig;
20
+ /** Content tracks (captions + overlays) */
21
+ tracks: TracksConfig;
22
+ /** Data subscriptions (host-managed) */
23
+ subscriptions?: SubscriptionDeclaration[];
24
+ /** Theme configuration (colors, typography, spacing) */
25
+ theme?: SpecTheme;
26
+ }
27
+ /**
28
+ * Theme configuration that can be embedded in a spec.
29
+ * Allows AI agents to customize overlay appearance.
30
+ */
31
+ export interface SpecTheme {
32
+ /** Use a preset theme as base */
33
+ preset?: 'default' | 'dark' | 'light' | 'neon' | 'warm' | 'cool';
34
+ /** Custom color overrides */
35
+ colors?: Partial<{
36
+ primary: string;
37
+ secondary: string;
38
+ background: string;
39
+ foreground: string;
40
+ success: string;
41
+ warning: string;
42
+ error: string;
43
+ }>;
44
+ /** Typography overrides */
45
+ typography?: Partial<{
46
+ fontFamily: string;
47
+ }>;
48
+ /** Component-specific overrides */
49
+ components?: {
50
+ caption?: {
51
+ background?: string;
52
+ textColor?: string;
53
+ speakerColor?: string;
54
+ };
55
+ };
56
+ }
57
+ export interface SpecMeta {
58
+ title?: string;
59
+ author?: string;
60
+ description?: string;
61
+ version?: string;
62
+ }
63
+ export interface SyncConfig {
64
+ /** Time source: video player or wall clock */
65
+ timebase: 'player' | 'wallClock';
66
+ /** Update frequency: requestAnimationFrame or video timeupdate event */
67
+ tick: 'raf' | 'timeupdate';
68
+ /** Tolerance for time window boundaries (ms) */
69
+ toleranceMs: number;
70
+ /** Behavior on video seek */
71
+ onSeek: 'recompute';
72
+ /** Optional time transform */
73
+ transform?: TimeTransform;
74
+ /** Optional conditions to freeze time */
75
+ freezeWhen?: Condition;
76
+ }
77
+ export interface TimeTransform {
78
+ /** Offset in milliseconds */
79
+ offsetMs?: number;
80
+ /** Scale factor (1.0 = normal speed) */
81
+ scale?: number;
82
+ }
83
+ export interface StateConfig {
84
+ /** Initial local state values */
85
+ local: Record<string, unknown>;
86
+ }
87
+ export interface TracksConfig {
88
+ /** Optional caption track */
89
+ captions?: CaptionTrack;
90
+ /** Overlay cues */
91
+ overlays: OverlayCue[];
92
+ }
93
+ export interface CaptionTrack {
94
+ /** Time-coded caption segments */
95
+ segments: CaptionSegment[];
96
+ /** Caption styling */
97
+ style: CaptionStyle;
98
+ }
99
+ export interface CaptionSegment {
100
+ /** Start time in milliseconds */
101
+ startMs: number;
102
+ /** End time in milliseconds */
103
+ endMs: number;
104
+ /** Caption text */
105
+ text: string;
106
+ /** Optional speaker identifier */
107
+ speaker?: string;
108
+ }
109
+ export interface CaptionStyle {
110
+ /** Position on screen */
111
+ position?: 'top' | 'bottom' | 'center';
112
+ /** Text size preset */
113
+ size?: 'sm' | 'md' | 'lg';
114
+ /** Optional background style */
115
+ background?: 'none' | 'solid' | 'gradient' | boolean;
116
+ /** Optional text shadow */
117
+ shadow?: boolean;
118
+ /** Optional text color */
119
+ color?: string;
120
+ }
121
+ export interface OverlayCue {
122
+ /** Unique cue identifier */
123
+ id: string;
124
+ /** Time window for visibility */
125
+ window: TimeWindow;
126
+ /** Additional visibility condition */
127
+ visibleWhen?: Condition;
128
+ /** Positioning configuration */
129
+ placement: Placement;
130
+ /** Dismiss behavior */
131
+ dismiss?: DismissPolicy;
132
+ /** Layout tree to render */
133
+ layout: LayoutNode;
134
+ /** Optional z-index override */
135
+ zIndex?: number;
136
+ }
137
+ export interface TimeWindow {
138
+ /** Start time in ms (undefined = from beginning) */
139
+ startMs?: number;
140
+ /** End time in ms (undefined = until end) */
141
+ endMs?: number;
142
+ }
143
+ export type Placement = TilePlacement | FullPlacement;
144
+ export interface TilePlacement {
145
+ /** Lane-based positioning for tile surface */
146
+ lane: 'top' | 'center' | 'bottom';
147
+ /** Inset from edges (pixels) */
148
+ inset?: number;
149
+ /** Horizontal alignment within lane */
150
+ align?: 'left' | 'center' | 'right';
151
+ /** Z-index */
152
+ zIndex?: number;
153
+ }
154
+ export interface FullPlacement {
155
+ /** Full surface positioning */
156
+ type: 'fullscreen' | 'inset' | 'positioned';
157
+ /** Direct position values */
158
+ top?: number | string;
159
+ right?: number | string;
160
+ bottom?: number | string;
161
+ left?: number | string;
162
+ /** Dimensions */
163
+ width?: number | string;
164
+ height?: number | string;
165
+ /** Z-index */
166
+ zIndex?: number;
167
+ /** Insets for 'inset' type (legacy/alternative) */
168
+ insets?: {
169
+ top?: number;
170
+ right?: number;
171
+ bottom?: number;
172
+ left?: number;
173
+ };
174
+ /** Position for 'positioned' type (legacy/alternative) */
175
+ position?: {
176
+ x: number | string;
177
+ y: number | string;
178
+ };
179
+ }
180
+ export interface DismissTrigger {
181
+ /** Trigger type */
182
+ type: 'tap' | 'swipe' | 'timeout' | 'action' | 'tap-outside' | 'time-window-end';
183
+ /** Delay for timeout triggers */
184
+ delayMs?: number;
185
+ /** Direction for swipe triggers */
186
+ direction?: 'up' | 'down' | 'left' | 'right';
187
+ }
188
+ export interface DismissPolicy {
189
+ /** Dismiss triggers (array of trigger objects) */
190
+ triggers: DismissTrigger[];
191
+ /** Animation type */
192
+ animation?: 'fade' | 'slide' | 'none';
193
+ /** Animation duration in ms */
194
+ durationMs?: number;
195
+ }
196
+ export interface LayoutNode {
197
+ /** Component type (registry ID) */
198
+ type: string;
199
+ /** Component props */
200
+ props?: Record<string, PropValue>;
201
+ /** Child nodes */
202
+ children?: LayoutNode[];
203
+ /** Optional key for list rendering */
204
+ key?: string;
205
+ }
206
+ /** Primitive prop values */
207
+ export type PrimitivePropValue = string | number | boolean | null;
208
+ /** Complex prop value (may contain nested values) */
209
+ export type PropValue = PrimitivePropValue | Binding | Action | PropValue[] | {
210
+ [key: string]: PropValue;
211
+ };
212
+ export interface Binding {
213
+ /** Binding path */
214
+ $bind: string;
215
+ /** Fallback value if binding resolves to undefined */
216
+ fallback?: unknown;
217
+ /** Optional format string */
218
+ format?: string;
219
+ }
220
+ export declare function isBinding(value: unknown): value is Binding;
221
+ export interface Action {
222
+ /** Action type */
223
+ $action: ActionType;
224
+ /** Action payload */
225
+ payload?: Record<string, unknown>;
226
+ }
227
+ export type ActionType = 'emit' | 'setState' | 'sequence' | 'openTile' | 'openFull' | 'navigate' | 'dismiss' | 'fx';
228
+ export declare function isAction(value: unknown): value is Action;
229
+ export type Condition = BindingCondition | ComparisonCondition | LogicalCondition;
230
+ export interface BindingCondition {
231
+ $bind: string;
232
+ }
233
+ export interface ComparisonCondition {
234
+ op: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'notIn';
235
+ left: PropValue;
236
+ right: PropValue;
237
+ }
238
+ export interface LogicalCondition {
239
+ op: 'and' | 'or' | 'not';
240
+ conditions: Condition[];
241
+ }
242
+ export interface SubscriptionDeclaration {
243
+ /** Subscription identifier */
244
+ id: string;
245
+ /** Subscription type */
246
+ type: 'realtime' | 'keyspace' | 'host';
247
+ /** Channel or key to subscribe to */
248
+ channel: string;
249
+ /** Path to write data to (in data.*) */
250
+ target: string;
251
+ /** Optional transform/filter */
252
+ transform?: string;
253
+ }
254
+ export interface SpecContext {
255
+ /** Tile ID */
256
+ tileId: string;
257
+ /** Current user ID (if authenticated) */
258
+ userId?: string;
259
+ /** Current surface */
260
+ surface: 'tile' | 'full';
261
+ /** Is user authenticated */
262
+ isAuthenticated: boolean;
263
+ /** Device info */
264
+ device: {
265
+ platform: 'ios' | 'android' | 'web';
266
+ viewport: {
267
+ width: number;
268
+ height: number;
269
+ };
270
+ };
271
+ }
272
+ export interface SpecState {
273
+ /** Local state (managed by spec) */
274
+ local: Record<string, unknown>;
275
+ /** Data from host (subscriptions, props) */
276
+ data: Record<string, unknown>;
277
+ /** Read-only context */
278
+ ctx: SpecContext;
279
+ /** Current effective time in ms */
280
+ timeMs: number;
281
+ }
282
+ export interface SpecEvent {
283
+ /** Event type/name */
284
+ type: string;
285
+ /** Event payload */
286
+ payload?: Record<string, unknown>;
287
+ /** Timestamp (auto-added if not provided) */
288
+ timestamp?: number;
289
+ /** Source cue ID */
290
+ cueId?: string;
291
+ }
292
+ export interface SpecCommand {
293
+ /** Command type */
294
+ type: 'setData' | 'setState' | 'dismiss' | 'fx';
295
+ /** Command payload */
296
+ payload: Record<string, unknown>;
297
+ }
298
+ export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
299
+ export type Weight = 'normal' | 'medium' | 'semibold' | 'bold';
300
+ export type Color = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'muted' | 'white' | 'black';
301
+ export type Variant = 'solid' | 'outline' | 'ghost' | 'link';
302
+ export type Align = 'left' | 'center' | 'right';
303
+ export type Justify = 'start' | 'center' | 'end' | 'between' | 'around';
304
+ export interface ValidationProfile {
305
+ /** Profile name */
306
+ name: 'tile' | 'full';
307
+ /** Max simultaneous overlays */
308
+ maxOverlays: number;
309
+ /** Max text length */
310
+ maxTextLength: number;
311
+ /** Allowed placement types */
312
+ allowedPlacements: string[];
313
+ /** Allowed component types */
314
+ allowedComponents: string[];
315
+ /** Allow scroll containers */
316
+ allowScroll: boolean;
317
+ /** Allow navigation actions */
318
+ allowNavigation: boolean;
319
+ }
320
+ export declare const TILE_PROFILE: ValidationProfile;
321
+ export declare const FULL_PROFILE: ValidationProfile;
322
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/spec/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,WAAW;IAC1B,0BAA0B;IAC1B,WAAW,EAAE,KAAK,CAAC;IAEnB,6BAA6B;IAC7B,EAAE,EAAE,MAAM,CAAC;IAEX,qBAAqB;IACrB,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB,wBAAwB;IACxB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAEhB,kCAAkC;IAClC,IAAI,EAAE,UAAU,CAAC;IAEjB,iCAAiC;IACjC,KAAK,EAAE,WAAW,CAAC;IAEnB,2CAA2C;IAC3C,MAAM,EAAE,YAAY,CAAC;IAErB,wCAAwC;IACxC,aAAa,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAE1C,wDAAwD;IACxD,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,iCAAiC;IACjC,MAAM,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAEjE,6BAA6B;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;IAEH,2BAA2B;IAC3B,UAAU,CAAC,EAAE,OAAO,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IA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AAC;AAChD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAMxE,MAAM,WAAW,iBAAiB;IAChC,mBAAmB;IACnB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IAEtB,gCAAgC;IAChC,WAAW,EAAE,MAAM,CAAC;IAEpB,sBAAsB;IACtB,aAAa,EAAE,MAAM,CAAC;IAEtB,8BAA8B;IAC9B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAE5B,8BAA8B;IAC9B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAE5B,8BAA8B;IAC9B,WAAW,EAAE,OAAO,CAAC;IAErB,+BAA+B;IAC/B,eAAe,EAAE,OAAO,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,EAAE,iBAQ1B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,iBAQ1B,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Overlay Spec Types
3
+ *
4
+ * A declarative, time-synced UI protocol for hybrid video tiles.
5
+ * Specs describe what to show and when, the host runtime handles rendering.
6
+ */
7
+ export function isBinding(value) {
8
+ return (typeof value === 'object' &&
9
+ value !== null &&
10
+ '$bind' in value &&
11
+ typeof value.$bind === 'string');
12
+ }
13
+ export function isAction(value) {
14
+ return (typeof value === 'object' &&
15
+ value !== null &&
16
+ '$action' in value &&
17
+ typeof value.$action === 'string');
18
+ }
19
+ export const TILE_PROFILE = {
20
+ name: 'tile',
21
+ maxOverlays: 3,
22
+ maxTextLength: 200,
23
+ allowedPlacements: ['lane'],
24
+ allowedComponents: ['ui.*'],
25
+ allowScroll: false,
26
+ allowNavigation: false,
27
+ };
28
+ export const FULL_PROFILE = {
29
+ name: 'full',
30
+ maxOverlays: 10,
31
+ maxTextLength: 1000,
32
+ allowedPlacements: ['lane', 'fullscreen', 'inset', 'positioned'],
33
+ allowedComponents: ['ui.*', 'tile.*'],
34
+ allowScroll: true,
35
+ allowNavigation: true,
36
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thewhateverapp/tile-sdk",
3
- "version": "0.13.31",
3
+ "version": "0.13.33",
4
4
  "description": "SDK for building interactive tiles on The Whatever App platform",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,6 +13,10 @@
13
13
  "types": "./dist/react/index.d.ts",
14
14
  "import": "./dist/react/index.js"
15
15
  },
16
+ "./spec": {
17
+ "types": "./dist/spec/index.d.ts",
18
+ "import": "./dist/spec/index.js"
19
+ },
16
20
  "./tools": {
17
21
  "types": "./dist/tools/index.d.ts",
18
22
  "import": "./dist/tools/index.js"
@@ -51,6 +55,9 @@
51
55
  ],
52
56
  "author": "The Whatever App",
53
57
  "license": "MIT",
58
+ "dependencies": {
59
+ "zod": "^3.22.0"
60
+ },
54
61
  "peerDependencies": {
55
62
  "react": "^18.0.0"
56
63
  },