Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/** @format */
/* eslint-disable wpcalypso/jsx-classname-namespace */
/**
* External dependencies
*/
import React from 'react';
/**
* WordPress Dependencies
*/
import { createSlotFill, withFocusReturn } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { ifCondition, compose } from '@wordpress/compose';
const { Fill, Slot } = createSlotFill( 'Sidebar' );
/**
* Renders a sidebar with its content.
*
* @return {Object} The rendered sidebar.
*/
const Sidebar = ( { children, label } ) => {
return (
<div tabindex="-1" label="" aria-label="{" role="region">
{ children }
</div>
);
};
/**
* WordPress dependencies
*/
import { createSlotFill, PanelBody } from '@wordpress/components';
const { Fill, Slot } = createSlotFill( 'PluginPrePublishPanel' );
/**
* Renders provided content to the pre-publish side panel in the publish flow
* (side panel that opens when a user first pushes "Publish" from the main editor).
*
* @param {Object} props Component props.
* @param {string} [props.className] An optional class name added to the panel.
* @param {string} [props.title] Title displayed at the top of the panel.
* @param {boolean} [props.initialOpen=false] Whether to have the panel initially opened. When no title is provided it is always opened.
*
* @example ES5
* ```js
* // Using ES5 syntax
* var __ = wp.i18n.__;
* var PluginPrePublishPanel = wp.editPost.PluginPrePublishPanel;
*
(() => {
const { Fill, Slot } = C.createSlotFill('Toolbar');
const ToolbarItem = () => My item;
const Toolbar = () => (
<div>
</div>
);
})();
import { useDispatch } from '@wordpress/data';
import { __ } from '@wordpress/i18n';
import RemoveIcon from 'components/icons/remove';
import AddReferenceDialog from 'gutenberg/dialogs/add-reference';
import StyleDialog from 'gutenberg/dialogs/update-style';
import { readReferencesFile } from 'utils/file';
import ToolbarMenu from './toolbar-menu';
import styles from './toolbar.scss';
interface Props {
selectedItems: readonly string[];
}
const { Slot: ToolbarButtonSlot, Fill: ToolbarButtonFill } = createSlotFill(
'abt-toolbar-buttons',
);
export const ToolbarButton = (props: IconButton.Props) => (
);
export default function Toolbar({ selectedItems }: Props) {
const { addReferences, removeFootnotes, removeReferences } = useDispatch(
'abt/data',
);
const { clearSelectedItems } = useDispatch('abt/ui');
const { createErrorNotice } = useDispatch('core/notices');
const removeSelectedItems = useCallback(() => {
/**
* External dependencies
*/
import React from 'react';
import { isEmpty } from 'lodash';
/**
* WordPress dependencies
*/
import { createSlotFill, MenuGroup } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
const { Fill: PluginsMoreMenuGroup, Slot } = createSlotFill( 'PluginsMoreMenuGroup' );
PluginsMoreMenuGroup.Slot = ( { fillProps } ) => (
{ fills => ! isEmpty( fills ) && { fills } }
);
export default PluginsMoreMenuGroup;
/**
* WordPress Dependencies
*/
import { createSlotFill, withFocusReturn } from '@wordpress/components';
import { withSelect } from '@wordpress/data';
import { ifCondition, compose } from '@wordpress/compose';
const { Fill, Slot } = createSlotFill( 'Sidebar' );
/**
* Renders a sidebar with its content.
*
* @return {Object} The rendered sidebar.
*/
const Sidebar = ( { children, label } ) => {
return (
<div tabindex="-1" label="" aria-label="{" role="region">
{ children }</div>
/**
* WordPress dependencies
*/
import { createSlotFill, Panel } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
const { Slot: TemplatesSlot, Fill: TemplatesFill } = createSlotFill(
'EditSiteSidebarTemplates'
);
const { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(
'EditSiteSidebarInspector'
);
function Sidebar() {
return (
<div tabindex="-1" aria-label="{" role="region">
</div>
/**
* WordPress dependencies
*/
import { createSlotFill, ToolbarButton } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { withDispatch } from '@wordpress/data';
const { Fill, Slot } = createSlotFill( 'SettingsToolbarButton' );
const SettingsButton = ( { openGeneralSidebar } ) => (
);
const SettingsButtonFill = ( props ) => (
);
const SettingsToolbarButton = withDispatch( ( dispatch ) => {
/**
* WordPress dependencies
*/
import { createSlotFill, Panel } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
const { Slot: TemplatesSlot, Fill: TemplatesFill } = createSlotFill(
'EditSiteSidebarTemplates'
);
const { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(
'EditSiteSidebarInspector'
);
function Sidebar() {
return (
<div tabindex="-1" aria-label="{" role="region">
</div>
/**
* External dependencies
*/
import classnames from 'classnames';
import React, { FunctionComponent } from 'react';
import { createSlotFill, Animate } from '@wordpress/components';
import { ifCondition } from '@wordpress/compose';
const { Fill, Slot } = createSlotFill( 'Sidebar' );
interface Props {
className: string;
label: string;
}
const Sidebar: FunctionComponent< Props > = ( { children, className, label } ) => {
return (
<div tabindex="{" label="" aria-label="{" role="region">
{ children }
</div>