diff --git a/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php b/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php index 8fd5076b..d6b7482f 100644 --- a/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php +++ b/backend/src/Controllers/Cloud/Libraries/LibraryItemPostController.php @@ -482,9 +482,11 @@ public function import_post_media_from_library( $post_id, $media, $import = true $service = new MediaLibraryService(); // Import post thumbnail - if ( $import && isset( $media->thumb ) && 'screenshot.png' !== $media->thumb->file_name ) { - $response = $service->import_cloud_media( $media->thumb, $post_id ); - set_post_thumbnail( $post_id, $response['id'] ); + if ( $import && isset( $media->thumb ) ) { + if ( ! preg_match( '/screenshot\.(png|jpg|gif)/', $media->thumb->file_name ) ) { + $response = $service->import_cloud_media( $media->thumb, $post_id ); + set_post_thumbnail( $post_id, $response['id'] ); + } } // Import post attachments diff --git a/backend/src/Hooks/Actions/OnPluginsLoaded.php b/backend/src/Hooks/Actions/OnWPLoaded.php similarity index 90% rename from backend/src/Hooks/Actions/OnPluginsLoaded.php rename to backend/src/Hooks/Actions/OnWPLoaded.php index d03d33d8..8932254e 100644 --- a/backend/src/Hooks/Actions/OnPluginsLoaded.php +++ b/backend/src/Hooks/Actions/OnWPLoaded.php @@ -5,10 +5,10 @@ use FL\Assistant\Services\CustomizerService; /** - * Class OnPluginsLoaded + * Class OnWPLoaded * @package FL\Assistant\Hooks\Actions */ -class OnPluginsLoaded { +class OnWPLoaded { public function __invoke() { $this->init_customizer_requests(); diff --git a/backend/src/Providers/HooksServiceProvider.php b/backend/src/Providers/HooksServiceProvider.php index e616837c..9ea40fb3 100644 --- a/backend/src/Providers/HooksServiceProvider.php +++ b/backend/src/Providers/HooksServiceProvider.php @@ -4,7 +4,7 @@ use FL\Assistant\System\Contracts\ServiceProviderAbstract; -use FL\Assistant\Hooks\Actions\OnPluginsLoaded; +use FL\Assistant\Hooks\Actions\OnWPLoaded; use FL\Assistant\Hooks\Actions\OnEditUserProfile; use FL\Assistant\Hooks\Actions\OnEnqueueScripts; use FL\Assistant\Hooks\Actions\OnPersonalOptionsUpdate; @@ -45,8 +45,8 @@ public function bootstrap() { public function actions() { - // Plugins loaded - add_action( 'plugins_loaded', $this->injector->make( OnPluginsLoaded::class ) ); + // WP loaded + add_action( 'wp_loaded', $this->injector->make( OnWPLoaded::class ) ); // Enqueue Assistant frontend $enqueue_scripts = $this->injector->make( OnEnqueueScripts::class ); diff --git a/package-lock.json b/package-lock.json index f3f214df..4c73868f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,10 +13,10 @@ "@beaverbuilder/box": "0.0.3", "@beaverbuilder/cloud": "^0.5.5", "@beaverbuilder/cloud-ui": "^0.8.4", - "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/fluid-docs": "0.0.6", - "@beaverbuilder/forms": "^0.3.8", - "@beaverbuilder/icons": "0.0.5", + "@beaverbuilder/fluid": "^0.7.9", + "@beaverbuilder/fluid-docs": "0.0.7", + "@beaverbuilder/forms": "^0.3.11", + "@beaverbuilder/icons": "^0.0.6", "@popmotion/popcorn": "^0.4.4", "array-move": "^3.0.1", "axios": "0.21.1", @@ -1697,14 +1697,14 @@ } }, "node_modules/@beaverbuilder/fluid": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.8.tgz", - "integrity": "sha512-Khm9aeleKxtt1h+Xthlh6xqltrqyGlwVGJEhG26UY9NoxI0L7b46eoyhcBqIk5ur0ud1bucaRCdqarUXRZnxKA==", + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.9.tgz", + "integrity": "sha512-DMvbvjUwXiMGzYzNbHwqEcMmBvbtTFqY12hcufK/9VHglGM8CIiHGeuUGo6MQpsPywy3/vkR+1wdESKwR6286w==", "dependencies": { "classnames": "^2.2.6" }, "peerDependencies": { - "@beaverbuilder/icons": "^0.0.5", + "@beaverbuilder/icons": "~0.0.5", "framer-motion": "^3.10.5", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -1713,36 +1713,36 @@ } }, "node_modules/@beaverbuilder/fluid-docs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.6.tgz", - "integrity": "sha512-TLvWfgoY4RC7C1i/yVKenpWrWUaINyPnk4jEU70BZpBTQgUHRCWNLyLKJZscpwwPPWjGyKMQEURFS2b7G1jK9A==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.7.tgz", + "integrity": "sha512-UetLDS5lWrV6Nx8nY3WDCldFIIL1H/s67Lm60E2nmATDwmeXUlOX8hEF6ZWqscFIWo2tWvYtxzoRIN5bFAW7Tw==", "dependencies": { "camelcase": "^5.3.1" }, "peerDependencies": { "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/icons": "^0.0.5", + "@beaverbuilder/icons": "~0.0.5", "react": "^17.0.2", "react-router-dom": "^5.2.0" } }, "node_modules/@beaverbuilder/forms": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.9.tgz", - "integrity": "sha512-KE00hXEFL9rhx9JXMZ6LMQf0CWWWa26VeN5/dIm8D8srM2pkP9j+Ery1Maa8efh8jnz1cLN50JGneG+B/F2u1w==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.11.tgz", + "integrity": "sha512-sJsOzOIc+n/TPYZhHNu038oi2FJTZ+BHxNmlbnCBLIg76dWV6ZiIIXiKQ7jw80jETUeP3W2jVA0bJGngz39fZA==", "peerDependencies": { "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/icons": "0.0.5", - "@wordpress/i18n": "^3.13.0", + "@beaverbuilder/icons": "~0.0.5", + "@wordpress/i18n": "^3.15.0", "classnames": "^2.2.6", "react": "^17.0.2", "react-router-dom": "^5.2.0" } }, "node_modules/@beaverbuilder/icons": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.5.tgz", - "integrity": "sha512-RRmfJwKFikEDrWfrDvYAlsifLEbnoWlK3U9XxmIxFCfVey/Vlo3pblKB1ujdbXRAIWTJr7nk7ddK7excsD/aJQ==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.6.tgz", + "integrity": "sha512-hxoO8MzXb1+yul8tXA6tF0XY9Xypb+UqZ7c0zWSQ5SWD3hKh/wdS7z9RgCjEXaYZIJDBoOp3TzSJE4VYZI4nwQ==", "peerDependencies": { "react": "^17.0.2" } @@ -21324,31 +21324,31 @@ } }, "@beaverbuilder/fluid": { - "version": "0.7.8", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.8.tgz", - "integrity": "sha512-Khm9aeleKxtt1h+Xthlh6xqltrqyGlwVGJEhG26UY9NoxI0L7b46eoyhcBqIk5ur0ud1bucaRCdqarUXRZnxKA==", + "version": "0.7.9", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid/-/fluid-0.7.9.tgz", + "integrity": "sha512-DMvbvjUwXiMGzYzNbHwqEcMmBvbtTFqY12hcufK/9VHglGM8CIiHGeuUGo6MQpsPywy3/vkR+1wdESKwR6286w==", "requires": { "classnames": "^2.2.6" } }, "@beaverbuilder/fluid-docs": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.6.tgz", - "integrity": "sha512-TLvWfgoY4RC7C1i/yVKenpWrWUaINyPnk4jEU70BZpBTQgUHRCWNLyLKJZscpwwPPWjGyKMQEURFS2b7G1jK9A==", + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@beaverbuilder/fluid-docs/-/fluid-docs-0.0.7.tgz", + "integrity": "sha512-UetLDS5lWrV6Nx8nY3WDCldFIIL1H/s67Lm60E2nmATDwmeXUlOX8hEF6ZWqscFIWo2tWvYtxzoRIN5bFAW7Tw==", "requires": { "camelcase": "^5.3.1" } }, "@beaverbuilder/forms": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.9.tgz", - "integrity": "sha512-KE00hXEFL9rhx9JXMZ6LMQf0CWWWa26VeN5/dIm8D8srM2pkP9j+Ery1Maa8efh8jnz1cLN50JGneG+B/F2u1w==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@beaverbuilder/forms/-/forms-0.3.11.tgz", + "integrity": "sha512-sJsOzOIc+n/TPYZhHNu038oi2FJTZ+BHxNmlbnCBLIg76dWV6ZiIIXiKQ7jw80jETUeP3W2jVA0bJGngz39fZA==", "requires": {} }, "@beaverbuilder/icons": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.5.tgz", - "integrity": "sha512-RRmfJwKFikEDrWfrDvYAlsifLEbnoWlK3U9XxmIxFCfVey/Vlo3pblKB1ujdbXRAIWTJr7nk7ddK7excsD/aJQ==", + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@beaverbuilder/icons/-/icons-0.0.6.tgz", + "integrity": "sha512-hxoO8MzXb1+yul8tXA6tF0XY9Xypb+UqZ7c0zWSQ5SWD3hKh/wdS7z9RgCjEXaYZIJDBoOp3TzSJE4VYZI4nwQ==", "requires": {} }, "@beaverbuilder/webpack-config": { diff --git a/package.json b/package.json index 6484be72..579a97e7 100644 --- a/package.json +++ b/package.json @@ -25,10 +25,10 @@ "@beaverbuilder/box": "0.0.3", "@beaverbuilder/cloud": "^0.5.5", "@beaverbuilder/cloud-ui": "^0.8.4", - "@beaverbuilder/fluid": "^0.7.8", - "@beaverbuilder/fluid-docs": "0.0.6", - "@beaverbuilder/forms": "^0.3.8", - "@beaverbuilder/icons": "0.0.5", + "@beaverbuilder/fluid": "^0.7.9", + "@beaverbuilder/fluid-docs": "0.0.7", + "@beaverbuilder/forms": "^0.3.11", + "@beaverbuilder/icons": "^0.0.6", "@popmotion/popcorn": "^0.4.4", "array-move": "^3.0.1", "axios": "0.21.1", diff --git a/src/apps/fl-home/ui/header-bar/index.js b/src/apps/fl-home/ui/header-bar/index.js index 302a230b..d8970adb 100644 --- a/src/apps/fl-home/ui/header-bar/index.js +++ b/src/apps/fl-home/ui/header-bar/index.js @@ -56,6 +56,7 @@ const HeaderBar = ( { setIsFocused( true ) onFocus() } } + onChange={ () => {} } // Prevent react error /> +
) } @@ -120,6 +120,7 @@ const MediaGrid = ( { if ( item instanceof File ) { return (