diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index a4331c85..f3617ae6 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.1.0", + "version": "2.1.1", "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", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.1.0", - "@performant-software/shared-components": "^2.1.0", + "@performant-software/semantic-components": "^2.1.1", + "@performant-software/shared-components": "^2.1.1", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 1129c967..622abf69 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.1.0", + "version": "2.1.1", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -38,9 +38,9 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0", - "@peripleo/maplibre": "^0.5.1", - "@peripleo/peripleo": "^0.5.1", + "@performant-software/geospatial": "^2.1.1", + "@peripleo/maplibre": "^0.5.2", + "@peripleo/peripleo": "^0.5.2", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/core-data/src/components/SearchResultsLayer.js b/packages/core-data/src/components/SearchResultsLayer.js index 81f2b2f3..733fcfe6 100644 --- a/packages/core-data/src/components/SearchResultsLayer.js +++ b/packages/core-data/src/components/SearchResultsLayer.js @@ -39,18 +39,37 @@ const SearchResultsLayer = (props: Props) => { const hits = useCachedHits(); const map = useMap(); + /** + * Memo-ize the Typesense hits as a feature collection. + * + * @type {unknown} + */ const data = useMemo(() => !_.isEmpty(hits) && TypesenseUtils.toFeatureCollection(hits), [hits]); /** * Here we'll implement our own fitting of the bounding box once the search has completed and the map has loaded, * rather than using the default implementation in LocationMarker that will change when the "data" prop changes. */ + const boundingBoxDependencies = [ + data, + mapLoaded, + searchCompleted, + props.boundingBoxData, + props.boundingBoxOptions, + props.buffer, + props.fitBoundingBox + ]; + useEffect(() => { - if (props.fitBoundingBox && mapLoaded && searchCompleted) { + if (props.fitBoundingBox && data && mapLoaded && searchCompleted) { + // Set the bounding box on the map const boundingBox = MapUtils.getBoundingBox(data, props.buffer); map.fitBounds(boundingBox, props.boundingBoxOptions, props.boundingBoxData); + + // Reset search completed + setSearchCompleted(false); } - }, [mapLoaded, searchCompleted, props.boundingBoxData, props.boundingBoxOptions, props.buffer, props.fitBoundingBox]); + }, boundingBoxDependencies); /** * Sets the mapLoaded state to true. diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index ab2ca863..3aa827bb 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0", + "version": "2.1.1", "description": "A package of components for all things map-related.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index 3f93b001..8655b142 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.1.0", + "version": "2.1.1", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "zotero-translation-client": "^5.0.1" }, "peerDependencies": { - "@performant-software/shared-components": "^2.1.0", + "@performant-software/shared-components": "^2.1.1", "@samvera/clover-iiif": "^2.3.2", "react": ">= 16.13.1 < 19.0.0", "react-dnd": "^11.1.3", diff --git a/packages/shared/package.json b/packages/shared/package.json index 5216eced..914cadc1 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0", + "version": "2.1.1", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 47c6d089..8d4467c4 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "2.1.0", + "version": "2.1.1", "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", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.1.0", - "@performant-software/shared-components": "^2.1.0", + "@performant-software/semantic-components": "^2.1.1", + "@performant-software/shared-components": "^2.1.1", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/visualize/package.json b/packages/visualize/package.json index b2dcaa67..4bb589f5 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0", + "version": "2.1.1", "description": "A package of components used for data visualization", "license": "MIT", "main": "./dist/index.cjs.js", diff --git a/react-components.json b/react-components.json index 3c13c2f0..17410dd2 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0" + "version": "2.1.1" }