@superinterface/react 2.0.2 → 2.0.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.cjs +6 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2100,8 +2100,7 @@ var import_react27 = require("react");
|
|
|
2100
2100
|
var import_react26 = require("react");
|
|
2101
2101
|
var MessageFormContext = (0, import_react26.createContext)({
|
|
2102
2102
|
isDisabled: false,
|
|
2103
|
-
isLoading: false
|
|
2104
|
-
submit: function() {}
|
|
2103
|
+
isLoading: false
|
|
2105
2104
|
});
|
|
2106
2105
|
// src/hooks/messages/useMessageFormContext/index.ts
|
|
2107
2106
|
var useMessageFormContext = function() {
|
|
@@ -2349,8 +2348,7 @@ var Root2 = function(param) {
|
|
|
2349
2348
|
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MessageFormContext.Provider, {
|
|
2350
2349
|
value: {
|
|
2351
2350
|
isDisabled: isDisabled,
|
|
2352
|
-
isLoading: isLoading
|
|
2353
|
-
submit: handleSubmit(onSubmit)
|
|
2351
|
+
isLoading: isLoading
|
|
2354
2352
|
},
|
|
2355
2353
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react_hook_form.FormProvider, _object_spread_props(_object_spread({}, formProps), {
|
|
2356
2354
|
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("form", {
|
|
@@ -2421,7 +2419,7 @@ var Root3 = function(param) {
|
|
|
2421
2419
|
var Control = function() {
|
|
2422
2420
|
var assistantNameContext = (0, import_react30.useContext)(AssistantNameContext);
|
|
2423
2421
|
var register = (0, import_react_hook_form2.useFormContext)().register;
|
|
2424
|
-
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading
|
|
2422
|
+
var _useMessageFormContext = useMessageFormContext(), isDisabled = _useMessageFormContext.isDisabled, isLoading = _useMessageFormContext.isLoading;
|
|
2425
2423
|
var isSubmitDisabled = (0, import_react30.useMemo)(function() {
|
|
2426
2424
|
return isDisabled || isLoading;
|
|
2427
2425
|
}, [
|
|
@@ -2447,12 +2445,12 @@ var Control = function() {
|
|
|
2447
2445
|
disabled: isDisabled,
|
|
2448
2446
|
onKeyDown: function(e) {
|
|
2449
2447
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
2448
|
+
var _e_currentTarget_form;
|
|
2450
2449
|
e.preventDefault();
|
|
2451
2450
|
if (isSubmitDisabled) return;
|
|
2452
|
-
|
|
2451
|
+
(_e_currentTarget_form = e.currentTarget.form) === null || _e_currentTarget_form === void 0 ? void 0 : _e_currentTarget_form.requestSubmit();
|
|
2453
2452
|
}
|
|
2454
|
-
}
|
|
2455
|
-
autoFocus: true
|
|
2453
|
+
}
|
|
2456
2454
|
}, textareaProps), {
|
|
2457
2455
|
ref: function(e) {
|
|
2458
2456
|
textareaProps.ref(e);
|