Skip to content
This repository was archived by the owner on Jul 9, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0839f3b
Testing UIStringContext
etoledom Sep 2, 2020
95a79a4
Adding custom string to be shown on missing block alert
etoledom Sep 11, 2020
f3fb203
Update gutenberg ref
etoledom Sep 11, 2020
ade5c36
Update gutenberg ref
etoledom Sep 21, 2020
abcb7a4
Merge remote-tracking branch 'origin/develop' into dynamic-ui-strings…
etoledom Sep 21, 2020
d1f6d44
Update gutenberg ref
etoledom Sep 22, 2020
4263473
Merge remote-tracking branch 'origin/develop' into dynamic-ui-strings…
etoledom Sep 22, 2020
dc7e710
Update gutenberg ref
etoledom Sep 22, 2020
722eaae
Fix typo
marecar3 Sep 24, 2020
080938c
Update gb reference
marecar3 Sep 24, 2020
6aa0607
Update gutenberg ref
etoledom Sep 24, 2020
841df27
Merge remote-tracking branch 'origin/develop' into dynamic-ui-strings…
etoledom Sep 24, 2020
f004c91
Update gb reference
marecar3 Sep 24, 2020
130d21f
Update gb reference
marecar3 Sep 24, 2020
ee7f083
Update gb reference
marecar3 Sep 24, 2020
05aa58e
Merge branch 'develop' into dynamic-ui-strings-mk2
marecar3 Sep 24, 2020
418df0a
Update gutenberg ref
etoledom Sep 25, 2020
a51a33d
Merge remote-tracking branch 'origin/develop' into dynamic-ui-strings…
etoledom Sep 25, 2020
8c575fe
Remove extra dependencies not needed
etoledom Sep 25, 2020
08cab76
Recover eslint-plugin-jsdoc as dev dependency
etoledom Sep 25, 2020
6529f3c
Install previous version of eslint-plugin-jsdoc (no update)
etoledom Sep 25, 2020
577a023
Update gutenberg ref
etoledom Sep 25, 2020
8df9f34
Update capability name to canEnableUnsupportedBlockEditor
etoledom Sep 25, 2020
29b8f20
Fix lint issues
etoledom Sep 25, 2020
9b7b2eb
Update gutenberg ref
etoledom Sep 25, 2020
0545492
Merge remote-tracking branch 'origin/develop' into dynamic-ui-strings…
etoledom Sep 25, 2020
433db5d
Update gutenberg ref
etoledom Sep 28, 2020
2217b1c
Bundle:js
etoledom Sep 28, 2020
cdb0675
Merge remote-tracking branch 'origin/develop' into dynamic-ui-strings…
etoledom Sep 28, 2020
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
5,126 changes: 2,565 additions & 2,561 deletions bundle/android/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/android/App.js.map

Large diffs are not rendered by default.

5,164 changes: 2,584 additions & 2,580 deletions bundle/ios/App.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/ios/App.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 32 files
+0 −40 lib/class-wp-customize-widget-blocks-control.php
+38 −9 lib/class-wp-widget-block.php
+0 −118 lib/customizer.php
+0 −1 lib/load.php
+4 −14 lib/widgets-page.php
+42 −20 packages/block-library/src/missing/edit.native.js
+2 −4 packages/block-library/src/missing/test/edit.native.js
+12 −4 packages/block-library/src/widget-area/edit/index.js
+1 −0 packages/components/src/index.native.js
+12 −0 packages/components/src/mobile/ui-strings/index.native.js
+1 −1 packages/edit-widgets/src/blocks/legacy-widget/edit/dom-manager.js
+0 −58 packages/edit-widgets/src/components/customizer-edit-widgets-initializer/index.js
+0 −187 packages/edit-widgets/src/components/customizer-edit-widgets-initializer/sync-customizer.js
+25 −15 packages/edit-widgets/src/components/header/index.js
+7 −15 packages/edit-widgets/src/hooks/use-last-selected-root-id.js
+0 −19 packages/edit-widgets/src/index.js
+28 −0 packages/edit-widgets/src/store/actions.js
+27 −0 packages/edit-widgets/src/store/reducer.js
+8 −0 packages/edit-widgets/src/store/resolvers.js
+12 −0 packages/edit-widgets/src/store/selectors.js
+0 −7 packages/edit-widgets/src/style.scss
+4 −2 packages/editor/src/components/provider/index.native.js
+3 −1 ...-bridge/android/src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/GutenbergBridgeJS2Parent.java
+5 −0 ...droid/src/main/java/org/wordpress/mobile/ReactNativeGutenbergBridge/RNReactNativeGutenbergBridgeModule.java
+3 −0 packages/react-native-bridge/android/src/main/java/org/wordpress/mobile/WPAndroidGlue/GutenbergProps.kt
+12 −0 packages/react-native-bridge/android/src/main/java/org/wordpress/mobile/WPAndroidGlue/WPAndroidGlueCode.java
+13 −0 packages/react-native-bridge/index.js
+4 −0 packages/react-native-bridge/ios/GutenbergBridgeDelegate.swift
+15 −9 packages/react-native-bridge/ios/GutenbergWebFallback/GutenbergWebSingleBlockViewController.swift
+1 −0 packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.m
+16 −0 packages/react-native-bridge/ios/RNReactNativeGutenbergBridge.swift
+5 −0 packages/react-native-editor/android/app/src/main/java/com/gutenberg/MainApplication.java
94 changes: 23 additions & 71 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import correctTextFontWeight from './text-font-weight-correct';
import setupJetpackEditor from './jetpack-editor-setup';

addAction( 'native.pre-render', 'gutenberg-mobile', ( props ) => {
require( './ui-strings' );
correctTextFontWeight();
setupJetpackEditor(
props.jetpackState || { blogId: 1, isJetpackActive: true }
Expand Down
53 changes: 53 additions & 0 deletions src/ui-strings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/**
* WordPress dependencies
*/
import { addStrings } from '@wordpress/components';
import { select } from '@wordpress/data';
import { __ } from '@wordpress/i18n';

export const uiStrings = () => {
const { getSettings } = select( 'core/block-editor' );
const unsupportedBlockEditor = {

@Tug Tug Sep 25, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think just using 2 variables instead of grouping them in an object is just simpler and easier to understand, especially since you're assigning an unsupportedBlockEditor to a supported property

supported:
getSettings( 'capabilities' ).unsupportedBlockEditor === true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just asking out of curiosity. We have a lot of explicit bool checks in this file (i.e., someValue === true and someValue === false). Are we doing that to guard against a cases where someValue could be some other truth-y or false-y values, or is it a style preference to do the explicit bool check instead of doing something like someValue (or even !!someValue if we needed a bool) and !someValue, or maybe there's another reason?

Just asking because I tend to use the !s when I can (I find them more readable), and I'm curious if there are considerations I may not be considering when I do that. I'm not asking because I think we need to change it here. 🙂

switchable:
getSettings( 'capabilities' ).canEnableUnsupportedBlockEditor ===
true,
};

let unsupportedBlocksExplanation;

if (
unsupportedBlockEditor.supported === false &&
unsupportedBlockEditor.switchable
) {
unsupportedBlocksExplanation = __(
'You can edit this block using the web version of the editor.'
);
const note = __(
'Note: You must allow WordPress.com login to edit this block in the mobile editor.'
);
unsupportedBlocksExplanation =
unsupportedBlocksExplanation + '\n\n' + note; // Translations can not have characters like '\n', so we add the new lines manually.
} else if ( unsupportedBlockEditor.supported === true ) {
unsupportedBlocksExplanation = __(
'You can edit this block using the web version of the editor.'
);
} else {
unsupportedBlocksExplanation = undefined; // Show default text.
}

const shouldOverwriteButtonTitle =
unsupportedBlockEditor.supported === false &&
unsupportedBlockEditor.switchable;
const unsupportedBlocksButton = shouldOverwriteButtonTitle
? __( 'Open Jetpack Security settings' )
: undefined;
Comment on lines +43 to +45

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: It seems like instead of using the extra shouldOverwriteButtonTitle variable, we could use the if-else statement above to set unsupportedBlocksButton.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would make us declare unsupportedBlocksButton as let right?
I thought shouldOverwriteButtonTitle name would also give some context of the reasoning for the undefined.

Would you say something like this?

let unsupportedBlocksButtonTitle = undefined;
if ( unsupportedBlockEditor.supported === false && unsupportedBlockEditor.switchable ) {
    unsupportedBlocksButtonTitle = __( 'Open Jetpack Security settings' );
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think I had something like that in mind.


return {
'missing-block-detail': unsupportedBlocksExplanation,
'missing-block-action-button': unsupportedBlocksButton,
};
};

addStrings( uiStrings );

@Tug Tug Sep 25, 2020 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I would expect that, given its name, addStrings would accept a list of strings as parameter. The fact that it accepts a function returning a mapping of (string id, string value) makes it a bit hard to grasp imo.