Skip to content

Commit

Permalink
Merge pull request #290 from performant-software/feature/cdc240_place…
Browse files Browse the repository at this point in the history
…_edit_form

CDC #240 - Place Edit Form
  • Loading branch information
dleadbetter authored Jul 17, 2024
2 parents 9ae7be9 + c950605 commit 0100a8b
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 16 deletions.
6 changes: 3 additions & 3 deletions packages/controlled-vocabulary/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/controlled-vocabulary",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand All @@ -23,8 +23,8 @@
"underscore": "^1.13.2"
},
"peerDependencies": {
"@performant-software/semantic-components": "^2.2.6",
"@performant-software/shared-components": "^2.2.6",
"@performant-software/semantic-components": "^2.2.7",
"@performant-software/shared-components": "^2.2.7",
"react": ">= 16.13.1 < 19.0.0",
"react-dom": ">= 16.13.1 < 19.0.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/core-data/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/core-data",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of components used with the Core Data platform.",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand Down Expand Up @@ -37,8 +37,8 @@
"underscore": "^1.13.2"
},
"peerDependencies": {
"@performant-software/shared-components": "^2.2.6",
"@performant-software/geospatial": "^2.2.6",
"@performant-software/shared-components": "^2.2.7",
"@performant-software/geospatial": "^2.2.7",
"@peripleo/maplibre": "^0.5.2",
"@peripleo/peripleo": "^0.5.2",
"react": ">= 16.13.1 < 19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/geospatial/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/geospatial",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of components for all things map-related.",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand Down
26 changes: 25 additions & 1 deletion packages/geospatial/src/components/MapDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import React, {
useState,
type Node
} from 'react';
import Map, { type MapboxMap } from 'react-map-gl';
import Map, { type MapboxMap, NavigationControl } from 'react-map-gl';
import { FullscreenControl } from 'react-map-gl/maplibre';
import _ from 'underscore';
import DrawControl from './DrawControl';
import GeocodingControl from './GeocodingControl';
Expand Down Expand Up @@ -39,11 +40,21 @@ type Props = {
*/
children?: Node,

/**
* If `true`, the map will require CTRL + scroll to zoom.
*/
cooperativeGestures?: boolean,

/**
* GeoJSON structured data to be displayed on the map.
*/
data: GeometryCollection | FeatureCollection,

/**
* If `true`, a control will be rendered to put the map in full screen mode.
*/
fullscreen?: boolean,

/**
* Controls the type of GeoJSON data returned from the MapTiler Geocoding API.
*/
Expand All @@ -54,6 +65,11 @@ type Props = {
*/
mapStyle: string,

/**
* If `true`, the navigation controls will display.
*/
navigation?: boolean,

/**
* Callback fired when the map geometries are changed.
*
Expand Down Expand Up @@ -180,6 +196,7 @@ const MapDraw = (props: Props) => {
return (
<Map
attributionControl={false}
cooperativeGestures={props.cooperativeGestures}
onLoad={() => setLoaded(true)}
mapLib={maplibregl}
ref={mapRef}
Expand Down Expand Up @@ -210,13 +227,20 @@ const MapDraw = (props: Props) => {
showResultMarkers={false}
/>
)}
{ props.navigation && (
<NavigationControl />
)}
{ props.fullscreen && (
<FullscreenControl />
)}
{ props.children }
</Map>
);
};

MapDraw.defaultProps = {
buffer: DEFAULT_BUFFER,
cooperativeGestures: true,
zoomDuration: DEFAULT_ZOOM_DELAY
};

Expand Down
4 changes: 2 additions & 2 deletions packages/semantic-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/semantic-components",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of shared components based on the Semantic UI Framework.",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand Down Expand Up @@ -35,7 +35,7 @@
"zotero-translation-client": "^5.0.1"
},
"peerDependencies": {
"@performant-software/shared-components": "^2.2.6",
"@performant-software/shared-components": "^2.2.7",
"@samvera/clover-iiif": "^2.3.2",
"react": ">= 16.13.1 < 19.0.0",
"react-dnd": "^11.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/shared-components",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of shared, framework agnostic, components.",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand Down
27 changes: 27 additions & 0 deletions packages/storybook/src/geospatial/MapDraw.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,30 @@ export const GeocodingPolygons = () => (
onGeocodingSelection={action('onGeocodingSelection')}
/>
);

export const DisableCooperativeGestures = () => (
<MapDraw
apiKey={mapTilerKey}
cooperativeGestures={false}
mapStyle='https://api.maptiler.com/maps/basic-v2/style.json'
onChange={action('onChange')}
/>
);

export const FullScreenControl = () => (
<MapDraw
apiKey={mapTilerKey}
fullscreen
mapStyle='https://api.maptiler.com/maps/basic-v2/style.json'
onChange={action('onChange')}
/>
);

export const NavigationControl = () => (
<MapDraw
apiKey={mapTilerKey}
mapStyle='https://api.maptiler.com/maps/basic-v2/style.json'
navigation
onChange={action('onChange')}
/>
);
6 changes: 3 additions & 3 deletions packages/user-defined-fields/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/user-defined-fields",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand All @@ -23,8 +23,8 @@
"underscore": "^1.13.2"
},
"peerDependencies": {
"@performant-software/semantic-components": "^2.2.6",
"@performant-software/shared-components": "^2.2.6",
"@performant-software/semantic-components": "^2.2.7",
"@performant-software/shared-components": "^2.2.7",
"react": ">= 16.13.1 < 19.0.0",
"react-dom": ">= 16.13.1 < 19.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/visualize/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/visualize",
"version": "2.2.6",
"version": "2.2.7",
"description": "A package of components used for data visualization",
"license": "MIT",
"main": "./dist/index.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion react-components.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"packages/user-defined-fields",
"packages/visualize"
],
"version": "2.2.6"
"version": "2.2.7"
}

0 comments on commit 0100a8b

Please sign in to comment.