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

[Mobile] Pass the Gallery v2 Flag over from the editor #33314

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
212 commits
Select commit Hold shift + click to select a range
c01bbfb
Refactor gallery to nested image blocks
Apr 11, 2021
038b22d
Fix issue with images not loading on first selection from media gallery
Nov 4, 2020
331c302
Remove the default columns setting as we don't have access to innerBl…
Nov 4, 2020
ee7da0a
Revert "Remove the default columns setting as we don't have access to…
Nov 4, 2020
c9fe911
Add image count so we can work out default columns as innerBlocks not…
Nov 4, 2020
a00a544
Disable the innerBlocks dropzones so drag drop works same as existing…
Nov 5, 2020
0c8742f
Lint changes
Nov 5, 2020
a77854c
Revert "Lint changes"
Nov 6, 2020
1965514
Revert "Disable the innerBlocks dropzones so drag drop works same as …
Nov 6, 2020
e5e1420
Suggested solution for handling multiple file drop into gallery
Nov 6, 2020
1d6c559
Remove non image files from drag and drop and disable individual imag…
Jan 21, 2021
39cecec
Fix transform to individual images
Nov 8, 2020
d9ec2b0
Fix transform from individual images
Nov 8, 2020
3742af8
Revert drag and drop transform changes
Nov 9, 2020
3acb223
Add gallery transform to image block to override the default gallery …
Nov 9, 2020
084e6c7
Move handling of file uploads to Gallery from media placeholder
Apr 11, 2021
cff6727
split innerblocks mapping into separate effect to reduce chatter
Nov 17, 2020
f1606cc
Add useMemo to currentImageOptions
Nov 17, 2020
1140646
reuse existing innerBlocks rather than recreating with every new imag…
Nov 17, 2020
6d23628
Switch to useMemo for updating local image const instead of local com…
Nov 17, 2020
f7a1ff4
Fix issue with image sizing not being available on initial load of co…
Nov 17, 2020
974ad90
Memoise the useImageSizes hook
Nov 17, 2020
5ac143b
Fix issue with media browser defaulting to edit gallery view
Nov 17, 2020
8ceaa3d
Fix missed incorrect use of addToGallery
Nov 17, 2020
8d7159b
Add some extra effects for getting the imageData as the getMedia call…
Nov 18, 2020
dbda7e9
Simplify the imageData by using a useSelect
Nov 19, 2020
342695e
Another optimisation - only return a new imageData reference if all i…
Nov 19, 2020
0744b59
Refactored Gallery: Add loading state to gallery image size options (…
aaronrobertshaw Nov 19, 2020
dad1b0b
Initial deprecations commit
Jan 13, 2021
bcf6664
Fix issue with linkDestination not being applied in migration
Nov 19, 2020
921fecc
Refactor gallery deprecations
aaronrobertshaw Nov 20, 2020
7920a45
Fix missing attributes from migration
aaronrobertshaw Nov 20, 2020
c97630c
Update deprecation to set allowResize
aaronrobertshaw Nov 22, 2020
2724965
Fix issue with crop not working when certain plugins are loaded
Mar 22, 2021
098ba86
Fix SCSS lint errors
aaronrobertshaw Nov 22, 2020
49f9d6b
Update the block example
Nov 23, 2020
88c096b
Linting fixes
Nov 23, 2020
37b4b4e
Fix the e2e test and the accessibility issue with having aria group r…
Mar 22, 2021
0c5e720
Fix the e2e test and the accessibility issue with having aria group r…
Mar 22, 2021
5840a1c
Fix frontend omission of wp-block-image class
aaronrobertshaw Nov 24, 2020
e1e6a8a
change deprecation to use imageCount as isEligible check as it seems …
Nov 25, 2020
d7187b4
Move back to a single deprecations file and reorder in array
Nov 26, 2020
b648b10
Remove additional check in v5 isEligible
Nov 26, 2020
f1454f2
Fix the v4 migration
Nov 26, 2020
e76bb06
Fix styles for Safari compatibility
aaronrobertshaw Nov 30, 2020
b969e3f
Remove unnecessary gallery editor styles
aaronrobertshaw Nov 30, 2020
0ff156a
Fix typo in deprecations
aaronrobertshaw Nov 30, 2020
309f9f0
Restore styles to render deprecated gallery versions
Mar 22, 2021
e6d1301
Avoid applying flex styles to IE11
aaronrobertshaw Dec 1, 2020
4953a0c
Add additional selector to prevent the hidden individual image drop z…
Mar 22, 2021
d259127
IE11 styling improvements
aaronrobertshaw Dec 2, 2020
1a16354
Apply default style class to new images added to gallery
Dec 11, 2020
9aadf8f
fix linting issues
Dec 11, 2020
e879978
Move block props to the outer wrapper
Dec 13, 2020
f072943
Revert "Move block props to the outer wrapper"
Dec 13, 2020
c4d06ee
Revert "Revert "Move block props to the outer wrapper""
Dec 13, 2020
82eee6e
Fetch media if isListItem is true
Apr 11, 2021
601119c
Change context from isListItem to isGrouped
Apr 11, 2021
4f1ddb4
Remove wrapper div
Mar 22, 2021
a6603cf
remove extra wrapper around media placeholder and caption and use fle…
Jan 13, 2021
9b8d498
Revert "remove extra wrapper around media placeholder and caption and…
Jan 13, 2021
bd88cb2
Revert "Remove external div wrapper by moving InnerBlocks to a fragment"
Mar 22, 2021
abcb029
another update to image wrapper
Jan 13, 2021
939456d
put media uploader outside figure so structure matches front end
Dec 17, 2020
bf0aec2
Replace div with View for the sake of native code
Dec 17, 2020
0938b5e
Move setting of attributes to the child images
Apr 11, 2021
94d9877
Gallery Block Refactor: Account for null image ids in gallery migrati…
glendaviesnz Dec 22, 2020
17ca088
Remove the gradient and put caption under image if is-rounded style a…
glendaviesnz Dec 24, 2020
2c2b38e
Remove outer div wrapper
Mar 22, 2021
82ef52a
Keep image margins while dragging sibling
aaronrobertshaw Jan 14, 2021
bc61288
Fix e2e test expected markup to match new structure
Jan 18, 2021
7af15db
Gallery Block Refactor: Add handling of short code transforms
Feb 15, 2021
1e1752e
Removed unused prop
Jan 20, 2021
726e48c
Account for undefined block and innerblocks in conversion to reusable…
Apr 11, 2021
21bd032
Add custom gutter sizes to refactored gallery (#28377)
aaronrobertshaw Jan 21, 2021
a9453d2
Adjust editor styles to match new dom structure
Mar 22, 2021
83b9074
Remove redundant styles that are duplicated in nested image blocks
Jan 21, 2021
e3a6c29
Fix issue with Image block dragged out of Gallery still having inheri…
Jan 22, 2021
d34dcdb
When dragging an image block into a gallery make sure we don't wipe a…
Jan 25, 2021
72e9c2b
fix issue with variable declaration order
Jan 25, 2021
e291f91
Fix bug with custom link being overwritten by gallery linkTo changes
Jan 26, 2021
795a568
Fix application of gutter size CSS var (#28759)
aaronrobertshaw Feb 5, 2021
9580649
Fix mobile width for gallery images
aaronrobertshaw Feb 10, 2021
74072f0
Add missing dependency to inner images selector
aaronrobertshaw Feb 10, 2021
cf4dc34
remove conversion to cover block if image in gallery
Mar 22, 2021
f90965c
Add fallback to old gallery edit and save for existing gallery (#28961)
glendaviesnz Feb 15, 2021
be75a36
Remove duplicate import
Feb 15, 2021
780e9e7
Remove need for temporary imageUploads attribute as we can just creat…
Feb 15, 2021
fd1e27d
Remove handling of gallery attribute updates from child images
Feb 16, 2021
652557e
Move updating of attributes back to gallery and show snackbar to indi…
Feb 16, 2021
1da955d
Update transforms to work with both versions of gallery
Feb 16, 2021
5b809d5
Remove redundant changes
Feb 16, 2021
b3fb72c
Remove redundant changes
Feb 16, 2021
b5ca5ef
Remove unused method
Feb 16, 2021
d5f5cba
Merge similar Image transforms.
Feb 16, 2021
82b97b8
Fix some issues missed when moving attribute setting back to gallery.
Feb 18, 2021
d9b1733
Simplify handling of images from media placeholder now that drag and …
Feb 19, 2021
ee6bef7
Fix typo
aaronrobertshaw Feb 19, 2021
9e0b05c
Fix broken upload from media placeholder
Feb 19, 2021
f27e872
Fix issue with new file uploads overwriting existing blocks
Feb 19, 2021
30dc02f
Remove isGrouped dependency from call to get image as not needed now …
Feb 22, 2021
3d47210
Remove custom gutter size feature
aaronrobertshaw Feb 22, 2021
fd56523
Use getMediaItems instead of getMedia for getting image data for all …
Feb 23, 2021
657ba78
Add back missing context prop from rebase conflict
Feb 23, 2021
a111532
Make use of new uniqueByBlock flag on updateBlockAttributes to batch …
Feb 23, 2021
6370194
Move the setting of the default attributes on new blocks to a single …
glendaviesnz Mar 1, 2021
e23ddb0
Add snackbar notice ids (#29364)
aaronrobertshaw Mar 1, 2021
fc2b2a0
Account for people adding and removing images from media browser so …
Mar 1, 2021
716ea1b
Changes from PR feedback
Mar 1, 2021
44df5dd
Fix issue with deprecated constants
Mar 3, 2021
3a75fb0
Fix linting and e2e test failures
Mar 3, 2021
84ebe2e
Some more e2e fixes
Mar 4, 2021
6b06732
Add transform from old gallery to new format
Mar 4, 2021
6caef45
Memoize the allowedBlocks
aaronrobertshaw Mar 8, 2021
8eceac7
Add warning about image formats required if uploading to gallery
Mar 8, 2021
efd0705
Move allowedBlocks outside of component to avoid useMemo use
aaronrobertshaw Mar 8, 2021
82cf526
Re-apply uncropped alignment changes lost in rebase
Mar 9, 2021
d133db7
Fix issue with non-cropped images in deprecated gallery
Mar 9, 2021
651ff59
Don't show media library buttons while images are still uploading as …
Apr 11, 2021
6209e6e
Remove gallerRef that was no longer doing anything
Mar 9, 2021
eaa0c7a
Respect sort order from Media Library (#30070)
glendaviesnz Mar 22, 2021
20477de
Gallery block refactor: make invalid file type errors consistent (#30…
glendaviesnz Mar 31, 2021
6195768
Fix issue with invalid type message when adding files via media brows…
Apr 6, 2021
9cfb170
Gallery block refactor: check for new images by clientId instead of i…
glendaviesnz Apr 8, 2021
772691d
Apply changes from rebase to deprecated gallery
Apr 11, 2021
d71011b
Apply patch from rebase to not select all items in media library when…
Apr 12, 2021
991437d
Copy caption across from image selected from media library (#30784)
glendaviesnz Apr 13, 2021
a2253ec
Add data-id to image to help with compatibility of refactored gallery…
glendaviesnz Apr 22, 2021
d225aca
Revert "Add data-id to image to help with compatibility of refactored…
Apr 23, 2021
fc06639
fix bug with image style being lost when gallery grouped (#31068)
glendaviesnz Apr 23, 2021
1067a0c
Only add RichText component if the figcaption is clicked to prevent i…
glendaviesnz Apr 28, 2021
1521f52
Move native v1 Gallery components to v1 directory
mkevins Apr 26, 2021
8639891
Use v1 defaultColumnsNumber in native v1 gallery
mkevins Apr 26, 2021
ff4fadc
Fix bug with alt text not being copied from media library (#31066)
glendaviesnz Apr 30, 2021
91c09b8
Make onFocus optional in MediaPlaceholder
mkevins Apr 27, 2021
ffc22e7
Add useInnerBlocksProps hook
mkevins Apr 27, 2021
e688131
Enable __experimentalGalleryRefactor flag under __DEV__
mkevins Apr 29, 2021
c8fbc35
Add WIP v2 gallery
mkevins Apr 29, 2021
2f44f58
Add numColumns to block-list flat list
mkevins Apr 29, 2021
9fd5897
Temporarily comment out spinner for pending imagesize option
mkevins Apr 29, 2021
d646d59
Fix spacing
mkevins Apr 29, 2021
59ea082
Adjust styles to avoid appender overlap
mkevins Apr 30, 2021
683af04
Add gallery caption
mkevins Apr 30, 2021
a520018
Fix lint
mkevins May 4, 2021
1f0073d
Fix sass lint
mkevins May 4, 2021
4e3d981
Merge branch 'refactor/gallery-to-nested-image-blocks' into rnmobile/…
mkevins May 7, 2021
b976235
Merge branch 'trunk' of github.com:WordPress/gutenberg into refactor/…
May 19, 2021
77091e2
Merge branch 'refactor/gallery-to-nested-image-blocks' into rnmobile/…
mkevins May 20, 2021
2c6e317
[Mobile] - Refactor gallery - cherry pick image edit native (#31826)
mkevins May 20, 2021
3221e23
Cherry-pick BlockListItem changes
mkevins May 24, 2021
7616231
Return early from render instead of renderContent
mkevins May 24, 2021
4d235fd
Cherry-pick plumb blockProps through BlockListBlock
mkevins May 24, 2021
df286d8
Cherry-pick add GridItem
mkevins May 24, 2021
f5ff38d
Cherry-pick BlockList
mkevins May 24, 2021
0e777c6
Cherry-pick StylePreview key change
mkevins May 24, 2021
acfcb7f
Cherry-pick blockProps and gridProperties in InnerBlocks
mkevins May 24, 2021
30d20b1
Use sass var for galleryAppender padding
mkevins May 24, 2021
8e89a84
Cherry-pick remaining gallery changes
mkevins May 24, 2021
2de17c3
Remove numColumns
mkevins May 26, 2021
931184a
Remove blockProps
mkevins May 26, 2021
e96cd3e
Fix gallery block.json (delete extra comma)
mkevins May 27, 2021
5c78270
Remove unused imageCrop
mkevins May 27, 2021
1a4345a
Gallery refactor - Infer version from existing content (#32270)
mkevins May 30, 2021
3c2f144
Merge branch 'refactor/gallery-to-nested-image-blocks' into rnmobile/…
mkevins May 31, 2021
e5420c6
Merge branch 'trunk' into refactor/gallery-to-nested-image-blocks-ups…
mkevins Jun 3, 2021
e183dcb
Resolve merge conflicts
mkevins Jun 3, 2021
46c8da7
Merge branch 'refactor/gallery-to-nested-image-blocks-upstream' into …
mkevins Jun 3, 2021
b2031f2
Use non-deprecated hook when possible
mkevins Jun 4, 2021
946aeab
Merge branch 'refactor/gallery-to-nested-image-blocks' into rnmobile/…
mkevins Jun 15, 2021
71b249c
Merge branch 'trunk' into refactor/gallery-to-nested-image-blocks-ups…
mkevins Jun 16, 2021
c72984f
Resolve conflict in block editor default settings
mkevins Jun 16, 2021
fb34126
Merge branch 'refactor/gallery-to-nested-image-blocks-upstream' into …
mkevins Jun 16, 2021
0527d39
Add back blockWidth contentContainerStyles in block list
mkevins May 31, 2021
a8c1f0e
Use boolean flags for variants in Platform module
mkevins May 31, 2021
1c1dc9d
Use boolean Platform flags
mkevins May 31, 2021
5f35c4c
Only render imageSizeOptions loading spinner on web
mkevins May 31, 2021
57a01f7
Add default for destructured context in image edit
mkevins Jun 1, 2021
0052b11
Temporarily hard-code experimenal gallery refactor flag to true
mkevins Jun 4, 2021
0d5fb18
Revert "Temporarily hard-code experimenal gallery refactor flag to true"
mkevins Jul 5, 2021
03d730b
Update experiments page with warning about the mobile app version
mkevins Jul 5, 2021
7da0c1b
Merge branch 'trunk' into refactor/gallery-to-nested-image-blocks-ups…
mkevins Jul 8, 2021
797cb28
Resolve conflict in image.js
mkevins Jul 8, 2021
93fd471
Merge branch 'refactor/gallery-to-nested-image-blocks-upstream' into …
mkevins Jul 8, 2021
b199e87
Pass the Gallery v2 Flag over from the editor
chipsnyder Jul 8, 2021
7d0e8ed
Capture Gallery Refactor in initial props
chipsnyder Jul 9, 2021
d5a2890
Lint Fix
chipsnyder Jul 9, 2021
fad851a
Minor changes from code review:
Jul 16, 2021
a83b106
Improve naming of save and deprecated save methods
Jul 19, 2021
a424509
Rename __experimentalGalleryRefactor flag to __unstableGalleryWithInn…
Jul 19, 2021
c69f2d5
Remove the isGrouped context as no longer needed.
Jul 20, 2021
887b6b4
Rename __unstableGalleryWithInnerBlocks to _unstableGalleryWithImageB…
Jul 22, 2021
c4eb362
Gallery block refactor: remove the imageCount attribute (#33677)
glendaviesnz Jul 26, 2021
55e8bf6
Merge branch 'trunk' of github.com:WordPress/gutenberg into refactor/…
Jul 27, 2021
8b1bd7d
Fix broken scss
Jul 28, 2021
0b9d8b2
Fix php linting error
Jul 28, 2021
9ca69ea
Merge branch 'refactor/gallery-to-nested-image-blocks' into rnmobile/…
Aug 2, 2021
475f976
Changes new gallery flag name
Aug 2, 2021
5387ca0
Updates mobile warning
Aug 2, 2021
ec158f7
Removes the imageCount attribute
Aug 2, 2021
53ba376
Remove the isGrouped context
Aug 2, 2021
fe40795
Fixes lint issue
Aug 2, 2021
b3460a6
Merge branch 'rnmobile/refactor/gallery-as-nested-image-blocks' into …
chipsnyder Aug 2, 2021
7e48195
[Mobile] Renames Gallery v2 Flag to __unstableGalleryWithImageBlocks …
Aug 2, 2021
0694339
Merge branch 'trunk' into rnmobile/refactor/gallery-as-nested-image-b…
chipsnyder Aug 2, 2021
6a58538
Merge mobile refactor of gallery to nested image blocks into desktop …
mkevins Aug 3, 2021
8529284
Merge branch 'trunk' of github.com:WordPress/gutenberg into refactor/…
Aug 3, 2021
778a848
Merge branch 'refactor/gallery-to-nested-image-blocks' into rnmobile/…
chipsnyder Aug 4, 2021
2e2e38b
Merge branch 'trunk' into rnmobile/refactor/gallery-as-nested-image-b…
Aug 30, 2021
b5fba10
Merge branch 'trunk' into rnmobile/refactor/gallery-as-nested-image-b…
Sep 1, 2021
3716881
Merge branch 'trunk' into rnmobile/refactor/gallery-as-nested-image-b…
Sep 1, 2021
a21a37e
[Mobile] Android: Pass the Gallery v2 Flag over from the editor (#33544)
Sep 2, 2021
c052389
Merge branch 'trunk' into rnmobile/refactor/gallery-as-nested-image-b…
Sep 2, 2021
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
16 changes: 13 additions & 3 deletions packages/editor/src/components/provider/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,15 @@ class NativeEditorProvider extends Component {
}

componentDidMount() {
const { capabilities, updateSettings } = this.props;
const {
capabilities,
updateSettings,
galleryWithImageBlocks,
} = this.props;

updateSettings( {
...capabilities,
...{ __unstableGalleryWithImageBlocks: galleryWithImageBlocks },
...this.getThemeColors( this.props ),
} );

Expand Down Expand Up @@ -142,8 +147,13 @@ class NativeEditorProvider extends Component {

this.subscriptionParentUpdateEditorSettings = subscribeUpdateEditorSettings(
( editorSettings ) => {
const themeColors = this.getThemeColors( editorSettings );
updateSettings( themeColors );
updateSettings( {
...{
__unstableGalleryWithImageBlocks:
editorSettings.galleryWithImageBlocks,
},
...this.getThemeColors( editorSettings ),
} );
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ data class GutenbergProps @JvmOverloads constructor(
?.let { putSerializable(PROP_STYLES, it) }
theme.getSerializable(PROP_FEATURES)
?.let { putSerializable(PROP_FEATURES, it) }
theme.getSerializable(PROP_IS_FSE_THEME)
?.let { putSerializable(PROP_IS_FSE_THEME, it) }
theme.getSerializable(PROP_GALLERY_WITH_IMAGE_BLOCKS)
?.let { putSerializable(PROP_GALLERY_WITH_IMAGE_BLOCKS, it) }
}
}

Expand Down Expand Up @@ -77,6 +81,8 @@ data class GutenbergProps @JvmOverloads constructor(
private const val PROP_GRADIENTS = "gradients"
private const val PROP_STYLES = "rawStyles"
private const val PROP_FEATURES = "rawFeatures"
private const val PROP_IS_FSE_THEME = "isFSETheme"
private const val PROP_GALLERY_WITH_IMAGE_BLOCKS = "galleryWithImageBlocks"

const val PROP_CAPABILITIES = "capabilities"
const val PROP_CAPABILITIES_CONTACT_INFO_BLOCK = "contactInfoBlock"
Expand Down
1 change: 1 addition & 0 deletions packages/react-native-bridge/ios/Gutenberg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public class Gutenberg: NSObject {
private func properties(from editorSettings: GutenbergEditorSettings?) -> [String : Any] {
var settingsUpdates = [String : Any]()
settingsUpdates["isFSETheme"] = editorSettings?.isFSETheme ?? false
settingsUpdates["galleryWithImageBlocks"] = editorSettings?.galleryWithImageBlocks ?? false

if let rawStyles = editorSettings?.rawStyles {
settingsUpdates["rawStyles"] = rawStyles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public extension GutenbergBridgeDataSource {

public protocol GutenbergEditorSettings {
var isFSETheme: Bool { get }
var galleryWithImageBlocks: Bool { get }
var rawStyles: String? { get }
var rawFeatures: String? { get }
var colors: [[String: String]]? { get }
Expand Down
2 changes: 2 additions & 0 deletions packages/react-native-editor/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ const setupInitHooks = () => {
gradients,
rawStyles,
rawFeatures,
galleryWithImageBlocks,
} = props;

if ( initialData === undefined && __DEV__ ) {
Expand Down Expand Up @@ -110,6 +111,7 @@ const setupInitHooks = () => {
gradients,
rawStyles,
rawFeatures,
galleryWithImageBlocks,
};
}
);
Expand Down