Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/npm_and_yarn/npm_and_yarn-c17c…
Browse files Browse the repository at this point in the history
…b7cb35
  • Loading branch information
faisal-alvi authored Sep 13, 2024
2 parents a550d93 + 74840b2 commit 28b7adc
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 43 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/push-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,8 @@ jobs:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
- name: Upload release asset
uses: actions/upload-release-asset@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ steps.deploy.outputs.zip-path }}
asset_name: ${{ github.event.repository.name }}.zip
asset_content_type: application/zip
files: ${{ github.workspace }}/${{ github.event.repository.name }}.zip
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Insert Special Characters

> A Special Character inserter for the WordPress block editor (Gutenberg).
![Insert Special Characters](https://github.com/10up/insert-special-characters/blob/develop/.wordpress-org/banner-1544x500.png)

[![Support Level](https://img.shields.io/badge/support-stable-blue.svg)](#support-level) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/insert-special-characters?label=WordPress) [![GPLv2 License](https://img.shields.io/github/license/10up/insert-special-characters.svg)](https://github.com/10up/insert-special-characters/blob/develop/LICENSE.md) [![Dependency Review](https://github.com/10up/insert-special-characters/actions/workflows/dependency-review.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/dependency-review.yml) [![WordPress Plugin Version](https://img.shields.io/wordpress/plugin/v/insert-special-characters?logo=wordpress&logoColor=FFFFFF&label=Playground%20Demo&labelColor=3858E9&color=3858E9)](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/10up/insert-special-characters/develop/.wordpress-org/blueprints/blueprint.json)

[![Support Level](https://img.shields.io/badge/support-stable-blue.svg)](#support-level) [![Release Version](https://img.shields.io/github/release/10up/insert-special-characters.svg)](https://github.com/10up/insert-special-characters/releases/latest) ![WordPress tested up to version](https://img.shields.io/wordpress/plugin/tested/insert-special-characters?label=WordPress) [![GPLv2 License](https://img.shields.io/github/license/10up/insert-special-characters.svg)](https://github.com/10up/insert-special-characters/blob/develop/LICENSE.md)
[![E2E test](https://github.com/10up/insert-special-characters/actions/workflows/cypress.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/cypress.yml) [![ESLint](https://github.com/10up/insert-special-characters/actions/workflows/eslint.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/eslint.yml) [![PHPCS](https://github.com/10up/insert-special-characters/actions/workflows/phpcs.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/phpcs.yml) [![PHP Compatibility](https://github.com/10up/insert-special-characters/actions/workflows/php-compatibility.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/php-compatibility.yml) [![CodeQL](https://github.com/10up/insert-special-characters/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/10up/insert-special-characters/actions/workflows/codeql-analysis.yml)

> A Special Character inserter for the WordPress block editor (Gutenberg).
## Overview

Expand Down Expand Up @@ -41,8 +45,8 @@ wp.hooks.addFilter(

## Requirements

* PHP 5.6+
* [WordPress](http://wordpress.org/) 5.5+
* PHP 7.4+
* [WordPress](http://wordpress.org/) 6.1+

## Installation

Expand Down
6 changes: 3 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
=== Insert Special Characters ===
Contributors: 10up, adamsilverstein, johnwatkins0, jeffpaul
Tags: Special Characters, Character Map, Omega, Gutenberg, Block, block editor
Tags: Special Characters, Character Map, Omega, character inserter, symbols
Stable tag: 1.1.2
Requires at least: 6.1
Tested up to: 6.4
Tested up to: 6.6
Requires PHP: 7.4
License: GPLv2
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
Expand All @@ -21,7 +21,7 @@ Development takes place in the [GitHub repository](https://github.com/10up/inser
== Technical Notes ==

* Requires PHP 7.4+.
* Requires [WordPress](http://wordpress.org/) 5.7+
* Requires [WordPress](http://wordpress.org/) 6.1+
* Issues and Pull requests welcome in the [GitHub repository](https://github.com/10up/insert-special-characters).

== Installation ==
Expand Down
59 changes: 28 additions & 31 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
useMemo,
} from '@wordpress/element';
import { BlockControls, RichTextShortcut } from '@wordpress/block-editor';
import { Popover, ToolbarButton, ToolbarGroup } from '@wordpress/components';
import { ToolbarButton, Dropdown } from '@wordpress/components';
import { applyFilters } from '@wordpress/hooks';
import { displayShortcut } from '@wordpress/keycodes';
import { __ } from '@wordpress/i18n';
Expand Down Expand Up @@ -151,21 +151,10 @@ registerFormatType( type, {
}, [ isPopoverActive, memoizedPopoverRef ] );

Check warning on line 151 in src/index.js

View workflow job for this annotation

GitHub Actions / eslint

React Hook useEffect has missing dependencies: 'contentRef' and 'start'. Either include them or remove the dependency array

const characters = applyFilters( `${ name }-characters`, Chars );
// Display the character map when it is active.
const specialCharsPopover = isPopoverActive && (
<Popover
className="character-map-popover"
placement="bottom-start"
focusOnMount="firstElement"
key="charmap-popover"
anchor={ contentRef.current }
expandOnMobile={ true }
headerTitle={ __(
'Insert Special Character',
'insert-special-characters'
) }
ref={ popoverRef }
>

// Character map component used by the dropdown render.
const characterMap = () => {
return (
<CharacterMap
characterData={ characters }
onSelect={
Expand Down Expand Up @@ -207,24 +196,33 @@ registerFormatType( type, {
'insert-special-characters'
) }
/>
</Popover>
);
);
};

return (
<Fragment>
<BlockControls group="other">
<ToolbarGroup>
<ToolbarButton
className={ `toolbar-button-with-text toolbar-button__advanced-${ name }` }
icon="editor-customchar"
isPressed={ isPopoverActive }
label={ title }
onClick={ () =>
setIsPopoverActive( ! isPopoverActive )
}
shortcut={ displayShortcut.primary( character ) }
/>
</ToolbarGroup>
<Dropdown
className="insert-special-character__dropdown"
open={ isPopoverActive }
onToggle={ () =>
setIsPopoverActive( ! isPopoverActive )
}
contentClassName="insert-special-character__dropdown-content"
renderToggle={ ( { onToggle, isOpen } ) => (
<ToolbarButton
icon="editor-customchar"
label={ title }
className="toolbar-button__advanced-insertspecialcharacters"
onClick={ onToggle }
isActive={ isOpen }
shortcut={ displayShortcut.primary(
character
) }
/>
) }
renderContent={ characterMap }
/>
</BlockControls>
<Fragment>
<RichTextShortcut
Expand All @@ -233,7 +231,6 @@ registerFormatType( type, {
onUse={ () => setIsPopoverActive( ! isPopoverActive ) }
/>
</Fragment>
{ specialCharsPopover }
</Fragment>
);
},
Expand Down

0 comments on commit 28b7adc

Please sign in to comment.