@assistant-ui/react 0.4.1 → 0.4.2
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.js +19 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +19 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -907,21 +907,30 @@ var ActionBarPrimitiveRoot = (0, import_react25.forwardRef)(({ hideWhenRunning,
|
|
907
907
|
ActionBarPrimitiveRoot.displayName = "ActionBarPrimitive.Root";
|
908
908
|
|
909
909
|
// src/utils/createActionButton.tsx
|
910
|
-
var import_primitive = require("@radix-ui/primitive");
|
911
|
-
var import_react_primitive2 = require("@radix-ui/react-primitive");
|
912
910
|
var import_react26 = require("react");
|
911
|
+
var import_react_primitive2 = require("@radix-ui/react-primitive");
|
912
|
+
var import_primitive = require("@radix-ui/primitive");
|
913
913
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
914
|
-
var createActionButton = (displayName, useActionButton) => {
|
914
|
+
var createActionButton = (displayName, useActionButton, forwardProps = []) => {
|
915
915
|
const ActionButton = (0, import_react26.forwardRef)((props, forwardedRef) => {
|
916
|
-
const
|
916
|
+
const forwardedProps = {};
|
917
|
+
const primitiveProps = {};
|
918
|
+
Object.keys(props).forEach((key) => {
|
919
|
+
if (forwardProps.includes(key)) {
|
920
|
+
forwardedProps[key] = props[key];
|
921
|
+
} else {
|
922
|
+
primitiveProps[key] = props[key];
|
923
|
+
}
|
924
|
+
});
|
925
|
+
const callback = useActionButton(forwardedProps);
|
917
926
|
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
918
927
|
import_react_primitive2.Primitive.button,
|
919
928
|
{
|
920
929
|
type: "button",
|
921
930
|
disabled: !callback,
|
922
|
-
...
|
931
|
+
...primitiveProps,
|
923
932
|
ref: forwardedRef,
|
924
|
-
onClick: (0, import_primitive.composeEventHandlers)(
|
933
|
+
onClick: (0, import_primitive.composeEventHandlers)(primitiveProps.onClick, () => {
|
925
934
|
callback?.();
|
926
935
|
})
|
927
936
|
}
|
@@ -934,7 +943,8 @@ var createActionButton = (displayName, useActionButton) => {
|
|
934
943
|
// src/primitives/actionBar/ActionBarCopy.tsx
|
935
944
|
var ActionBarPrimitiveCopy = createActionButton(
|
936
945
|
"ActionBarPrimitive.Copy",
|
937
|
-
useActionBarCopy
|
946
|
+
useActionBarCopy,
|
947
|
+
["copiedDuration"]
|
938
948
|
);
|
939
949
|
|
940
950
|
// src/primitives/actionBar/ActionBarReload.tsx
|
@@ -1951,7 +1961,8 @@ var ThreadPrimitiveScrollToBottom = createActionButton(
|
|
1951
1961
|
// src/primitives/thread/ThreadSuggestion.tsx
|
1952
1962
|
var ThreadPrimitiveSuggestion = createActionButton(
|
1953
1963
|
"ThreadPrimitive.Suggestion",
|
1954
|
-
useThreadSuggestion
|
1964
|
+
useThreadSuggestion,
|
1965
|
+
["prompt", "autoSend", "method"]
|
1955
1966
|
);
|
1956
1967
|
|
1957
1968
|
// src/runtimes/local/useLocalRuntime.tsx
|