-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Map block: Do not render the actual map if in block preview mode (#39768
) * Map block: Use block editor store preview flag to determine whether or not to display the placeholder * changelog * Cover the map container with the preview image * Update CHANGELOG wording * Remove preview attribute in favor of flag coming from the block editor store * Default to mapHeight and fall back to 400px * Add attribute removal changelog entry
- Loading branch information
Showing
9 changed files
with
88 additions
and
86 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/display-map-block-as-preview-if-in-block-preview-mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: other | ||
|
||
Map block: Display a static map image when the block is rendered in a pattern preview |
4 changes: 4 additions & 0 deletions
4
projects/plugins/jetpack/changelog/remove-preview-attribute-from-map-block
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: other | ||
|
||
Map: remove preview attribute. The mechanism to determine if the block is in preview mode changed internally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 31 additions & 32 deletions
63
projects/plugins/jetpack/extensions/blocks/map/test/fixtures/jetpack__map__deprecated-1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "jetpack/map", | ||
"isValid": true, | ||
"attributes": { | ||
"points": [ | ||
{ | ||
"placeTitle": "Williams Street", | ||
"title": "Williams Street", | ||
"caption": "15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand", | ||
"id": "address.3454160499802812", | ||
"coordinates": { | ||
"longitude": 172.652908, | ||
"latitude": -43.391304 | ||
} | ||
} | ||
], | ||
"mapDetails": true, | ||
"zoom": 11.765903600711997, | ||
"mapCenter": { | ||
"lng": 172.652908, | ||
"lat": -43.391304 | ||
}, | ||
"markerColor": "red", | ||
"preview": false, | ||
"scrollToZoom": false, | ||
"className": "is-style-black-and-white", | ||
"showFullscreenButton": true | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-jetpack-map is-style-black-and-white\" data-map-style=\"black-and-white\" data-map-details=\"true\" data-points=\"[{"placeTitle":"Williams Street","title":"Williams Street","caption":"15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand","id":"address.3454160499802812","coordinates":{"longitude":172.652908,"latitude":-43.391304}}]\" data-zoom=\"11.765903600711997\" data-map-center=\"{"lng":172.652908,"lat":-43.391304}\" data-marker-color=\"red\"><ul><li><a href=\"https://www.google.com/maps/search/?api=1&query=-43.391304,172.652908\">Williams Street</a></li></ul></div>" | ||
} | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "jetpack/map", | ||
"isValid": true, | ||
"attributes": { | ||
"points": [ | ||
{ | ||
"placeTitle": "Williams Street", | ||
"title": "Williams Street", | ||
"caption": "15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand", | ||
"id": "address.3454160499802812", | ||
"coordinates": { | ||
"longitude": 172.652908, | ||
"latitude": -43.391304 | ||
} | ||
} | ||
], | ||
"mapDetails": true, | ||
"zoom": 11.765903600711997, | ||
"mapCenter": { | ||
"lng": 172.652908, | ||
"lat": -43.391304 | ||
}, | ||
"markerColor": "red", | ||
"scrollToZoom": false, | ||
"className": "is-style-black-and-white", | ||
"showFullscreenButton": true | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-jetpack-map is-style-black-and-white\" data-map-style=\"black-and-white\" data-map-details=\"true\" data-points=\"[{"placeTitle":"Williams Street","title":"Williams Street","caption":"15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand","id":"address.3454160499802812","coordinates":{"longitude":172.652908,"latitude":-43.391304}}]\" data-zoom=\"11.765903600711997\" data-map-center=\"{"lng":172.652908,"lat":-43.391304}\" data-marker-color=\"red\"><ul><li><a href=\"https://www.google.com/maps/search/?api=1&query=-43.391304,172.652908\">Williams Street</a></li></ul></div>" | ||
} | ||
] |
63 changes: 31 additions & 32 deletions
63
projects/plugins/jetpack/extensions/blocks/map/test/fixtures/jetpack__map__deprecated-2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,33 @@ | ||
[ | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "jetpack/map", | ||
"isValid": true, | ||
"attributes": { | ||
"points": [ | ||
{ | ||
"placeTitle": "Williams Street", | ||
"title": "Williams Street", | ||
"caption": "15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand", | ||
"id": "address.3454160499802812", | ||
"coordinates": { | ||
"longitude": 172.652908, | ||
"latitude": -43.391304 | ||
} | ||
} | ||
], | ||
"mapDetails": true, | ||
"zoom": 11.765903600711997, | ||
"mapCenter": { | ||
"lng": 172.652908, | ||
"lat": -43.391304 | ||
}, | ||
"markerColor": "red", | ||
"preview": false, | ||
"scrollToZoom": false, | ||
"showFullscreenButton": true, | ||
"className": "is-style-black-and-white" | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-jetpack-map is-style-black-and-white\" data-map-style=\"black-and-white\" data-map-details=\"true\" data-points=\"[{"placeTitle":"Williams Street","title":"Williams Street","caption":"15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand","id":"address.3454160499802812","coordinates":{"longitude":172.652908,"latitude":-43.391304}}]\" data-zoom=\"11.765903600711997\" data-map-center=\"{"lng":172.652908,"lat":-43.391304}\" data-marker-color=\"red\" data-show-fullscreen-button=\"true\"><ul><li><a href=\"https://www.google.com/maps/search/?api=1&query=-43.391304,172.652908\">Williams Street</a></li></ul></div>" | ||
} | ||
{ | ||
"clientId": "_clientId_0", | ||
"name": "jetpack/map", | ||
"isValid": true, | ||
"attributes": { | ||
"points": [ | ||
{ | ||
"placeTitle": "Williams Street", | ||
"title": "Williams Street", | ||
"caption": "15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand", | ||
"id": "address.3454160499802812", | ||
"coordinates": { | ||
"longitude": 172.652908, | ||
"latitude": -43.391304 | ||
} | ||
} | ||
], | ||
"mapDetails": true, | ||
"zoom": 11.765903600711997, | ||
"mapCenter": { | ||
"lng": 172.652908, | ||
"lat": -43.391304 | ||
}, | ||
"markerColor": "red", | ||
"scrollToZoom": false, | ||
"showFullscreenButton": true, | ||
"className": "is-style-black-and-white" | ||
}, | ||
"innerBlocks": [], | ||
"originalContent": "<div class=\"wp-block-jetpack-map is-style-black-and-white\" data-map-style=\"black-and-white\" data-map-details=\"true\" data-points=\"[{"placeTitle":"Williams Street","title":"Williams Street","caption":"15 Williams Street, Kaiapoi, The Pines Beach 7630, New Zealand","id":"address.3454160499802812","coordinates":{"longitude":172.652908,"latitude":-43.391304}}]\" data-zoom=\"11.765903600711997\" data-map-center=\"{"lng":172.652908,"lat":-43.391304}\" data-marker-color=\"red\" data-show-fullscreen-button=\"true\"><ul><li><a href=\"https://www.google.com/maps/search/?api=1&query=-43.391304,172.652908\">Williams Street</a></li></ul></div>" | ||
} | ||
] |