@superinterface/react 3.0.2 → 3.2.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.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MessagesPage, SerializedMessage, Avatar as Avatar$1, SerializedRunStep, ToolCall } from './types/index.cjs';
2
+ import { MessagesPage, StyleProps, SerializedMessage, Avatar as Avatar$1, SerializedRunStep, ToolCall } from './types/index.cjs';
3
3
  import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
5
5
  import * as react_hook_form from 'react-hook-form';
@@ -16,11 +16,11 @@ import * as openai_resources_beta_threads_runs_steps from 'openai/resources/beta
16
16
  declare const options: {
17
17
  get: ({ assistantId, }: {
18
18
  assistantId: string;
19
- }) => any;
19
+ }) => string | undefined;
20
20
  set: ({ assistantId, threadId, }: {
21
21
  assistantId: string;
22
22
  threadId: string;
23
- }) => any;
23
+ }) => string | undefined;
24
24
  };
25
25
 
26
26
  type Args$9 = {
@@ -50,29 +50,27 @@ declare const useSuperinterfaceContext: () => {
50
50
 
51
51
  type Args$8 = Args$9;
52
52
 
53
- type Args$7 = Args$8;
53
+ type Args$7 = Args$8 & StyleProps;
54
54
 
55
55
  type Args$6 = Omit<Args$7, 'children'>;
56
56
  declare const Thread: {
57
57
  (props: Args$6): react_jsx_runtime.JSX.Element;
58
- Root: ({ children, ...rest }: Args$7) => react_jsx_runtime.JSX.Element;
58
+ Root: ({ children, style, className, ...rest }: Args$7) => react_jsx_runtime.JSX.Element;
59
59
  Messages: {
60
- ({ children, style, }: {
60
+ ({ children, className, style, }: {
61
61
  children?: React.ReactNode;
62
- style?: React.CSSProperties;
63
- }): react_jsx_runtime.JSX.Element;
64
- Root: ({ children, style, }: {
62
+ } & StyleProps): react_jsx_runtime.JSX.Element;
63
+ Root: ({ children, style, className, }: {
65
64
  children: React.ReactNode;
66
- style?: React.CSSProperties;
67
- }) => react_jsx_runtime.JSX.Element;
68
- Message: ({ message, }: {
65
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
66
+ Message: ({ message, className, style, }: {
69
67
  message: SerializedMessage;
70
- }) => react_jsx_runtime.JSX.Element;
68
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
71
69
  NextPageSkeleton: () => react_jsx_runtime.JSX.Element | null;
72
70
  };
73
71
  MessageForm: {
74
- (): react_jsx_runtime.JSX.Element;
75
- Root: ({ children, onSubmit: onSubmitArg, isDisabled: isDisabledArg, }: {
72
+ (props: StyleProps): react_jsx_runtime.JSX.Element;
73
+ Root: ({ children, onSubmit: onSubmitArg, isDisabled: isDisabledArg, style, className, }: {
76
74
  children: React.ReactNode;
77
75
  onSubmit?: react_hook_form.SubmitHandler<{
78
76
  content: string;
@@ -82,29 +80,31 @@ declare const Thread: {
82
80
  createMessage: any;
83
81
  }>;
84
82
  isDisabled?: boolean;
85
- }) => react_jsx_runtime.JSX.Element;
83
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
86
84
  Field: {
87
- Root: ({ children, }: {
85
+ Root: ({ children, className, style, }: {
88
86
  children: React.ReactNode;
89
- }) => react_jsx_runtime.JSX.Element;
87
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
90
88
  Control: {
91
- (): react_jsx_runtime.JSX.Element;
92
- Root: ({ children, }: {
89
+ (props: StyleProps): react_jsx_runtime.JSX.Element;
90
+ Root: ({ children, style, className, }: {
93
91
  children: React.ReactNode;
92
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
93
+ Input: (props: Omit<StyleProps, "style"> & {
94
+ style?: Omit<React.CSSProperties, "minHeight" | "maxHeight" | "height">;
94
95
  }) => react_jsx_runtime.JSX.Element;
95
- Input: () => react_jsx_runtime.JSX.Element;
96
96
  };
97
97
  Files: {
98
- Preview: () => react_jsx_runtime.JSX.Element | null;
99
- Control: () => react_jsx_runtime.JSX.Element;
98
+ Preview: (props: StyleProps) => react_jsx_runtime.JSX.Element | null;
99
+ Control: (props: StyleProps) => react_jsx_runtime.JSX.Element;
100
100
  };
101
101
  };
102
102
  Submit: {
103
- (): react_jsx_runtime.JSX.Element;
104
- Root: ({ children, }: {
103
+ (props: StyleProps): react_jsx_runtime.JSX.Element;
104
+ Root: ({ children, style, className, }: {
105
105
  children: React.ReactNode;
106
- }) => react_jsx_runtime.JSX.Element;
107
- Button: () => react_jsx_runtime.JSX.Element;
106
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
107
+ Button: (props: StyleProps) => react_jsx_runtime.JSX.Element;
108
108
  };
109
109
  };
110
110
  };
@@ -118,15 +118,15 @@ declare const useMessages: () => {
118
118
  isLoading: false;
119
119
  isLoadingError: false;
120
120
  isRefetchError: true;
121
- isFetchNextPageError: false;
122
- isFetchPreviousPageError: false;
123
121
  isSuccess: false;
124
122
  status: "error";
125
123
  fetchNextPage: (options?: _tanstack_react_query.FetchNextPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<TQueryFnData, unknown>, Error>>;
126
124
  fetchPreviousPage: (options?: _tanstack_react_query.FetchPreviousPageOptions) => Promise<_tanstack_react_query.InfiniteQueryObserverResult<InfiniteData<TQueryFnData, unknown>, Error>>;
127
125
  hasNextPage: boolean;
128
126
  hasPreviousPage: boolean;
127
+ isFetchNextPageError: boolean;
129
128
  isFetchingNextPage: boolean;
129
+ isFetchPreviousPageError: boolean;
130
130
  isFetchingPreviousPage: boolean;
131
131
  dataUpdatedAt: number;
132
132
  errorUpdatedAt: number;
@@ -143,6 +143,7 @@ declare const useMessages: () => {
143
143
  isStale: boolean;
144
144
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<TQueryFnData, unknown>, Error>>;
145
145
  fetchStatus: _tanstack_react_query.FetchStatus;
146
+ promise: Promise<InfiniteData<TQueryFnData, unknown>>;
146
147
  } | {
147
148
  messages: SerializedMessage[];
148
149
  data: InfiniteData<TQueryFnData, unknown>;
@@ -177,10 +178,11 @@ declare const useMessages: () => {
177
178
  isStale: boolean;
178
179
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<InfiniteData<TQueryFnData, unknown>, Error>>;
179
180
  fetchStatus: _tanstack_react_query.FetchStatus;
181
+ promise: Promise<InfiniteData<TQueryFnData, unknown>>;
180
182
  };
181
183
 
182
184
  declare const useMessageContext: () => {
183
- message: Message | null;
185
+ message: SerializedMessage | null;
184
186
  };
185
187
 
186
188
  declare const useLatestMessage: () => {
@@ -193,15 +195,15 @@ declare const useLatestMessage: () => {
193
195
  isLoading: false;
194
196
  isLoadingError: false;
195
197
  isRefetchError: true;
196
- isFetchNextPageError: false;
197
- isFetchPreviousPageError: false;
198
198
  isSuccess: false;
199
199
  status: "error";
200
200
  fetchNextPage: (options?: _tanstack_query_core.FetchNextPageOptions) => Promise<_tanstack_query_core.InfiniteQueryObserverResult<_tanstack_query_core.InfiniteData<TQueryFnData, unknown>, Error>>;
201
201
  fetchPreviousPage: (options?: _tanstack_query_core.FetchPreviousPageOptions) => Promise<_tanstack_query_core.InfiniteQueryObserverResult<_tanstack_query_core.InfiniteData<TQueryFnData, unknown>, Error>>;
202
202
  hasNextPage: boolean;
203
203
  hasPreviousPage: boolean;
204
+ isFetchNextPageError: boolean;
204
205
  isFetchingNextPage: boolean;
206
+ isFetchPreviousPageError: boolean;
205
207
  isFetchingPreviousPage: boolean;
206
208
  dataUpdatedAt: number;
207
209
  errorUpdatedAt: number;
@@ -218,6 +220,7 @@ declare const useLatestMessage: () => {
218
220
  isStale: boolean;
219
221
  refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_tanstack_query_core.InfiniteData<TQueryFnData, unknown>, Error>>;
220
222
  fetchStatus: _tanstack_query_core.FetchStatus;
223
+ promise: Promise<_tanstack_query_core.InfiniteData<TQueryFnData, unknown>>;
221
224
  } | {
222
225
  latestMessage: SerializedMessage;
223
226
  messages: SerializedMessage[];
@@ -253,6 +256,7 @@ declare const useLatestMessage: () => {
253
256
  isStale: boolean;
254
257
  refetch: (options?: _tanstack_query_core.RefetchOptions) => Promise<_tanstack_query_core.QueryObserverResult<_tanstack_query_core.InfiniteData<TQueryFnData, unknown>, Error>>;
255
258
  fetchStatus: _tanstack_query_core.FetchStatus;
259
+ promise: Promise<_tanstack_query_core.InfiniteData<TQueryFnData, unknown>>;
256
260
  };
257
261
 
258
262
  declare const useCreateMessage: ({ onError, }?: {
@@ -371,6 +375,7 @@ declare const useAssistant: ({ assistantId, }: Args$5) => {
371
375
  isStale: boolean;
372
376
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
373
377
  fetchStatus: _tanstack_react_query.FetchStatus;
378
+ promise: Promise<any>;
374
379
  } | {
375
380
  assistant: any;
376
381
  data: any;
@@ -397,6 +402,7 @@ declare const useAssistant: ({ assistantId, }: Args$5) => {
397
402
  isStale: boolean;
398
403
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
399
404
  fetchStatus: _tanstack_react_query.FetchStatus;
405
+ promise: Promise<any>;
400
406
  } | {
401
407
  assistant: any;
402
408
  data: undefined;
@@ -423,6 +429,7 @@ declare const useAssistant: ({ assistantId, }: Args$5) => {
423
429
  isStale: boolean;
424
430
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
425
431
  fetchStatus: _tanstack_react_query.FetchStatus;
432
+ promise: Promise<any>;
426
433
  } | {
427
434
  assistant: any;
428
435
  data: undefined;
@@ -449,6 +456,7 @@ declare const useAssistant: ({ assistantId, }: Args$5) => {
449
456
  isStale: boolean;
450
457
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
451
458
  fetchStatus: _tanstack_react_query.FetchStatus;
459
+ promise: Promise<any>;
452
460
  } | {
453
461
  assistant: any;
454
462
  data: undefined;
@@ -475,6 +483,7 @@ declare const useAssistant: ({ assistantId, }: Args$5) => {
475
483
  isStale: boolean;
476
484
  refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
477
485
  fetchStatus: _tanstack_react_query.FetchStatus;
486
+ promise: Promise<any>;
478
487
  };
479
488
 
480
489
  declare const ThreadDialog: {
@@ -485,26 +494,21 @@ declare const ThreadDialog: {
485
494
  Trigger: {
486
495
  (args: Omit<{
487
496
  children: React.ReactNode;
488
- style?: React.CSSProperties;
489
- }, "children">): react_jsx_runtime.JSX.Element;
490
- Root: ({ children, style, }: {
497
+ } & StyleProps, "children">): react_jsx_runtime.JSX.Element;
498
+ Root: ({ children, style, className, }: {
491
499
  children: React.ReactNode;
492
- style?: React.CSSProperties;
493
- }) => react_jsx_runtime.JSX.Element;
494
- Button: () => react_jsx_runtime.JSX.Element;
500
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
501
+ Button: (props: StyleProps) => react_jsx_runtime.JSX.Element;
495
502
  };
496
503
  Content: {
497
- ({ style, }: {
498
- style?: React.CSSProperties;
499
- }): react_jsx_runtime.JSX.Element;
500
- Root: ({ children, style, }: {
504
+ (props: StyleProps): react_jsx_runtime.JSX.Element;
505
+ Root: ({ children, className, style, }: {
501
506
  children: React.ReactNode;
502
- style?: React.CSSProperties;
503
- }) => react_jsx_runtime.JSX.Element | null;
504
- Messages: () => react_jsx_runtime.JSX.Element;
505
- FormContainer: ({ children, }: {
507
+ } & StyleProps) => react_jsx_runtime.JSX.Element | null;
508
+ Messages: ({ className, style, }: StyleProps) => react_jsx_runtime.JSX.Element;
509
+ FormContainer: ({ children, className, style, }: {
506
510
  children: React.ReactNode;
507
- }) => react_jsx_runtime.JSX.Element;
511
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
508
512
  };
509
513
  };
510
514
 
@@ -514,47 +518,42 @@ declare const ThreadDialogContext: react.Context<{
514
518
  }>;
515
519
 
516
520
  declare const AudioThreadDialog: {
517
- (): react_jsx_runtime.JSX.Element;
521
+ (props: StyleProps): react_jsx_runtime.JSX.Element;
518
522
  Root: ({ children, }: {
519
523
  children: React.ReactNode;
520
524
  }) => react_jsx_runtime.JSX.Element;
521
525
  Trigger: {
522
526
  (args: Omit<{
523
527
  children: React.ReactNode;
524
- style?: React.CSSProperties;
525
- }, "children">): react_jsx_runtime.JSX.Element;
526
- Root: ({ children, style, }: {
528
+ } & StyleProps, "children">): react_jsx_runtime.JSX.Element;
529
+ Root: ({ children, style, className, }: {
527
530
  children: React.ReactNode;
528
- style?: React.CSSProperties;
529
- }) => react_jsx_runtime.JSX.Element;
530
- Button: () => react_jsx_runtime.JSX.Element;
531
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
532
+ Button: (props: StyleProps) => react_jsx_runtime.JSX.Element;
531
533
  };
532
534
  Content: {
533
- ({ style, }: {
534
- style?: React.CSSProperties;
535
- }): react_jsx_runtime.JSX.Element;
536
- Root: ({ children, style, }: {
535
+ (props: StyleProps): react_jsx_runtime.JSX.Element;
536
+ Root: ({ children, className, style, }: {
537
537
  children: React.ReactNode;
538
- style?: React.CSSProperties;
539
- }) => react_jsx_runtime.JSX.Element | null;
540
- Messages: () => react_jsx_runtime.JSX.Element;
541
- FormContainer: ({ children, }: {
538
+ } & StyleProps) => react_jsx_runtime.JSX.Element | null;
539
+ Messages: ({ className, style, }: StyleProps) => react_jsx_runtime.JSX.Element;
540
+ FormContainer: ({ children, className, style, }: {
542
541
  children: React.ReactNode;
543
- }) => react_jsx_runtime.JSX.Element;
542
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
544
543
  };
545
544
  };
546
545
 
547
546
  type Args$4 = {
548
547
  children: React.ReactNode;
549
- };
548
+ } & StyleProps;
550
549
 
551
550
  type Args$3 = Omit<Args$4, 'children'>;
552
551
  declare const AudioThread: {
553
552
  (props: Args$3): react_jsx_runtime.JSX.Element;
554
- Root: ({ children, }: Args$4) => react_jsx_runtime.JSX.Element;
555
- Visualization: () => react_jsx_runtime.JSX.Element;
556
- Status: () => react_jsx_runtime.JSX.Element;
557
- Form: () => react_jsx_runtime.JSX.Element;
553
+ Root: ({ children, ...rest }: Args$4) => react_jsx_runtime.JSX.Element;
554
+ Visualization: (props: StyleProps) => react_jsx_runtime.JSX.Element;
555
+ Status: (props: StyleProps) => react_jsx_runtime.JSX.Element;
556
+ Form: (props: StyleProps) => react_jsx_runtime.JSX.Element;
558
557
  };
559
558
 
560
559
  declare const useThreadDialogContext: () => {
@@ -563,27 +562,27 @@ declare const useThreadDialogContext: () => {
563
562
  };
564
563
 
565
564
  declare const Suggestions: {
566
- ({ children, }: {
565
+ ({ children, className, style, }: {
567
566
  children: React.ReactNode;
568
- }): react_jsx_runtime.JSX.Element | null;
567
+ } & StyleProps): react_jsx_runtime.JSX.Element | null;
569
568
  Item: {
570
- ({ suggestion, isDisabled, }: {
569
+ ({ suggestion, isDisabled, className, style, }: {
571
570
  suggestion: string;
572
571
  isDisabled: boolean;
573
- }): react_jsx_runtime.JSX.Element;
574
- Content: ({ onClick, isDisabled, isPending, children, }: {
572
+ } & StyleProps): react_jsx_runtime.JSX.Element;
573
+ Content: ({ onClick, isDisabled, isPending, children, className, style, }: {
575
574
  onClick: () => void;
576
575
  isDisabled: boolean;
577
576
  isPending: boolean;
578
577
  children: React.ReactNode;
579
- }) => react_jsx_runtime.JSX.Element;
578
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
580
579
  };
581
580
  };
582
581
 
583
582
  declare const MarkdownContext: react.Context<{
584
583
  components: {
585
584
  p: ({ children }: JSX.IntrinsicElements["p"]) => react_jsx_runtime.JSX.Element;
586
- a: ({ children, href, download, target, }: react.DetailedHTMLProps<react.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => react_jsx_runtime.JSX.Element;
585
+ a: ({ children, href, download, target, }: JSX.IntrinsicElements) => react_jsx_runtime.JSX.Element;
587
586
  strong: ({ children }: JSX.IntrinsicElements["strong"]) => react_jsx_runtime.JSX.Element;
588
587
  ul: ({ children }: JSX.IntrinsicElements["ul"]) => react_jsx_runtime.JSX.Element;
589
588
  ol: ({ children }: JSX.IntrinsicElements["ul"]) => react_jsx_runtime.JSX.Element;
@@ -620,7 +619,7 @@ declare const MarkdownProvider: ({ children, ...rest }: {
620
619
  declare const useMarkdownContext: () => {
621
620
  components: {
622
621
  p: ({ children }: JSX.IntrinsicElements["p"]) => react_jsx_runtime.JSX.Element;
623
- a: ({ children, href, download, target, }: react.DetailedHTMLProps<react.AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => react_jsx_runtime.JSX.Element;
622
+ a: ({ children, href, download, target, }: JSX.IntrinsicElements) => react_jsx_runtime.JSX.Element;
624
623
  strong: ({ children }: JSX.IntrinsicElements["strong"]) => react_jsx_runtime.JSX.Element;
625
624
  ul: ({ children }: JSX.IntrinsicElements["ul"]) => react_jsx_runtime.JSX.Element;
626
625
  ol: ({ children }: JSX.IntrinsicElements["ul"]) => react_jsx_runtime.JSX.Element;
@@ -656,10 +655,10 @@ declare const AssistantNameContext: react.Context<string>;
656
655
 
657
656
  declare const UserAvatarContext: react.Context<react_jsx_runtime.JSX.Element>;
658
657
 
659
- declare const Avatar: ({ avatar, size, }: {
658
+ declare const Avatar: ({ avatar, size, className, style, }: {
660
659
  avatar: Avatar$1;
661
660
  size?: "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
662
- }) => react_jsx_runtime.JSX.Element;
661
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
663
662
 
664
663
  type FunctionComponents = {
665
664
  [key: string]: React.ReactNode;
@@ -680,17 +679,17 @@ declare const ComponentsProvider: ({ children, ...rest }: {
680
679
  declare const useComponents: () => {
681
680
  components: {
682
681
  RunStep: {
683
- ({ runStep, }: {
682
+ ({ runStep, className, style, }: {
684
683
  runStep: SerializedRunStep;
685
- }): react_jsx_runtime.JSX.Element | null;
684
+ } & StyleProps): react_jsx_runtime.JSX.Element | null;
686
685
  ToolCalls: {
687
- ({ stepDetails, runStep, }: {
686
+ ({ stepDetails, runStep, className, style, }: {
688
687
  stepDetails: openai_resources_beta_threads_runs_steps.ToolCallsStepDetails;
689
688
  runStep: SerializedRunStep;
690
- }): react_jsx_runtime.JSX.Element;
691
- Root: ({ children, }: {
689
+ } & StyleProps): react_jsx_runtime.JSX.Element;
690
+ Root: ({ children, className, style, }: {
692
691
  children: React.ReactNode;
693
- }) => react_jsx_runtime.JSX.Element;
692
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
694
693
  Starting: () => react_jsx_runtime.JSX.Element;
695
694
  ToolCall: ({ toolCall, runStep, }: {
696
695
  toolCall: ToolCall;
@@ -703,17 +702,17 @@ declare const useComponents: () => {
703
702
 
704
703
  type Args$1 = {
705
704
  runStep: SerializedRunStep;
706
- };
705
+ } & StyleProps;
707
706
  declare const RunStep: {
708
- ({ runStep, }: Args$1): react_jsx_runtime.JSX.Element | null;
707
+ ({ runStep, className, style, }: Args$1): react_jsx_runtime.JSX.Element | null;
709
708
  ToolCalls: {
710
- ({ stepDetails, runStep, }: {
709
+ ({ stepDetails, runStep, className, style, }: {
711
710
  stepDetails: openai_resources_beta_threads_runs_steps.ToolCallsStepDetails;
712
711
  runStep: SerializedRunStep;
713
- }): react_jsx_runtime.JSX.Element;
714
- Root: ({ children, }: {
712
+ } & StyleProps): react_jsx_runtime.JSX.Element;
713
+ Root: ({ children, className, style, }: {
715
714
  children: React.ReactNode;
716
- }) => react_jsx_runtime.JSX.Element;
715
+ } & StyleProps) => react_jsx_runtime.JSX.Element;
717
716
  Starting: () => react_jsx_runtime.JSX.Element;
718
717
  ToolCall: ({ toolCall, runStep, }: {
719
718
  toolCall: ToolCall;