fix: click readme hide config

This commit is contained in:
Joel
2026-01-26 11:39:47 +08:00
parent 4f75d7f8e2
commit 3f4d6b9452
3 changed files with 16 additions and 2 deletions

View File

@ -87,11 +87,16 @@ const ReadmePanel: FC = () => {
const portalContent = showType === ReadmeShowType.drawer const portalContent = showType === ReadmeShowType.drawer
? ( ? (
<div className={cn('fixed inset-0 z-[999] flex', position === 'left' ? 'justify-start' : 'justify-end')} onClick={onClose}> <div
className={cn('fixed inset-0 z-[999] flex', position === 'left' ? 'justify-start' : 'justify-end')}
data-readme-panel-root="true"
onClick={onClose}
>
<div <div
className={cn( className={cn(
'pointer-events-auto mb-2 ml-2 mr-2 mt-16 w-[600px] max-w-[600px] justify-start rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg p-0 shadow-xl', 'pointer-events-auto mb-2 ml-2 mr-2 mt-16 w-[600px] max-w-[600px] justify-start rounded-2xl border-[0.5px] border-components-panel-border bg-components-panel-bg p-0 shadow-xl',
)} )}
data-readme-panel="true"
onClick={(event) => { onClick={(event) => {
event.stopPropagation() event.stopPropagation()
}} }}
@ -101,11 +106,16 @@ const ReadmePanel: FC = () => {
</div> </div>
) )
: ( : (
<div className="fixed inset-0 z-[999] flex items-center justify-center p-2" onClick={onClose}> <div
className="fixed inset-0 z-[999] flex items-center justify-center p-2"
data-readme-panel-root="true"
onClick={onClose}
>
<div <div
className={cn( className={cn(
'pointer-events-auto relative h-[calc(100vh-16px)] w-full max-w-[800px] rounded-2xl bg-components-panel-bg p-0 shadow-xl', 'pointer-events-auto relative h-[calc(100vh-16px)] w-full max-w-[800px] rounded-2xl bg-components-panel-bg p-0 shadow-xl',
)} )}
data-readme-panel="true"
onClick={(event) => { onClick={(event) => {
event.stopPropagation() event.stopPropagation()
}} }}

View File

@ -281,6 +281,8 @@ const ToolBlockComponent: FC<ToolBlockComponentProps> = ({
const panelEl = portalContainer?.querySelector('[data-tool-setting-panel="true"]') const panelEl = portalContainer?.querySelector('[data-tool-setting-panel="true"]')
if (!target || !panelEl) if (!target || !panelEl)
return return
if (target instanceof Element && target.closest('[data-readme-panel-root="true"], [data-readme-panel="true"]'))
return
if (target instanceof Element && target.closest('[data-modal-root="true"]')) if (target instanceof Element && target.closest('[data-modal-root="true"]'))
return return
if (panelEl.contains(target)) if (panelEl.contains(target))

View File

@ -339,6 +339,8 @@ const ToolGroupBlockComponent: FC<ToolGroupBlockComponentProps> = ({
const panelEl = portalContainer?.querySelector('[data-tool-group-setting-panel="true"]') const panelEl = portalContainer?.querySelector('[data-tool-group-setting-panel="true"]')
if (!target || !panelEl) if (!target || !panelEl)
return return
if (target instanceof Element && target.closest('[data-readme-panel-root="true"], [data-readme-panel="true"]'))
return
if (target instanceof Element && target.closest('[data-modal-root="true"]')) if (target instanceof Element && target.closest('[data-modal-root="true"]'))
return return
if (panelEl.contains(target)) if (panelEl.contains(target))