How to use the @wordpress/rich-text.__unstableIsActiveListType function in @wordpress/rich-text

To help you get started, we’ve selected a few @wordpress/rich-text examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github WordPress / gutenberg / packages / block-editor / src / components / rich-text / list-edit.native.js View on Github external
export const ListEdit = ( {
	onTagNameChange,
	tagName,
	value,
	onChange,
} ) => (
github WordPress / gutenberg / packages / block-editor / src / components / rich-text / list-edit.js View on Github external
onTagNameChange && {
						icon: 'editor-ul',
						title: __( 'Convert to unordered list' ),
						isActive: isActiveListType( value, 'ul', tagName ),
						onClick() {
							onChange( changeListType( value, { type: 'ul' } ) );

							if ( isListRootSelected( value ) ) {
								onTagNameChange( 'ul' );
							}
						},
					},
					onTagNameChange && {
						icon: 'editor-ol',
						title: __( 'Convert to ordered list' ),
						isActive: isActiveListType( value, 'ol', tagName ),
						onClick() {
							onChange( changeListType( value, { type: 'ol' } ) );

							if ( isListRootSelected( value ) ) {
								onTagNameChange( 'ol' );
							}
						},
					},
					{
						icon: 'editor-outdent',
						title: __( 'Outdent list item' ),
						shortcut: _x( 'Backspace', 'keyboard key' ),
						onClick: () => {
							onChange( outdentListItems( value ) );
						},
					},
github WordPress / gutenberg / packages / block-library / src / list / edit.js View on Github external
} }
			/>
			 {
					onChange( outdentListItems( value ) );
				} }
			/>
github WordPress / gutenberg / packages / block-editor / src / components / rich-text / list-edit.native.js View on Github external
onTagNameChange && {
					icon: 'editor-ul',
					title: __( 'Convert to unordered list' ),
					isActive: isActiveListType( value, 'ul', tagName ),
					onClick() {
						onChange( changeListType( value, { type: 'ul' } ) );

						if ( isListRootSelected( value ) ) {
							onTagNameChange( 'ul' );
						}
					},
				},
				onTagNameChange && {
					icon: 'editor-ol',
					title: __( 'Convert to ordered list' ),
					isActive: isActiveListType( value, 'ol', tagName ),
					onClick() {
						onChange( changeListType( value, { type: 'ol' } ) );

						if ( isListRootSelected( value ) ) {
							onTagNameChange( 'ol' );
						}
					},
				},
			].filter( Boolean ) }
		/>
	
);
github WordPress / gutenberg / packages / block-library / src / list / edit.js View on Github external
{
							icon: 'editor-ul',
							title: __( 'Convert to unordered list' ),
							isActive: isActiveListType( value, 'ul', tagName ),
							onClick() {
								onChange( changeListType( value, { type: 'ul' } ) );

								if ( isListRootSelected( value ) ) {
									setAttributes( { ordered: false } );
								}
							},
						},
						{
							icon: 'editor-ol',
							title: __( 'Convert to ordered list' ),
							isActive: isActiveListType( value, 'ol', tagName ),
							onClick() {
								onChange( changeListType( value, { type: 'ol' } ) );

								if ( isListRootSelected( value ) ) {
									setAttributes( { ordered: true } );
								}
							},
						},
						{
							icon: 'editor-outdent',
							title: __( 'Outdent list item' ),
							shortcut: _x( 'Backspace', 'keyboard key' ),
							onClick() {
								onChange( outdentListItems( value ) );
							},
						},