This commit is contained in:
Pedro Reis 2025-09-21 13:59:29 +01:00 committed by GitHub
commit ee56d0c33a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 21 additions and 10 deletions

View file

@ -111,7 +111,8 @@
"tailwind-merge": "^1.9.1",
"tailwindcss-animate": "^1.0.5",
"tailwindcss-radix": "^2.8.0",
"zod": "^3.22.4"
"zod": "^3.22.4",
"dompurify": "^3.2.6"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.22.15",

View file

@ -7,6 +7,7 @@ import { useGetEndpointsQuery, useGetStartupConfig } from '~/data-provider';
import ConvoIcon from '~/components/Endpoints/ConvoIcon';
import { useLocalize, useAuthContext } from '~/hooks';
import { getIconEndpoint, getEntity } from '~/utils';
import DOMPurify from 'dompurify';
const containerClassName =
'shadow-stroke relative flex h-full items-center justify-center rounded-full bg-white dark:bg-presentation dark:text-white text-black dark:after:shadow-none ';
@ -204,9 +205,10 @@ export default function Landing({ centerFormOnLanding }: { centerFormOnLanding:
)}
</div>
{description && (
<div className="animate-fadeIn mt-4 max-w-md text-center text-sm font-normal text-text-primary">
{description}
</div>
<div
className="animate-fadeIn mt-4 max-w-md text-center text-sm font-normal text-text-primary"
dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(description || '') }}
/>
)}
</div>
</div>

View file

@ -239,16 +239,17 @@ export default function AgentConfig({ createMutation }: Pick<AgentPanelProps, 'c
name="description"
control={control}
render={({ field }) => (
<input
<textarea
{...field}
value={field.value ?? ''}
maxLength={512}
className={inputClass}
className={`${inputClass} min-h-[100px] resize-y`}
id="description"
type="text"
placeholder={localize('com_agents_description_placeholder')}
aria-label="Agent description"
/>
rows={4}
onChange={field.onChange}
>
{field.value ?? ''}
</textarea>
)}
/>
</div>

4
package-lock.json generated
View file

@ -13,6 +13,9 @@
"client",
"packages/*"
],
"dependencies": {
"dompurify": "^3.2.6"
},
"devDependencies": {
"@axe-core/playwright": "^4.10.1",
"@eslint/compat": "^1.2.6",
@ -2661,6 +2664,7 @@
"copy-to-clipboard": "^3.3.3",
"cross-env": "^7.0.3",
"date-fns": "^3.3.1",
"dompurify": "^3.2.6",
"downloadjs": "^1.4.7",
"export-from-json": "^1.7.2",
"filenamify": "^6.0.0",

View file

@ -153,5 +153,8 @@
"admin/",
"packages/"
]
},
"dependencies": {
"dompurify": "^3.2.6"
}
}