| @@ -1,7 +1,12 @@ | ||
| 1 | -import { withSelect, withDispatch } from '@wordpress/data'; | |
| 1 | +import { withSelect, withDispatch, select } from '@wordpress/data'; | |
| 2 | 2 | |
| 3 | -const applyWithSelect = withSelect((select: Function, props: any): any => { | |
| 3 | +// from answer here: https://github.com/WordPress/gutenberg/issues/44477#issuecomment-1263026599 | |
| 4 | +export const isFullSiteEditor = () => { | |
| 5 | + return select && !!select('core/edit-site'); | |
| 6 | +}; | |
| 7 | + | |
| 8 | +const applyWithSelect: any = withSelect((select: Function, props: any): any => { | |
| 4 | 9 | return { |
| 5 | 10 | metaValue: select('core/editor').getEditedPostAttribute('meta')[ |
| 6 | 11 | props.metaKey |
| 7 | 12 | ], |
| @@ -7,9 +12,9 @@ | ||
| 7 | 12 | ], |
| 8 | 13 | }; |
| 9 | 14 | }); |
| 10 | 15 | |
| 11 | -const applyWithDispatch = withDispatch( | |
| 16 | +const applyWithDispatch: any = withDispatch( | |
| 12 | 17 | (dispatch: Function, props: any): any => { |
| 13 | 18 | return { |
| 14 | 19 | setMetaValue(value: string) { |
| 15 | 20 | dispatch('core/editor').editPost({ meta: { [props.metaKey]: value } }); |