@superinterface/react 2.15.2 → 2.15.3

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
@@ -4,6 +4,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
5
5
  import * as react from 'react';
6
6
  import { Dispatch, SetStateAction } from 'react';
7
+ import * as react_hook_form from 'react-hook-form';
7
8
  import * as _tanstack_query_core from '@tanstack/query-core';
8
9
  import OpenAI from 'openai';
9
10
  import * as openai_resources_beta_threads_runs_steps from 'openai/resources/beta/threads/runs/steps';
@@ -75,8 +76,13 @@ declare const Thread: {
75
76
  };
76
77
  MessageForm: {
77
78
  (): react_jsx_runtime.JSX.Element;
78
- Root: ({ children, }: {
79
+ Root: ({ children, onSubmit: onSubmitArg, }: {
79
80
  children: react.ReactNode;
81
+ onSubmit?: react_hook_form.SubmitHandler<{
82
+ content: string;
83
+ } | {
84
+ reset: any;
85
+ }> | undefined;
80
86
  }) => react_jsx_runtime.JSX.Element;
81
87
  Field: {
82
88
  Root: ({ children, }: {
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import * as _tanstack_react_query from '@tanstack/react-query';
4
4
  import { UseInfiniteQueryOptions, InfiniteData, UseMutationOptions } from '@tanstack/react-query';
5
5
  import * as react from 'react';
6
6
  import { Dispatch, SetStateAction } from 'react';
7
+ import * as react_hook_form from 'react-hook-form';
7
8
  import * as _tanstack_query_core from '@tanstack/query-core';
8
9
  import OpenAI from 'openai';
9
10
  import * as openai_resources_beta_threads_runs_steps from 'openai/resources/beta/threads/runs/steps';
@@ -75,8 +76,13 @@ declare const Thread: {
75
76
  };
76
77
  MessageForm: {
77
78
  (): react_jsx_runtime.JSX.Element;
78
- Root: ({ children, }: {
79
+ Root: ({ children, onSubmit: onSubmitArg, }: {
79
80
  children: react.ReactNode;
81
+ onSubmit?: react_hook_form.SubmitHandler<{
82
+ content: string;
83
+ } | {
84
+ reset: any;
85
+ }> | undefined;
80
86
  }) => react_jsx_runtime.JSX.Element;
81
87
  Field: {
82
88
  Root: ({ children, }: {
package/dist/index.js CHANGED
@@ -2183,9 +2183,10 @@ var formOptions = {
2183
2183
  resolver: zodResolver(schema)
2184
2184
  };
2185
2185
  // src/components/threads/Thread/MessageForm/Root/index.tsx
2186
+ import { partob as partob2 } from "radash";
2186
2187
  import { jsx as jsx41 } from "react/jsx-runtime";
2187
2188
  var Root3 = function(param) {
2188
- var children = param.children;
2189
+ var children = param.children, onSubmitArg = param.onSubmit;
2189
2190
  var formProps = useForm(formOptions);
2190
2191
  var handleSubmit = formProps.handleSubmit, isSubmitting = formProps.formState.isSubmitting, reset = formProps.reset;
2191
2192
  var addToast = useToasts().addToast;
@@ -2221,7 +2222,9 @@ var Root3 = function(param) {
2221
2222
  isMutatingMessage,
2222
2223
  isSubmitting
2223
2224
  ]);
2224
- var onSubmit = function() {
2225
+ var onSubmit = onSubmitArg ? partob2(onSubmitArg, {
2226
+ reset: reset
2227
+ }) : function() {
2225
2228
  var _ref = _async_to_generator(function(data2) {
2226
2229
  return _ts_generator(this, function(_state) {
2227
2230
  switch(_state.label){
@@ -2242,7 +2245,7 @@ var Root3 = function(param) {
2242
2245
  }
2243
2246
  });
2244
2247
  });
2245
- return function onSubmit(data2) {
2248
+ return function(data2) {
2246
2249
  return _ref.apply(this, arguments);
2247
2250
  };
2248
2251
  }();