fix: prevent asset conflicts between React and Grid.js versions

Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
dwindown
2026-04-18 17:02:14 +07:00
parent bd9cdac02e
commit e8fbfb14c1
74973 changed files with 6658406 additions and 71 deletions

View File

@@ -0,0 +1,41 @@
import { createElement } from "react";
/**
* External dependencies
*/
import { View } from 'react-native';
/**
* WordPress dependencies
*/
import { TextControl } from '@wordpress/components';
import { withPreferredColorScheme } from '@wordpress/compose';
import { useMemo } from '@wordpress/element';
/**
* Internal dependencies
*/
import styles from './actions.scss';
import BottomSeparatorCover from './bottom-separator-cover';
function PanelActions({
actions,
getStylesFromColorScheme
}) {
const mappedActions = useMemo(() => {
return actions.map(({
label,
onPress
}) => {
return createElement(TextControl, {
label: label,
onPress: onPress,
labelStyle: styles.defaultLabelStyle,
key: label
});
});
}, [actions]);
return createElement(View, {
style: getStylesFromColorScheme(styles.panelActionsContainer, styles.panelActionsContainerDark)
}, mappedActions, createElement(BottomSeparatorCover, null));
}
export default withPreferredColorScheme(PanelActions);
//# sourceMappingURL=actions.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["View","TextControl","withPreferredColorScheme","useMemo","styles","BottomSeparatorCover","PanelActions","actions","getStylesFromColorScheme","mappedActions","map","label","onPress","createElement","labelStyle","defaultLabelStyle","key","style","panelActionsContainer","panelActionsContainerDark"],"sources":["@wordpress/components/src/panel/actions.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { TextControl } from '@wordpress/components';\nimport { withPreferredColorScheme } from '@wordpress/compose';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport styles from './actions.scss';\nimport BottomSeparatorCover from './bottom-separator-cover';\n\nfunction PanelActions( { actions, getStylesFromColorScheme } ) {\n\tconst mappedActions = useMemo( () => {\n\t\treturn actions.map( ( { label, onPress } ) => {\n\t\t\treturn (\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tonPress={ onPress }\n\t\t\t\t\tlabelStyle={ styles.defaultLabelStyle }\n\t\t\t\t\tkey={ label }\n\t\t\t\t/>\n\t\t\t);\n\t\t} );\n\t}, [ actions ] );\n\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.panelActionsContainer,\n\t\t\t\tstyles.panelActionsContainerDark\n\t\t\t) }\n\t\t>\n\t\t\t{ mappedActions }\n\t\t\t<BottomSeparatorCover />\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( PanelActions );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,WAAW,QAAQ,uBAAuB;AACnD,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,OAAO,QAAQ,oBAAoB;;AAE5C;AACA;AACA;AACA,OAAOC,MAAM,MAAM,gBAAgB;AACnC,OAAOC,oBAAoB,MAAM,0BAA0B;AAE3D,SAASC,YAAYA,CAAE;EAAEC,OAAO;EAAEC;AAAyB,CAAC,EAAG;EAC9D,MAAMC,aAAa,GAAGN,OAAO,CAAE,MAAM;IACpC,OAAOI,OAAO,CAACG,GAAG,CAAE,CAAE;MAAEC,KAAK;MAAEC;IAAQ,CAAC,KAAM;MAC7C,OACCC,aAAA,CAACZ,WAAW;QACXU,KAAK,EAAGA,KAAO;QACfC,OAAO,EAAGA,OAAS;QACnBE,UAAU,EAAGV,MAAM,CAACW,iBAAmB;QACvCC,GAAG,EAAGL;MAAO,CACb,CAAC;IAEJ,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEJ,OAAO,CAAG,CAAC;EAEhB,OACCM,aAAA,CAACb,IAAI;IACJiB,KAAK,EAAGT,wBAAwB,CAC/BJ,MAAM,CAACc,qBAAqB,EAC5Bd,MAAM,CAACe,yBACR;EAAG,GAEDV,aAAa,EACfI,aAAA,CAACR,oBAAoB,MAAE,CAClB,CAAC;AAET;AAEA,eAAeH,wBAAwB,CAAEI,YAAa,CAAC"}

View File

@@ -0,0 +1,111 @@
import { createElement } from "react";
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { useReducedMotion, useMergeRefs } from '@wordpress/compose';
import { forwardRef, useRef } from '@wordpress/element';
import { chevronUp, chevronDown } from '@wordpress/icons';
/**
* Internal dependencies
*/
import Button from '../button';
import Icon from '../icon';
import { useControlledState, useUpdateEffect } from '../utils';
const noop = () => {};
export function UnforwardedPanelBody(props, ref) {
const {
buttonProps = {},
children,
className,
icon,
initialOpen,
onToggle = noop,
opened,
title,
scrollAfterOpen = true
} = props;
const [isOpened, setIsOpened] = useControlledState(opened, {
initial: initialOpen === undefined ? true : initialOpen,
fallback: false
});
const nodeRef = useRef(null);
// Defaults to 'smooth' scrolling
// https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView
const scrollBehavior = useReducedMotion() ? 'auto' : 'smooth';
const handleOnToggle = event => {
event.preventDefault();
const next = !isOpened;
setIsOpened(next);
onToggle(next);
};
// Ref is used so that the effect does not re-run upon scrollAfterOpen changing value.
const scrollAfterOpenRef = useRef();
scrollAfterOpenRef.current = scrollAfterOpen;
// Runs after initial render.
useUpdateEffect(() => {
if (isOpened && scrollAfterOpenRef.current && nodeRef.current?.scrollIntoView) {
/*
* Scrolls the content into view when visible.
* This improves the UX when there are multiple stacking <PanelBody />
* components in a scrollable container.
*/
nodeRef.current.scrollIntoView({
inline: 'nearest',
block: 'nearest',
behavior: scrollBehavior
});
}
}, [isOpened, scrollBehavior]);
const classes = classnames('components-panel__body', className, {
'is-opened': isOpened
});
return createElement("div", {
className: classes,
ref: useMergeRefs([nodeRef, ref])
}, createElement(PanelBodyTitle, {
icon: icon,
isOpened: Boolean(isOpened),
onClick: handleOnToggle,
title: title,
...buttonProps
}), typeof children === 'function' ? children({
opened: Boolean(isOpened)
}) : isOpened && children);
}
const PanelBodyTitle = forwardRef(({
isOpened,
icon,
title,
...props
}, ref) => {
if (!title) return null;
return createElement("h2", {
className: "components-panel__body-title"
}, createElement(Button, {
className: "components-panel__body-toggle",
"aria-expanded": isOpened,
ref: ref,
...props
}, createElement("span", {
"aria-hidden": "true"
}, createElement(Icon, {
className: "components-panel__arrow",
icon: isOpened ? chevronUp : chevronDown
})), title, icon && createElement(Icon, {
icon: icon,
className: "components-panel__icon",
size: 20
})));
});
export const PanelBody = forwardRef(UnforwardedPanelBody);
export default PanelBody;
//# sourceMappingURL=body.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,26 @@
import { createElement } from "react";
/**
* External dependencies
*/
import { Text, View } from 'react-native';
/**
* Internal dependencies
*/
import styles from './body.scss';
import BottomSeparatorCover from './bottom-separator-cover';
export function PanelBody({
children,
title,
style,
titleStyle = {}
}) {
return createElement(View, {
style: [styles.panelContainer, style]
}, title && createElement(Text, {
accessibilityRole: "header",
style: [styles.sectionHeaderText, titleStyle]
}, title), children, createElement(BottomSeparatorCover, null));
}
export default PanelBody;
//# sourceMappingURL=body.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Text","View","styles","BottomSeparatorCover","PanelBody","children","title","style","titleStyle","createElement","panelContainer","accessibilityRole","sectionHeaderText"],"sources":["@wordpress/components/src/panel/body.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { Text, View } from 'react-native';\n\n/**\n * Internal dependencies\n */\nimport styles from './body.scss';\nimport BottomSeparatorCover from './bottom-separator-cover';\n\nexport function PanelBody( { children, title, style, titleStyle = {} } ) {\n\treturn (\n\t\t<View style={ [ styles.panelContainer, style ] }>\n\t\t\t{ title && (\n\t\t\t\t<Text\n\t\t\t\t\taccessibilityRole=\"header\"\n\t\t\t\t\tstyle={ [ styles.sectionHeaderText, titleStyle ] }\n\t\t\t\t>\n\t\t\t\t\t{ title }\n\t\t\t\t</Text>\n\t\t\t) }\n\t\t\t{ children }\n\t\t\t<BottomSeparatorCover />\n\t\t</View>\n\t);\n}\n\nexport default PanelBody;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,EAAEC,IAAI,QAAQ,cAAc;;AAEzC;AACA;AACA;AACA,OAAOC,MAAM,MAAM,aAAa;AAChC,OAAOC,oBAAoB,MAAM,0BAA0B;AAE3D,OAAO,SAASC,SAASA,CAAE;EAAEC,QAAQ;EAAEC,KAAK;EAAEC,KAAK;EAAEC,UAAU,GAAG,CAAC;AAAE,CAAC,EAAG;EACxE,OACCC,aAAA,CAACR,IAAI;IAACM,KAAK,EAAG,CAAEL,MAAM,CAACQ,cAAc,EAAEH,KAAK;EAAI,GAC7CD,KAAK,IACNG,aAAA,CAACT,IAAI;IACJW,iBAAiB,EAAC,QAAQ;IAC1BJ,KAAK,EAAG,CAAEL,MAAM,CAACU,iBAAiB,EAAEJ,UAAU;EAAI,GAEhDF,KACG,CACN,EACCD,QAAQ,EACVI,aAAA,CAACN,oBAAoB,MAAE,CAClB,CAAC;AAET;AAEA,eAAeC,SAAS"}

View File

@@ -0,0 +1,24 @@
import { createElement } from "react";
/**
* External dependencies
*/
import { View } from 'react-native';
/**
* WordPress dependencies
*/
import { withPreferredColorScheme } from '@wordpress/compose';
/**
* Internal dependencies
*/
import styles from './bottom-separator-cover.scss';
function BottomSeparatorCover({
getStylesFromColorScheme
}) {
return createElement(View, {
style: getStylesFromColorScheme(styles.coverSeparator, styles.coverSeparatorDark)
});
}
export default withPreferredColorScheme(BottomSeparatorCover);
//# sourceMappingURL=bottom-separator-cover.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["View","withPreferredColorScheme","styles","BottomSeparatorCover","getStylesFromColorScheme","createElement","style","coverSeparator","coverSeparatorDark"],"sources":["@wordpress/components/src/panel/bottom-separator-cover.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './bottom-separator-cover.scss';\n\nfunction BottomSeparatorCover( { getStylesFromColorScheme } ) {\n\treturn (\n\t\t<View\n\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\tstyles.coverSeparator,\n\t\t\t\tstyles.coverSeparatorDark\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default withPreferredColorScheme( BottomSeparatorCover );\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,IAAI,QAAQ,cAAc;;AAEnC;AACA;AACA;AACA,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,OAAOC,MAAM,MAAM,+BAA+B;AAElD,SAASC,oBAAoBA,CAAE;EAAEC;AAAyB,CAAC,EAAG;EAC7D,OACCC,aAAA,CAACL,IAAI;IACJM,KAAK,EAAGF,wBAAwB,CAC/BF,MAAM,CAACK,cAAc,EACrBL,MAAM,CAACM,kBACR;EAAG,CACH,CAAC;AAEJ;AAEA,eAAeP,wBAAwB,CAAEE,oBAAqB,CAAC"}

View File

@@ -0,0 +1,20 @@
import { createElement } from "react";
/**
* Internal dependencies
*/
/**
* `PanelHeader` renders the header for the `Panel`.
* This is used by the `Panel` component under the hood,
* so it does not typically need to be used.
*/
function PanelHeader({
label,
children
}) {
return createElement("div", {
className: "components-panel__header"
}, label && createElement("h2", null, label), children);
}
export default PanelHeader;
//# sourceMappingURL=header.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["PanelHeader","label","children","createElement","className"],"sources":["@wordpress/components/src/panel/header.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { PanelHeaderProps } from './types';\n\n/**\n * `PanelHeader` renders the header for the `Panel`.\n * This is used by the `Panel` component under the hood,\n * so it does not typically need to be used.\n */\nfunction PanelHeader( { label, children }: PanelHeaderProps ) {\n\treturn (\n\t\t<div className=\"components-panel__header\">\n\t\t\t{ label && <h2>{ label }</h2> }\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\nexport default PanelHeader;\n"],"mappings":";AAAA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA,SAASA,WAAWA,CAAE;EAAEC,KAAK;EAAEC;AAA2B,CAAC,EAAG;EAC7D,OACCC,aAAA;IAAKC,SAAS,EAAC;EAA0B,GACtCH,KAAK,IAAIE,aAAA,aAAMF,KAAW,CAAC,EAC3BC,QACE,CAAC;AAER;AAEA,eAAeF,WAAW"}

View File

@@ -0,0 +1,48 @@
import { createElement } from "react";
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { forwardRef } from '@wordpress/element';
/**
* Internal dependencies
*/
import PanelHeader from './header';
function UnforwardedPanel({
header,
className,
children
}, ref) {
const classNames = classnames(className, 'components-panel');
return createElement("div", {
className: classNames,
ref: ref
}, header && createElement(PanelHeader, {
label: header
}), children);
}
/**
* `Panel` expands and collapses multiple sections of content.
*
* ```jsx
* import { Panel, PanelBody, PanelRow } from '@wordpress/components';
* import { more } from '@wordpress/icons';
*
* const MyPanel = () => (
* <Panel header="My Panel">
* <PanelBody title="My Block Settings" icon={ more } initialOpen={ true }>
* <PanelRow>My Panel Inputs and Labels</PanelRow>
* </PanelBody>
* </Panel>
* );
* ```
*/
export const Panel = forwardRef(UnforwardedPanel);
export default Panel;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["classnames","forwardRef","PanelHeader","UnforwardedPanel","header","className","children","ref","classNames","createElement","label","Panel"],"sources":["@wordpress/components/src/panel/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport PanelHeader from './header';\nimport type { PanelProps } from './types';\n\nfunction UnforwardedPanel(\n\t{ header, className, children }: PanelProps,\n\tref: React.ForwardedRef< HTMLDivElement >\n) {\n\tconst classNames = classnames( className, 'components-panel' );\n\treturn (\n\t\t<div className={ classNames } ref={ ref }>\n\t\t\t{ header && <PanelHeader label={ header } /> }\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * `Panel` expands and collapses multiple sections of content.\n *\n * ```jsx\n * import { Panel, PanelBody, PanelRow } from '@wordpress/components';\n * import { more } from '@wordpress/icons';\n *\n * const MyPanel = () => (\n * \t<Panel header=\"My Panel\">\n * \t\t<PanelBody title=\"My Block Settings\" icon={ more } initialOpen={ true }>\n * \t\t\t<PanelRow>My Panel Inputs and Labels</PanelRow>\n * \t\t</PanelBody>\n * \t</Panel>\n * );\n * ```\n */\nexport const Panel = forwardRef( UnforwardedPanel );\n\nexport default Panel;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;;AAE/C;AACA;AACA;AACA,OAAOC,WAAW,MAAM,UAAU;AAGlC,SAASC,gBAAgBA,CACxB;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAqB,CAAC,EAC3CC,GAAyC,EACxC;EACD,MAAMC,UAAU,GAAGR,UAAU,CAAEK,SAAS,EAAE,kBAAmB,CAAC;EAC9D,OACCI,aAAA;IAAKJ,SAAS,EAAGG,UAAY;IAACD,GAAG,EAAGA;EAAK,GACtCH,MAAM,IAAIK,aAAA,CAACP,WAAW;IAACQ,KAAK,EAAGN;EAAQ,CAAE,CAAC,EAC1CE,QACE,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMK,KAAK,GAAGV,UAAU,CAAEE,gBAAiB,CAAC;AAEnD,eAAeQ,KAAK"}

View File

@@ -0,0 +1,27 @@
import { createElement } from "react";
/**
* External dependencies
*/
import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { forwardRef } from '@wordpress/element';
function UnforwardedPanelRow({
className,
children
}, ref) {
return createElement("div", {
className: classnames('components-panel__row', className),
ref: ref
}, children);
}
/**
* `PanelRow` is a generic container for rows within a `PanelBody`.
* It is a flex container with a top margin for spacing.
*/
export const PanelRow = forwardRef(UnforwardedPanelRow);
export default PanelRow;
//# sourceMappingURL=row.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["classnames","forwardRef","UnforwardedPanelRow","className","children","ref","createElement","PanelRow"],"sources":["@wordpress/components/src/panel/row.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type { PanelRowProps } from './types';\n\nfunction UnforwardedPanelRow(\n\t{ className, children }: PanelRowProps,\n\tref: ForwardedRef< HTMLDivElement >\n) {\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'components-panel__row', className ) }\n\t\t\tref={ ref }\n\t\t>\n\t\t\t{ children }\n\t\t</div>\n\t);\n}\n\n/**\n * `PanelRow` is a generic container for rows within a `PanelBody`.\n * It is a flex container with a top margin for spacing.\n */\nexport const PanelRow = forwardRef( UnforwardedPanelRow );\n\nexport default PanelRow;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,UAAU,QAAQ,oBAAoB;AAQ/C,SAASC,mBAAmBA,CAC3B;EAAEC,SAAS;EAAEC;AAAwB,CAAC,EACtCC,GAAmC,EAClC;EACD,OACCC,aAAA;IACCH,SAAS,EAAGH,UAAU,CAAE,uBAAuB,EAAEG,SAAU,CAAG;IAC9DE,GAAG,EAAGA;EAAK,GAETD,QACE,CAAC;AAER;;AAEA;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAQ,GAAGN,UAAU,CAAEC,mBAAoB,CAAC;AAEzD,eAAeK,QAAQ"}

View File

@@ -0,0 +1,2 @@
export {};
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["@wordpress/components/src/panel/types.ts"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ButtonAsButtonProps } from '../button/types';\nimport type { WordPressComponentProps } from '../context';\n\nexport type PanelProps = {\n\t/**\n\t * The text that will be rendered as the title of the panel.\n\t * Text will be rendered inside an `<h2>` tag.\n\t */\n\theader?: PanelHeaderProps[ 'label' ];\n\t/**\n\t * The CSS class to apply to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * The content to display within the panel.\n\t */\n\tchildren: React.ReactNode;\n};\n\nexport type PanelHeaderProps = {\n\t/**\n\t * The text that will be rendered as the title of the panel.\n\t * Will be rendered in an `<h2>` tag.\n\t */\n\tlabel?: string;\n\t/**\n\t * The content to display within the panel header.\n\t */\n\tchildren?: React.ReactNode;\n};\n\nexport type PanelRowProps = {\n\t/**\n\t * The CSS class to apply to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * The content to display within the panel row.\n\t */\n\tchildren: React.ReactNode;\n};\n\nexport type PanelBodyProps = {\n\t/**\n\t * Props that are passed to the `Button` component in title within the\n\t * `PanelBody`.\n\t *\n\t * @default {}\n\t */\n\tbuttonProps?: WordPressComponentProps<\n\t\tOmit< ButtonAsButtonProps, 'icon' >,\n\t\t'button',\n\t\tfalse\n\t>;\n\t/**\n\t * The content to display in the `PanelBody`.If a function is provided for\n\t * this prop, it will receive an object with the `opened` prop as an argument.\n\t */\n\tchildren?:\n\t\t| React.ReactNode\n\t\t| ( ( props: { opened: boolean } ) => React.ReactNode );\n\n\t/**\n\t * The CSS class to apply to the wrapper element.\n\t */\n\tclassName?: string;\n\t/**\n\t * An icon to be shown next to the title.\n\t */\n\ticon?: JSX.Element;\n\t/**\n\t * Whether or not the panel will start open.\n\t */\n\tinitialOpen?: boolean;\n\t/**\n\t * A function that is called any time the component is toggled from its closed\n\t * state to its opened state, or vice versa.\n\t *\n\t * @default noop\n\t */\n\tonToggle?: ( next: boolean ) => void;\n\t/**\n\t * When set to `true`, the component will remain open regardless of the\n\t * `initialOpen` prop and the panel will be prevented from being closed.\n\t */\n\topened?: boolean;\n\t/**\n\t * Title text. It shows even when it is closed.\n\t */\n\ttitle?: string;\n\t/**\n\t * Scrolls the content into view when visible. This improves the UX when\n\t * multiple `PanelBody` components are stacked in a scrollable container.\n\t *\n\t * @default true\n\t */\n\tscrollAfterOpen?: boolean;\n};\n\nexport type PanelBodyTitleProps = Omit< ButtonAsButtonProps, 'icon' > & {\n\t/**\n\t * An icon to be shown next to the title.\n\t */\n\ticon?: JSX.Element;\n\t/**\n\t * Whether or not the `PanelBody` is currently opened or not.\n\t */\n\tisOpened?: boolean;\n\t/**\n\t * The title text.\n\t */\n\ttitle?: string;\n};\n"],"mappings":""}