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

Map Block #27836

Closed
wants to merge 112 commits into from
Closed
Show file tree
Hide file tree
Changes from 84 commits
Commits
Show all changes
112 commits
Select commit Hold shift + click to select a range
eb67549
Initial commit of directories and placeholder blocks.
jeffersonrabb Sep 27, 2018
f2a927a
Configs rewritten as a single object with comma-separated properties.…
jeffersonrabb Oct 8, 2018
5d758e5
Replaced incorrect const with let in for loop.
jeffersonrabb Oct 8, 2018
d4787ce
Clean branch with temp blocks deleted, as a starting point for others.
jeffersonrabb Oct 8, 2018
b5c756d
Map block, initial commit.
jeffersonrabb Oct 8, 2018
74af045
On-block approach to adding Map Points.
jeffersonrabb Oct 9, 2018
65766a9
Editable info windows, and many other refinements.
jeffersonrabb Oct 9, 2018
1d5cc78
SVG for markers instead of raster images.
jeffersonrabb Oct 10, 2018
7faefab
Changes to the UI for hiding/showing the Add Marker button. Dashed ic…
jeffersonrabb Oct 10, 2018
fb970f3
Bug fix: clear active marker after deletion, to avoid another marker'…
jeffersonrabb Oct 10, 2018
6c2edeb
Color and Map Theme pickers.
jeffersonrabb Oct 10, 2018
99b4af1
Missing map theme component.
jeffersonrabb Oct 10, 2018
4431eee
Close button for location search popover.
jeffersonrabb Oct 10, 2018
6f6b4be
Hover animation on Map Theme buttons.
jeffersonrabb Oct 10, 2018
741f7b0
Fix for JS error occurring in frontend.
jeffersonrabb Oct 10, 2018
ad5685f
Removing artificial height constraint in frontend.
jeffersonrabb Oct 10, 2018
011f316
Refactoring the frontend initialization, moving code into each block'…
jeffersonrabb Oct 10, 2018
987bd15
Don't recalculate map bounds if the info window is open. The recalcul…
jeffersonrabb Oct 10, 2018
e5197fa
Adding Map block to the Jetpack preset.
jeffersonrabb Oct 10, 2018
acbedc9
Removing some unused React functions.
jeffersonrabb Oct 10, 2018
5191ef4
Key attributes in iterated markup.
jeffersonrabb Oct 10, 2018
b3b9c35
Resolved - its a theme support question.
jeffersonrabb Oct 11, 2018
f02f912
Removing an errant console log as well as some unused variables.
jeffersonrabb Oct 11, 2018
a61def0
Some syntax clean-up.
jeffersonrabb Oct 11, 2018
dd897b8
More syntax and legibility improvements. Removed an ancient setTimeou…
jeffersonrabb Oct 11, 2018
82a6fc2
Removal of sidebar Locations component, which is now redundant. Marke…
jeffersonrabb Oct 11, 2018
d693302
Use browser geolocation to set map center if no points have been prov…
jeffersonrabb Oct 11, 2018
dd1452e
Minor changes to the infowindow, fix to zoom bug.
jeffersonrabb Oct 11, 2018
30c49d8
Check to insure initialization occurs only view-side.
jeffersonrabb Oct 12, 2018
5449ace
Z-index fix for Add Marker popover, to keep it from appearing above v…
jeffersonrabb Oct 12, 2018
0efd694
Multi-line object formatting.
jeffersonrabb Oct 12, 2018
c5e2b2d
Less jarring background color.
jeffersonrabb Oct 12, 2018
51cc707
Better approach to determining if view.js is loaded in Editor or View…
jeffersonrabb Oct 12, 2018
40a57a8
Removal of all jQuery. Calypso loadScript library used to dynamically…
jeffersonrabb Oct 12, 2018
325e538
Do not render markers until map exists.
jeffersonrabb Oct 12, 2018
4263be1
Comments, readability improvements, clean-up.
jeffersonrabb Oct 12, 2018
480696c
TextareaControl instead of TextControl for caption field in popover.
jeffersonrabb Oct 12, 2018
82ff721
Reinstatement of Locations component, for testing.
jeffersonrabb Oct 12, 2018
fb7666e
Fixes to two bugs that could break clickable markers. THe first preve…
jeffersonrabb Oct 13, 2018
ba0f065
Right padding to separate the arrow in nested panels from the text.
jeffersonrabb Oct 13, 2018
3181a22
Removing unused subcomponents directory. Will be reinstated in future…
jeffersonrabb Oct 13, 2018
3df859c
Removing console log statement.
jeffersonrabb Oct 13, 2018
b2b70f7
Circle CI lint & translate issues.
jeffersonrabb Oct 13, 2018
97a30bc
Removed incorrect second key attribute.
jeffersonrabb Oct 13, 2018
a4f9b7d
Missed one linting fix.
jeffersonrabb Oct 13, 2018
68ffb7a
Switch to Theme Colors for Marker Color.
jeffersonrabb Oct 13, 2018
f8212f0
Removal of an unused event, fix to the z-index of the Add Point popover.
jeffersonrabb Oct 13, 2018
eede270
Don't show the Locations component unless there is at least one marker.
jeffersonrabb Oct 13, 2018
fc75969
Update block sizing after alignment change.
jeffersonrabb Oct 13, 2018
cf8c9ac
Removing unused color values, now that theme colors are used instead.
jeffersonrabb Oct 13, 2018
36a4d0a
Lookup component - simplified rewrite of Autocomplete component desig…
jeffersonrabb Oct 16, 2018
de0ae1c
Removing caption.
jeffersonrabb Oct 17, 2018
cf87034
Removing Geolocation feature - too slow and too invasive without a po…
jeffersonrabb Oct 17, 2018
3009a9c
Lookup key command accessibility to mirror Autocomplete.
jeffersonrabb Oct 17, 2018
15c7a89
Marker caption defaults to address.
jeffersonrabb Oct 17, 2018
022ca84
Implementation of withSpokenMessages to match Autocomplete.
jeffersonrabb Oct 17, 2018
762ff13
Set anchor point of map markers so that the point of the graphic is p…
jeffersonrabb Oct 17, 2018
933b877
Refactor to reduce size of view script and address view script enqueu…
jeffersonrabb Oct 17, 2018
072f509
Replacing lodash clone() with Array.slice(0) to remove dependency. A …
jeffersonrabb Oct 18, 2018
1326789
Moved all WordPress dependencies into External dependencies block. Re…
jeffersonrabb Oct 19, 2018
7f06bd6
Replacing all bound event handlers with arrow functions. Removing unn…
jeffersonrabb Oct 19, 2018
2a2c3f9
Missed localization.
jeffersonrabb Oct 19, 2018
cf4dfe2
Remove Add Point icon asset from block, move to CDN instead.
jeffersonrabb Oct 19, 2018
f9e9496
Renamed CONFIG->settings.
jeffersonrabb Oct 19, 2018
1cbfd2a
Neglected to add this file after rename. Also, lowercase keywords.
jeffersonrabb Oct 19, 2018
29944ff
CSS class name changes to match Calypso guidelines.
jeffersonrabb Oct 19, 2018
f57991a
Correcting indentation issues in two files.
jeffersonrabb Oct 20, 2018
2360440
Jetpack text domain for all localizations. Also, caught a few unlocal…
jeffersonrabb Oct 22, 2018
fd8a77b
Sytax updates with Prettier.
jeffersonrabb Oct 22, 2018
68771da
Removing 'atavist' from block registration name.
jeffersonrabb Oct 23, 2018
5f0c938
Removing all atavist references, and styles.
jeffersonrabb Oct 23, 2018
bf7f6a0
One missing localization text domain, some JsPrettier formatting.
jeffersonrabb Oct 23, 2018
d2d5f51
Changing block name prefix from a8c to jetpack.
jeffersonrabb Oct 23, 2018
e45afae
Use Jetpack REST API for Google Maps API Key.
jeffersonrabb Oct 23, 2018
1920bb1
Google Maps API key retrieval by API in view.
jeffersonrabb Oct 24, 2018
4bbe248
API key deletion. Notices on API update error.
jeffersonrabb Oct 24, 2018
4fac59a
Placeholder with API key field for first-time users who have not yet …
jeffersonrabb Oct 24, 2018
df86050
Google Maps API Key form field in its own PanelGroup. Markers & Googl…
jeffersonrabb Oct 24, 2018
6d85144
Some tweaks to the Google Maps API form element area.
jeffersonrabb Oct 24, 2018
925707c
Change to Service API Keys endpoint.
jeffersonrabb Oct 25, 2018
9608c88
A better change to the Service API Keys endpoint.
jeffersonrabb Oct 25, 2018
28808a5
Changes to the /service-api-keys/ parameters.
jeffersonrabb Oct 25, 2018
8bfb1cc
Merge branch 'master' into atavist/map-block-v2
jeffersonrabb Oct 25, 2018
dadf5f8
Better apiFetch promise, using second param of .then() as the catch.
jeffersonrabb Oct 25, 2018
10ccbdf
Additional keyword, removed translation for "jetpack" as it is a bran…
jeffersonrabb Oct 26, 2018
7ce9855
Bug fix: frontend Google Maps API retrieval was out of date with rece…
jeffersonrabb Oct 26, 2018
1c47ada
Removing left/right alignment options.
jeffersonrabb Oct 26, 2018
8ac2e2a
New approach to map styles, with four options available (Roadmap, Ter…
jeffersonrabb Oct 26, 2018
c2009e1
Switch to Mapbox from Google Maps.
jeffersonrabb Oct 31, 2018
d8f438b
Mapbox error management.
jeffersonrabb Nov 1, 2018
6b34ca1
Replace jQuery ajax() with pure Javascript.
jeffersonrabb Nov 1, 2018
e6e946c
Fallback to Open Street Map embed, which will be visible if block is …
jeffersonrabb Nov 1, 2018
a548742
Some visual and textual improvements to the Map Theme picker.
jeffersonrabb Nov 1, 2018
b6cc9a1
Fix to the opacity of marker pins - they are now 90% opaque.
jeffersonrabb Nov 1, 2018
ef5c1d5
Improvements to the styling of Map popups.
jeffersonrabb Nov 1, 2018
c7fa98e
Give focus to the location search text field whenever it is displayed.
jeffersonrabb Nov 1, 2018
acf8bf3
New opening screen Mapbox copy.
jeffersonrabb Nov 1, 2018
b8617e3
When dropping from two points down to one, set zoom to 12 so the sing…
jeffersonrabb Nov 2, 2018
76eaf81
When point is added, check to see if identical point has already been…
jeffersonrabb Nov 2, 2018
ee85e9b
Lodash import fixes.
jeffersonrabb Nov 2, 2018
d2c809e
Lodash import fixes.
jeffersonrabb Nov 2, 2018
2deab74
Refactor of property observer functions to be more explicit and 'grep…
jeffersonrabb Nov 2, 2018
82585a7
Bug fix to make popup text fields editable without hiding the popup. …
jeffersonrabb Nov 2, 2018
3fef44a
Merge branch 'try/map-block-mapbox' into atavist/map-block-v2
jeffersonrabb Nov 2, 2018
3306a87
Renaming block so that directory structure matches block name. Change…
jeffersonrabb Nov 2, 2018
864ec24
Revised fallback approach: list of marker points, each linked to Goog…
jeffersonrabb Nov 2, 2018
c1fe92a
Fix to fallback for map with no markers.
jeffersonrabb Nov 2, 2018
b54cc37
Merge branch 'master' into atavist/map-block-v2
jeffersonrabb Nov 5, 2018
6fe4149
Merge branch 'master' into atavist/map-block-v2
jeffersonrabb Nov 7, 2018
43e7f45
Merge branch 'master' into atavist/map-block-v2
jeffersonrabb Nov 9, 2018
ea07f2e
Include Map Theme picker assets in the block bundle.
jeffersonrabb Nov 9, 2018
0964c39
Debouncer for map resizing.
jeffersonrabb Nov 9, 2018
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
39 changes: 39 additions & 0 deletions client/gutenberg/extensions/map-block/add-point/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/** @format */

/**
* External dependencies
*/

import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Button, Dashicon, Popover } from '@wordpress/components';

/**
* Internal dependencies
*/

import LocationSearch from '../location-search';
import './style.scss';
export class AddPoint extends Component {
render() {
const { onClose, onAddPoint } = this.props;
return (
<Button className="component__add-point">
{ __( 'Add marker', 'jetpack' ) }
<Popover className="component__add-point__popover">
<Button className="component__add-point__close" onClick={ onClose }>
<Dashicon icon="no" />
</Button>
<LocationSearch onAddPoint={ onAddPoint } label={ __( 'Add a location', 'jetpack' ) } />
</Popover>
</Button>
);
}
}

AddPoint.defaultProps = {
onAddPoint: () => {},
jeffersonrabb marked this conversation as resolved.
Show resolved Hide resolved
onClose: () => {},
};

export default AddPoint;
53 changes: 53 additions & 0 deletions client/gutenberg/extensions/map-block/add-point/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/** @format */

.component__add-point {
position: absolute;
left: 50%;
top: 50%;
z-index: 1;
width: 32px;
height: 38px;
margin-top: -19px;
margin-left: -16px;
background-image: url( https://s3.amazonaws.com/atavist-static/map/oval.svg );
jeffersonrabb marked this conversation as resolved.
Show resolved Hide resolved
background-repeat: no-repeat;
text-indent: -9999px;
box-shadow: none;
background-color: transparent;
&.components-button:not( :disabled ):not( [aria-disabled='true'] ):focus {
background-color: transparent;
box-shadow: none;
}
&:focus,
&:active {
background-color: transparent;
box-shadow: none;
}
}
.component__add-point__popover {
// Default z-index for components-popover places it above Edit Post Header and Notices
&.components-popover,
&.components-popover:not( .is-mobile ).is-bottom {
z-index: 20;
}
.components-button:not( :disabled ):not( [aria-disabled='true'] ):focus {
background-color: transparent;
box-shadow: none;
}
.components-popover__content {
padding: 0.1rem;
}
.components-location-search {
margin: 0.5rem;
}
}
.component__add-point__close {
margin: 0;
padding: 0;
border: none;
box-shadow: none;
float: right;
path {
color: #aaa;
}
}
Loading