Skip to content

Commit dc115b8

Browse files
committed
Merge branch 'develop' into feature/unsupported-core-blocks
2 parents 356695d + 864e5f2 commit dc115b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1017
-674
lines changed

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; ignore the submodules
22
gutenberg
3+
symlinked-packages
34
symlinked-packages-in-parent
45
react-native-aztec
56
bundle

.eslintrc

-31
This file was deleted.

.eslintrc.js

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* External dependencies
3+
*/
4+
const { map } = require( 'lodash' );
5+
6+
module.exports = {
7+
parser: "babel-eslint",
8+
env: {
9+
browser: true,
10+
"jest/globals": true
11+
},
12+
globals: {
13+
__DEV__: true
14+
},
15+
plugins: [
16+
"react",
17+
"react-native",
18+
"jest",
19+
"flowtype"
20+
],
21+
extends: [
22+
"plugin:@wordpress/eslint-plugin/recommended",
23+
"plugin:flowtype/recommended",
24+
],
25+
settings: {
26+
flowtype: {
27+
onlyFilesWithFlowAnnotation: true,
28+
},
29+
react: {
30+
pragma: "React",
31+
version: "16.8.3",
32+
flowVersion: "0.92.0",
33+
},
34+
},
35+
rules: {
36+
'no-restricted-syntax': [
37+
'error',
38+
// NOTE: We can't include the forward slash in our regex or
39+
// we'll get a `SyntaxError` (Invalid regular expression: \ at end of pattern)
40+
// here. That's why we use \\u002F in the regexes below.
41+
{
42+
selector: 'ImportDeclaration[source.value=/^@wordpress\\u002F.+\\u002F/]',
43+
message: 'Path access on WordPress dependencies is not allowed.',
44+
},
45+
{
46+
selector: 'CallExpression[callee.name=/^(__|_x|_n|_nx)$/] Literal[value=/\\.{3}/]',
47+
message: 'Use ellipsis character (…) in place of three dots',
48+
},
49+
{
50+
selector: 'ImportDeclaration[source.value="lodash"] Identifier.imported[name="memoize"]',
51+
message: 'Use memize instead of Lodash’s memoize',
52+
},
53+
{
54+
selector: 'CallExpression[callee.object.name="page"][callee.property.name="waitFor"]',
55+
message: 'Prefer page.waitForSelector instead.',
56+
},
57+
{
58+
selector: 'JSXAttribute[name.name="id"][value.type="Literal"]',
59+
message: 'Do not use string literals for IDs; use withInstanceId instead.',
60+
},
61+
{
62+
// Discourage the usage of `Math.random()` as it's a code smell
63+
// for UUID generation, for which we already have a higher-order
64+
// component: `withInstanceId`.
65+
selector: 'CallExpression[callee.object.name="Math"][callee.property.name="random"]',
66+
message: 'Do not use Math.random() to generate unique IDs; use withInstanceId instead. (If you’re not generating unique IDs: ignore this message.)',
67+
},
68+
{
69+
selector: 'CallExpression[callee.name="withDispatch"] > :function > BlockStatement > :not(VariableDeclaration,ReturnStatement)',
70+
message: 'withDispatch must return an object with consistent keys. Avoid performing logic in `mapDispatchToProps`.',
71+
},
72+
],
73+
},
74+
}

__mocks__/styleMock.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@ module.exports = {
1919
blockCode: {
2020
fontFamily: 'serif',
2121
},
22-
'editor-rich-text': {
22+
'block-editor-rich-text': {
2323
fontFamily: 'serif',
24+
minHeight: 30,
2425
},
25-
'editor-plain-text': {
26+
'block-editor-plain-text': {
2627
fontFamily: 'serif',
2728
},
2829
blockHolderFocused: {

i18n-cache/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,15 @@ const fetchTranslations = () => {
9090
const translationFilePromises = fetchedTranslations.map( ( languageResult ) => {
9191
return new Promise( ( resolve, reject ) => {
9292
const translationRelativePath = getTranslationFilePath( languageResult.locale );
93-
const translationAbsolutePath = path.resolve( __dirname, translationRelativePath );
9493

9594
if ( languageResult.inCache ) {
9695
languageResult.path = translationRelativePath;
9796
resolve( translationRelativePath );
9897
return;
9998
}
10099

100+
const translationAbsolutePath = path.resolve( __dirname, translationRelativePath );
101+
101102
fs.writeFile( translationAbsolutePath, JSON.stringify( languageResult.response ), 'utf8', ( err ) => {
102103
if ( err ) {
103104
reject( err );

index.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/** @flow
22
* @format */
33

4+
/**
5+
* Internal dependencies
6+
*/
47
import { registerApp } from './src';
58

69
registerApp();

ios/gutenberg.xcodeproj/project.pbxproj

+17-17
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
7EC7328F21907E3F00FED2E6 /* GutenbergViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7EC7328E21907E3F00FED2E6 /* GutenbergViewController.swift */; };
3838
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
3939
8C666FF0C9224FB88C2C0447 /* libRNSVG-tvOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9BFAFEB337654221B2F14D03 /* libRNSVG-tvOS.a */; };
40-
91C7517C21DE3A2400106645 /* libRNKeyboardAwareScrollView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 91C7517721DE393000106645 /* libRNKeyboardAwareScrollView.a */; };
40+
91C2E1B42242321F00D5E1F5 /* libRNTKeyboardAwareScrollView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 91C2E1B322422C9F00D5E1F5 /* libRNTKeyboardAwareScrollView.a */; };
4141
ADBDB9381DFEBF1600ED6528 /* libRCTBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */; };
4242
CF45443564B845C8BDCFBAB6 /* libRNTAztecView.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3ADEFEC092CF4D00BEF1019E /* libRNTAztecView.a */; };
4343
DD2AE937473A49B2B5A0E7B6 /* libRNSVG.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0EB766FE2F6D446A80AC6E6A /* libRNSVG.a */; };
@@ -315,12 +315,12 @@
315315
remoteGlobalIDString = 6DA7B8031F692C4C00FD1D50;
316316
remoteInfo = RNSafeArea;
317317
};
318-
91C7517621DE393000106645 /* PBXContainerItemProxy */ = {
318+
91C2E1B222422C9F00D5E1F5 /* PBXContainerItemProxy */ = {
319319
isa = PBXContainerItemProxy;
320-
containerPortal = 91C7514D21DE393000106645 /* RNKeyboardAwareScrollView.xcodeproj */;
320+
containerPortal = 91C2E1AE22422C9F00D5E1F5 /* RNTKeyboardAwareScrollView.xcodeproj */;
321321
proxyType = 2;
322-
remoteGlobalIDString = 6DA7B8031F692C4C00FD1D50;
323-
remoteInfo = RNKeyboardAwareScrollView;
322+
remoteGlobalIDString = 134814201AA4EA6300B7C361;
323+
remoteInfo = RNTKeyboardAwareScrollView;
324324
};
325325
ADBDB9261DFEBF0700ED6528 /* PBXContainerItemProxy */ = {
326326
isa = PBXContainerItemProxy;
@@ -422,7 +422,7 @@
422422
7EA30CF021AC8CDA0092F894 /* libxml2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libxml2.tbd; path = usr/lib/libxml2.tbd; sourceTree = SDKROOT; };
423423
7EC7328E21907E3F00FED2E6 /* GutenbergViewController.swift */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = sourcecode.swift; name = GutenbergViewController.swift; path = gutenberg/GutenbergViewController.swift; sourceTree = "<group>"; tabWidth = 1; };
424424
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
425-
91C7514D21DE393000106645 /* RNKeyboardAwareScrollView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNKeyboardAwareScrollView.xcodeproj; path = "../node_modules/react-native-keyboard-aware-scroll-view/ios/RNKeyboardAwareScrollView.xcodeproj"; sourceTree = "<group>"; };
425+
91C2E1AE22422C9F00D5E1F5 /* RNTKeyboardAwareScrollView.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNTKeyboardAwareScrollView.xcodeproj; path = "../node_modules/react-native-keyboard-aware-scroll-view/ios/RNTKeyboardAwareScrollView.xcodeproj"; sourceTree = "<group>"; };
426426
9B18D59B9364468890D0E546 /* RNSVG.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = RNSVG.xcodeproj; path = "../node_modules/react-native-svg/ios/RNSVG.xcodeproj"; sourceTree = "<group>"; };
427427
9BFAFEB337654221B2F14D03 /* libRNSVG-tvOS.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = "libRNSVG-tvOS.a"; sourceTree = "<group>"; };
428428
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTBlob.xcodeproj; path = "../node_modules/react-native/Libraries/Blob/RCTBlob.xcodeproj"; sourceTree = "<group>"; };
@@ -470,10 +470,10 @@
470470
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
471471
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
472472
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
473+
91C2E1B42242321F00D5E1F5 /* libRNTKeyboardAwareScrollView.a in Frameworks */,
473474
DD2AE937473A49B2B5A0E7B6 /* libRNSVG.a in Frameworks */,
474475
CF45443564B845C8BDCFBAB6 /* libRNTAztecView.a in Frameworks */,
475476
7E45CC5B218B42E000C0B2AB /* libRNReactNativeGutenbergBridge.a in Frameworks */,
476-
91C7517C21DE3A2400106645 /* libRNKeyboardAwareScrollView.a in Frameworks */,
477477
16AEBAC87CB24520ADA106D7 /* libRNSafeArea.a in Frameworks */,
478478
);
479479
runOnlyForDeploymentPostprocessing = 0;
@@ -665,14 +665,14 @@
665665
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
666666
isa = PBXGroup;
667667
children = (
668+
91C2E1AE22422C9F00D5E1F5 /* RNTKeyboardAwareScrollView.xcodeproj */,
668669
7E45CC55218B42C000C0B2AB /* RNReactNativeGutenbergBridge.xcodeproj */,
669670
5E91572D1DD0AC6500FF2AA8 /* RCTAnimation.xcodeproj */,
670671
146833FF1AC3E56700842450 /* React.xcodeproj */,
671672
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
672673
ADBDB91F1DFEBF0600ED6528 /* RCTBlob.xcodeproj */,
673674
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
674675
00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */,
675-
91C7514D21DE393000106645 /* RNKeyboardAwareScrollView.xcodeproj */,
676676
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */,
677677
00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */,
678678
139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */,
@@ -730,10 +730,10 @@
730730
name = Products;
731731
sourceTree = "<group>";
732732
};
733-
91C7514E21DE393000106645 /* Products */ = {
733+
91C2E1AF22422C9F00D5E1F5 /* Products */ = {
734734
isa = PBXGroup;
735735
children = (
736-
91C7517721DE393000106645 /* libRNKeyboardAwareScrollView.a */,
736+
91C2E1B322422C9F00D5E1F5 /* libRNTKeyboardAwareScrollView.a */,
737737
);
738738
name = Products;
739739
sourceTree = "<group>";
@@ -960,10 +960,6 @@
960960
ProductGroup = 146834001AC3E56700842450 /* Products */;
961961
ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */;
962962
},
963-
{
964-
ProductGroup = 91C7514E21DE393000106645 /* Products */;
965-
ProjectRef = 91C7514D21DE393000106645 /* RNKeyboardAwareScrollView.xcodeproj */;
966-
},
967963
{
968964
ProductGroup = 7E45CC56218B42C000C0B2AB /* Products */;
969965
ProjectRef = 7E45CC55218B42C000C0B2AB /* RNReactNativeGutenbergBridge.xcodeproj */;
@@ -980,6 +976,10 @@
980976
ProductGroup = F1B3E7B920FFA99B0042D8C3 /* Products */;
981977
ProjectRef = F619623252704B46A619C33C /* RNTAztecView.xcodeproj */;
982978
},
979+
{
980+
ProductGroup = 91C2E1AF22422C9F00D5E1F5 /* Products */;
981+
ProjectRef = 91C2E1AE22422C9F00D5E1F5 /* RNTKeyboardAwareScrollView.xcodeproj */;
982+
},
983983
);
984984
projectRoot = "";
985985
targets = (
@@ -1230,11 +1230,11 @@
12301230
remoteRef = 9161EFC721D277D300314043 /* PBXContainerItemProxy */;
12311231
sourceTree = BUILT_PRODUCTS_DIR;
12321232
};
1233-
91C7517721DE393000106645 /* libRNKeyboardAwareScrollView.a */ = {
1233+
91C2E1B322422C9F00D5E1F5 /* libRNTKeyboardAwareScrollView.a */ = {
12341234
isa = PBXReferenceProxy;
12351235
fileType = archive.ar;
1236-
path = libRNKeyboardAwareScrollView.a;
1237-
remoteRef = 91C7517621DE393000106645 /* PBXContainerItemProxy */;
1236+
path = libRNTKeyboardAwareScrollView.a;
1237+
remoteRef = 91C2E1B222422C9F00D5E1F5 /* PBXContainerItemProxy */;
12381238
sourceTree = BUILT_PRODUCTS_DIR;
12391239
};
12401240
ADBDB9271DFEBF0700ED6528 /* libRCTBlob.a */ = {

ios/gutenberg/GutenbergViewController.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ extension GutenbergViewController {
176176

177177
func showMoreSheet() {
178178
let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
179-
179+
alert.popoverPresentationController?.barButtonItem = navigationItem.rightBarButtonItem
180+
180181
let cancelAction = UIAlertAction(title: "Keep Editing", style: .cancel)
181182
alert.addAction(toggleHTMLModeAction)
182183
alert.addAction(updateHtmlAction)

ios/gutenberg/Info.plist

+37-30
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>UIAppFonts</key>
6-
<array>
7-
<string>NotoSerif-BoldItalic.ttf</string>
8-
<string>NotoSerif-Regular.ttf</string>
9-
<string>NotoSerif-Italic.ttf</string>
10-
<string>NotoSerif-Bold.ttf</string>
11-
</array>
125
<key>CFBundleDevelopmentRegion</key>
136
<string>en</string>
147
<key>CFBundleDisplayName</key>
@@ -31,6 +24,36 @@
3124
<string>1</string>
3225
<key>LSRequiresIPhoneOS</key>
3326
<true/>
27+
<key>NSAppTransportSecurity</key>
28+
<dict>
29+
<key>NSExceptionDomains</key>
30+
<dict>
31+
<key>localhost</key>
32+
<dict>
33+
<key>NSExceptionAllowsInsecureHTTPLoads</key>
34+
<true/>
35+
</dict>
36+
</dict>
37+
</dict>
38+
<key>NSCameraUsageDescription</key>
39+
<string>To take photos or videos to use in your posts.</string>
40+
<key>NSLocationUsageDescription</key>
41+
<string>The app would like to add your location to posts on sites where you have enabled geotagging.</string>
42+
<key>NSLocationWhenInUseUsageDescription</key>
43+
<string>The app would like to add your location to posts on sites where you have enabled geotagging.</string>
44+
<key>NSMicrophoneUsageDescription</key>
45+
<string>Enable microphone access to record sound in your videos.</string>
46+
<key>NSPhotoLibraryAddUsageDescription</key>
47+
<string>To add photos or videos to your posts.</string>
48+
<key>NSPhotoLibraryUsageDescription</key>
49+
<string>To add photos or videos to your posts.</string>
50+
<key>UIAppFonts</key>
51+
<array>
52+
<string>NotoSerif-BoldItalic.ttf</string>
53+
<string>NotoSerif-Regular.ttf</string>
54+
<string>NotoSerif-Italic.ttf</string>
55+
<string>NotoSerif-Bold.ttf</string>
56+
</array>
3457
<key>UILaunchStoryboardName</key>
3558
<string>LaunchScreen</string>
3659
<key>UIRequiredDeviceCapabilities</key>
@@ -43,30 +66,14 @@
4366
<string>UIInterfaceOrientationLandscapeLeft</string>
4467
<string>UIInterfaceOrientationLandscapeRight</string>
4568
</array>
69+
<key>UISupportedInterfaceOrientations~ipad</key>
70+
<array>
71+
<string>UIInterfaceOrientationPortrait</string>
72+
<string>UIInterfaceOrientationLandscapeLeft</string>
73+
<string>UIInterfaceOrientationLandscapeRight</string>
74+
<string>UIInterfaceOrientationPortraitUpsideDown</string>
75+
</array>
4676
<key>UIViewControllerBasedStatusBarAppearance</key>
4777
<false/>
48-
<key>NSLocationWhenInUseUsageDescription</key>
49-
<string>The app would like to add your location to posts on sites where you have enabled geotagging.</string>
50-
<key>NSCameraUsageDescription</key>
51-
<string>To take photos or videos to use in your posts.</string>
52-
<key>NSLocationUsageDescription</key>
53-
<string>The app would like to add your location to posts on sites where you have enabled geotagging.</string>
54-
<key>NSMicrophoneUsageDescription</key>
55-
<string>Enable microphone access to record sound in your videos.</string>
56-
<key>NSPhotoLibraryUsageDescription</key>
57-
<string>To add photos or videos to your posts.</string>
58-
<key>NSPhotoLibraryAddUsageDescription</key>
59-
<string>To add photos or videos to your posts.</string>
60-
<key>NSAppTransportSecurity</key>
61-
<dict>
62-
<key>NSExceptionDomains</key>
63-
<dict>
64-
<key>localhost</key>
65-
<dict>
66-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
67-
<true/>
68-
</dict>
69-
</dict>
70-
</dict>
7178
</dict>
7279
</plist>

jest/setup.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jest.mock( '../react-native-gutenberg-bridge', () => {
77
subscribeSetTitle: jest.fn(),
88
subscribeSetFocusOnTitle: jest.fn(),
99
subscribeUpdateHtml: jest.fn(),
10+
subscribeMediaAppend: jest.fn(),
1011
editorDidMount: jest.fn(),
1112
};
1213
} );
@@ -20,7 +21,7 @@ jest.mock( 'react-native-safe-area', () => {
2021
accept( { safeAreaInsets: { bottom: 34 } } );
2122
} );
2223
},
23-
addEventListener: addEventListener,
24+
addEventListener,
2425
removeEventListener: jest.fn(),
2526
};
2627
} );

0 commit comments

Comments
 (0)