From bf02733ec5f1c3ac97a502f0ea303c33e35c992e Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Wed, 5 Feb 2020 13:54:15 +1000 Subject: [PATCH 1/4] Enable gallery upload options in production --- .../src/components/media-upload/index.native.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/block-editor/src/components/media-upload/index.native.js b/packages/block-editor/src/components/media-upload/index.native.js index 2a57846847ebe9..d90da4d7a0a3bb 100644 --- a/packages/block-editor/src/components/media-upload/index.native.js +++ b/packages/block-editor/src/components/media-upload/index.native.js @@ -95,14 +95,6 @@ export class MediaUpload extends React.Component { getMediaOptionsItems() { const { allowedTypes = [], multiple = false } = this.props; - // disable upload sources for now when multiple flag is set - // eslint-disable-next-line no-undef - if ( ! __DEV__ ) { - if ( allowedTypes.includes( MEDIA_TYPE_IMAGE ) && multiple ) { - return [ siteLibrarySource ]; - } - } - return this.getAllSources() .filter( ( source ) => { return ( From 3209f9bf59c25b752da48a4fc7a9835da733d3df Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Tue, 11 Feb 2020 17:39:39 +1000 Subject: [PATCH 2/4] Refactor native gallery image scss --- .../gallery/gallery-image-style.native.scss | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/packages/block-library/src/gallery/gallery-image-style.native.scss b/packages/block-library/src/gallery/gallery-image-style.native.scss index a953a1e8d62940..821e2d5b3cd10d 100644 --- a/packages/block-library/src/gallery/gallery-image-style.native.scss +++ b/packages/block-library/src/gallery/gallery-image-style.native.scss @@ -1,10 +1,10 @@ -$get-gallery-image-container-height: 150px; -$get-overlay-border-width: 3px; -$get-caption-background-color: rgba(0, 0, 0, 0.4); +$gallery-image-container-height: 150px; +$overlay-border-width: 3px; +$caption-background-color: rgba(0, 0, 0, 0.4); .galleryImageContainer { flex: 1; - height: $get-gallery-image-container-height; + height: $gallery-image-container-height; background-color: $gray-lighten-30; } @@ -31,7 +31,7 @@ $get-caption-background-color: rgba(0, 0, 0, 0.4); bottom: 0; left: 0; right: 0; - border-width: $get-overlay-border-width; + border-width: $overlay-border-width; border-color: #0000; } @@ -126,7 +126,7 @@ $get-caption-background-color: rgba(0, 0, 0, 0.4); .caption { @include caption-shared; - background-color: $get-caption-background-color; + background-color: $caption-background-color; } .captionPlaceholder { @@ -141,18 +141,17 @@ $get-caption-background-color: rgba(0, 0, 0, 0.4); // expand caption container to compensate for overlay border .captionExpandedContainer { - $width: $get-overlay-border-width; // constrain height to gallery image height for caption scroll - max-height: $get-gallery-image-container-height; + max-height: $gallery-image-container-height; position: absolute; - bottom: - $width; - left: - $width; - right: - $width; - padding-bottom: $width; - padding-left: $width; - padding-right: $width; + bottom: - $overlay-border-width; + left: - $overlay-border-width; + right: - $overlay-border-width; + padding-bottom: $overlay-border-width; + padding-left: $overlay-border-width; + padding-right: $overlay-border-width; // use caption background color on container when expanded - background-color: $get-caption-background-color; + background-color: $caption-background-color; } .captionExpanded { From bfabd0fa7af92e88a0723f4f705fca0820f3d704 Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Tue, 11 Feb 2020 17:40:46 +1000 Subject: [PATCH 3/4] Add vertical padding to mobile gallery image caption --- .../src/gallery/gallery-image-style.native.scss | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/block-library/src/gallery/gallery-image-style.native.scss b/packages/block-library/src/gallery/gallery-image-style.native.scss index 821e2d5b3cd10d..765f6c4918544d 100644 --- a/packages/block-library/src/gallery/gallery-image-style.native.scss +++ b/packages/block-library/src/gallery/gallery-image-style.native.scss @@ -1,6 +1,7 @@ $gallery-image-container-height: 150px; $overlay-border-width: 3px; $caption-background-color: rgba(0, 0, 0, 0.4); +$caption-padding-vertical: 8px; .galleryImageContainer { flex: 1; @@ -127,6 +128,8 @@ $caption-background-color: rgba(0, 0, 0, 0.4); .caption { @include caption-shared; background-color: $caption-background-color; + padding-top: $caption-padding-vertical; + padding-bottom: $caption-padding-vertical; } .captionPlaceholder { @@ -147,7 +150,8 @@ $caption-background-color: rgba(0, 0, 0, 0.4); bottom: - $overlay-border-width; left: - $overlay-border-width; right: - $overlay-border-width; - padding-bottom: $overlay-border-width; + padding-top: $caption-padding-vertical; + padding-bottom: $overlay-border-width + $caption-padding-vertical; padding-left: $overlay-border-width; padding-right: $overlay-border-width; // use caption background color on container when expanded From 95d2b549eb9b36aa3047f80f8d63fb2469a2dcaf Mon Sep 17 00:00:00 2001 From: Matthew Kevins Date: Tue, 11 Feb 2020 17:45:21 +1000 Subject: [PATCH 4/4] Remove unused variable in media-upload --- .../block-editor/src/components/media-upload/index.native.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-editor/src/components/media-upload/index.native.js b/packages/block-editor/src/components/media-upload/index.native.js index d90da4d7a0a3bb..2e3b527b10956c 100644 --- a/packages/block-editor/src/components/media-upload/index.native.js +++ b/packages/block-editor/src/components/media-upload/index.native.js @@ -93,7 +93,7 @@ export class MediaUpload extends React.Component { } getMediaOptionsItems() { - const { allowedTypes = [], multiple = false } = this.props; + const { allowedTypes = [] } = this.props; return this.getAllSources() .filter( ( source ) => {