Skip to content

Commit

Permalink
RC #251 - Publishing v1.2.0-beta.9; Testing removing useMap hook from…
Browse files Browse the repository at this point in the history
… "geospatial" package
  • Loading branch information
dleadbetter committed Feb 16, 2024
1 parent 8835ec9 commit b20f2a3
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 22 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": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -12,8 +12,8 @@
"build": "webpack --mode production && flow-copy-source -v src types"
},
"dependencies": {
"@performant-software/semantic-components": "^1.2.0-beta.8",
"@performant-software/shared-components": "^1.2.0-beta.8",
"@performant-software/semantic-components": "^1.2.0-beta.9",
"@performant-software/shared-components": "^1.2.0-beta.9",
"i18next": "^21.9.2",
"semantic-ui-react": "^2.1.2",
"underscore": "^1.13.2"
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": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"description": "A package of components used for Core Data",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -9,6 +9,8 @@
"build": "webpack --mode production && flow-copy-source -v src types"
},
"dependencies": {
"@peripleo/maplibre": "^0.3.3",
"@performant-software/geospatial": "^1.2.0-beta.8",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-dialog": "^1.0.5",
"@samvera/clover-iiif": "^2.3.2",
Expand All @@ -20,8 +22,6 @@
"underscore": "^1.13.2"
},
"peerDependencies": {
"@peripleo/maplibre": "^0.3.3",
"@performant-software/geospatial": "^1.2.0-beta.8",
"react": ">= 16.13.1 < 19.0.0",
"react-dom": ">= 16.13.1 < 19.0.0"
},
Expand Down
2 changes: 2 additions & 0 deletions packages/core-data/src/components/PlaceMarker.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @flow

import { useMap } from '@peripleo/maplibre';
import { LocationMarker } from '@performant-software/geospatial';
import React, { useCallback, useEffect, useState } from 'react';

Expand Down Expand Up @@ -52,6 +53,7 @@ const PlaceMarker = (props: Props) => {
return (
<LocationMarker
data={place}
useMap={useMap}
/>
);
};
Expand Down
4 changes: 2 additions & 2 deletions packages/geospatial/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@performant-software/geospatial",
"version": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"description": "TODO: ADD",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -10,6 +10,7 @@
},
"dependencies": {
"@mapbox/mapbox-gl-draw": "^1.4.3",
"@peripleo/maplibre": "^0.3.3",
"@radix-ui/react-accordion": "^1.1.2",
"@radix-ui/react-dialog": "^1.0.5",
"@samvera/clover-iiif": "^2.3.2",
Expand All @@ -22,7 +23,6 @@
"underscore": "^1.13.6"
},
"peerDependencies": {
"@peripleo/maplibre": "^0.3.3",
"react": ">= 16.13.1 < 19.0.0",
"react-dom": ">= 16.13.1 < 19.0.0"
},
Expand Down
15 changes: 10 additions & 5 deletions packages/geospatial/src/components/LocationMarker.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import React, { useEffect } from 'react';
import { MixedGeoJSONLayer, PulsingMarkerLayer, useMap } from '@peripleo/maplibre';
import React, { useEffect, useMemo } from 'react';
import { MixedGeoJSONLayer, PulsingMarkerLayer, type Map } from '@peripleo/maplibre';
import { DEFAULT_FILL_STYLE, DEFAULT_POINT_STYLE, DEFAULT_STROKE_STYLE } from '../utils/MapStyles';
import MapUtils from '../utils/Map';

Expand Down Expand Up @@ -29,7 +29,12 @@ type Props = {
/**
* GeoJSON layer stroke style
*/
strokeStyle?: { [key: string]: any }
strokeStyle?: { [key: string]: any },

/**
* Hook used to retrieve the map instance.
*/
useMap?: () => Map
};

const DEFAULT_BUFFER = 2;
Expand All @@ -38,7 +43,7 @@ const DEFAULT_BUFFER = 2;
* This component renders a location marker to be used in a Peripleo context.
*/
const LocationMarker = (props: Props) => {
const map = useMap();
const map = useMemo(() => props.useMap(), [props.useMap]);

/**
* Sets the bounding box on the map.
Expand All @@ -48,7 +53,7 @@ const LocationMarker = (props: Props) => {
const boundingBox = MapUtils.getBoundingBox(props.data, props.buffer);
map.fitBounds(boundingBox);
}
}, [props.buffer, props.data]);
}, [map, props.buffer, props.data]);

return (
<>
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": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"description": "A package of shared components based on the Semantic UI Framework.",
"license": "MIT",
"main": "./build/index.js",
Expand All @@ -12,7 +12,7 @@
"build": "webpack --mode production && flow-copy-source -v src types"
},
"dependencies": {
"@performant-software/shared-components": "^1.2.0-beta.8",
"@performant-software/shared-components": "^1.2.0-beta.9",
"@react-google-maps/api": "^2.8.1",
"axios": "^0.26.1",
"i18next": "^19.4.4",
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": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"description": "A package of shared, framework agnostic, components.",
"license": "MIT",
"main": "./build/index.js",
Expand Down
3 changes: 2 additions & 1 deletion packages/storybook/src/geospatial/LocationMarker.stories.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @flow

import { Peripleo, Controls } from '@peripleo/peripleo';
import { Map, Zoom } from '@peripleo/maplibre';
import { Map, Zoom, useMap } from '@peripleo/maplibre';
import React from 'react';
import LocationMarker from '../../../geospatial/src/components/LocationMarker';
import mapStyle from '../data/MapStyles.json';
Expand Down Expand Up @@ -35,6 +35,7 @@ export const Default = () => (
31.4252249
]
}}
useMap={useMap}
/>
</div>
</Map>
Expand Down
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": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"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": "./build/index.js",
Expand All @@ -9,8 +9,8 @@
"build": "webpack --mode production && flow-copy-source -v src types"
},
"dependencies": {
"@performant-software/semantic-components": "^1.2.0-beta.8",
"@performant-software/shared-components": "^1.2.0-beta.8",
"@performant-software/semantic-components": "^1.2.0-beta.9",
"@performant-software/shared-components": "^1.2.0-beta.9",
"i18next": "^21.9.1",
"semantic-ui-react": "^2.1.2",
"underscore": "^1.13.2"
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": "1.2.0-beta.8",
"version": "1.2.0-beta.9",
"description": "A package of components used for data visualization",
"license": "MIT",
"main": "./build/index.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": "1.2.0-beta.8"
"version": "1.2.0-beta.9"
}

0 comments on commit b20f2a3

Please sign in to comment.