5.1.2 • Published 2 months ago

@teft/editor-tools v5.1.2

Weekly downloads
11
License
GPL-2.0-or-later
Repository
github
Last release
2 months ago

Editor tools

Installation

Install the module

npm install @teft/editor-tools

Post Selector

image

Example:

import { PostSelector } from '@teft/editor-tools';
import { useState } from '@wordpress/element';

const [ postIds, setPostIds ] = useState( [] );
const [ visible, setVisible ] = useState( false );

{ visible && (
	<PostSelector
		ids={ postIds }
		onSelect={ ( ids ) => setPostIds( ids ) }
		onClose={ () => setVisible( false ) }
		postTypes={ [ 'post', 'page' ] }
	/>
) }

Query Sidebar

Example:

import { QuerySidebarOptions, queryServerAttributes } from '@teft/editor-tools';

function Edit( { attributes, setAttributes } ) {
	return (
		<>
			<QuerySidebarOptions
				attributes={ attributes }
				setAttributes={ setAttributes }
			/>

			<Disabled>
				<ServerSideRender
					block="teft/cards-query"
					attributes={ queryServerAttributes( attributes ) }
				/>
			</Disabled>
		</>
	);
}
5.1.2

2 months ago

5.1.0

2 months ago

5.0.3

2 months ago

0.4.1

3 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago