Skip to content

Commit

Permalink
Merge branch 'trunk' of github.com:wordpress-mobile/gutenberg-mobile …
Browse files Browse the repository at this point in the history
…into release/1.79.0
  • Loading branch information
dcalhoun committed Jul 8, 2022
2 parents 662335d + 024409d commit 24dfc01
Show file tree
Hide file tree
Showing 11 changed files with 2,508 additions and 2,387 deletions.
18 changes: 15 additions & 3 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
Unreleased
---
* [**] Prevent validation error when viewing VideoPress markup within app [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4899]
* [*] Add 'Insert from URL' option to Video block [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4941]
* [*] Image block copies the alt text from the media library when selecting an item [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4976]
* [*] Introduce "block recovery" option for invalid blocks [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4996]

## 1.79.0
- [*] Add 'Insert from URL' option to Video block [https://github.com/WordPress/gutenberg/pull/41493]
- [*] Image block copies the alt text from the media library when selecting an item [https://github.com/WordPress/gutenberg/pull/41839]
- [*] Introduce "block recovery" option for invalid blocks [https://github.com/WordPress/gutenberg/pull/41988]

## 1.78.1

- [**] Re-introduce support for v1 of the Gallery block to the native version of the editor [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4928]
- [**] Fix missing translations for locales that include region (only on Android) [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4950]
---
* [**] Re-introduce support for v1 of the Gallery block to the native version of the editor [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4928]
* [**] Fix missing translations for locales that include region (only on Android) [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4950]

## 1.78.0
---
Expand All @@ -24,6 +28,14 @@ Unreleased
* [*] [a11y] Improve text read by screen readers for BottomSheetSelectControl [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4854]
* [*] Add 'Insert from URL' option to Image block [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4779]

## 1.76.3
---
* [***] Fix crash on iOS related to JSI and Reanimated [https://github.com/WordPress/gutenberg/pull/41482]

## 1.76.2
---
* [*] Ensure post title gets focused when is notified from native side [https://github.com/WordPress/gutenberg/pull/41371]

## 1.76.1
---
* [*] BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell [https://github.com/wordpress-mobile/gutenberg-mobile/pull/4865]
Expand Down
27 changes: 27 additions & 0 deletions bin/install-jetpack.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
set -Eeuo pipefail

# Check if nvm is installed
[ -z "$NVM_DIR" ] && NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

command -v nvm >/dev/null 2>&1 || {
echo "nvm is not installed or cannot be sourced from $NVM_DIR/nvm.sh. Please verify that "'$NVM_DIR'" points to the .nvm directory."
exit 1
}

pushd jetpack

# Set up node requirement for Jetpack
nvm install

# Set up required pnpm version
listed_pnpm_version=$(npx -c 'echo $npm_package_engines_pnpm')
pnpm_version=$(npx semver -c "$listed_pnpm_version")

cd projects/plugins/jetpack

# npx might prompt to install pnpm at the requested version. Let's just agree and carry on.
( yes || true ) | npx --cache /tmp/empty-cache pnpm@"$pnpm_version" install

popd
4 changes: 3 additions & 1 deletion bundle/android/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@
<string name="gutenberg_native_contact_support" tools:ignore="UnusedResources">Contact support</string>
<string name="gutenberg_native_convert_to_link" tools:ignore="UnusedResources">Convert to link</string>
<string name="gutenberg_native_copied_block" tools:ignore="UnusedResources">Copied block</string>
<string name="gutenberg_native_copy_block" tools:ignore="UnusedResources">Copy block</string>
<string name="gutenberg_native_copy_file_url" tools:ignore="UnusedResources">Copy file URL</string>
<!-- translators: Copy URL from the clipboard, https://sample.url -->
<string name="gutenberg_native_copy_url_from_the_clipboard_s" tools:ignore="UnusedResources">Copy URL from the clipboard, %s</string>
Expand Down Expand Up @@ -244,6 +243,7 @@ translators: %s: Select control button label e.g. "Button width" -->
<string name="gutenberg_native_once_you_become_familiar_with_the_names_of_different_blocks_you_c" tools:ignore="UnusedResources">Once you become familiar with the names of different blocks, you can add a block by typing a forward slash followed by the block name — for example, /image or /heading.</string>
<string name="gutenberg_native_one" tools:ignore="UnusedResources">One</string>
<string name="gutenberg_native_only_show_excerpt" tools:ignore="UnusedResources">Only show excerpt</string>
<string name="gutenberg_native_opacity" tools:ignore="UnusedResources">Opacity</string>
<string name="gutenberg_native_open" tools:ignore="UnusedResources">OPEN</string>
<string name="gutenberg_native_open_block_actions_menu" tools:ignore="UnusedResources">Open Block Actions Menu</string>
<string name="gutenberg_native_open_jetpack_security_settings" tools:ignore="UnusedResources">Open Jetpack Security settings</string>
Expand Down Expand Up @@ -346,6 +346,8 @@ translators: %s: Select control option value e.g: "Auto, 25%". -->
<string name="gutenberg_native_ungroup" tools:ignore="UnusedResources">Ungroup</string>
<string name="gutenberg_native_unsupported" tools:ignore="UnusedResources">Unsupported</string>
<string name="gutenberg_native_updates_the_title" tools:ignore="UnusedResources">Updates the title.</string>
<string name="gutenberg_native_upgrade_your_plan_to_upload_audio" tools:ignore="UnusedResources">Upgrade your plan to upload audio</string>
<string name="gutenberg_native_upgrade_your_plan_to_use_video_covers" tools:ignore="UnusedResources">Upgrade your plan to use video covers</string>
<string name="gutenberg_native_uploading" tools:ignore="UnusedResources">Uploading…</string>
<string name="gutenberg_native_use_icon_button" tools:ignore="UnusedResources">Use icon button</string>
<!-- translators: accessibility text. Empty video caption. -->
Expand Down
4,714 changes: 2,366 additions & 2,348 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.

4 changes: 3 additions & 1 deletion bundle/ios/GutenbergNativeTranslations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ private func dummy() {
_ = NSLocalizedString("Contact support", comment: "")
_ = NSLocalizedString("Convert to link", comment: "")
_ = NSLocalizedString("Copied block", comment: "")
_ = NSLocalizedString("Copy block", comment: "")
_ = NSLocalizedString("Copy file URL", comment: "")
_ = NSLocalizedString("Copy URL from the clipboard, %s", comment: "translators: Copy URL from the clipboard, https://sample.url")
_ = NSLocalizedString("Create embed", comment: "")
Expand Down Expand Up @@ -225,6 +224,7 @@ private func dummy() {
_ = NSLocalizedString("Once you become familiar with the names of different blocks, you can add a block by typing a forward slash followed by the block name — for example, /image or /heading.", comment: "")
_ = NSLocalizedString("One", comment: "")
_ = NSLocalizedString("Only show excerpt", comment: "")
_ = NSLocalizedString("Opacity", comment: "")
_ = NSLocalizedString("OPEN", comment: "")
_ = NSLocalizedString("Open Block Actions Menu", comment: "")
_ = NSLocalizedString("Open Jetpack Security settings", comment: "")
Expand Down Expand Up @@ -293,6 +293,8 @@ private func dummy() {
_ = NSLocalizedString("Ungroup", comment: "")
_ = NSLocalizedString("Unsupported", comment: "")
_ = NSLocalizedString("Updates the title.", comment: "")
_ = NSLocalizedString("Upgrade your plan to upload audio", comment: "")
_ = NSLocalizedString("Upgrade your plan to use video covers", comment: "")
_ = NSLocalizedString("Uploading…", comment: "")
_ = NSLocalizedString("Use icon button", comment: "")
_ = NSLocalizedString("Video caption. %s", comment: "translators: accessibility text. %s: video caption.")
Expand Down
2 changes: 1 addition & 1 deletion jetpack
Submodule jetpack updated 4410 files
82 changes: 57 additions & 25 deletions metro.config.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,77 @@
const path = require( 'path' );
const fs = require( 'fs' );
const metroResolver = require( 'metro-resolver' );

const gutenbergMetroConfig = require( './gutenberg/packages/react-native-editor/metro.config.js' );
const extraNodeModules = {};
const gutenbergMetroConfigCopy = {
...gutenbergMetroConfig,
resolver: {
...gutenbergMetroConfig.resolver,
sourceExts: [ 'js', 'jsx', 'json', 'scss', 'sass', 'ts', 'tsx' ],
extraNodeModules,
},
};

gutenbergMetroConfigCopy.resolver.extraNodeModules = new Proxy(
{},
{
get: ( target, name ) => {
// Try to find the module in the Gutenberg submodule.
const gutenbergFolder = path.join(
process.cwd(),
`gutenberg/node_modules/${ name }`
);
if ( fs.existsSync( gutenbergFolder ) ) {
return gutenbergFolder;
}
const nodeModulePaths = [
'gutenberg/node_modules',
'jetpack/projects/plugins/jetpack/node_modules',
];

const possibleModulePaths = ( name ) =>
nodeModulePaths.map( ( dir ) => path.join( process.cwd(), dir, name ) );

gutenbergMetroConfigCopy.resolver.resolveRequest = (
context,
moduleName,
platform
) => {
// Add the module to the extra node modules object if the module is not on a local path.
if ( ! ( moduleName.startsWith( '.' ) || moduleName.startsWith( '/' ) ) ) {
const [ namespace, module = '' ] = moduleName.split( '/' );
const name = path.join( namespace, module );

// Try to find the module in Jetpack's .pnpm folder.
const moduleFolderPnpm = path.join(
process.cwd(),
`./jetpack/node_modules/.pnpm/node_modules/${ name }`
if ( ! extraNodeModules[ name ] ) {
let extraNodeModulePath;

const modulePath = possibleModulePaths( name ).find(
fs.existsSync
);

if ( fs.existsSync( moduleFolderPnpm ) ) {
// pnpm uses symlinks so, let's find the target
const symlinkTarget = fs.readlinkSync( moduleFolderPnpm );
extraNodeModulePath = modulePath && fs.realpathSync( modulePath );

// If we haven't resolved the module yet, check if the module is managed by pnpm.
if (
! extraNodeModulePath &&
context.originModulePath.includes( '.pnpm' )
) {
const filePath = require.resolve( name, {
paths: [ path.dirname( context.originModulePath ) ],
} );

const innerNodeModules = filePath.match(
/.*node_modules/
)?.[ 0 ];

// the target is still using paths relative to the parent folder of the module, let's find the real path.
return path.resolve(
moduleFolderPnpm + '/../' + symlinkTarget
);
extraNodeModulePath =
innerNodeModules && path.join( innerNodeModules, name );
}
},

if ( extraNodeModulePath ) {
extraNodeModules[ name ] = extraNodeModulePath;
}
}
}
);

// Restore the original resolver
return metroResolver.resolve(
{
...context,
resolveRequest: null,
},
moduleName,
platform
);
};

module.exports = gutenbergMetroConfigCopy;
33 changes: 30 additions & 3 deletions package-lock.json

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

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,11 @@
"rungen": "^0.3.2",
"sprintf-js": "^1.1.1",
"typescript": "4.1.3",
"wd": "^1.11.1"
"wd": "^1.11.1",
"metro-resolver": "^0.70.3"
},
"scripts": {
"postinstall": "patch-package && npm ci --prefix gutenberg && npm run i18n:check-cache && cd jetpack/projects/plugins/jetpack && npx pnpm@6 install",
"postinstall": "patch-package && npm ci --prefix gutenberg && npm run i18n:check-cache && ./bin/install-jetpack.sh",
"start": "echo \"\\x1b[33mThe start command is not available in this project. It is strongly recommended to use \\x1b[1:33mstart:reset\\x1b[0m\\x1b[33m to perform some cleanup when starting the metro bundler.\nOr you may use \\x1b[1:33mstart:quick\\x1b[0m\\x1b[33m for a quicker startup, but this may lead to unexpected javascript errors when running the app.\\x1b[0m\"",
"start:reset": "npm run core clean:runtime && npm run start:quick -- --reset-cache",
"start:quick": "react-native start --config ./metro.config.js",
Expand Down Expand Up @@ -93,6 +94,5 @@
"lint": "eslint . --ext .js",
"lint:fix": "npm run lint -- --fix",
"version": "npm run bundle && git add -A bundle"
},
"dependencies": {}
}
}
1 change: 1 addition & 0 deletions src/jetpack-editor-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
registerLoomVariation,
registerSmartframeVariation,
} from '../jetpack/projects/plugins/jetpack/extensions/extended-blocks/core-embed';
import '../jetpack/projects/plugins/jetpack/extensions/blocks/videopress/editor';

// When adding new blocks to this list please also consider updating ./block-support/supported-blocks.json
const supportedJetpackBlocks = {
Expand Down

0 comments on commit 24dfc01

Please sign in to comment.