@melony/react 0.1.22 → 0.1.23
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 +9 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2341,6 +2341,14 @@ function Thread({
|
|
|
2341
2341
|
});
|
|
2342
2342
|
const starterPrompts = localStarterPrompts ?? config?.starterPrompts;
|
|
2343
2343
|
const options = localOptions ?? config?.options;
|
|
2344
|
+
const allDefaultSelectedIds = useMemo(() => {
|
|
2345
|
+
const defaultSelectedIdsFromOptions = options?.flatMap(
|
|
2346
|
+
(group) => group.defaultSelectedIds ?? []
|
|
2347
|
+
) ?? [];
|
|
2348
|
+
return [
|
|
2349
|
+
.../* @__PURE__ */ new Set([...defaultSelectedIdsFromOptions, ...defaultSelectedIds ?? []])
|
|
2350
|
+
];
|
|
2351
|
+
}, [options, defaultSelectedIds]);
|
|
2344
2352
|
const [input, setInput] = useState("");
|
|
2345
2353
|
const messagesEndRef = useRef(null);
|
|
2346
2354
|
useEffect(() => {
|
|
@@ -2412,7 +2420,7 @@ function Thread({
|
|
|
2412
2420
|
isLoading,
|
|
2413
2421
|
options,
|
|
2414
2422
|
autoFocus,
|
|
2415
|
-
defaultSelectedIds
|
|
2423
|
+
defaultSelectedIds: allDefaultSelectedIds
|
|
2416
2424
|
}
|
|
2417
2425
|
) }) })
|
|
2418
2426
|
]
|