mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? Feat: Fixed the issue where the prompt menu content was hidden #3221 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
13
web/package-lock.json
generated
13
web/package-lock.json
generated
@ -89,6 +89,7 @@
|
|||||||
"remark-math": "^6.0.0",
|
"remark-math": "^6.0.0",
|
||||||
"sonner": "^1.7.4",
|
"sonner": "^1.7.4",
|
||||||
"tailwind-merge": "^2.5.4",
|
"tailwind-merge": "^2.5.4",
|
||||||
|
"tailwind-scrollbar": "^3.1.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"umi": "^4.0.90",
|
"umi": "^4.0.90",
|
||||||
"umi-request": "^1.4.0",
|
"umi-request": "^1.4.0",
|
||||||
@ -31293,6 +31294,18 @@
|
|||||||
"url": "https://github.com/sponsors/dcastil"
|
"url": "https://github.com/sponsors/dcastil"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tailwind-scrollbar": {
|
||||||
|
"version": "3.1.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/tailwind-scrollbar/-/tailwind-scrollbar-3.1.0.tgz",
|
||||||
|
"integrity": "sha512-pmrtDIZeHyu2idTejfV59SbaJyvp1VRjYxAjZBH0jnyrPRo6HL1kD5Glz8VPagasqr6oAx6M05+Tuw429Z8jxg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12.13.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"tailwindcss": "3.x"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tailwindcss": {
|
"node_modules/tailwindcss": {
|
||||||
"version": "3.4.14",
|
"version": "3.4.14",
|
||||||
"resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-3.4.14.tgz",
|
"resolved": "https://registry.npmmirror.com/tailwindcss/-/tailwindcss-3.4.14.tgz",
|
||||||
|
|||||||
@ -100,6 +100,7 @@
|
|||||||
"remark-math": "^6.0.0",
|
"remark-math": "^6.0.0",
|
||||||
"sonner": "^1.7.4",
|
"sonner": "^1.7.4",
|
||||||
"tailwind-merge": "^2.5.4",
|
"tailwind-merge": "^2.5.4",
|
||||||
|
"tailwind-scrollbar": "^3.1.0",
|
||||||
"tailwindcss-animate": "^1.0.7",
|
"tailwindcss-animate": "^1.0.7",
|
||||||
"umi": "^4.0.90",
|
"umi": "^4.0.90",
|
||||||
"umi-request": "^1.4.0",
|
"umi-request": "^1.4.0",
|
||||||
|
|||||||
@ -723,7 +723,7 @@ export const initialStringTransformValues = {
|
|||||||
method: StringTransformMethod.Merge,
|
method: StringTransformMethod.Merge,
|
||||||
split_ref: '',
|
split_ref: '',
|
||||||
script: '',
|
script: '',
|
||||||
delimiters: [],
|
delimiters: [StringTransformDelimiter.Comma],
|
||||||
outputs: {
|
outputs: {
|
||||||
result: {
|
result: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
@ -851,6 +851,7 @@ export const RestrictedUpstreamMap = {
|
|||||||
[Operator.WaitingDialogue]: [Operator.Begin],
|
[Operator.WaitingDialogue]: [Operator.Begin],
|
||||||
[Operator.Agent]: [Operator.Begin],
|
[Operator.Agent]: [Operator.Begin],
|
||||||
[Operator.TavilySearch]: [Operator.Begin],
|
[Operator.TavilySearch]: [Operator.Begin],
|
||||||
|
[Operator.StringTransform]: [Operator.Begin],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const NodeMap = {
|
export const NodeMap = {
|
||||||
|
|||||||
@ -67,7 +67,6 @@ function VariablePickerMenuItem({
|
|||||||
option: VariableOption | VariableInnerOption,
|
option: VariableOption | VariableInnerOption,
|
||||||
) => void;
|
) => void;
|
||||||
}) {
|
}) {
|
||||||
console.info('xxxx');
|
|
||||||
return (
|
return (
|
||||||
<li
|
<li
|
||||||
key={option.key}
|
key={option.key}
|
||||||
@ -245,11 +244,10 @@ export default function VariablePickerMenuPlugin({
|
|||||||
options={buildNextOptions()}
|
options={buildNextOptions()}
|
||||||
menuRenderFn={(anchorElementRef, { selectOptionAndCleanUp }) => {
|
menuRenderFn={(anchorElementRef, { selectOptionAndCleanUp }) => {
|
||||||
const nextOptions = buildNextOptions();
|
const nextOptions = buildNextOptions();
|
||||||
console.log('🚀 ~ nextOptions:', nextOptions);
|
|
||||||
return anchorElementRef.current && nextOptions.length
|
return anchorElementRef.current && nextOptions.length
|
||||||
? ReactDOM.createPortal(
|
? ReactDOM.createPortal(
|
||||||
<div className="typeahead-popover w-[200px] p-2">
|
<div className="typeahead-popover w-[200px] p-2">
|
||||||
<ul>
|
<ul className="overflow-y-auto !scrollbar-thin overflow-x-hidden">
|
||||||
{nextOptions.map((option, i: number) => (
|
{nextOptions.map((option, i: number) => (
|
||||||
<VariablePickerMenuItem
|
<VariablePickerMenuItem
|
||||||
index={i}
|
index={i}
|
||||||
|
|||||||
@ -6,20 +6,26 @@ import {
|
|||||||
StringTransformMethod,
|
StringTransformMethod,
|
||||||
} from '../../constant';
|
} from '../../constant';
|
||||||
|
|
||||||
|
function transferDelimiters(formData: typeof initialStringTransformValues) {
|
||||||
|
return formData.method === StringTransformMethod.Merge
|
||||||
|
? formData.delimiters[0]
|
||||||
|
: formData.delimiters;
|
||||||
|
}
|
||||||
|
|
||||||
export function useValues(node?: RAGFlowNodeType) {
|
export function useValues(node?: RAGFlowNodeType) {
|
||||||
const values = useMemo(() => {
|
const values = useMemo(() => {
|
||||||
const formData = node?.data?.form;
|
const formData = node?.data?.form;
|
||||||
|
|
||||||
if (isEmpty(formData)) {
|
if (isEmpty(formData)) {
|
||||||
return initialStringTransformValues;
|
return {
|
||||||
|
...initialStringTransformValues,
|
||||||
|
delimiters: transferDelimiters(formData),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...formData,
|
...formData,
|
||||||
delimiters:
|
delimiters: transferDelimiters(formData),
|
||||||
formData.method === StringTransformMethod.Merge
|
|
||||||
? formData.delimiters[0]
|
|
||||||
: formData.delimiters,
|
|
||||||
};
|
};
|
||||||
}, [node?.data?.form]);
|
}, [node?.data?.form]);
|
||||||
|
|
||||||
|
|||||||
@ -219,5 +219,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [require('tailwindcss-animate'), require('@tailwindcss/line-clamp')],
|
plugins: [
|
||||||
|
require('tailwindcss-animate'),
|
||||||
|
require('@tailwindcss/line-clamp'),
|
||||||
|
require('tailwind-scrollbar'),
|
||||||
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user