Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External Media: Implementation #15717

Merged
merged 49 commits into from
Jun 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
4a612fb
external-media: Add /list endpoint
retrofox May 7, 2020
80d00bd
external-media-endpoint: update wpcom path
retrofox May 8, 2020
27a608c
Add file to phpcs whitelist
obenland May 8, 2020
09142d9
external-media: propagate `search` term to the end
retrofox May 11, 2020
a82b27c
fse: add `/copy` external media endpoint
retrofox May 11, 2020
0e72e26
external-media: whitelist `list` endpoint args
retrofox May 11, 2020
ce5b30e
external-media: add `connection` endpoint
retrofox May 11, 2020
dad3d28
external-media: tidy code
retrofox May 11, 2020
5e904ae
external-media: fix connection endpoint path
retrofox May 11, 2020
8a05f9a
externa-media: add text domain to translations
retrofox May 11, 2020
bd49285
external-image: fix typo
retrofox May 11, 2020
78d5ce1
external-media: adjust `media` copy arg
retrofox May 11, 2020
78341e5
Add some comments
obenland May 11, 2020
89e04fe
Properly pass on WP_Error responses
obenland May 12, 2020
03ca918
Properly pass on response status
obenland May 12, 2020
4fed729
Use 1.1 endpoint to establish connection
obenland May 12, 2020
5716c1d
Handle Google file names
obenland May 13, 2020
89b89ba
External Media: Add Editor integration (#15721)
marekhrabe May 13, 2020
87d0fcb
external-media: restore appying google filters
retrofox May 14, 2020
f8d17dc
external-media: whitelist `filter` endpoint arg
retrofox May 14, 2020
ae0fac6
Improve sanitization/validation for copy endpoint
obenland May 14, 2020
3d394be
Separate out more media upload steps
obenland May 14, 2020
bf2caca
Further split out API methods
obenland May 14, 2020
bd7fdb7
API updates to work on dotcom
obenland May 18, 2020
7ca5108
change filter priority so it plays nice with AMP plugin
marekhrabe May 19, 2020
2b52884
Keep parsing responses when not using wpcomFetch
obenland May 19, 2020
74126a9
Remove erroneous typeof
obenland May 19, 2020
25caf2b
Remove Pexels example query prone to unexpected results
frontdevde May 19, 2020
a34197b
Avoid duplocate content headers
obenland May 19, 2020
8988a98
Remove unused scss vars
WunderBart May 20, 2020
a76f6ee
Use color var for image placeholder bg
WunderBart May 20, 2020
186b2dd
Run editor.scss through Prettier
WunderBart May 20, 2020
6f94b43
Export with memo call instead of naming the func twice
WunderBart May 20, 2020
153fb2a
Rewrap long comments
WunderBart May 20, 2020
0aa088c
External Media: Fix Pexels search markup (#15853)
jeryj May 20, 2020
f37ab4a
Fix display of insert button in IE 11
obenland May 20, 2020
9cd6cb4
External Media: Use ul and li for media items with checkbox role to b…
jeryj May 20, 2020
a0086d1
Add NavigableMenu component for arrow key use and trapping focus. Add…
jeryj May 20, 2020
9888e4e
Only show External MEdia to connected users
obenland May 21, 2020
555a3e6
Improve error handling in list endpoint
obenland May 21, 2020
2f5466d
Make error message translatable
obenland May 21, 2020
6f50748
Simplify Favorites label
obenland May 21, 2020
04ac820
Use keyCode over which
obenland May 21, 2020
8e69138
Fix invalid DOM property warning
obenland May 21, 2020
3cbc00b
Reuse existing translation strings
obenland May 21, 2020
a90b8a2
Only replace button for image blocks
obenland May 21, 2020
e45da18
External Media: Improve modal elements focus for better a11y (#15868)
WunderBart May 28, 2020
0b6a348
Add media type information
obenland May 29, 2020
ed6f1e9
[not verified] Be more specific about button margins
obenland May 29, 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

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bin/phpcs-whitelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = [
'_inc/lib/class-jetpack-wizard.php',
'_inc/lib/components.php',
'_inc/lib/core-api/class.jetpack-core-api-site-endpoints.php',
'_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-external-media.php',
'_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-instagram-gallery.php',
'_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-podcast-player.php',
'_inc/lib/core-api/wpcom-endpoints/class-wpcom-rest-api-v2-endpoint-resolve-redirect.php',
Expand Down
1 change: 1 addition & 0 deletions extensions/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import './shared/public-path';
import './shared/block-category';
import './shared/plan-upgrade-notification';
import './shared/stripe-connection-notification';
import './shared/external-media';
import analytics from '../_inc/client/lib/analytics';

// @TODO Please make a shared analytics solution and remove this!
Expand Down
137 changes: 137 additions & 0 deletions extensions/shared/external-media/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
/**
* External dependencies
*/

import { __ } from '@wordpress/i18n';

export const SOURCE_WORDPRESS = 'wordpress';
export const SOURCE_GOOGLE_PHOTOS = 'google_photos';
export const SOURCE_PEXELS = 'pexels';
export const PATH_RECENT = 'recent';
export const PATH_ROOT = '/';
export const PATH_OPTIONS = [
{
value: PATH_RECENT,
label: __( 'Recent Photos', 'jetpack' ),
},
{
value: PATH_ROOT,
label: __( 'Albums', 'jetpack' ),
},
];
export const GOOGLE_PHOTOS_CATEGORIES = [
{
value: '',
/* translators: category of images */
label: __( 'All categories', 'jetpack' ),
},
{
value: 'animals',
/* translators: category of images */
label: __( 'Animals', 'jetpack' ),
},
{
value: 'arts',
/* translators: category of images */
label: __( 'Arts', 'jetpack' ),
},
{
value: 'birthdays',
/* translators: category of images */
label: __( 'Birthdays', 'jetpack' ),
},
{
value: 'cityscapes',
/* translators: category of images */
label: __( 'Cityscapes', 'jetpack' ),
},
{
value: 'crafts',
/* translators: category of images */
label: __( 'Crafts', 'jetpack' ),
},
{
value: 'fashion',
/* translators: category of images */
label: __( 'Fashion', 'jetpack' ),
},
{
value: 'food',
/* translators: category of images */
label: __( 'Food', 'jetpack' ),
},
{
value: 'flowers',
/* translators: category of images */
label: __( 'Flowers', 'jetpack' ),
},
{
value: 'gardens',
/* translators: category of images */
label: __( 'Gardens', 'jetpack' ),
},
{
value: 'holidays',
/* translators: category of images */
label: __( 'Holidays', 'jetpack' ),
},
{
value: 'houses',
/* translators: category of images */
label: __( 'Houses', 'jetpack' ),
},
{
value: 'landmarks',
/* translators: category of images */
label: __( 'Landmarks', 'jetpack' ),
},
{
value: 'landscapes',
/* translators: category of images */
label: __( 'Landscapes', 'jetpack' ),
},
{
value: 'night',
/* translators: category of images */
label: __( 'Night', 'jetpack' ),
},
{
value: 'people',
/* translators: category of images */
label: __( 'People', 'jetpack' ),
},
{
value: 'pets',
/* translators: category of images */
label: __( 'Pets', 'jetpack' ),
},
{
value: 'selfies',
/* translators: category of images */
label: __( 'Selfies', 'jetpack' ),
},
{
value: 'sport',
/* translators: category of images */
label: __( 'Sport', 'jetpack' ),
},
{
value: 'travel',
/* translators: category of images */
label: __( 'Travel', 'jetpack' ),
},
{
value: 'weddings',
/* translators: category of images */
label: __( 'Weddings', 'jetpack' ),
},
];
export const PEXELS_EXAMPLE_QUERIES = [
'mountain',
'ocean',
'river',
'clouds',
'pattern',
'abstract',
'sky',
];
Loading