Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion block-editor/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-rich-text'), 'version' => '17f5c0bec291cb2ddb3f');
<?php return array('dependencies' => array('lodash', 'react', 'react-jsx-runtime', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-element', 'wp-i18n', 'wp-primitives', 'wp-rich-text'), 'version' => '053349df96bda0ebca60');
2 changes: 1 addition & 1 deletion block-editor/build/index.js

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions block-editor/src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { computeIconLayerCount, prepareParamsForUseBlock, renderIcon } from './r
import IconModifier from './iconModifier'
import createCustomEvent from './createCustomEvent'

const openIconChooserForAddLayerEvent = createCustomEvent()
const { IconChooserModal } = get(window, [GLOBAL_KEY, 'iconChooser'], {})
const modifyToolbarIcon = wpIconFromFaIconDefinition(faBrush)
const defaultStylingParams = {
Expand All @@ -23,6 +22,8 @@ const defaultStylingParams = {
export function Edit(props) {
const { attributes, setAttributes } = props

const iconChooserOpenEvent = createCustomEvent()

const [justificationDropdownMenuIcon, setJustificationDropdownMenuIcon] = useState(justifyCenter)

const setJustification = (justification) => {
Expand Down Expand Up @@ -121,8 +122,8 @@ export function Edit(props) {
attributes={attributes}
setAttributes={setAttributes}
IconChooserModal={IconChooserModal}
prepareHandleSelect={prepareHandleSelect}
iconChooserOpenEvent={openIconChooserForAddLayerEvent}
handleSelect={prepareHandleSelect({ replace: 0 })}
iconChooserOpenEvent={iconChooserOpenEvent}
/>
</Modal>
)}
Expand All @@ -145,11 +146,11 @@ export function Edit(props) {
>
<IconChooserModal
onSubmit={prepareHandleSelect({ append: true })}
openEvent={openIconChooserForAddLayerEvent}
openEvent={iconChooserOpenEvent}
/>
<Button
variant="secondary"
onClick={() => document.dispatchEvent(openIconChooserForAddLayerEvent)}
onClick={() => document.dispatchEvent(iconChooserOpenEvent)}
>
{__('Choose Icon', 'font-awesome')}
</Button>
Expand Down
4 changes: 2 additions & 2 deletions block-editor/src/iconModifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ export default function (params) {
context,
iconChooserOpenEvent,
IconChooserModal,
prepareHandleSelect
handleSelect
} = params

const iconLayers = attributes.iconLayers || []
Expand Down Expand Up @@ -483,7 +483,7 @@ export default function (params) {
</div>
<IconChooserModal
title={__('Change Font Awesome Icon', 'font-awesome')}
onSubmit={prepareHandleSelect({ replace: 0 })}
onSubmit={handleSelect}
openEvent={iconChooserOpenEvent}
/>
</div>
Expand Down
Loading