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,49 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Toolbar", {
enumerable: true,
get: function () {
return _toolbar.default;
}
});
Object.defineProperty(exports, "ToolbarButton", {
enumerable: true,
get: function () {
return _toolbarButton.default;
}
});
Object.defineProperty(exports, "ToolbarContext", {
enumerable: true,
get: function () {
return _toolbarContext.default;
}
});
Object.defineProperty(exports, "ToolbarDropdownMenu", {
enumerable: true,
get: function () {
return _toolbarDropdownMenu.default;
}
});
Object.defineProperty(exports, "ToolbarGroup", {
enumerable: true,
get: function () {
return _toolbarGroup.default;
}
});
Object.defineProperty(exports, "ToolbarItem", {
enumerable: true,
get: function () {
return _toolbarItem.default;
}
});
var _toolbar = _interopRequireDefault(require("./toolbar"));
var _toolbarButton = _interopRequireDefault(require("./toolbar-button"));
var _toolbarContext = _interopRequireDefault(require("./toolbar-context"));
var _toolbarDropdownMenu = _interopRequireDefault(require("./toolbar-dropdown-menu"));
var _toolbarGroup = _interopRequireDefault(require("./toolbar-group"));
var _toolbarItem = _interopRequireDefault(require("./toolbar-item"));
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_toolbar","_interopRequireDefault","require","_toolbarButton","_toolbarContext","_toolbarDropdownMenu","_toolbarGroup","_toolbarItem"],"sources":["@wordpress/components/src/toolbar/index.js"],"sourcesContent":["export { default as Toolbar } from './toolbar';\nexport { default as ToolbarButton } from './toolbar-button';\nexport { default as ToolbarContext } from './toolbar-context';\nexport { default as ToolbarDropdownMenu } from './toolbar-dropdown-menu';\nexport { default as ToolbarGroup } from './toolbar-group';\nexport { default as ToolbarItem } from './toolbar-item';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,oBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,aAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,YAAA,GAAAN,sBAAA,CAAAC,OAAA"}

View File

@@ -0,0 +1,104 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ToolbarButton = void 0;
var _react = require("react");
var _classnames = _interopRequireDefault(require("classnames"));
var _element = require("@wordpress/element");
var _button = _interopRequireDefault(require("../../button"));
var _toolbarItem = _interopRequireDefault(require("../toolbar-item"));
var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
var _toolbarButtonContainer = _interopRequireDefault(require("./toolbar-button-container"));
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function UnforwardedToolbarButton({
children,
className,
containerClassName,
extraProps,
isActive,
isDisabled,
title,
...props
}, ref) {
const accessibleToolbarState = (0, _element.useContext)(_toolbarContext.default);
if (!accessibleToolbarState) {
return (0, _react.createElement)(_toolbarButtonContainer.default, {
className: containerClassName
}, (0, _react.createElement)(_button.default, {
ref: ref,
icon: props.icon,
label: title,
shortcut: props.shortcut,
"data-subscript": props.subscript,
onClick: event => {
event.stopPropagation();
// TODO: Possible bug; maybe use onClick instead of props.onClick.
if (props.onClick) {
props.onClick(event);
}
},
className: (0, _classnames.default)('components-toolbar__control', className),
isPressed: isActive,
disabled: isDisabled,
"data-toolbar-item": true,
...extraProps,
...props
}, children));
}
// ToobarItem will pass all props to the render prop child, which will pass
// all props to Button. This means that ToolbarButton has the same API as
// Button.
return (0, _react.createElement)(_toolbarItem.default, {
className: (0, _classnames.default)('components-toolbar-button', className),
...extraProps,
...props,
ref: ref
}, toolbarItemProps => (0, _react.createElement)(_button.default, {
label: title,
isPressed: isActive,
disabled: isDisabled,
...toolbarItemProps
}, children));
}
/**
* ToolbarButton can be used to add actions to a toolbar, usually inside a Toolbar
* or ToolbarGroup when used to create general interfaces.
*
* ```jsx
* import { Toolbar, ToolbarButton } from '@wordpress/components';
* import { edit } from '@wordpress/icons';
*
* function MyToolbar() {
* return (
* <Toolbar label="Options">
* <ToolbarButton
* icon={ edit }
* label="Edit"
* onClick={ () => alert( 'Editing' ) }
* />
* </Toolbar>
* );
* }
* ```
*/
const ToolbarButton = (0, _element.forwardRef)(UnforwardedToolbarButton);
exports.ToolbarButton = ToolbarButton;
var _default = ToolbarButton;
exports.default = _default;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
/**
* Internal dependencies
*/
const ToolbarButtonContainer = ({
children,
className
}) => (0, _react.createElement)("div", {
className: className
}, children);
var _default = ToolbarButtonContainer;
exports.default = _default;
//# sourceMappingURL=toolbar-button-container.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["ToolbarButtonContainer","children","className","_react","createElement","_default","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar-button/toolbar-button-container.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { ToolbarButtonContainerProps } from './types';\n\nconst ToolbarButtonContainer = ( {\n\tchildren,\n\tclassName,\n}: ToolbarButtonContainerProps ) => (\n\t<div className={ className }>{ children }</div>\n);\n\nexport default ToolbarButtonContainer;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAGA,MAAMA,sBAAsB,GAAGA,CAAE;EAChCC,QAAQ;EACRC;AAC4B,CAAC,KAC7B,IAAAC,MAAA,CAAAC,aAAA;EAAKF,SAAS,EAAGA;AAAW,GAAGD,QAAe,CAC9C;AAAC,IAAAI,QAAA,GAEaL,sBAAsB;AAAAM,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _reactNative = require("react-native");
/**
* External dependencies
*/
var _default = props => (0, _react.createElement)(_reactNative.View, null, props.children);
exports.default = _default;
//# sourceMappingURL=toolbar-button-container.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_reactNative","require","_default","props","_react","createElement","View","children","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar-button/toolbar-button-container.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\nexport default ( props ) => <View>{ props.children }</View>;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;AAFA,IAAAC,QAAA,GAKiBC,KAAK,IAAM,IAAAC,MAAA,CAAAC,aAAA,EAACL,YAAA,CAAAM,IAAI,QAAGH,KAAK,CAACI,QAAgB,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAP,QAAA"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar-button/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type ToolbarButtonProps = {\n\t/**\n\t * Children to be rendered inside the button.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An optional class name for the button container.\n\t */\n\tcontainerClassName?: string;\n\t/**\n\t * Additional props to be passed alongside props.\n\t */\n\textraProps?: any;\n\t/**\n\t * Indicates if the button is active.\n\t */\n\tisActive?: boolean;\n\t/**\n\t * Indicates if the button is disabled.\n\t */\n\tisDisabled?: boolean;\n\t/**\n\t * An optional subscript for the button.\n\t */\n\tsubscript?: string;\n\t/**\n\t * An optional title/label for the button.\n\t */\n\ttitle?: string;\n};\n\nexport type ToolbarButtonContainerProps = {\n\t/**\n\t * Children to be rendered inside the button container.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An optional class name for the button container.\n\t */\n\tclassName?: string;\n};\n"],"mappings":""}

View File

@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _element = require("@wordpress/element");
/**
* External dependencies
*/
// eslint-disable-next-line no-restricted-imports
/**
* WordPress dependencies
*/
const ToolbarContext = (0, _element.createContext)(undefined);
var _default = ToolbarContext;
exports.default = _default;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_element","require","ToolbarContext","createContext","undefined","_default","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar-context/index.ts"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport type * as Ariakit from '@ariakit/react';\n\n/**\n * WordPress dependencies\n */\nimport { createContext } from '@wordpress/element';\n\nconst ToolbarContext = createContext< Ariakit.ToolbarStore | undefined >(\n\tundefined\n);\n\nexport default ToolbarContext;\n"],"mappings":";;;;;;AASA,IAAAA,QAAA,GAAAC,OAAA;AATA;AACA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMC,cAAc,GAAG,IAAAC,sBAAa,EACnCC,SACD,CAAC;AAAC,IAAAC,QAAA,GAEaH,cAAc;AAAAI,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

View File

@@ -0,0 +1,45 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _element = require("@wordpress/element");
var _toolbarItem = _interopRequireDefault(require("../toolbar-item"));
var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
var _dropdownMenu = _interopRequireDefault(require("../../dropdown-menu"));
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarDropdownMenu(props, ref) {
const accessibleToolbarState = (0, _element.useContext)(_toolbarContext.default);
if (!accessibleToolbarState) {
return (0, _react.createElement)(_dropdownMenu.default, {
...props
});
}
// ToolbarItem will pass all props to the render prop child, which will pass
// all props to the toggle of DropdownMenu. This means that ToolbarDropdownMenu
// has the same API as DropdownMenu.
return (0, _react.createElement)(_toolbarItem.default, {
ref: ref,
...props.toggleProps
}, toolbarItemProps => (0, _react.createElement)(_dropdownMenu.default, {
...props,
popoverProps: {
...props.popoverProps
},
toggleProps: toolbarItemProps
}));
}
var _default = (0, _element.forwardRef)(ToolbarDropdownMenu);
exports.default = _default;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_element","require","_toolbarItem","_interopRequireDefault","_toolbarContext","_dropdownMenu","ToolbarDropdownMenu","props","ref","accessibleToolbarState","useContext","ToolbarContext","_react","createElement","default","toggleProps","toolbarItemProps","popoverProps","_default","forwardRef","exports"],"sources":["@wordpress/components/src/toolbar/toolbar-dropdown-menu/index.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\n\n/**\n * External dependencies\n */\nimport type { ForwardedRef } from 'react';\n\n/**\n * Internal dependencies\n */\nimport ToolbarItem from '../toolbar-item';\nimport ToolbarContext from '../toolbar-context';\nimport DropdownMenu from '../../dropdown-menu';\nimport type { DropdownMenuProps } from '../../dropdown-menu/types';\n\nfunction ToolbarDropdownMenu(\n\tprops: DropdownMenuProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tif ( ! accessibleToolbarState ) {\n\t\treturn <DropdownMenu { ...props } />;\n\t}\n\n\t// ToolbarItem will pass all props to the render prop child, which will pass\n\t// all props to the toggle of DropdownMenu. This means that ToolbarDropdownMenu\n\t// has the same API as DropdownMenu.\n\treturn (\n\t\t<ToolbarItem ref={ ref } { ...props.toggleProps }>\n\t\t\t{ ( toolbarItemProps ) => (\n\t\t\t\t<DropdownMenu\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tpopoverProps={ {\n\t\t\t\t\t\t...props.popoverProps,\n\t\t\t\t\t} }\n\t\t\t\t\ttoggleProps={ toolbarItemProps }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</ToolbarItem>\n\t);\n}\n\nexport default forwardRef( ToolbarDropdownMenu );\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAUA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,aAAA,GAAAF,sBAAA,CAAAF,OAAA;AAfA;AACA;AACA;;AAQA;AACA;AACA;;AAMA,SAASK,mBAAmBA,CAC3BC,KAAwB,EACxBC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAG,IAAAC,mBAAU,EAAEC,uBAAe,CAAC;EAE3D,IAAK,CAAEF,sBAAsB,EAAG;IAC/B,OAAO,IAAAG,MAAA,CAAAC,aAAA,EAACR,aAAA,CAAAS,OAAY;MAAA,GAAMP;IAAK,CAAI,CAAC;EACrC;;EAEA;EACA;EACA;EACA,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACX,YAAA,CAAAY,OAAW;IAACN,GAAG,EAAGA,GAAK;IAAA,GAAMD,KAAK,CAACQ;EAAW,GAC1CC,gBAAgB,IACnB,IAAAJ,MAAA,CAAAC,aAAA,EAACR,aAAA,CAAAS,OAAY;IAAA,GACPP,KAAK;IACVU,YAAY,EAAG;MACd,GAAGV,KAAK,CAACU;IACV,CAAG;IACHF,WAAW,EAAGC;EAAkB,CAChC,CAEU,CAAC;AAEhB;AAAC,IAAAE,QAAA,GAEc,IAAAC,mBAAU,EAAEb,mBAAoB,CAAC;AAAAc,OAAA,CAAAN,OAAA,GAAAI,QAAA"}

View File

@@ -0,0 +1,107 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _classnames = _interopRequireDefault(require("classnames"));
var _element = require("@wordpress/element");
var _toolbarButton = _interopRequireDefault(require("../toolbar-button"));
var _toolbarGroupContainer = _interopRequireDefault(require("./toolbar-group-container"));
var _toolbarGroupCollapsed = _interopRequireDefault(require("./toolbar-group-collapsed"));
var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function isNestedArray(arr) {
return Array.isArray(arr) && Array.isArray(arr[0]);
}
/**
* Renders a collapsible group of controls
*
* The `controls` prop accepts an array of sets. A set is an array of controls.
* Controls have the following shape:
*
* ```
* {
* icon: string,
* title: string,
* subscript: string,
* onClick: Function,
* isActive: boolean,
* isDisabled: boolean
* }
* ```
*
* For convenience it is also possible to pass only an array of controls. It is
* then assumed this is the only set.
*
* Either `controls` or `children` is required, otherwise this components
* renders nothing.
*
* @param props Component props.
* @param [props.controls] The controls to render in this toolbar.
* @param [props.children] Any other things to render inside the toolbar besides the controls.
* @param [props.className] Class to set on the container div.
* @param [props.isCollapsed] Turns ToolbarGroup into a dropdown menu.
* @param [props.title] ARIA label for dropdown menu if is collapsed.
*/
function ToolbarGroup({
controls = [],
children,
className,
isCollapsed,
title,
...props
}) {
// It'll contain state if `ToolbarGroup` is being used within
// `<Toolbar label="label" />`
const accessibleToolbarState = (0, _element.useContext)(_toolbarContext.default);
if ((!controls || !controls.length) && !children) {
return null;
}
const finalClassName = (0, _classnames.default)(
// Unfortunately, there's legacy code referencing to `.components-toolbar`
// So we can't get rid of it
accessibleToolbarState ? 'components-toolbar-group' : 'components-toolbar', className);
// Normalize controls to nested array of objects (sets of controls)
let controlSets;
if (isNestedArray(controls)) {
controlSets = controls;
} else {
controlSets = [controls];
}
if (isCollapsed) {
return (0, _react.createElement)(_toolbarGroupCollapsed.default, {
label: title,
controls: controlSets,
className: finalClassName,
children: children,
...props
});
}
return (0, _react.createElement)(_toolbarGroupContainer.default, {
className: finalClassName,
...props
}, controlSets?.flatMap((controlSet, indexOfSet) => controlSet.map((control, indexOfControl) => (0, _react.createElement)(_toolbarButton.default, {
key: [indexOfSet, indexOfControl].join(),
containerClassName: indexOfSet > 0 && indexOfControl === 0 ? 'has-left-divider' : undefined,
...control
}))), children);
}
var _default = ToolbarGroup;
exports.default = _default;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,46 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _element = require("@wordpress/element");
var _dropdownMenu = _interopRequireDefault(require("../../dropdown-menu"));
var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
var _toolbarItem = _interopRequireDefault(require("../toolbar-item"));
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarGroupCollapsed({
controls = [],
toggleProps,
...props
}) {
// It'll contain state if `ToolbarGroup` is being used within
// `<Toolbar label="label" />`
const accessibleToolbarState = (0, _element.useContext)(_toolbarContext.default);
const renderDropdownMenu = internalToggleProps => (0, _react.createElement)(_dropdownMenu.default, {
controls: controls,
toggleProps: {
...internalToggleProps,
'data-toolbar-item': true
},
...props
});
if (accessibleToolbarState) {
return (0, _react.createElement)(_toolbarItem.default, {
...toggleProps
}, renderDropdownMenu);
}
return renderDropdownMenu(toggleProps);
}
var _default = ToolbarGroupCollapsed;
exports.default = _default;
//# sourceMappingURL=toolbar-group-collapsed.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_element","require","_dropdownMenu","_interopRequireDefault","_toolbarContext","_toolbarItem","ToolbarGroupCollapsed","controls","toggleProps","props","accessibleToolbarState","useContext","ToolbarContext","renderDropdownMenu","internalToggleProps","_react","createElement","default","_default","exports"],"sources":["@wordpress/components/src/toolbar/toolbar-group/toolbar-group-collapsed.tsx"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport ToolbarContext from '../toolbar-context';\nimport ToolbarItem from '../toolbar-item';\nimport type { ToolbarGroupCollapsedProps } from './types';\nimport type { DropdownMenuProps } from '../../dropdown-menu/types';\n\nfunction ToolbarGroupCollapsed( {\n\tcontrols = [],\n\ttoggleProps,\n\t...props\n}: ToolbarGroupCollapsedProps ) {\n\t// It'll contain state if `ToolbarGroup` is being used within\n\t// `<Toolbar label=\"label\" />`\n\tconst accessibleToolbarState = useContext( ToolbarContext );\n\n\tconst renderDropdownMenu = (\n\t\tinternalToggleProps?: DropdownMenuProps[ 'toggleProps' ]\n\t) => (\n\t\t<DropdownMenu\n\t\t\tcontrols={ controls }\n\t\t\ttoggleProps={ {\n\t\t\t\t...internalToggleProps,\n\t\t\t\t'data-toolbar-item': true,\n\t\t\t} }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n\n\tif ( accessibleToolbarState ) {\n\t\treturn (\n\t\t\t<ToolbarItem { ...toggleProps }>{ renderDropdownMenu }</ToolbarItem>\n\t\t);\n\t}\n\n\treturn renderDropdownMenu( toggleProps );\n}\n\nexport default ToolbarGroupCollapsed;\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,eAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,YAAA,GAAAF,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAOA,SAASK,qBAAqBA,CAAE;EAC/BC,QAAQ,GAAG,EAAE;EACbC,WAAW;EACX,GAAGC;AACwB,CAAC,EAAG;EAC/B;EACA;EACA,MAAMC,sBAAsB,GAAG,IAAAC,mBAAU,EAAEC,uBAAe,CAAC;EAE3D,MAAMC,kBAAkB,GACvBC,mBAAwD,IAExD,IAAAC,MAAA,CAAAC,aAAA,EAACd,aAAA,CAAAe,OAAY;IACZV,QAAQ,EAAGA,QAAU;IACrBC,WAAW,EAAG;MACb,GAAGM,mBAAmB;MACtB,mBAAmB,EAAE;IACtB,CAAG;IAAA,GACEL;EAAK,CACV,CACD;EAED,IAAKC,sBAAsB,EAAG;IAC7B,OACC,IAAAK,MAAA,CAAAC,aAAA,EAACX,YAAA,CAAAY,OAAW;MAAA,GAAMT;IAAW,GAAKK,kBAAiC,CAAC;EAEtE;EAEA,OAAOA,kBAAkB,CAAEL,WAAY,CAAC;AACzC;AAAC,IAAAU,QAAA,GAEcZ,qBAAqB;AAAAa,OAAA,CAAAF,OAAA,GAAAC,QAAA"}

View File

@@ -0,0 +1,40 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _reactNative = require("react-native");
var _compose = require("@wordpress/compose");
var _dropdownMenu = _interopRequireDefault(require("../../dropdown-menu"));
var _style = _interopRequireDefault(require("./style.scss"));
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarGroupCollapsed({
controls = [],
getStylesFromColorScheme,
passedStyle,
...props
}) {
return (0, _react.createElement)(_reactNative.View, {
style: [getStylesFromColorScheme(_style.default.container, _style.default.containerDark), passedStyle]
}, (0, _react.createElement)(_dropdownMenu.default, {
controls: controls,
...props
}));
}
var _default = (0, _compose.withPreferredColorScheme)(ToolbarGroupCollapsed);
exports.default = _default;
//# sourceMappingURL=toolbar-group-collapsed.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_reactNative","require","_compose","_dropdownMenu","_interopRequireDefault","_style","ToolbarGroupCollapsed","controls","getStylesFromColorScheme","passedStyle","props","_react","createElement","View","style","styles","container","containerDark","default","_default","withPreferredColorScheme","exports"],"sources":["@wordpress/components/src/toolbar/toolbar-group/toolbar-group-collapsed.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n/**\n * WordPress dependencies\n */\nimport { withPreferredColorScheme } from '@wordpress/compose';\n/**\n * Internal dependencies\n */\nimport DropdownMenu from '../../dropdown-menu';\nimport styles from './style.scss';\n\nfunction ToolbarGroupCollapsed( {\n\tcontrols = [],\n\tgetStylesFromColorScheme,\n\tpassedStyle,\n\t...props\n} ) {\n\treturn (\n\t\t<View\n\t\t\tstyle={ [\n\t\t\t\tgetStylesFromColorScheme(\n\t\t\t\t\tstyles.container,\n\t\t\t\t\tstyles.containerDark\n\t\t\t\t),\n\t\t\t\tpassedStyle,\n\t\t\t] }\n\t\t>\n\t\t\t<DropdownMenu controls={ controls } { ...props } />\n\t\t</View>\n\t);\n}\n\nexport default withPreferredColorScheme( ToolbarGroupCollapsed );\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,QAAA,GAAAD,OAAA;AAIA,IAAAE,aAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAD,sBAAA,CAAAH,OAAA;AAZA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAIA,SAASK,qBAAqBA,CAAE;EAC/BC,QAAQ,GAAG,EAAE;EACbC,wBAAwB;EACxBC,WAAW;EACX,GAAGC;AACJ,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACZ,YAAA,CAAAa,IAAI;IACJC,KAAK,EAAG,CACPN,wBAAwB,CACvBO,cAAM,CAACC,SAAS,EAChBD,cAAM,CAACE,aACR,CAAC,EACDR,WAAW;EACT,GAEH,IAAAE,MAAA,CAAAC,aAAA,EAACT,aAAA,CAAAe,OAAY;IAACX,QAAQ,EAAGA,QAAU;IAAA,GAAMG;EAAK,CAAI,CAC7C,CAAC;AAET;AAAC,IAAAS,QAAA,GAEc,IAAAC,iCAAwB,EAAEd,qBAAsB,CAAC;AAAAe,OAAA,CAAAH,OAAA,GAAAC,QAAA"}

View File

@@ -0,0 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
/**
* Internal dependencies
*/
const ToolbarGroupContainer = ({
className,
children,
...props
}) => (0, _react.createElement)("div", {
className: className,
...props
}, children);
var _default = ToolbarGroupContainer;
exports.default = _default;
//# sourceMappingURL=toolbar-group-container.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["ToolbarGroupContainer","className","children","props","_react","createElement","_default","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar-group/toolbar-group-container.tsx"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport type { WordPressComponentProps } from '../../context';\nimport type { ToolbarGroupContainerProps } from './types';\n\nconst ToolbarGroupContainer = ( {\n\tclassName,\n\tchildren,\n\t...props\n}: WordPressComponentProps< ToolbarGroupContainerProps, 'div', false > ) => (\n\t<div className={ className } { ...props }>\n\t\t{ children }\n\t</div>\n);\nexport default ToolbarGroupContainer;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;;AAIA,MAAMA,qBAAqB,GAAGA,CAAE;EAC/BC,SAAS;EACTC,QAAQ;EACR,GAAGC;AACiE,CAAC,KACrE,IAAAC,MAAA,CAAAC,aAAA;EAAKJ,SAAS,EAAGA,SAAW;EAAA,GAAME;AAAK,GACpCD,QACE,CACL;AAAC,IAAAI,QAAA,GACaN,qBAAqB;AAAAO,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

View File

@@ -0,0 +1,37 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _reactNative = require("react-native");
var _compose = require("@wordpress/compose");
var _style = _interopRequireDefault(require("./style.scss"));
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const ToolbarGroupContainer = ({
passedStyle,
children
}) => {
const groupStyles = [(0, _compose.usePreferredColorSchemeStyle)(_style.default.container, _style.default.containerDark), {
borderLeftWidth: _reactNative.StyleSheet.hairlineWidth
}, passedStyle];
return (0, _react.createElement)(_reactNative.View, {
style: groupStyles
}, children);
};
var _default = ToolbarGroupContainer;
exports.default = _default;
//# sourceMappingURL=toolbar-group-container.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_reactNative","require","_compose","_style","_interopRequireDefault","ToolbarGroupContainer","passedStyle","children","groupStyles","usePreferredColorSchemeStyle","styles","container","containerDark","borderLeftWidth","StyleSheet","hairlineWidth","_react","createElement","View","style","_default","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar-group/toolbar-group-container.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { StyleSheet, View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst ToolbarGroupContainer = ( { passedStyle, children } ) => {\n\tconst groupStyles = [\n\t\tusePreferredColorSchemeStyle( styles.container, styles.containerDark ),\n\t\t{ borderLeftWidth: StyleSheet.hairlineWidth },\n\t\tpassedStyle,\n\t];\n\n\treturn <View style={ groupStyles }>{ children }</View>;\n};\n\nexport default ToolbarGroupContainer;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AAKA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAMI,qBAAqB,GAAGA,CAAE;EAAEC,WAAW;EAAEC;AAAS,CAAC,KAAM;EAC9D,MAAMC,WAAW,GAAG,CACnB,IAAAC,qCAA4B,EAAEC,cAAM,CAACC,SAAS,EAAED,cAAM,CAACE,aAAc,CAAC,EACtE;IAAEC,eAAe,EAAEC,uBAAU,CAACC;EAAc,CAAC,EAC7CT,WAAW,CACX;EAED,OAAO,IAAAU,MAAA,CAAAC,aAAA,EAACjB,YAAA,CAAAkB,IAAI;IAACC,KAAK,EAAGX;EAAa,GAAGD,QAAgB,CAAC;AACvD,CAAC;AAAC,IAAAa,QAAA,GAEaf,qBAAqB;AAAAgB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar-group/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\n/**\n * Internal dependencies\n */\nimport type {\n\tDropdownMenuProps,\n\tDropdownOption,\n} from '../../dropdown-menu/types';\n\n/**\n * WordPress dependencies\n */\nimport type { Props as IconProps } from '../../icon';\n\nexport type ToolbarGroupControls = DropdownOption & {\n\t/**\n\t * An optional subscript associated to the control.\n\t */\n\tsubscript?: string;\n};\n\ntype ToolbarGroupPropsBase = {\n\t/**\n\t * The controls to render in this toolbar.\n\t */\n\tcontrols?: ToolbarGroupControls[] | ToolbarGroupControls[][];\n\n\t/**\n\t * Class to set on the container div.\n\t */\n\tclassName?: string;\n\n\t/**\n\t * Any other things to render inside the toolbar besides the controls.\n\t */\n\tchildren?: ReactNode;\n\n\t/**\n\t * The Dashicon icon slug to be shown for the option.\n\t */\n\ticon?: IconProps[ 'icon' ];\n};\n\nexport type ToolbarGroupProps = ToolbarGroupPropsBase &\n\t(\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * When true, turns `ToolbarGroup` into a dropdown menu.\n\t\t\t\t */\n\t\t\t\tisCollapsed?: false;\n\t\t\t\t/**\n\t\t\t\t * Any other things to render inside the toolbar besides the controls.\n\t\t\t\t */\n\t\t\t\tchildren?: ReactNode;\n\t\t\t\ttitle?: never;\n\t\t }\n\t\t| {\n\t\t\t\t/**\n\t\t\t\t * When true, turns `ToolbarGroup` into a dropdown menu.\n\t\t\t\t */\n\t\t\t\tisCollapsed: true;\n\t\t\t\t/**\n\t\t\t\t * Any other things to render inside the toolbar besides the controls.\n\t\t\t\t */\n\t\t\t\tchildren?: ToolbarGroupCollapsedProps[ 'children' ];\n\t\t\t\t/**\n\t\t\t\t * ARIA label for dropdown menu if is collapsed.\n\t\t\t\t */\n\t\t\t\ttitle: string;\n\t\t }\n\t);\n\nexport type ToolbarGroupCollapsedProps = DropdownMenuProps;\n\nexport type ToolbarGroupContainerProps = {\n\t/**\n\t * Children to be rendered inside the toolbar.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * Class to set on the container div.\n\t */\n\tclassName?: string;\n\t/**\n\t * Props to be passed.\n\t */\n\tprops?: any;\n};\n"],"mappings":""}

View File

@@ -0,0 +1,64 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
var _element = require("@wordpress/element");
var _warning = _interopRequireDefault(require("@wordpress/warning"));
var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
/**
* External dependencies
*/
// eslint-disable-next-line no-restricted-imports
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function ToolbarItem({
children,
as: Component,
...props
}, ref) {
const accessibleToolbarStore = (0, _element.useContext)(_toolbarContext.default);
const isRenderProp = typeof children === 'function';
if (!isRenderProp && !Component) {
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)('`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' + 'See https://developer.wordpress.org/block-editor/components/toolbar-item/') : void 0;
return null;
}
const allProps = {
...props,
ref,
'data-toolbar-item': true
};
if (!accessibleToolbarStore) {
if (Component) {
return (0, _react.createElement)(Component, {
...allProps
}, children);
}
if (!isRenderProp) {
return null;
}
return children(allProps);
}
const render = isRenderProp ? children : Component && (0, _react.createElement)(Component, null, children);
return (0, _react.createElement)(Ariakit.ToolbarItem, {
...allProps,
store: accessibleToolbarStore,
render: render
});
}
var _default = (0, _element.forwardRef)(ToolbarItem);
exports.default = _default;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_warning","_interopRequireDefault","_toolbarContext","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ToolbarItem","children","as","Component","props","ref","accessibleToolbarStore","useContext","ToolbarContext","isRenderProp","SCRIPT_DEBUG","warning","allProps","_react","createElement","render","store","_default","forwardRef","exports"],"sources":["@wordpress/components/src/toolbar/toolbar-item/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useContext } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarItemProps } from './types';\n\nfunction ToolbarItem(\n\t{ children, as: Component, ...props }: ToolbarItemProps,\n\tref: ForwardedRef< any >\n) {\n\tconst accessibleToolbarStore = useContext( ToolbarContext );\n\tconst isRenderProp = typeof children === 'function';\n\n\tif ( ! isRenderProp && ! Component ) {\n\t\twarning(\n\t\t\t'`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' +\n\t\t\t\t'See https://developer.wordpress.org/block-editor/components/toolbar-item/'\n\t\t);\n\t\treturn null;\n\t}\n\n\tconst allProps = { ...props, ref, 'data-toolbar-item': true };\n\n\tif ( ! accessibleToolbarStore ) {\n\t\tif ( Component ) {\n\t\t\treturn <Component { ...allProps }>{ children }</Component>;\n\t\t}\n\t\tif ( ! isRenderProp ) {\n\t\t\treturn null;\n\t\t}\n\t\treturn children( allProps );\n\t}\n\n\tconst render = isRenderProp\n\t\t? children\n\t\t: Component && <Component>{ children }</Component>;\n\n\treturn (\n\t\t<Ariakit.ToolbarItem\n\t\t\t{ ...allProps }\n\t\t\tstore={ accessibleToolbarStore }\n\t\t\trender={ render }\n\t\t/>\n\t);\n}\n\nexport default forwardRef( ToolbarItem );\n"],"mappings":";;;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AAKA,IAAAI,eAAA,GAAAD,sBAAA,CAAAH,OAAA;AAAgD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAhBhD;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAIA,SAASW,WAAWA,CACnB;EAAEC,QAAQ;EAAEC,EAAE,EAAEC,SAAS;EAAE,GAAGC;AAAwB,CAAC,EACvDC,GAAwB,EACvB;EACD,MAAMC,sBAAsB,GAAG,IAAAC,mBAAU,EAAEC,uBAAe,CAAC;EAC3D,MAAMC,YAAY,GAAG,OAAOR,QAAQ,KAAK,UAAU;EAEnD,IAAK,CAAEQ,YAAY,IAAI,CAAEN,SAAS,EAAG;IACpC,OAAAO,YAAA,oBAAAA,YAAA,gBAAAC,gBAAO,EACN,sIAAsI,GACrI,2EACF,CAAC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMC,QAAQ,GAAG;IAAE,GAAGR,KAAK;IAAEC,GAAG;IAAE,mBAAmB,EAAE;EAAK,CAAC;EAE7D,IAAK,CAAEC,sBAAsB,EAAG;IAC/B,IAAKH,SAAS,EAAG;MAChB,OAAO,IAAAU,MAAA,CAAAC,aAAA,EAACX,SAAS;QAAA,GAAMS;MAAQ,GAAKX,QAAqB,CAAC;IAC3D;IACA,IAAK,CAAEQ,YAAY,EAAG;MACrB,OAAO,IAAI;IACZ;IACA,OAAOR,QAAQ,CAAEW,QAAS,CAAC;EAC5B;EAEA,MAAMG,MAAM,GAAGN,YAAY,GACxBR,QAAQ,GACRE,SAAS,IAAI,IAAAU,MAAA,CAAAC,aAAA,EAACX,SAAS,QAAGF,QAAqB,CAAC;EAEnD,OACC,IAAAY,MAAA,CAAAC,aAAA,EAAC3C,OAAO,CAAC6B,WAAW;IAAA,GACdY,QAAQ;IACbI,KAAK,EAAGV,sBAAwB;IAChCS,MAAM,EAAGA;EAAQ,CACjB,CAAC;AAEJ;AAAC,IAAAE,QAAA,GAEc,IAAAC,mBAAU,EAAElB,WAAY,CAAC;AAAAmB,OAAA,CAAAlC,OAAA,GAAAgC,QAAA"}

View File

@@ -0,0 +1,29 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _element = require("@wordpress/element");
var _warning = _interopRequireDefault(require("@wordpress/warning"));
/**
* WordPress dependencies
*/
function ToolbarItem({
children,
...props
}, ref) {
if (typeof children !== 'function') {
typeof SCRIPT_DEBUG !== "undefined" && SCRIPT_DEBUG === true ? (0, _warning.default)('`ToolbarItem` is a generic headless component that accepts only function children props') : void 0;
return null;
}
return children({
...props,
ref
});
}
var _default = (0, _element.forwardRef)(ToolbarItem);
exports.default = _default;
//# sourceMappingURL=index.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_element","require","_warning","_interopRequireDefault","ToolbarItem","children","props","ref","SCRIPT_DEBUG","warning","_default","forwardRef","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar-item/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport warning from '@wordpress/warning';\n\nfunction ToolbarItem( { children, ...props }, ref ) {\n\tif ( typeof children !== 'function' ) {\n\t\twarning(\n\t\t\t'`ToolbarItem` is a generic headless component that accepts only function children props'\n\t\t);\n\t\treturn null;\n\t}\n\treturn children( { ...props, ref } );\n}\n\nexport default forwardRef( ToolbarItem );\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA,SAASG,WAAWA,CAAE;EAAEC,QAAQ;EAAE,GAAGC;AAAM,CAAC,EAAEC,GAAG,EAAG;EACnD,IAAK,OAAOF,QAAQ,KAAK,UAAU,EAAG;IACrC,OAAAG,YAAA,oBAAAA,YAAA,gBAAAC,gBAAO,EACN,yFACD,CAAC;IACD,OAAO,IAAI;EACZ;EACA,OAAOJ,QAAQ,CAAE;IAAE,GAAGC,KAAK;IAAEC;EAAI,CAAE,CAAC;AACrC;AAAC,IAAAG,QAAA,GAEc,IAAAC,mBAAU,EAAEP,WAAY,CAAC;AAAAQ,OAAA,CAAAC,OAAA,GAAAH,QAAA"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar-item/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type {\n\tReactElement,\n\tReactNode,\n\tElementType,\n\tHTMLAttributes,\n\tRefAttributes,\n} from 'react';\n\nexport type ToolbarItemProps = Omit< HTMLAttributes< any >, 'children' > & {\n\t/**\n\t * Component type that will be used to render the toolbar item.\n\t */\n\tas?: ElementType;\n\t/**\n\t * A function that receives the props that should be spread onto the element\n\t * that will be rendered as a toolbar item. If the `as` prop is not provided,\n\t * this prop will accept a ReactNode instead.\n\t */\n\tchildren?:\n\t\t| ReactNode\n\t\t| ( (\n\t\t\t\tprops: HTMLAttributes< any > & RefAttributes< any >\n\t\t ) => ReactElement | null );\n};\n"],"mappings":""}

View File

@@ -0,0 +1,100 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.Toolbar = void 0;
var _react = require("react");
var _classnames = _interopRequireDefault(require("classnames"));
var _element = require("@wordpress/element");
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
var _toolbarGroup = _interopRequireDefault(require("../toolbar-group"));
var _toolbarContainer = _interopRequireDefault(require("./toolbar-container"));
var _context = require("../../context");
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function UnforwardedToolbar({
className,
label,
variant,
...props
}, ref) {
const isVariantDefined = variant !== undefined;
const contextSystemValue = (0, _element.useMemo)(() => {
if (isVariantDefined) {
return {};
}
return {
DropdownMenu: {
variant: 'toolbar'
},
Dropdown: {
variant: 'toolbar'
}
};
}, [isVariantDefined]);
if (!label) {
(0, _deprecated.default)('Using Toolbar without label prop', {
since: '5.6',
alternative: 'ToolbarGroup component',
link: 'https://developer.wordpress.org/block-editor/components/toolbar/'
});
// Extracting title from `props` because `ToolbarGroup` doesn't accept it.
const {
title: _title,
...restProps
} = props;
return (0, _react.createElement)(_toolbarGroup.default, {
isCollapsed: false,
...restProps,
className: className
});
}
// `ToolbarGroup` already uses components-toolbar for compatibility reasons.
const finalClassName = (0, _classnames.default)('components-accessible-toolbar', className, variant && `is-${variant}`);
return (0, _react.createElement)(_context.ContextSystemProvider, {
value: contextSystemValue
}, (0, _react.createElement)(_toolbarContainer.default, {
className: finalClassName,
label: label,
ref: ref,
...props
}));
}
/**
* Renders a toolbar.
*
* To add controls, simply pass `ToolbarButton` components as children.
*
* ```jsx
* import { Toolbar, ToolbarButton } from '@wordpress/components';
* import { formatBold, formatItalic, link } from '@wordpress/icons';
*
* function MyToolbar() {
* return (
* <Toolbar label="Options">
* <ToolbarButton icon={ formatBold } label="Bold" />
* <ToolbarButton icon={ formatItalic } label="Italic" />
* <ToolbarButton icon={ link } label="Link" />
* </Toolbar>
* );
* }
* ```
*/
const Toolbar = (0, _element.forwardRef)(UnforwardedToolbar);
exports.Toolbar = Toolbar;
var _default = Toolbar;
exports.default = _default;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_classnames","_interopRequireDefault","require","_element","_deprecated","_toolbarGroup","_toolbarContainer","_context","UnforwardedToolbar","className","label","variant","props","ref","isVariantDefined","undefined","contextSystemValue","useMemo","DropdownMenu","Dropdown","deprecated","since","alternative","link","title","_title","restProps","_react","createElement","default","isCollapsed","finalClassName","classnames","ContextSystemProvider","value","Toolbar","forwardRef","exports","_default"],"sources":["@wordpress/components/src/toolbar/toolbar/index.tsx"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef, useMemo } from '@wordpress/element';\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport ToolbarGroup from '../toolbar-group';\nimport ToolbarContainer from './toolbar-container';\nimport type { ToolbarProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\nimport { ContextSystemProvider } from '../../context';\n\nfunction UnforwardedToolbar(\n\t{\n\t\tclassName,\n\t\tlabel,\n\t\tvariant,\n\t\t...props\n\t}: WordPressComponentProps< ToolbarProps, 'div', false >,\n\tref: ForwardedRef< any >\n) {\n\tconst isVariantDefined = variant !== undefined;\n\tconst contextSystemValue = useMemo( () => {\n\t\tif ( isVariantDefined ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn {\n\t\t\tDropdownMenu: {\n\t\t\t\tvariant: 'toolbar',\n\t\t\t},\n\t\t\tDropdown: {\n\t\t\t\tvariant: 'toolbar',\n\t\t\t},\n\t\t};\n\t}, [ isVariantDefined ] );\n\n\tif ( ! label ) {\n\t\tdeprecated( 'Using Toolbar without label prop', {\n\t\t\tsince: '5.6',\n\t\t\talternative: 'ToolbarGroup component',\n\t\t\tlink: 'https://developer.wordpress.org/block-editor/components/toolbar/',\n\t\t} );\n\t\t// Extracting title from `props` because `ToolbarGroup` doesn't accept it.\n\t\tconst { title: _title, ...restProps } = props;\n\t\treturn (\n\t\t\t<ToolbarGroup\n\t\t\t\tisCollapsed={ false }\n\t\t\t\t{ ...restProps }\n\t\t\t\tclassName={ className }\n\t\t\t/>\n\t\t);\n\t}\n\t// `ToolbarGroup` already uses components-toolbar for compatibility reasons.\n\tconst finalClassName = classnames(\n\t\t'components-accessible-toolbar',\n\t\tclassName,\n\t\tvariant && `is-${ variant }`\n\t);\n\n\treturn (\n\t\t<ContextSystemProvider value={ contextSystemValue }>\n\t\t\t<ToolbarContainer\n\t\t\t\tclassName={ finalClassName }\n\t\t\t\tlabel={ label }\n\t\t\t\tref={ ref }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</ContextSystemProvider>\n\t);\n}\n\n/**\n * Renders a toolbar.\n *\n * To add controls, simply pass `ToolbarButton` components as children.\n *\n * ```jsx\n * import { Toolbar, ToolbarButton } from '@wordpress/components';\n * import { formatBold, formatItalic, link } from '@wordpress/icons';\n *\n * function MyToolbar() {\n * return (\n * <Toolbar label=\"Options\">\n * <ToolbarButton icon={ formatBold } label=\"Bold\" />\n * <ToolbarButton icon={ formatItalic } label=\"Italic\" />\n * <ToolbarButton icon={ link } label=\"Link\" />\n * </Toolbar>\n * );\n * }\n * ```\n */\nexport const Toolbar = forwardRef( UnforwardedToolbar );\nexport default Toolbar;\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAKA,IAAAG,aAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AAGA,IAAAK,QAAA,GAAAL,OAAA;AAnBA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAOA,SAASM,kBAAkBA,CAC1B;EACCC,SAAS;EACTC,KAAK;EACLC,OAAO;EACP,GAAGC;AACmD,CAAC,EACxDC,GAAwB,EACvB;EACD,MAAMC,gBAAgB,GAAGH,OAAO,KAAKI,SAAS;EAC9C,MAAMC,kBAAkB,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACzC,IAAKH,gBAAgB,EAAG;MACvB,OAAO,CAAC,CAAC;IACV;IACA,OAAO;MACNI,YAAY,EAAE;QACbP,OAAO,EAAE;MACV,CAAC;MACDQ,QAAQ,EAAE;QACTR,OAAO,EAAE;MACV;IACD,CAAC;EACF,CAAC,EAAE,CAAEG,gBAAgB,CAAG,CAAC;EAEzB,IAAK,CAAEJ,KAAK,EAAG;IACd,IAAAU,mBAAU,EAAE,kCAAkC,EAAE;MAC/CC,KAAK,EAAE,KAAK;MACZC,WAAW,EAAE,wBAAwB;MACrCC,IAAI,EAAE;IACP,CAAE,CAAC;IACH;IACA,MAAM;MAAEC,KAAK,EAAEC,MAAM;MAAE,GAAGC;IAAU,CAAC,GAAGd,KAAK;IAC7C,OACC,IAAAe,MAAA,CAAAC,aAAA,EAACvB,aAAA,CAAAwB,OAAY;MACZC,WAAW,EAAG,KAAO;MAAA,GAChBJ,SAAS;MACdjB,SAAS,EAAGA;IAAW,CACvB,CAAC;EAEJ;EACA;EACA,MAAMsB,cAAc,GAAG,IAAAC,mBAAU,EAChC,+BAA+B,EAC/BvB,SAAS,EACTE,OAAO,IAAK,MAAMA,OAAS,EAC5B,CAAC;EAED,OACC,IAAAgB,MAAA,CAAAC,aAAA,EAACrB,QAAA,CAAA0B,qBAAqB;IAACC,KAAK,EAAGlB;EAAoB,GAClD,IAAAW,MAAA,CAAAC,aAAA,EAACtB,iBAAA,CAAAuB,OAAgB;IAChBpB,SAAS,EAAGsB,cAAgB;IAC5BrB,KAAK,EAAGA,KAAO;IACfG,GAAG,EAAGA,GAAK;IAAA,GACND;EAAK,CACV,CACqB,CAAC;AAE1B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMuB,OAAO,GAAG,IAAAC,mBAAU,EAAE5B,kBAAmB,CAAC;AAAC6B,OAAA,CAAAF,OAAA,GAAAA,OAAA;AAAA,IAAAG,QAAA,GACzCH,OAAO;AAAAE,OAAA,CAAAR,OAAA,GAAAS,QAAA"}

View File

@@ -0,0 +1,52 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = exports.ToolbarContainer = void 0;
var _react = require("react");
var Ariakit = _interopRequireWildcard(require("@ariakit/react"));
var _element = require("@wordpress/element");
var _i18n = require("@wordpress/i18n");
var _toolbarContext = _interopRequireDefault(require("../toolbar-context"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
/**
* External dependencies
*/
// eslint-disable-next-line no-restricted-imports
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function UnforwardedToolbarContainer({
label,
...props
}, ref) {
const toolbarStore = Ariakit.useToolbarStore({
focusLoop: true,
rtl: (0, _i18n.isRTL)()
});
return (
// This will provide state for `ToolbarButton`'s
(0, _react.createElement)(_toolbarContext.default.Provider, {
value: toolbarStore
}, (0, _react.createElement)(Ariakit.Toolbar, {
ref: ref,
"aria-label": label,
store: toolbarStore,
...props
}))
);
}
const ToolbarContainer = (0, _element.forwardRef)(UnforwardedToolbarContainer);
exports.ToolbarContainer = ToolbarContainer;
var _default = ToolbarContainer;
exports.default = _default;
//# sourceMappingURL=toolbar-container.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["Ariakit","_interopRequireWildcard","require","_element","_i18n","_toolbarContext","_interopRequireDefault","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","UnforwardedToolbarContainer","label","props","ref","toolbarStore","useToolbarStore","focusLoop","rtl","isRTL","_react","createElement","Provider","value","Toolbar","store","ToolbarContainer","forwardRef","exports","_default"],"sources":["@wordpress/components/src/toolbar/toolbar/toolbar-container.tsx"],"sourcesContent":["/**\n * External dependencies\n */\n// eslint-disable-next-line no-restricted-imports\nimport * as Ariakit from '@ariakit/react';\nimport type { ForwardedRef } from 'react';\n\n/**\n * WordPress dependencies\n */\nimport { forwardRef } from '@wordpress/element';\nimport { isRTL } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ToolbarContext from '../toolbar-context';\nimport type { ToolbarProps } from './types';\nimport type { WordPressComponentProps } from '../../context';\n\nfunction UnforwardedToolbarContainer(\n\t{ label, ...props }: WordPressComponentProps< ToolbarProps, 'div', false >,\n\tref: ForwardedRef< any >\n) {\n\tconst toolbarStore = Ariakit.useToolbarStore( {\n\t\tfocusLoop: true,\n\t\trtl: isRTL(),\n\t} );\n\n\treturn (\n\t\t// This will provide state for `ToolbarButton`'s\n\t\t<ToolbarContext.Provider value={ toolbarStore }>\n\t\t\t<Ariakit.Toolbar\n\t\t\t\tref={ ref }\n\t\t\t\taria-label={ label }\n\t\t\t\tstore={ toolbarStore }\n\t\t\t\t{ ...props }\n\t\t\t/>\n\t\t</ToolbarContext.Provider>\n\t);\n}\n\nexport const ToolbarContainer = forwardRef( UnforwardedToolbarContainer );\nexport default ToolbarContainer;\n"],"mappings":";;;;;;;;AAIA,IAAAA,OAAA,GAAAC,uBAAA,CAAAC,OAAA;AAMA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,eAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAgD,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAP,wBAAAW,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAhBhD;AACA;AACA;AACA;;AAIA;AACA;AACA;;AAIA;AACA;AACA;;AAKA,SAASW,2BAA2BA,CACnC;EAAEC,KAAK;EAAE,GAAGC;AAA6D,CAAC,EAC1EC,GAAwB,EACvB;EACD,MAAMC,YAAY,GAAGjC,OAAO,CAACkC,eAAe,CAAE;IAC7CC,SAAS,EAAE,IAAI;IACfC,GAAG,EAAE,IAAAC,WAAK,EAAC;EACZ,CAAE,CAAC;EAEH;IACC;IACA,IAAAC,MAAA,CAAAC,aAAA,EAAClC,eAAA,CAAAS,OAAc,CAAC0B,QAAQ;MAACC,KAAK,EAAGR;IAAc,GAC9C,IAAAK,MAAA,CAAAC,aAAA,EAACvC,OAAO,CAAC0C,OAAO;MACfV,GAAG,EAAGA,GAAK;MACX,cAAaF,KAAO;MACpBa,KAAK,EAAGV,YAAc;MAAA,GACjBF;IAAK,CACV,CACuB;EAAC;AAE5B;AAEO,MAAMa,gBAAgB,GAAG,IAAAC,mBAAU,EAAEhB,2BAA4B,CAAC;AAACiB,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AAAA,IAAAG,QAAA,GAC3DH,gBAAgB;AAAAE,OAAA,CAAAhC,OAAA,GAAAiC,QAAA"}

View File

@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _react = require("react");
var _reactNative = require("react-native");
/**
* External dependencies
*/
const ToolbarContainer = ({
children
}) => (0, _react.createElement)(_reactNative.View, null, children);
var _default = ToolbarContainer;
exports.default = _default;
//# sourceMappingURL=toolbar-container.native.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":["_reactNative","require","ToolbarContainer","children","_react","createElement","View","_default","exports","default"],"sources":["@wordpress/components/src/toolbar/toolbar/toolbar-container.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\nconst ToolbarContainer = ( { children } ) => <View>{ children }</View>;\n\nexport default ToolbarContainer;\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,gBAAgB,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM,IAAAC,MAAA,CAAAC,aAAA,EAACL,YAAA,CAAAM,IAAI,QAAGH,QAAgB,CAAC;AAAC,IAAAI,QAAA,GAExDL,gBAAgB;AAAAM,OAAA,CAAAC,OAAA,GAAAF,QAAA"}

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
//# sourceMappingURL=types.js.map

View File

@@ -0,0 +1 @@
{"version":3,"names":[],"sources":["@wordpress/components/src/toolbar/toolbar/types.ts"],"sourcesContent":["/**\n * External dependencies\n */\nimport type { ReactNode } from 'react';\n\nexport type ToolbarProps = {\n\t/**\n\t * Children to be rendered inside the toolbar.\n\t */\n\tchildren?: ReactNode;\n\t/**\n\t * An accessible label for the toolbar.\n\t */\n\tlabel: string;\n\t/**\n\t * Specifies the toolbar's style.\n\t *\n\t * Leave undefined for the default style. Or `'unstyled'` which\n\t * removes the border from the toolbar, but keeps the default\n\t * popover style.\n\t *\n\t * @default undefined\n\t */\n\tvariant?: 'unstyled' | undefined;\n};\n"],"mappings":""}