-
Notifications
You must be signed in to change notification settings - Fork 56
/
index.js
45 lines (39 loc) · 1.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* WordPress dependencies
*/
import { registerGutenberg } from '@wordpress/react-native-editor';
/**
* Internal dependencies
*/
import { getTranslation as getJetpackTranslation } from './i18n-cache/jetpack';
import { getTranslation as getLayoutGridTranslation } from './i18n-cache/layout-grid';
import { getTranslation as getJetpackVideoPressTranslation } from './i18n-cache/jetpack-videopress-pkg';
const pluginTranslations = [
{
domain: 'jetpack',
getTranslation: getJetpackTranslation,
},
{
domain: 'layout-grid',
getTranslation: getLayoutGridTranslation,
},
{
domain: 'jetpack-videopress-pkg',
getTranslation: getJetpackVideoPressTranslation,
},
];
export default function registerGutenbergMobile() {
registerGutenberg( {
beforeInitCallback: () => {
// We have to lazy import the setup code to prevent executing any code located
// at global scope before the editor is initialized, like translations retrieval.
require( './setup' ).default();
// Set up Jetpack
require( './jetpack-editor-setup' ).default();
// Set up Block experiments (i.e. Layout Grid block)
require( './block-experiments-setup' ).default();
},
pluginTranslations,
} );
}
registerGutenbergMobile();