From 23ffe2f16fd08304c879ded815d22a0c9d24b49c Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Wed, 13 Mar 2024 15:51:17 -0400 Subject: [PATCH 001/109] Atlas #1 - Adding first-pass at Typesense utility components --- packages/core-data/package.json | 3 + .../PersistentSearchStateContextProvider.js | 46 +++++++ .../src/components/RefinementListProxy.js | 15 +++ .../src/context/PersistentSearchState.js | 16 +++ .../core-data/src/hooks/ProgressiveSearch.js | 92 ++++++++++++++ packages/core-data/src/hooks/Typesense.js | 31 +++++ packages/core-data/src/index.js | 10 ++ packages/core-data/src/types/RuntimeConfig.js | 41 +++++++ .../src/types/typesense/SearchResult.js | 14 +++ packages/core-data/src/utils/Peripleo.js | 52 ++++++++ packages/core-data/src/utils/Typesense.js | 116 ++++++++++++++++++ yarn.lock | 85 ++++++++++++- 12 files changed, 517 insertions(+), 4 deletions(-) create mode 100644 packages/core-data/src/components/PersistentSearchStateContextProvider.js create mode 100644 packages/core-data/src/components/RefinementListProxy.js create mode 100644 packages/core-data/src/context/PersistentSearchState.js create mode 100644 packages/core-data/src/hooks/ProgressiveSearch.js create mode 100644 packages/core-data/src/hooks/Typesense.js create mode 100644 packages/core-data/src/types/RuntimeConfig.js create mode 100644 packages/core-data/src/types/typesense/SearchResult.js create mode 100644 packages/core-data/src/utils/Peripleo.js create mode 100644 packages/core-data/src/utils/Typesense.js diff --git a/packages/core-data/package.json b/packages/core-data/package.json index df165008..d984bd01 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -22,11 +22,14 @@ "@radix-ui/react-dialog": "^1.0.5", "@samvera/clover-iiif": "^2.3.2", "@turf/turf": "^6.5.0", + "dequal": "^2.0.3", "i18next": "^23.8.2", + "instantsearch.js": "^4.66.0", "lucide-react": "^0.321.0", "react-instantsearch": "^7.5.4", "react-virtualized-auto-sizer": "^1.0.22", "react-window": "^1.8.10", + "typesense-instantsearch-adapter": "^2.8.0", "underscore": "^1.13.2" }, "peerDependencies": { diff --git a/packages/core-data/src/components/PersistentSearchStateContextProvider.js b/packages/core-data/src/components/PersistentSearchStateContextProvider.js new file mode 100644 index 00000000..867645f8 --- /dev/null +++ b/packages/core-data/src/components/PersistentSearchStateContextProvider.js @@ -0,0 +1,46 @@ +// @flow + +import React, { useMemo, type ReactNode } from 'react'; +import PersistentSearchStateContext from '../context/PersistentSearchState'; +import useProgressiveSearch from '../hooks/ProgressiveSearch'; + +type Props = { + geoSearch: any, + infiniteHits: any, + searchBox: any, + children: ReactNode +}; + +const PersistentSearchStateContextProvider = (props: Props) => { + const { geoSearch, infiniteHits, searchBox } = props; + const { cachedHits, observe, unobserve } = useProgressiveSearch(infiniteHits); + + /** + * Memoizes the context value. + * + * @type {{ + * unobserve: function(OnCompleteCallback): void, + * geoSearch: *, + * cachedHits: TypesenseSearchResult[], + * observe: function(OnCompleteCallback): void, + * searchBox: * + * }} + */ + const value = useMemo(() => ({ + cachedHits, + geoSearch, + searchBox, + observe, + unobserve + }), [cachedHits, geoSearch, searchBox, observe, unobserve]); + + return ( + + { props.children } + + ); +}; + +export default PersistentSearchStateContextProvider; diff --git a/packages/core-data/src/components/RefinementListProxy.js b/packages/core-data/src/components/RefinementListProxy.js new file mode 100644 index 00000000..8600823b --- /dev/null +++ b/packages/core-data/src/components/RefinementListProxy.js @@ -0,0 +1,15 @@ +// @flow + +type Props = { + useRefinementList: (props: any) => void; +}; + +const RefinementListProxy = ({ useRefinementList, ...props }: Props) => { + // Just a trick to have an empty component that keeps this + // facet mounted, while the GUI element mounts and unmounts + useRefinementList(props); + + return null; +}; + +export default RefinementListProxy; diff --git a/packages/core-data/src/context/PersistentSearchState.js b/packages/core-data/src/context/PersistentSearchState.js new file mode 100644 index 00000000..a44beafa --- /dev/null +++ b/packages/core-data/src/context/PersistentSearchState.js @@ -0,0 +1,16 @@ +// @flow + +import { createContext } from 'react'; +import type { SearchResult } from '../types/typesense/SearchResult'; + +type PersistentSearchStateContextType = { + cachedHits: Array, + geoSearch: any, + searchBox: any, + observe: (callback: ((hits: Array) => void)) => void, + unobserve: (callback: ((hits: Array) => void)) => void +}; + +const PersistentSearchStateContext = createContext(undefined); + +export default PersistentSearchStateContext; diff --git a/packages/core-data/src/hooks/ProgressiveSearch.js b/packages/core-data/src/hooks/ProgressiveSearch.js new file mode 100644 index 00000000..e70adcc2 --- /dev/null +++ b/packages/core-data/src/hooks/ProgressiveSearch.js @@ -0,0 +1,92 @@ +// @flow + +import { dequal } from 'dequal/lite'; +import { + useCallback, + useEffect, + useRef, + useState +} from 'react'; +import type { SearchResult } from '../types/typesense/SearchResult'; +import TypesenseUtils from '../utils/Typesense'; + +type OnCompleteCallback = (results: Array) => void; + +const useProgressiveSearch = (infiniteHits) => { + const [cachedHits, setCachedHits] = useState(TypesenseUtils.createCachedHits([])); + + const lastSearchState = useRef(); + const callbacks = useRef>([]); + + /** + * Adds the passed callback to the list of callbacks. + * + * @type {(function(OnCompleteCallback): void)|*} + */ + const observe = useCallback((callback: OnCompleteCallback) => { + callbacks.current = [...callbacks.current, callback]; + }, []); + + /** + * Removes the passed callback from the list of callbacks. + * + * @type {(function(OnCompleteCallback): void)|*} + */ + const unobserve = useCallback((callback: OnCompleteCallback) => { + callbacks.current = callbacks.current.filter((c) => c !== callback); + }, []); + + /** + * Returns true if the state has changed. + * + * @param a + * @param b + * @param ignorePageNo + * + * @returns {boolean} + */ + const hasStateChanged = (a: any, b: any, ignorePageNo?: boolean) => { + if (ignorePageNo && a) { + // eslint-disable-next-line no-param-reassign + delete a.page; + } + + if (ignorePageNo && b) { + // eslint-disable-next-line no-param-reassign + delete b.page; + } + + return !dequal(a, b); + }; + + useEffect(() => { + const { results } = infiniteHits; + + const isFirstPage = results.page === 0; + const isLastPage = results.page + 1 >= results.nbPages; + + const hits = TypesenseUtils.normalizeResults(results.hits); + + // Add to cache and load next page + if (isFirstPage && hasStateChanged(results._state, lastSearchState.current, true)) { + setCachedHits(() => TypesenseUtils.createCachedHits(hits)); + } else { + setCachedHits(({ merge }) => merge(hits)); + } + + if (!isLastPage && infiniteHits.showMore) { + setTimeout(() => infiniteHits.showMore(), 25); + } else if (hasStateChanged(results._state, lastSearchState.current)) { + callbacks.current.forEach((callback) => { + const merged = cachedHits.merge(hits); + callback(merged.hits); + }); + } + + lastSearchState.current = results._state; + }, [infiniteHits.results]); + + return { cachedHits: cachedHits.hits, observe, unobserve }; +}; + +export default useProgressiveSearch; diff --git a/packages/core-data/src/hooks/Typesense.js b/packages/core-data/src/hooks/Typesense.js new file mode 100644 index 00000000..aabef914 --- /dev/null +++ b/packages/core-data/src/hooks/Typesense.js @@ -0,0 +1,31 @@ +// @flow + +import { useContext, useEffect } from 'react'; +import PersistentSearchStateContext from '../context/PersistentSearchState'; + +export const useCachedHits = () => { + const { cachedHits } = useContext(PersistentSearchStateContext); + return cachedHits; +}; + +export const useSearchBox = () => { + const { searchBox } = useContext(PersistentSearchStateContext); + return searchBox; +}; + +export const useGeoSearch = () => { + const { geoSearch } = useContext(PersistentSearchStateContext); + return geoSearch; +}; + +export const useSearchCompleted = (callback: ((hits: TypesenseSearchResult[]) => void), deps: Array) => { + const { observe, unobserve } = useContext(PersistentSearchStateContext); + + useEffect(() => { + observe(callback); + + return () => { + unobserve(callback); + }; + }, deps); +}; diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index b66872e9..bd0ba3f4 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -6,9 +6,11 @@ import './index.css'; // Components export { default as LoadAnimation } from './components/LoadAnimation'; export { default as MediaGallery } from './components/MediaGallery'; +export { default as PersistentSearchStateContextProvider } from './components/PersistentSearchStateContextProvider'; export { default as PlaceDetailsPanel } from './components/PlaceDetailsPanel'; export { default as PlaceMarkers } from './components/PlaceMarkers'; export { default as PlaceResultsList } from './components/PlaceResultsList'; +export { default as RefinementListProxy } from './components/RefinementListProxy'; export { default as RelatedItemsList } from './components/RelatedItemsList'; export { default as RelatedList } from './components/RelatedList'; export { default as RelatedMedia } from './components/RelatedMedia'; @@ -16,3 +18,11 @@ export { default as RelatedOrganization } from './components/RelatedOrganization export { default as RelatedPeople } from './components/RelatedPeople'; export { default as RelatedPlaces } from './components/RelatedPlaces'; export { default as RelatedTaxonomies } from './components/RelatedTaxonomies'; + +// Hooks +export { default as useProgressiveSearch } from './hooks/ProgressiveSearch'; +export * from './hooks/Typesense'; + +// Utilities +export { default as Peripleo } from './utils/Peripleo'; +export { default as Typesense } from './utils/Typesense'; diff --git a/packages/core-data/src/types/RuntimeConfig.js b/packages/core-data/src/types/RuntimeConfig.js new file mode 100644 index 00000000..960ce30e --- /dev/null +++ b/packages/core-data/src/types/RuntimeConfig.js @@ -0,0 +1,41 @@ +// @flow + +export type RuntimeConfig = { + branding: { + title?: string, + map_style: string, + related?: Array<{ + endpoint: string, + ui_label: string, + default_open?: boolean + }> + }, + layers: Array<{ + name: string, + layer_type: 'raster' | 'vector' | 'geojson', + overlay?: boolean, + url: string, + description?: string, + tilesize?: number, + attribution?: string, + minzoom?: number, + maxzoom?: number + }>, + typesense: { + host: string, + port?: number, + protocol?: 'http' | 'https', + api_key: string, + index_name: string, + query_by: string, + limit?: number, + facets?: { + include?: string[], + exclude?: string[] + } + }, + core_data: { + project_ids: number[], + url: string + } +}; diff --git a/packages/core-data/src/types/typesense/SearchResult.js b/packages/core-data/src/types/typesense/SearchResult.js new file mode 100644 index 00000000..8ea95ac2 --- /dev/null +++ b/packages/core-data/src/types/typesense/SearchResult.js @@ -0,0 +1,14 @@ +// @flow + +export type SearchResult = { + uuid: string, + record_id: string, + type: string, + name: string, + names: Array, + coordinates: Array, + geometry: { + type: 'Point' | 'GeometryCollection', + coordinates: [ number, number ] + } +}; diff --git a/packages/core-data/src/utils/Peripleo.js b/packages/core-data/src/utils/Peripleo.js new file mode 100644 index 00000000..d75353aa --- /dev/null +++ b/packages/core-data/src/utils/Peripleo.js @@ -0,0 +1,52 @@ +// @flow + +import _ from 'underscore'; +import type { RuntimeConfig } from '../types/RuntimeConfig'; + +/** + * Moves the layers into separate base layers and data layers. + * + * @param config + * + * @returns * + */ +const filterLayers = (config: RuntimeConfig) => { + const baselayers = _.filter(config.layers, (l) => !l.loverlay); + const datalayers = _.filter(config.layers, (l) => l.overlay); + + return { ...config, baselayers, datalayers }; +}; + +/** + * Normalizes the passed runtime config. + * + * @param config + * + * @returns * + */ +const normalize = (config: RuntimeConfig) => ({ + ...config, + layers: config.layers || [], + typesense: { + ...config.typesense, + host: config.typesense.host || '443', + protocol: config.typesense.protocol || 'https' + }, + core_data: { + ...config.core_data, + + // Remove trailing slash if any + url: config.core_data.url.endsWith('/') + ? config.core_data.url.substring(0, config.core_data.url.length - 1) + : config.core_data.url, + + project_ids: Array.isArray(config.core_data.project_ids) + ? config.core_data.project_ids + : [config.core_data.project_ids] + } +}); + +export default { + filterLayers, + normalize +}; diff --git a/packages/core-data/src/utils/Typesense.js b/packages/core-data/src/utils/Typesense.js new file mode 100644 index 00000000..a4852796 --- /dev/null +++ b/packages/core-data/src/utils/Typesense.js @@ -0,0 +1,116 @@ +// @flow + +import { history } from 'instantsearch.js/es/lib/routers'; +import TypesenseInstantsearchAdapter from 'typesense-instantsearch-adapter'; +import type { RuntimeConfig } from '../types/RuntimeConfig'; +import type { TypesenseSearchResult } from '../types/typesense/SearchResult'; + +const createCachedHits = (hits: TypesenseSearchResult[]) => { + const ids = new Set(hits.map((h) => h.uuid)); + + // De-duplication: drop all hits that are already in the list, append the rest + const merge = (toMerge: TypesenseSearchResult[]) => { + const toAppend = toMerge.filter((h) => !ids.has(h.uuid)); + return createCachedHits([...hits, ...toAppend]); + }; + + return { hits, merge }; +}; + +const createRouting = (config: RuntimeConfig) => ({ + router: history({ + cleanUrlOnDispose: false + }), + stateMapping: { + stateToRoute: (state: any) => { + const uiState = state[config.typesense.index_name]; + const { refinementList } = uiState; + + let route = { + q: uiState.query + }; + + if (refinementList) { + route = { + ...route, + ...refinementList + }; + } + + return route; + }, + + routeToState: (state: any) => { + const { q, ...facets } = state; + + const uiState = { + [config.typesense.index_name]: { + query: q, + } + }; + + if (Object.keys(facets).length > 0) { + uiState[config.typesense.index_name].refinementList = facets; + } + + return uiState; + } + } +}); + +const createTypesenseAdapter = (config: RuntimeConfig, options = {}) => ( + new TypesenseInstantsearchAdapter({ + server: { + apiKey: config.typesense.api_key, + nodes: [ + { + host: config.typesense.host, + port: config.typesense.port || 443, + protocol: config.typesense.protocol || 'https' + } + ], + cacheSearchResultsForSeconds: 120 + }, + geoLocationField: 'coordinates', + additionalSearchParameters: { + query_by: config.typesense.query_by, + limit: config.typesense.limit || 250 + }, + ...options + }) +); + +/** + * Necessary normalization steps to make the TypeSense result work + * for visualization. Currently, these include: + * + * - Removing places without coordinates + */ +const normalizeResults = (results: Array) => results.filter((h) => h.coordinates); + +const toFeature = (result: TypesenseSearchResult) => ({ + id: parseInt(result.record_id, 10), + type: 'Feature', + properties: { + id: result.record_id, + ccode: [], + title: result.name, + uuid: result.uuid, + record_id: result.record_id, + name: result.name, + names: result.names.map((toponym: string) => ({ toponym })), + type: result.type + }, + geometry: { + type: 'Point', + coordinates: result.coordinates.slice().reverse() + } +}); + +export default { + createCachedHits, + createRouting, + createTypesenseAdapter, + normalizeResults, + toFeature +}; diff --git a/yarn.lock b/yarn.lock index 5490fada..e847f8e5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6050,6 +6050,13 @@ algoliasearch-helper@3.16.2: dependencies: "@algolia/events" "^4.0.1" +algoliasearch-helper@3.16.3: + version "3.16.3" + resolved "https://registry.yarnpkg.com/algoliasearch-helper/-/algoliasearch-helper-3.16.3.tgz#38c3a18e278306f565823cc7f3dd706825b4bfb9" + integrity sha512-1OuJT6sONAa9PxcOmWo5WCAT3jQSpCR9/m5Azujja7nhUQwAUDvaaAYrcmUySsrvHh74usZHbE3jFfGnWtZj8w== + dependencies: + "@algolia/events" "^4.0.1" + ansi-colors@^4.1.1: version "4.1.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" @@ -6358,7 +6365,7 @@ axe-core@^4.2.0: resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.8.3.tgz#205df863dd9917d5979e9435dab4d47692759051" integrity sha512-d5ZQHPSPkF9Tw+yfyDcRoUOc4g/8UloJJe5J8m4L5+c7AtDdjDLRxew/knnI4CxvtdxEUVgWz4x3OIQUIFiMfw== -axios@^0.26.1: +axios@^0.26.0, axios@^0.26.1: version "0.26.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== @@ -9612,6 +9619,13 @@ ini@^1.3.5: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== +instantsearch-ui-components@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/instantsearch-ui-components/-/instantsearch-ui-components-0.4.0.tgz#0aabc136107b1adac42bbb93c6dc3cfb1942b24e" + integrity sha512-Isa9Ankm89e9PUXsUto6TxYzcQpXKlWZMsKLXc//dO4i9q5JS8s0Es+c+U65jRLK2j1DiVlNx/Z6HshRIZwA8w== + dependencies: + "@babel/runtime" "^7.1.2" + instantsearch.js@4.64.2: version "4.64.2" resolved "https://registry.yarnpkg.com/instantsearch.js/-/instantsearch.js-4.64.2.tgz#e0780c1a86e231547218836221dea1cf54b565e8" @@ -9631,6 +9645,24 @@ instantsearch.js@4.64.2: qs "^6.5.1 < 6.10" search-insights "^2.13.0" +instantsearch.js@^4.66.0: + version "4.66.0" + resolved "https://registry.yarnpkg.com/instantsearch.js/-/instantsearch.js-4.66.0.tgz#86107edd260918cb498d9a9d4d8ba60fd745a55a" + integrity sha512-85HVTVBfO0QUBPfbCx2wPE9wEsnWQqWl8IHEOni4567IhH//CwbWv8PwHhT7rBrxSCHsxrgnMTe5dFMz7yc+/A== + dependencies: + "@algolia/events" "^4.0.1" + "@types/dom-speech-recognition" "^0.0.1" + "@types/google.maps" "^3.45.3" + "@types/hogan.js" "^3.0.0" + "@types/qs" "^6.5.3" + algoliasearch-helper "3.16.3" + hogan.js "^3.0.2" + htm "^3.0.0" + instantsearch-ui-components "0.4.0" + preact "^10.10.0" + qs "^6.5.1 < 6.10" + search-insights "^2.13.0" + internal-slot@^1.0.5: version "1.0.6" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.6.tgz#37e756098c4911c5e912b8edbf71ed3aa116f930" @@ -10922,6 +10954,11 @@ log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" +loglevel@^1.8.0: + version "1.9.1" + resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.9.1.tgz#d63976ac9bcd03c7c873116d41c2a85bafff1be7" + integrity sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg== + loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" @@ -13667,7 +13704,16 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -13741,7 +13787,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -14304,6 +14357,21 @@ typesafe-actions@^5.1.0: resolved "https://registry.yarnpkg.com/typesafe-actions/-/typesafe-actions-5.1.0.tgz#9afe8b1e6a323af1fd59e6a57b11b7dd6623d2f1" integrity sha512-bna6Yi1pRznoo6Bz1cE6btB/Yy8Xywytyfrzu/wc+NFW3ZF0I+2iCGImhBsoYYCOWuICtRO4yHcnDlzgo1AdNg== +typesense-instantsearch-adapter@^2.8.0: + version "2.8.0" + resolved "https://registry.yarnpkg.com/typesense-instantsearch-adapter/-/typesense-instantsearch-adapter-2.8.0.tgz#2c01d00957cef97df5a941f55bced072013300bb" + integrity sha512-2q4QVpHoUV0ncf1XOqIC0dufOTkFRxQ0mHzg//H3WK02ZYqdNNPCAacZODhQlltl1cNJdTI8Y4uuGVd6fJuGzw== + dependencies: + typesense "^1.7.2" + +typesense@^1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/typesense/-/typesense-1.7.2.tgz#d62351f56486db43a9f48b4d354801b9e5fb95e9" + integrity sha512-hgQESOiyNJq+w2mpRJa/a1UMhWtJ/+sb0p7NoeCDSkikm9sasisJdnc7uhQchM6vTWKw2sMLWUBNbAhItR6zUQ== + dependencies: + axios "^0.26.0" + loglevel "^1.8.0" + typewise-core@^1.2, typewise-core@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/typewise-core/-/typewise-core-1.2.0.tgz#97eb91805c7f55d2f941748fa50d315d991ef195" @@ -14912,7 +14980,7 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -14930,6 +14998,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" From e978706af299bd4348343c3302a4f9fdcf6afc9b Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 14 Mar 2024 07:00:25 -0400 Subject: [PATCH 002/109] Atlas #1 - Publishing v2.1.0-beta.3 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 7ce8960a..40d291f0 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "2.0.0", + "version": "2.1.0-beta.3", "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.0.0", - "@performant-software/shared-components": "^2.0.0", + "@performant-software/semantic-components": "^2.1.0-beta.3", + "@performant-software/shared-components": "^2.1.0-beta.3", "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 d984bd01..ba185c23 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/core-data", - "version": "2.0.0", + "version": "2.1.0-beta.3", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.0.0", + "@performant-software/geospatial": "^2.1.0-beta.3", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, @@ -48,4 +48,4 @@ "tailwindcss": "^3.4.1", "vite": "^5.1.4" } -} +} \ No newline at end of file diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 560234e5..6a778841 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.0.0", + "version": "2.1.0-beta.3", "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 9f226304..7f3fd2c6 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "2.0.0", + "version": "2.1.0-beta.3", "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.0.0", + "@performant-software/shared-components": "^2.1.0-beta.3", "@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 b2a554f7..1e9adce9 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.0.0", + "version": "2.1.0-beta.3", "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 640b4566..17136bdd 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.0.0", + "version": "2.1.0-beta.3", "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.0.0", - "@performant-software/shared-components": "^2.0.0", + "@performant-software/semantic-components": "^2.1.0-beta.3", + "@performant-software/shared-components": "^2.1.0-beta.3", "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 3eb6206d..07b09bb9 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.0.0", + "version": "2.1.0-beta.3", "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 f6337cf2..1cea69c3 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.0.0" + "version": "2.1.0-beta.3" } From ba70aa48e6241fd1919a139032c6e5d1efadb4fb Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 14 Mar 2024 10:51:24 -0400 Subject: [PATCH 003/109] Atlas #1 - Re-generating yarn.lock --- yarn.lock | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/yarn.lock b/yarn.lock index e847f8e5..a07ad52a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1607,6 +1607,14 @@ fast-deep-equal "^3.1.3" supercluster "^8.0.1" +"@headlessui/react@^1.7.18": + version "1.7.18" + resolved "https://registry.yarnpkg.com/@headlessui/react/-/react-1.7.18.tgz#30af4634d2215b2ca1aa29d07f33d02bea82d9d7" + integrity sha512-4i5DOrzwN4qSgNsL4Si61VMkUcWbcSKueUV7sFhpHzQcSShdlHENE5+QBntMSRvHt8NyoFO2AGG8si9lq+w4zQ== + dependencies: + "@tanstack/react-virtual" "^3.0.0-beta.60" + client-only "^0.0.1" + "@humanwhocodes/config-array@^0.5.0": version "0.5.0" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9" @@ -3928,6 +3936,18 @@ resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.5.tgz#043b731d4f56a79b4897a3de1af35e75d56bc63a" integrity sha512-myfUej5naTBWnqOCc/MdVOLVjXUXtIA+NpDrDBKJtLLg2shUjBu3cZmB/85RyitKc55+lUUyl7oRfLOvkr2hsw== +"@tanstack/react-virtual@^3.0.0-beta.60": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@tanstack/react-virtual/-/react-virtual-3.1.3.tgz#4ef2a7dd819a7dd2b634d50cbd6ba498f06529ec" + integrity sha512-YCzcbF/Ws/uZ0q3Z6fagH+JVhx4JLvbSflgldMgLsuvB8aXjZLLb3HvrEVxY480F9wFlBiXlvQxOyXb5ENPrNA== + dependencies: + "@tanstack/virtual-core" "3.1.3" + +"@tanstack/virtual-core@3.1.3": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@tanstack/virtual-core/-/virtual-core-3.1.3.tgz#77ced625f19ec9350f6e460f142b3be9bff03866" + integrity sha512-Y5B4EYyv1j9V8LzeAoOVeTg0LI7Fo5InYKgAjkY1Pu9GjtUwX/EKxNcU7ng3sKr99WEf+bPTcktAeybyMOYo+g== + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -6350,6 +6370,18 @@ autoprefixer@^10.4.17: picocolors "^1.0.0" postcss-value-parser "^4.2.0" +autoprefixer@^10.4.18: + version "10.4.18" + resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.18.tgz#fcb171a3b017be7cb5d8b7a825f5aacbf2045163" + integrity sha512-1DKbDfsr6KUElM6wg+0zRNkB/Q7WcKYAaK+pzXn+Xqmszm/5Xa9coeNdtP88Vi+dPzZnMjhge8GIV49ZQkDa+g== + dependencies: + browserslist "^4.23.0" + caniuse-lite "^1.0.30001591" + fraction.js "^4.3.7" + normalize-range "^0.1.2" + picocolors "^1.0.0" + postcss-value-parser "^4.2.0" + available-typed-arrays@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" @@ -6654,6 +6686,16 @@ browserslist@^4.21.10, browserslist@^4.22.2: node-releases "^2.0.14" update-browserslist-db "^1.0.13" +browserslist@^4.23.0: + version "4.23.0" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.0.tgz#8f3acc2bbe73af7213399430890f86c63a5674ab" + integrity sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ== + dependencies: + caniuse-lite "^1.0.30001587" + electron-to-chromium "^1.4.668" + node-releases "^2.0.14" + update-browserslist-db "^1.0.13" + bser@2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" @@ -6759,6 +6801,11 @@ caniuse-lite@^1.0.30001580: resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz#0dfd4db9e94edbdca67d57348ebc070dece279f4" integrity sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ== +caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001591: + version "1.0.30001597" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001597.tgz#8be94a8c1d679de23b22fbd944232aa1321639e6" + integrity sha512-7LjJvmQU6Sj7bL0j5b5WY/3n7utXUJvAe1lxhsHDbLmwX9mdL86Yjtr+5SRCyf8qME4M7pU2hswj0FpyBVCv9w== + canvas@^2.11.2: version "2.11.2" resolved "https://registry.yarnpkg.com/canvas/-/canvas-2.11.2.tgz#553d87b1e0228c7ac0fc72887c3adbac4abbd860" @@ -6920,6 +6967,11 @@ cli-table3@^0.6.1: optionalDependencies: "@colors/colors" "1.5.0" +client-only@^0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/client-only/-/client-only-0.0.1.tgz#38bba5d403c41ab150bff64a95c85013cf73bca1" + integrity sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA== + cliui@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" @@ -7834,6 +7886,11 @@ electron-to-chromium@^1.4.648: resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.650.tgz#b38ef9de16991b9f7b924246770576ab91ab3d64" integrity sha512-sYSQhJCJa4aGA1wYol5cMQgekDBlbVfTRavlGZVr3WZpDdOPcp6a6xUnFfrt8TqZhsBYYbDxJZCjGfHuGupCRQ== +electron-to-chromium@^1.4.668: + version "1.4.705" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.705.tgz#ef4f912620bd7c9555a20554ffc568184c0ddceb" + integrity sha512-LKqhpwJCLhYId2VVwEzFXWrqQI5n5zBppz1W9ehhTlfYU8CUUW6kClbN8LHF/v7flMgRdETS772nqywJ+ckVAw== + emittery@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.8.1.tgz#bb23cc86d03b30aa75a7f734819dee2e1ba70860" From d94c0fb75950f91d458ce97905d42a34e176c9f4 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 14 Mar 2024 10:56:06 -0400 Subject: [PATCH 004/109] Atlas #1 - Publishing v2.1.0-beta.4 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 40d291f0..48d1870f 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-beta.3", + "version": "2.1.0-beta.4", "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-beta.3", - "@performant-software/shared-components": "^2.1.0-beta.3", + "@performant-software/semantic-components": "^2.1.0-beta.4", + "@performant-software/shared-components": "^2.1.0-beta.4", "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 ba185c23..67f5be65 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-beta.3", + "version": "2.1.0-beta.4", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.3", + "@performant-software/geospatial": "^2.1.0-beta.4", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 6a778841..bccdfb9f 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.3", + "version": "2.1.0-beta.4", "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 7f3fd2c6..163dbfb9 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-beta.3", + "version": "2.1.0-beta.4", "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-beta.3", + "@performant-software/shared-components": "^2.1.0-beta.4", "@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 1e9adce9..4af2e847 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.3", + "version": "2.1.0-beta.4", "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 17136bdd..10932a90 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-beta.3", + "version": "2.1.0-beta.4", "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-beta.3", - "@performant-software/shared-components": "^2.1.0-beta.3", + "@performant-software/semantic-components": "^2.1.0-beta.4", + "@performant-software/shared-components": "^2.1.0-beta.4", "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 07b09bb9..6fc4e97c 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.3", + "version": "2.1.0-beta.4", "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 1cea69c3..5e021257 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.3" + "version": "2.1.0-beta.4" } From 90940ccf2fac59f20caf6db145d7bf4a0893bfa3 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Fri, 15 Mar 2024 07:01:04 -0400 Subject: [PATCH 005/109] Atlas #1 - Updating "@peripleo/maplibre" dependency to latest version --- packages/geospatial/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index bccdfb9f..e1561864 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -27,7 +27,7 @@ "underscore": "^1.13.6" }, "peerDependencies": { - "@peripleo/maplibre": "^0.3.3", + "@peripleo/maplibre": "^0.4.1", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, From 4f9fdbc3fd3f3ee825c547fafcf4728a0de1afe2 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Fri, 15 Mar 2024 07:04:52 -0400 Subject: [PATCH 006/109] Atlas #1 - Publishing v2.1.0-beta.5 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 48d1870f..1faac435 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-beta.4", + "version": "2.1.0-beta.5", "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-beta.4", - "@performant-software/shared-components": "^2.1.0-beta.4", + "@performant-software/semantic-components": "^2.1.0-beta.5", + "@performant-software/shared-components": "^2.1.0-beta.5", "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 67f5be65..aee07037 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-beta.4", + "version": "2.1.0-beta.5", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.4", + "@performant-software/geospatial": "^2.1.0-beta.5", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index e1561864..8b036138 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.4", + "version": "2.1.0-beta.5", "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 163dbfb9..f2393eac 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-beta.4", + "version": "2.1.0-beta.5", "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-beta.4", + "@performant-software/shared-components": "^2.1.0-beta.5", "@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 4af2e847..6b92b85b 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.4", + "version": "2.1.0-beta.5", "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 10932a90..e5a3cb27 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-beta.4", + "version": "2.1.0-beta.5", "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-beta.4", - "@performant-software/shared-components": "^2.1.0-beta.4", + "@performant-software/semantic-components": "^2.1.0-beta.5", + "@performant-software/shared-components": "^2.1.0-beta.5", "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 6fc4e97c..a23b54cd 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.4", + "version": "2.1.0-beta.5", "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 5e021257..1337312f 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.4" + "version": "2.1.0-beta.5" } From cbfd7991b19f91fad897768da8e084e61bacf23e Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 09:48:47 -0400 Subject: [PATCH 007/109] Atlas #2 - Adding optional "layerId" prop to LocationMarkers component --- packages/geospatial/src/components/LocationMarkers.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/geospatial/src/components/LocationMarkers.js b/packages/geospatial/src/components/LocationMarkers.js index ba8d59e3..a2d0bdc4 100644 --- a/packages/geospatial/src/components/LocationMarkers.js +++ b/packages/geospatial/src/components/LocationMarkers.js @@ -26,6 +26,11 @@ type Props = { */ fillStyle?: { [key: string]: any }, + /** + * An ID value to apply to the layer. + */ + layerId?: string, + /** * GeoJSON layer point style. */ @@ -65,6 +70,7 @@ const LocationMarkers = (props: Props) => { From e173be12fab36cbe8df9a5c0fc03ad25fbd73e70 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 09:49:50 -0400 Subject: [PATCH 008/109] Atlas #2 - Adding "truncate" function to /shared/utils/String --- packages/shared/src/utils/String.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/shared/src/utils/String.js b/packages/shared/src/utils/String.js index 2c7d8c16..d2dc76f1 100644 --- a/packages/shared/src/utils/String.js +++ b/packages/shared/src/utils/String.js @@ -14,7 +14,20 @@ const toString = (value: any) => { return value || ''; }; +const truncate = (str: string, length: number) => { + if (!str) { + return null; + } + + if (!length || length > str.length) { + return str; + } + + return str.substring(0, length).trim(); +}; + export default { includes, - toString + toString, + truncate }; From 8a2134bd209627ac01918572b42e0349f53ad5da Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 10:33:51 -0400 Subject: [PATCH 009/109] Atlas #2 - Publishing v2.1.0-beta.6 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 1faac435..dcadd2bb 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-beta.5", + "version": "2.1.0-beta.6", "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-beta.5", - "@performant-software/shared-components": "^2.1.0-beta.5", + "@performant-software/semantic-components": "^2.1.0-beta.6", + "@performant-software/shared-components": "^2.1.0-beta.6", "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 aee07037..edc48ba5 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-beta.5", + "version": "2.1.0-beta.6", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.5", + "@performant-software/geospatial": "^2.1.0-beta.6", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 8b036138..a2ad8836 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.5", + "version": "2.1.0-beta.6", "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 f2393eac..7b230097 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-beta.5", + "version": "2.1.0-beta.6", "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-beta.5", + "@performant-software/shared-components": "^2.1.0-beta.6", "@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 6b92b85b..d0d67b14 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.5", + "version": "2.1.0-beta.6", "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 e5a3cb27..0b243f48 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-beta.5", + "version": "2.1.0-beta.6", "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-beta.5", - "@performant-software/shared-components": "^2.1.0-beta.5", + "@performant-software/semantic-components": "^2.1.0-beta.6", + "@performant-software/shared-components": "^2.1.0-beta.6", "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 a23b54cd..50c9f7b3 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.5", + "version": "2.1.0-beta.6", "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 1337312f..0966cdea 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.5" + "version": "2.1.0-beta.6" } From ae98e670aae903797d43a35a029818ab3d7d7a98 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 11:35:21 -0400 Subject: [PATCH 010/109] Atlas #2 - Refactoring TypesenseUtils toFeature to use turfjs; Adding toFeatureCollection --- packages/core-data/src/utils/Typesense.js | 35 ++++++++++++++++------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/packages/core-data/src/utils/Typesense.js b/packages/core-data/src/utils/Typesense.js index a4852796..6fd38e12 100644 --- a/packages/core-data/src/utils/Typesense.js +++ b/packages/core-data/src/utils/Typesense.js @@ -1,7 +1,9 @@ // @flow +import { feature, featureCollection, point } from '@turf/turf'; import { history } from 'instantsearch.js/es/lib/routers'; import TypesenseInstantsearchAdapter from 'typesense-instantsearch-adapter'; +import _ from 'underscore'; import type { RuntimeConfig } from '../types/RuntimeConfig'; import type { TypesenseSearchResult } from '../types/typesense/SearchResult'; @@ -88,10 +90,16 @@ const createTypesenseAdapter = (config: RuntimeConfig, options = {}) => ( */ const normalizeResults = (results: Array) => results.filter((h) => h.coordinates); -const toFeature = (result: TypesenseSearchResult) => ({ - id: parseInt(result.record_id, 10), - type: 'Feature', - properties: { +const toFeature = (result: TypesenseSearchResult) => { + let geometry; + + if (result.coordinates) { + geometry = point(result.coordinates); + } else { + geometry = result.geometry; + } + + const properties = { id: result.record_id, ccode: [], title: result.name, @@ -100,17 +108,22 @@ const toFeature = (result: TypesenseSearchResult) => ({ name: result.name, names: result.names.map((toponym: string) => ({ toponym })), type: result.type - }, - geometry: { - type: 'Point', - coordinates: result.coordinates.slice().reverse() - } -}); + }; + + const id = parseInt(result.record_id, 10); + + return feature(geometry, properties, { id }); +}; + +const toFeatureCollection = (results: Array) => ( + featureCollection(_.map(results, toFeature)) +); export default { createCachedHits, createRouting, createTypesenseAdapter, normalizeResults, - toFeature + toFeature, + toFeatureCollection }; From d25d23909f6afaeed5ac834c8fe60c5df671970f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 11:47:36 -0400 Subject: [PATCH 011/109] Atlas #2 - Publishing v2.1.0-beta.7 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index dcadd2bb..375de298 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-beta.6", + "version": "2.1.0-beta.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", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.1.0-beta.6", - "@performant-software/shared-components": "^2.1.0-beta.6", + "@performant-software/semantic-components": "^2.1.0-beta.7", + "@performant-software/shared-components": "^2.1.0-beta.7", "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 edc48ba5..4e307123 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-beta.6", + "version": "2.1.0-beta.7", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.6", + "@performant-software/geospatial": "^2.1.0-beta.7", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index a2ad8836..b4a936bd 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.6", + "version": "2.1.0-beta.7", "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 7b230097..05beb7d7 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-beta.6", + "version": "2.1.0-beta.7", "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-beta.6", + "@performant-software/shared-components": "^2.1.0-beta.7", "@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 d0d67b14..75986f3e 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.6", + "version": "2.1.0-beta.7", "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 0b243f48..ecc1d337 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-beta.6", + "version": "2.1.0-beta.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", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.1.0-beta.6", - "@performant-software/shared-components": "^2.1.0-beta.6", + "@performant-software/semantic-components": "^2.1.0-beta.7", + "@performant-software/shared-components": "^2.1.0-beta.7", "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 50c9f7b3..dbcf2e74 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.6", + "version": "2.1.0-beta.7", "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 0966cdea..47bf4d00 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.6" + "version": "2.1.0-beta.7" } From aeaf6bf7bd5157a8e1e56b0f4ead46251d3e6103 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 11:48:35 -0400 Subject: [PATCH 012/109] Atlas #2 - Updating toFeature to correctly get point geometry from coordinates --- packages/core-data/src/utils/Typesense.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-data/src/utils/Typesense.js b/packages/core-data/src/utils/Typesense.js index 6fd38e12..f14c3697 100644 --- a/packages/core-data/src/utils/Typesense.js +++ b/packages/core-data/src/utils/Typesense.js @@ -94,7 +94,7 @@ const toFeature = (result: TypesenseSearchResult) => { let geometry; if (result.coordinates) { - geometry = point(result.coordinates); + geometry = point(result.coordinates.slice().reverse()); } else { geometry = result.geometry; } From ea94822ec37edd055b9009c993ff0c9ad5accf8e Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 11:53:49 -0400 Subject: [PATCH 013/109] Atlas #2 - Publishing v2.1.0-beta.8 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 375de298..69805e5d 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-beta.7", + "version": "2.1.0-beta.8", "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-beta.7", - "@performant-software/shared-components": "^2.1.0-beta.7", + "@performant-software/semantic-components": "^2.1.0-beta.8", + "@performant-software/shared-components": "^2.1.0-beta.8", "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 4e307123..465e5fc7 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-beta.7", + "version": "2.1.0-beta.8", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.7", + "@performant-software/geospatial": "^2.1.0-beta.8", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index b4a936bd..7cb31eea 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.7", + "version": "2.1.0-beta.8", "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 05beb7d7..c08c919c 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-beta.7", + "version": "2.1.0-beta.8", "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-beta.7", + "@performant-software/shared-components": "^2.1.0-beta.8", "@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 75986f3e..de58899f 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.7", + "version": "2.1.0-beta.8", "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 ecc1d337..e5ac869f 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-beta.7", + "version": "2.1.0-beta.8", "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-beta.7", - "@performant-software/shared-components": "^2.1.0-beta.7", + "@performant-software/semantic-components": "^2.1.0-beta.8", + "@performant-software/shared-components": "^2.1.0-beta.8", "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 dbcf2e74..f66b16a6 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.7", + "version": "2.1.0-beta.8", "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 47bf4d00..ad2a31df 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.7" + "version": "2.1.0-beta.8" } From 2c2d390705fdfef3f98f20cb8c673b476eca136d Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 12:01:17 -0400 Subject: [PATCH 014/109] Atlas #2 - Fixing a bug with the toFeature logic for point geometries --- packages/core-data/src/utils/Typesense.js | 31 +++++++++++++++++------ 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/core-data/src/utils/Typesense.js b/packages/core-data/src/utils/Typesense.js index f14c3697..bd8b3442 100644 --- a/packages/core-data/src/utils/Typesense.js +++ b/packages/core-data/src/utils/Typesense.js @@ -90,14 +90,15 @@ const createTypesenseAdapter = (config: RuntimeConfig, options = {}) => ( */ const normalizeResults = (results: Array) => results.filter((h) => h.coordinates); +/** + * Returns the passed Typesense search result as a GeoJSON feature. + * + * @param result + * + * @returns {*} + */ const toFeature = (result: TypesenseSearchResult) => { - let geometry; - - if (result.coordinates) { - geometry = point(result.coordinates.slice().reverse()); - } else { - geometry = result.geometry; - } + let value; const properties = { id: result.record_id, @@ -112,9 +113,23 @@ const toFeature = (result: TypesenseSearchResult) => { const id = parseInt(result.record_id, 10); - return feature(geometry, properties, { id }); + if (result.coordinates) { + const coordinates = result.coordinates.slice().reverse(); + value = point(coordinates, properties, { id }); + } else { + value = feature(result.geometry, properties, { id }); + } + + return value; }; +/** + * Returns the passed array of Typesense search results as a GeoJSON feature collection. + * + * @param results + * + * @returns {FeatureCollection} + */ const toFeatureCollection = (results: Array) => ( featureCollection(_.map(results, toFeature)) ); From e3e1ceaa437f3648f04bfa4320683012166f158f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 12:33:24 -0400 Subject: [PATCH 015/109] Atlas #2 - Publishing v2.1.0-beta.9 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 69805e5d..beb9ee99 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-beta.8", + "version": "2.1.0-beta.9", "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-beta.8", - "@performant-software/shared-components": "^2.1.0-beta.8", + "@performant-software/semantic-components": "^2.1.0-beta.9", + "@performant-software/shared-components": "^2.1.0-beta.9", "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 465e5fc7..1aadc7d5 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-beta.8", + "version": "2.1.0-beta.9", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.8", + "@performant-software/geospatial": "^2.1.0-beta.9", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 7cb31eea..351119a9 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.8", + "version": "2.1.0-beta.9", "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 c08c919c..203e92e5 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-beta.8", + "version": "2.1.0-beta.9", "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-beta.8", + "@performant-software/shared-components": "^2.1.0-beta.9", "@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 de58899f..da87f8e7 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.8", + "version": "2.1.0-beta.9", "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 e5ac869f..5a68bc70 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-beta.8", + "version": "2.1.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": "./dist/index.cjs.js", @@ -23,8 +23,8 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/semantic-components": "^2.1.0-beta.8", - "@performant-software/shared-components": "^2.1.0-beta.8", + "@performant-software/semantic-components": "^2.1.0-beta.9", + "@performant-software/shared-components": "^2.1.0-beta.9", "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 f66b16a6..5f680fff 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.8", + "version": "2.1.0-beta.9", "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 ad2a31df..4977e752 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.8" + "version": "2.1.0-beta.9" } From cb06526b69ffff33d92b79882df292776f5fd05c Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 12:34:59 -0400 Subject: [PATCH 016/109] Atlas #2 - Updating name of base layers and data layers objects in runtime config --- packages/core-data/src/utils/Peripleo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core-data/src/utils/Peripleo.js b/packages/core-data/src/utils/Peripleo.js index d75353aa..1942a957 100644 --- a/packages/core-data/src/utils/Peripleo.js +++ b/packages/core-data/src/utils/Peripleo.js @@ -11,10 +11,10 @@ import type { RuntimeConfig } from '../types/RuntimeConfig'; * @returns * */ const filterLayers = (config: RuntimeConfig) => { - const baselayers = _.filter(config.layers, (l) => !l.loverlay); - const datalayers = _.filter(config.layers, (l) => l.overlay); + const baseLayers = _.filter(config.layers, (l) => !l.loverlay); + const dataLayers = _.filter(config.layers, (l) => l.overlay); - return { ...config, baselayers, datalayers }; + return { ...config, baseLayers, dataLayers }; }; /** From fffcf465a52994b7d3f69bee5086166fc9f92da2 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 13:02:58 -0400 Subject: [PATCH 017/109] Atlas #2 - Publishing v2.1.0-beta.10 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index beb9ee99..0b0cf76b 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-beta.9", + "version": "2.1.0-beta.10", "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-beta.9", - "@performant-software/shared-components": "^2.1.0-beta.9", + "@performant-software/semantic-components": "^2.1.0-beta.10", + "@performant-software/shared-components": "^2.1.0-beta.10", "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 1aadc7d5..0853e539 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-beta.9", + "version": "2.1.0-beta.10", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.9", + "@performant-software/geospatial": "^2.1.0-beta.10", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 351119a9..36abfcae 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.9", + "version": "2.1.0-beta.10", "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 203e92e5..887031dd 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-beta.9", + "version": "2.1.0-beta.10", "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-beta.9", + "@performant-software/shared-components": "^2.1.0-beta.10", "@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 da87f8e7..a5720db5 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.9", + "version": "2.1.0-beta.10", "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 5a68bc70..bd6cdff9 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-beta.9", + "version": "2.1.0-beta.10", "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-beta.9", - "@performant-software/shared-components": "^2.1.0-beta.9", + "@performant-software/semantic-components": "^2.1.0-beta.10", + "@performant-software/shared-components": "^2.1.0-beta.10", "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 5f680fff..6f541fb8 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.9", + "version": "2.1.0-beta.10", "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 4977e752..e7659cd6 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.9" + "version": "2.1.0-beta.10" } From 9555ec041cb8e8d14d63202baf235fd6579925ed Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 13:07:06 -0400 Subject: [PATCH 018/109] Atlas #2 - Refactoring MapStyles and exporting --- .../geospatial/src/components/GeoJsonLayer.js | 76 +++---------------- .../src/components/LocationMarkers.js | 8 +- packages/geospatial/src/index.js | 1 + packages/geospatial/src/utils/MapStyles.js | 12 ++- 4 files changed, 24 insertions(+), 73 deletions(-) diff --git a/packages/geospatial/src/components/GeoJsonLayer.js b/packages/geospatial/src/components/GeoJsonLayer.js index f2929748..e6c1e4e3 100644 --- a/packages/geospatial/src/components/GeoJsonLayer.js +++ b/packages/geospatial/src/components/GeoJsonLayer.js @@ -1,13 +1,11 @@ // @flow import React, { - useCallback, useEffect, - useMemo, useState } from 'react'; import { Layer, Source } from 'react-map-gl'; -import _ from 'underscore'; +import MapStyles from '../utils/MapStyles'; type Props = { data?: { [key: string]: any }, @@ -17,69 +15,9 @@ type Props = { url?: string }; -const DEFAULT_COLOR = '#CC3333'; -const HIGHLIGHT_COLOR = '#990000'; - -const DEFAULT_FILL_STYLES = { - 'fill-color': DEFAULT_COLOR, - 'fill-opacity': 0.2 -}; - -const DEFAULT_LINE_STYLES = { - 'line-color': HIGHLIGHT_COLOR, - 'line-opacity': 0.6 -}; - -const DEFAULT_POINT_STYLES = { - 'circle-radius': [ - 'interpolate', - ['linear'], - ['number', ['get', 'point_count'], 1], - 0, 4, - 10, 14 - ], - 'circle-stroke-width': 1, - 'circle-color': DEFAULT_COLOR, - 'circle-stroke-color': HIGHLIGHT_COLOR -}; - const GeoJsonLayer = (props: Props) => { const [data, setData] = useState(props.data); - /** - * Returns the layer style for the passed style and default. - * - * @type {function(*, *): *} - */ - const getLayerStyles = useCallback((style, defaultStyle) => _.defaults(style, defaultStyle), []); - - /** - * Sets the fill layer style. - * - * @type {*} - */ - const fillStyle = useMemo(() => ( - getLayerStyles(props.fillStyle, DEFAULT_FILL_STYLES) - ), [getLayerStyles, props.fillStyle]); - - /** - * Sets the line layer style. - * - * @type {*} - */ - const lineStyle = useMemo(() => ( - getLayerStyles(props.lineStyle, DEFAULT_LINE_STYLES) - ), [getLayerStyles, props.lineStyle]); - - /** - * Sets the point layer style. - * - * @type {*} - */ - const pointStyle = useMemo(() => ( - getLayerStyles(props.pointStyle, DEFAULT_POINT_STYLES) - ), [getLayerStyles, props.pointStyle]); - /** * If the data is passed as a URL, fetches the passed URL and sets the response on the state. */ @@ -98,21 +36,27 @@ const GeoJsonLayer = (props: Props) => { > ); }; +GeoJsonLayer.defaultProps = { + fillStyle: MapStyles.fill, + pointStyle: MapStyles.point, + strokeStyle: MapStyles.stroke +}; + export default GeoJsonLayer; diff --git a/packages/geospatial/src/components/LocationMarkers.js b/packages/geospatial/src/components/LocationMarkers.js index a2d0bdc4..977a1ffc 100644 --- a/packages/geospatial/src/components/LocationMarkers.js +++ b/packages/geospatial/src/components/LocationMarkers.js @@ -2,7 +2,7 @@ import { MixedGeoJSONLayer, PulsingMarkerLayer, useMap } from '@peripleo/maplibre'; import React, { useEffect } from 'react'; -import { DEFAULT_FILL_STYLE, DEFAULT_POINT_STYLE, DEFAULT_STROKE_STYLE } from '../utils/MapStyles'; +import MapStyles from '../utils/MapStyles'; import MapUtils from '../utils/Map'; type Props = { @@ -80,9 +80,9 @@ const LocationMarkers = (props: Props) => { LocationMarkers.defaultProps = { buffer: DEFAULT_BUFFER, - fillStyle: DEFAULT_FILL_STYLE, - pointStyle: DEFAULT_POINT_STYLE, - strokeStyle: DEFAULT_STROKE_STYLE + fillStyle: MapStyles.fill, + pointStyle: MapStyles.point, + strokeStyle: MapStyles.stroke }; export default LocationMarkers; diff --git a/packages/geospatial/src/index.js b/packages/geospatial/src/index.js index 6248dc3d..bad0508d 100644 --- a/packages/geospatial/src/index.js +++ b/packages/geospatial/src/index.js @@ -11,3 +11,4 @@ export { default as RasterLayer } from './components/RasterLayer'; // Utils export { default as Map } from './utils/Map'; +export { default as MapStyles } from './utils/MapStyles'; diff --git a/packages/geospatial/src/utils/MapStyles.js b/packages/geospatial/src/utils/MapStyles.js index 2fd25d31..0ad47a7d 100644 --- a/packages/geospatial/src/utils/MapStyles.js +++ b/packages/geospatial/src/utils/MapStyles.js @@ -1,6 +1,6 @@ // @flow -export const DEFAULT_POINT_STYLE = { +const point = { type: 'circle', paint: { 'circle-radius': [ @@ -21,7 +21,7 @@ export const DEFAULT_POINT_STYLE = { } }; -export const DEFAULT_FILL_STYLE = { +const fill = { type: 'fill', paint: { 'fill-color': '#ff623b', @@ -29,10 +29,16 @@ export const DEFAULT_FILL_STYLE = { } }; -export const DEFAULT_STROKE_STYLE = { +const stroke = { type: 'line', paint: { 'line-color': '#ff623b', 'line-opacity': 0.6 } }; + +export default { + point, + fill, + stroke +}; From c86914b79fa61828a65c20b2a68fc4d4168628a3 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 13:25:03 -0400 Subject: [PATCH 019/109] Atlas #2 - Publishing v2.1.0-beta.11 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 0b0cf76b..be05cca8 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-beta.10", + "version": "2.1.0-beta.11", "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-beta.10", - "@performant-software/shared-components": "^2.1.0-beta.10", + "@performant-software/semantic-components": "^2.1.0-beta.11", + "@performant-software/shared-components": "^2.1.0-beta.11", "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 0853e539..df7e6c72 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-beta.10", + "version": "2.1.0-beta.11", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -33,7 +33,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.10", + "@performant-software/geospatial": "^2.1.0-beta.11", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 36abfcae..b23b5731 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.10", + "version": "2.1.0-beta.11", "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 887031dd..10a04448 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-beta.10", + "version": "2.1.0-beta.11", "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-beta.10", + "@performant-software/shared-components": "^2.1.0-beta.11", "@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 a5720db5..0998eaf7 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.10", + "version": "2.1.0-beta.11", "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 bd6cdff9..e7c2be56 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-beta.10", + "version": "2.1.0-beta.11", "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-beta.10", - "@performant-software/shared-components": "^2.1.0-beta.10", + "@performant-software/semantic-components": "^2.1.0-beta.11", + "@performant-software/shared-components": "^2.1.0-beta.11", "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 6f541fb8..1c7823a8 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.10", + "version": "2.1.0-beta.11", "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 e7659cd6..741e8fb2 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.10" + "version": "2.1.0-beta.11" } From a3fde48bdaa1ff00ffeab5096a70dac6459ab028 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 14:06:07 -0400 Subject: [PATCH 020/109] Atlas #2 - Adding mapping components and utilities --- packages/core-data/package.json | 4 +- .../core-data/src/components/LayerMenu.js | 132 ++++++++++++++++++ .../core-data/src/components/OverlayLayers.js | 48 +++++++ .../src/components/SearchResultsLayer.js | 50 +++++++ packages/core-data/src/index.js | 3 + packages/core-data/src/types/RuntimeConfig.js | 24 ++-- packages/core-data/src/types/Translations.js | 5 + packages/core-data/src/utils/Peripleo.js | 42 +++++- 8 files changed, 294 insertions(+), 14 deletions(-) create mode 100644 packages/core-data/src/components/LayerMenu.js create mode 100644 packages/core-data/src/components/OverlayLayers.js create mode 100644 packages/core-data/src/components/SearchResultsLayer.js create mode 100644 packages/core-data/src/types/Translations.js diff --git a/packages/core-data/package.json b/packages/core-data/package.json index df7e6c72..a38b9174 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -20,6 +20,7 @@ "dependencies": { "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-dialog": "^1.0.5", + "@radix-ui/react-dropdown-menu": "^2.0.6", "@samvera/clover-iiif": "^2.3.2", "@turf/turf": "^6.5.0", "dequal": "^2.0.3", @@ -34,6 +35,7 @@ }, "peerDependencies": { "@performant-software/geospatial": "^2.1.0-beta.11", + "@peripleo/maplibre": "^0.4.1", "react": ">= 16.13.1 < 19.0.0", "react-dom": ">= 16.13.1 < 19.0.0" }, @@ -48,4 +50,4 @@ "tailwindcss": "^3.4.1", "vite": "^5.1.4" } -} \ No newline at end of file +} diff --git a/packages/core-data/src/components/LayerMenu.js b/packages/core-data/src/components/LayerMenu.js new file mode 100644 index 00000000..5d913e82 --- /dev/null +++ b/packages/core-data/src/components/LayerMenu.js @@ -0,0 +1,132 @@ +// @flow + +import * as Dropdown from '@radix-ui/react-dropdown-menu'; +import { Check, Dot, Layers } from 'lucide-react'; +import React, { useEffect, useState } from 'react'; +import type { Layer } from '../types/RuntimeConfig'; +import type { Translations } from '../types/Translations'; + +type Props = { + baseLayer: Layer, + baseLayers: Array, + dataLayers: Array, + onChangeBaseLayer: (config: Layer) => void, + onChangeOverlays: (visible: Array) => void, + translations: Translations +}; + +const LayerMenu = (props: Props) => { + const [selectedOverlays, setSelectedOverlays] = useState({}); + + const { + baseLayer, + baseLayers, + dataLayers, + onChangeBaseLayer, + onChangeOverlays + } = props; + + const onToggleOverlay = (name: string) => ( + (checked: boolean) => setSelectedOverlays((state) => ({ ...state, [name]: checked })) + ); + + useEffect(() => { + const visible = Object.entries(selectedOverlays) + .filter(([, v]) => v) + .map(([name]) => dataLayers.find((l) => l.name === name)) + .filter(Boolean); + + onChangeOverlays(visible); + }, [selectedOverlays]); + + return ( + <> + + + + + + + + { props.translations.baseLayers } + + + { baseLayers.map((b) => ( + + + + + { b.name } + + ))} + + { dataLayers.length > 0 && ( + <> + + + { props.translations.overlays } + +
+ { dataLayers.map((o) => ( + + + + + { o.name } + + ))} +
+ + )} +
+
+
+ + ); +}; + +export default LayerMenu; diff --git a/packages/core-data/src/components/OverlayLayers.js b/packages/core-data/src/components/OverlayLayers.js new file mode 100644 index 00000000..3b83b0a6 --- /dev/null +++ b/packages/core-data/src/components/OverlayLayers.js @@ -0,0 +1,48 @@ +// @flow + +import { MapStyles } from '@performant-software/geospatial'; +import { MixedGeoJSONLayer, RasterOverlayLayer } from '@peripleo/maplibre'; +import React from 'react'; +import _ from 'underscore'; +import type { Layer as LayerType } from '../types/RuntimeConfig'; + +interface OverlayLayerProps { + overlay: Layer; +} + +const OverlayLayer = (props: OverlayLayerProps) => { + const { overlay } = props; + + if (overlay.layer_type === 'geojson') { + return ( + + ); + } + + if (overlay.layer_type === 'raster') { + return ( + + ); + } + + return null; +}; + +type Props = { + overlays: Array +}; + +const OverlayLayers = (props: Props) => ( + _.map(props.overlays, (overlay: any) => ) +); + +export default OverlayLayers; diff --git a/packages/core-data/src/components/SearchResultsLayer.js b/packages/core-data/src/components/SearchResultsLayer.js new file mode 100644 index 00000000..393f276c --- /dev/null +++ b/packages/core-data/src/components/SearchResultsLayer.js @@ -0,0 +1,50 @@ +// @flow + +import { LocationMarkers } from '@performant-software/geospatial'; +import { useMap } from '@peripleo/maplibre'; +import React, { useEffect, useMemo, useState } from 'react'; +import TypesenseUtils from '../utils/Typesense'; +import { useCachedHits, useSearchCompleted } from '../hooks/Typesense'; + +type Props = { + layerId: string +}; + +const SearchResultsLayer = (props: Props) => { + const [mapLoaded, setMapLoaded] = useState(false); + const [visible, setVisible] = useState(false); + + const hits = useCachedHits(); + const map = useMap(); + + const data = useMemo(() => TypesenseUtils.toFeatureCollection(hits), [hits]); + // const { visible = true } = props; + + useEffect(() => { + if (map.loaded()) { + setMapLoaded(true); + } else { + const onLoad = () => setMapLoaded(true); + map.on('load', onLoad); + } + + return () => { + setMapLoaded(false); + }; + }, [map]); + + useSearchCompleted(() => setVisible(true)); + + if (!(mapLoaded && visible)) { + return null; + } + + return ( + + ); +}; + +export default SearchResultsLayer; diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index bd0ba3f4..8cba2e4b 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -4,8 +4,10 @@ import './index.css'; // Components +export { default as LayerMenu } from './components/LayerMenu'; export { default as LoadAnimation } from './components/LoadAnimation'; export { default as MediaGallery } from './components/MediaGallery'; +export { default as OverlayLayers } from './components/OverlayLayers'; export { default as PersistentSearchStateContextProvider } from './components/PersistentSearchStateContextProvider'; export { default as PlaceDetailsPanel } from './components/PlaceDetailsPanel'; export { default as PlaceMarkers } from './components/PlaceMarkers'; @@ -18,6 +20,7 @@ export { default as RelatedOrganization } from './components/RelatedOrganization export { default as RelatedPeople } from './components/RelatedPeople'; export { default as RelatedPlaces } from './components/RelatedPlaces'; export { default as RelatedTaxonomies } from './components/RelatedTaxonomies'; +export { default as SearchResultsLayer } from './components/SearchResultsLayer'; // Hooks export { default as useProgressiveSearch } from './hooks/ProgressiveSearch'; diff --git a/packages/core-data/src/types/RuntimeConfig.js b/packages/core-data/src/types/RuntimeConfig.js index 960ce30e..68621d09 100644 --- a/packages/core-data/src/types/RuntimeConfig.js +++ b/packages/core-data/src/types/RuntimeConfig.js @@ -1,5 +1,17 @@ // @flow +export type Layer = { + name: string, + layer_type: 'raster' | 'vector' | 'geojson', + overlay?: boolean, + url: string, + description?: string, + tilesize?: number, + attribution?: string, + minzoom?: number, + maxzoom?: number +}; + export type RuntimeConfig = { branding: { title?: string, @@ -10,17 +22,7 @@ export type RuntimeConfig = { default_open?: boolean }> }, - layers: Array<{ - name: string, - layer_type: 'raster' | 'vector' | 'geojson', - overlay?: boolean, - url: string, - description?: string, - tilesize?: number, - attribution?: string, - minzoom?: number, - maxzoom?: number - }>, + layers: Array, typesense: { host: string, port?: number, diff --git a/packages/core-data/src/types/Translations.js b/packages/core-data/src/types/Translations.js new file mode 100644 index 00000000..2fd29f73 --- /dev/null +++ b/packages/core-data/src/types/Translations.js @@ -0,0 +1,5 @@ +// @flow + +export type Translations = { + [key: string]: string +}; diff --git a/packages/core-data/src/utils/Peripleo.js b/packages/core-data/src/utils/Peripleo.js index 1942a957..9d6e739d 100644 --- a/packages/core-data/src/utils/Peripleo.js +++ b/packages/core-data/src/utils/Peripleo.js @@ -1,7 +1,7 @@ // @flow import _ from 'underscore'; -import type { RuntimeConfig } from '../types/RuntimeConfig'; +import type { Layer as LayerType, RuntimeConfig } from '../types/RuntimeConfig'; /** * Moves the layers into separate base layers and data layers. @@ -46,7 +46,45 @@ const normalize = (config: RuntimeConfig) => ({ } }); +/** + * Exports the passed layer as a MaxBox layer style. + * + * @param config + * @param id + * + * @returns * + */ +const toLayerStyle = (config: LayerType, id: string) => { + if (config.layer_type === 'vector') { + // Assumes MapBox-compatible style URL + return config.url; + } + + if (config.layer_type === 'raster') { + return { + version: 8, + sources: { + [id]: { + type: 'raster', + tiles: [config.url], + tileSize: config.tilesize || 256 + } + }, + layers: [{ + id, + type: 'raster', + source: id, + minzoom: config.minzoom || 0, + maxzoom: config.maxzoom || 22 + }] + }; + } + + throw new Error(`Unsupported baselayer type: ${config.layer_type}`); +}; + export default { filterLayers, - normalize + normalize, + toLayerStyle }; From 922cad93c93953a3a4f4866d561fe9dcdfe880b5 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 18 Mar 2024 14:17:18 -0400 Subject: [PATCH 021/109] Atlas #2 - Adding I18n context --- packages/core-data/src/components/LayerMenu.js | 15 ++++++++------- .../src/components/SearchResultsLayer.js | 7 ++++++- packages/core-data/src/context/I18n.js | 11 +++++++++++ packages/core-data/src/types/Translations.js | 5 ----- 4 files changed, 25 insertions(+), 13 deletions(-) create mode 100644 packages/core-data/src/context/I18n.js delete mode 100644 packages/core-data/src/types/Translations.js diff --git a/packages/core-data/src/components/LayerMenu.js b/packages/core-data/src/components/LayerMenu.js index 5d913e82..36b3410c 100644 --- a/packages/core-data/src/components/LayerMenu.js +++ b/packages/core-data/src/components/LayerMenu.js @@ -2,22 +2,23 @@ import * as Dropdown from '@radix-ui/react-dropdown-menu'; import { Check, Dot, Layers } from 'lucide-react'; -import React, { useEffect, useState } from 'react'; +import React, { useContext, useEffect, useState } from 'react'; +import I18nContext from '../context/I18n'; import type { Layer } from '../types/RuntimeConfig'; -import type { Translations } from '../types/Translations'; type Props = { baseLayer: Layer, baseLayers: Array, dataLayers: Array, onChangeBaseLayer: (config: Layer) => void, - onChangeOverlays: (visible: Array) => void, - translations: Translations + onChangeOverlays: (visible: Array) => void }; const LayerMenu = (props: Props) => { const [selectedOverlays, setSelectedOverlays] = useState({}); + const { translations } = useContext(I18nContext); + const { baseLayer, baseLayers, @@ -47,7 +48,7 @@ const LayerMenu = (props: Props) => { > - { props.place && ( - <> - { firstImage && ( -
-
- -
-
- {firstImage.title} -
-
- )} -
-

- { props.place.properties.title } -

-
    - { _.map(userDefined, ({ label, value }) => ( -
  1. -
    - { label } -
    -
    - { value } -
    -
  2. - ))} -
-
- - - )} - - ); -}; - -export default PlaceDetailsPanel; diff --git a/packages/core-data/src/components/RelatedItem.css b/packages/core-data/src/components/RelatedItem.css new file mode 100644 index 00000000..e6892a5c --- /dev/null +++ b/packages/core-data/src/components/RelatedItem.css @@ -0,0 +1,4 @@ +.related-item .accordion-content[data-state="closed"] { + visibility: hidden; + height: 0; +} \ No newline at end of file diff --git a/packages/core-data/src/components/RelatedItem.js b/packages/core-data/src/components/RelatedItem.js new file mode 100644 index 00000000..3f03ef50 --- /dev/null +++ b/packages/core-data/src/components/RelatedItem.js @@ -0,0 +1,65 @@ +// @flow + +import * as Accordion from '@radix-ui/react-accordion'; +import { AlertCircle, ChevronDown } from 'lucide-react'; +import React, { type Node } from 'react'; +import i18n from '../i18n/i18n'; +import LoadAnimation from './LoadAnimation'; +import './RelatedItem.css'; + +type Props = { + children: Node, + count?: number, + error?: boolean, + id: string, + label: string, + loading?: boolean +}; + +/** + * This component renders the passed list of related items in an accordion fashion. + */ +const RelatedItemsList = (props: Props) => ( + + + +
+ { props.label } + { props.count && ( + + { i18n.t('RelatedItemsList.labels.count', { count: props.count })} + + )} + { props.error && ( + + )} + { props.loading && ( + + )} +
+ +
+
+ + { props.children } + +
+); + +export default RelatedItemsList; diff --git a/packages/core-data/src/components/RelatedItemsList.js b/packages/core-data/src/components/RelatedItemsList.js index 6a871fcd..b58f35e9 100644 --- a/packages/core-data/src/components/RelatedItemsList.js +++ b/packages/core-data/src/components/RelatedItemsList.js @@ -1,105 +1,23 @@ // @flow import * as Accordion from '@radix-ui/react-accordion'; -import { AlertCircle, ChevronDown } from 'lucide-react'; -import React from 'react'; -import _ from 'underscore'; -import i18n from '../i18n/i18n'; -import LoadAnimation from './LoadAnimation'; -import type { RelatedItems } from '../types/RelatedItems'; -import RelatedMedia from './RelatedMedia'; -import RelatedOrganizations from './RelatedOrganizations'; -import RelatedPeople from './RelatedPeople'; -import RelatedPlaces from './RelatedPlaces'; -import RelatedTaxonomies from './RelatedTaxonomies'; +import React, { type Node } from 'react'; import './RelatedItemsList.css'; type Props = { - /** - * A list of related items. - */ - items: Array + children: Node }; /** * This component renders the passed list of related items in an accordion fashion. */ -const RelatedItemsList = (props: Props) => { - if (_.isEmpty(props.items)) { - return null; - } - - return ( - - { _.map(props.items, ({ data, error, ...conf }) => ( - - - -
- { conf.ui_label } - { data && ( - - { i18n.t('RelatedItemsList.labels.count', { count: data.items?.length })} - - )} - { error && ( - - )} - { !(data || error) && ( - - )} -
- -
-
- - { conf.endpoint === 'media_contents' && ( - - )} - { conf.endpoint === 'organizations' && ( - - )} - { conf.endpoint === 'people' && ( - - )} - { conf.endpoint === 'places' && ( - - )} - { conf.endpoint === 'taxonomies' && ( - - )} - -
- ))} -
- ); -}; +const RelatedItemsList = (props: Props) => ( + + { props.children } + +); export default RelatedItemsList; diff --git a/packages/core-data/src/components/RelatedList.js b/packages/core-data/src/components/RelatedList.js index a3a83eb3..a3b3a14c 100644 --- a/packages/core-data/src/components/RelatedList.js +++ b/packages/core-data/src/components/RelatedList.js @@ -2,7 +2,8 @@ import React from 'react'; import _ from 'underscore'; -import type { AnnotationPage } from '../types/AnnotationPage'; +import { useLoader } from '../hooks/CoreData'; +import LoadAnimation from './LoadAnimation'; type Item = { id: string @@ -10,9 +11,9 @@ type Item = { type Props = { /** - * An annotation page containing the list of records to render. + * Callback fired when the component is mounted to fetch the data. */ - data: AnnotationPage, + onLoad: () => any, /** * A message to display when the list is empty. @@ -29,9 +30,15 @@ type Props = { * This component is a helper component used to structure the lists for the other `Related*` comnponents. */ const RelatedList = (props: Props) => { - const { items } = props.data; + const { data, loading } = useLoader(props.onLoad, []); - if (_.isEmpty(items)) { + if (loading) { + return ( + + ); + } + + if (_.isEmpty(data?.items)) { return (
{
    - { _.map(items, (item) => ( + { _.map(data?.items, (item) => (
  • , + onLoad: () => any, /** * Media thumbnail height. @@ -33,11 +33,13 @@ const DEFAULT_THUMBNAIL_WIDTH = 80; const RelatedMedia = (props: Props) => { const [showGallery, setShowGallery] = useState(); + const { data } = useLoader(props.onLoad); + return (
    - { _.map(props.data?.items, (item) => ( + { _.map(data?.items, (item) => ( + onLoad: () => any }; /** @@ -19,8 +17,8 @@ type Props = { */ const RelatedOrganizations = (props: Props) => ( ( <> + onLoad: () => any }; /** @@ -19,8 +17,8 @@ type Props = { */ const RelatedPeople = (props: Props) => ( ( <> + onLoad: () => any, }; /** @@ -19,8 +17,8 @@ type Props = { */ const RelatedPlaces = (props: Props) => ( ( <> + onLoad: () => any, }; /** @@ -19,8 +17,8 @@ type Props = { */ const RelatedTaxonomies = (props: Props) => ( ( <> ({ + baseUrl: undefined, + projectIds: undefined +}); + +export default CoreDataContext; diff --git a/packages/core-data/src/hooks/CoreData.js b/packages/core-data/src/hooks/CoreData.js new file mode 100644 index 00000000..90c2e59f --- /dev/null +++ b/packages/core-data/src/hooks/CoreData.js @@ -0,0 +1,35 @@ +// @flow + +import { useContext, useEffect, useState } from 'react'; +import CoreDataContext from '../context/CoreData'; + +/** + * Hook to call the passed onLoad function and returns the loading state and eventual data. + * + * @param onLoad + * @param deps + * + * @returns {{data: unknown, loading: boolean}} + */ +export const useLoader = (onLoad, deps = []) => { + const [data, setData] = useState(); + const [loading, setLoading] = useState(false); + + const { baseUrl, projectIds } = useContext(CoreDataContext); + + /** + * Sets the loading state to "true" and calls the onLoad callback. + */ + useEffect(() => { + setLoading(true); + + onLoad(baseUrl, projectIds) + .then((d) => setData(d)) + .finally(() => setLoading(false)); + }, [...deps]); + + return { + data, + loading + }; +}; diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index f94b86ba..bacb8bd7 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -4,6 +4,7 @@ import './index.css'; // Components +export { default as CoreDataContextProvider } from './components/CoreDataContextProvider'; export { default as FacetList } from './components/FacetList'; export { default as FacetLists } from './components/FacetLists'; export { default as FacetListsGrouped } from './components/FacetListsGrouped'; @@ -13,7 +14,7 @@ export { default as LoadAnimation } from './components/LoadAnimation'; export { default as MediaGallery } from './components/MediaGallery'; export { default as OverlayLayers } from './components/OverlayLayers'; export { default as PersistentSearchStateContextProvider } from './components/PersistentSearchStateContextProvider'; -export { default as PlaceDetailsPanel } from './components/PlaceDetailsPanel'; +export { default as PlaceDetails } from './components/PlaceDetails'; export { default as PlaceMarkers } from './components/PlaceMarkers'; export { default as PlaceResultsList } from './components/PlaceResultsList'; export { default as RefinementListProxy } from './components/RefinementListProxy'; @@ -27,14 +28,25 @@ export { default as RelatedTaxonomies } from './components/RelatedTaxonomies'; export { default as SearchResultsLayer } from './components/SearchResultsLayer'; // Contexts +export { default as CoreDataContext } from './context/CoreData'; export { default as FacetStateContext } from './context/FacetStateContext'; export { default as I18nContext } from './context/I18n'; // Hooks +export { useLoader } from './hooks/CoreData'; export { default as useProgressiveSearch } from './hooks/ProgressiveSearch'; -export * from './hooks/Typesense'; +export { + useCachedHits, + useGeoSearch, + useGeoSearchToggle, + useSearchBox, + useSearchCompleted +} from './hooks/Typesense'; + +// Services +export { default as PlacesService } from './services/Places'; // Utilities -export { default as CoreData } from './utils/CoreData'; +export { default as Api } from './utils/Api'; export { default as Peripleo } from './utils/Peripleo'; export { default as Typesense } from './utils/Typesense'; diff --git a/packages/core-data/src/services/Places.js b/packages/core-data/src/services/Places.js new file mode 100644 index 00000000..5e13e29d --- /dev/null +++ b/packages/core-data/src/services/Places.js @@ -0,0 +1,101 @@ +// @flow + +import Api from '../utils/Api'; + +/** + * Calls the GET /core_data/public/places/:id API endpoint. + * + * @param baseUrl + * @param id + * @param projectIds + * @param params + * @returns {Promise} + */ +const fetchOne = (baseUrl, id, projectIds, params = {}) => { + const url = Api.buildUrl(baseUrl, 'places', id, projectIds, params); + return fetch(url).then((response) => response.json()); +}; + +/** + * Calls the GET /core_data/public/places/:id/media_contents API endpoint. + * + * @param baseUrl + * @param id + * @param projectIds + * @param params + * + * @returns {Promise} + */ +const fetchRelatedMedia = (baseUrl, id, projectIds, params = {}) => { + const url = Api.buildNestedUrl(baseUrl, 'places', id, 'media_contents', projectIds, params); + return fetch(url).then((response) => response.json()); +}; + +/** + * Calls the GET /core_data/public/places/:id/organizations API endpoint. + * + * @param baseUrl + * @param id + * @param projectIds + * @param params + * + * @returns {Promise} + */ +const fetchRelatedOrganizations = (baseUrl, id, projectIds, params = {}) => { + const url = Api.buildNestedUrl(baseUrl, 'places', id, 'organizations', projectIds, params); + return fetch(url).then((response) => response.json()); +}; + +/** + * Calls the GET /core_data/public/places/:id/people API endpoint. + * + * @param baseUrl + * @param id + * @param projectIds + * @param params + * + * @returns {Promise} + */ +const fetchRelatedPeople = (baseUrl, id, projectIds, params = {}) => { + const url = Api.buildNestedUrl(baseUrl, 'places', id, 'people', projectIds, params); + return fetch(url).then((response) => response.json()); +}; + +/** + * Calls the GET /core_data/public/places/:id/places API endpoint. + * + * @param baseUrl + * @param id + * @param projectIds + * @param params + * + * @returns {Promise} + */ +const fetchRelatedPlaces = (baseUrl, id, projectIds, params = {}) => { + const url = Api.buildNestedUrl(baseUrl, 'places', id, 'places', projectIds, params); + return fetch(url).then((response) => response.json()); +}; + +/** + * Calls the GET /core_data/public/places/:id/taxonomies API endpoint. + * + * @param baseUrl + * @param id + * @param projectIds + * @param params + * + * @returns {Promise} + */ +const fetchRelatedTaxonomies = (baseUrl, id, projectIds, params = {}) => { + const url = Api.buildNestedUrl(baseUrl, 'places', id, 'taxonomies', projectIds, params); + return fetch(url).then((response) => response.json()); +}; + +export default { + fetchOne, + fetchRelatedMedia, + fetchRelatedOrganizations, + fetchRelatedPeople, + fetchRelatedPlaces, + fetchRelatedTaxonomies +}; diff --git a/packages/core-data/src/utils/Api.js b/packages/core-data/src/utils/Api.js new file mode 100644 index 00000000..f6de9b68 --- /dev/null +++ b/packages/core-data/src/utils/Api.js @@ -0,0 +1,43 @@ +// @flow + +/** + * Builds a fully qualified nested URL for the passed base URL and route. + * + * @param baseUrl + * @param route + * @param id + * @param nested + * @param projectIds + * @param searchParams + * + * @returns {`${string}?${string}`} + */ +const buildNestedUrl = (baseUrl, route, id, nested, projectIds, searchParams = {}) => { + const url = `${baseUrl}/core_data/public/${route}/${id}/${nested}`; + const params = new URLSearchParams({ ...searchParams, project_ids: projectIds }); + + return `${url}?${params}`; +}; + +/** + * Builds a fully qualified URL for the passed base URL and route. + * + * @param baseUrl + * @param route + * @param id + * @param projectIds + * @param searchParams + * + * @returns {`${string}?${string}`} + */ +const buildUrl = (baseUrl, route, id, projectIds, searchParams = {}) => { + const url = `${baseUrl}/core_data/public/${route}/${id}`; + const params = new URLSearchParams({ ...searchParams, project_ids: projectIds }); + + return `${url}?${params}`; +}; + +export default { + buildNestedUrl, + buildUrl +}; diff --git a/packages/core-data/src/utils/CoreData.js b/packages/core-data/src/utils/CoreData.js deleted file mode 100644 index 22e02bae..00000000 --- a/packages/core-data/src/utils/CoreData.js +++ /dev/null @@ -1,21 +0,0 @@ -// @flow - -/** - * Returns the place record for the passed UUID from the Core Data API and converts the response to JSON. - * - * @param baseUrl - * @param id - * @param projectIds - * - * @returns {Promise} - */ -const fetchPlace = (baseUrl, id, projectIds) => { - const url = `${baseUrl}/core_data/public/places/${id}?project_ids=${projectIds}`; - const params = new URLSearchParams({ project_ids: projectIds }); - - return fetch(`${url}?${params}`).then((response) => response.json()); -}; - -export default { - fetchPlace -}; diff --git a/packages/storybook/.storybook/preview.js b/packages/storybook/.storybook/preview.js index 3b9f2cb6..279f98ef 100644 --- a/packages/storybook/.storybook/preview.js +++ b/packages/storybook/.storybook/preview.js @@ -9,6 +9,8 @@ import '../../core-data/dist/style.css'; import '../../geospatial/dist/style.css'; import '../../semantic-ui/dist/style.css'; import '../../shared/dist/style.css'; +import './styles/index.css'; +import '../src/index.css'; /** * If a list of accessibility tags are provided, only run the tests for those specific tags. diff --git a/packages/storybook/.storybook/styles/index.css b/packages/storybook/.storybook/styles/index.css new file mode 100644 index 00000000..cc09f88c --- /dev/null +++ b/packages/storybook/.storybook/styles/index.css @@ -0,0 +1,3 @@ +.p6o-map-container.maplibregl-map { + height: 100%; +} \ No newline at end of file diff --git a/packages/storybook/package.json b/packages/storybook/package.json index 6fef8753..43d5ee4e 100644 --- a/packages/storybook/package.json +++ b/packages/storybook/package.json @@ -39,6 +39,7 @@ "dotenv": "^16.0.3", "http-proxy-middleware": "^2.0.6", "i18next": "^22.0.1", + "lucide-react": "^0.362.0", "moment": "^2.30.1", "postcss": "^8.4.35", "react": "^18.2.0", diff --git a/packages/storybook/src/core-data/PlaceDetails.stories.js b/packages/storybook/src/core-data/PlaceDetails.stories.js new file mode 100644 index 00000000..d7cee387 --- /dev/null +++ b/packages/storybook/src/core-data/PlaceDetails.stories.js @@ -0,0 +1,187 @@ +// @flow + +import { Dialog, Transition } from '@headlessui/react'; +import { action } from '@storybook/addon-actions'; +import { X } from 'lucide-react'; +import React, { useState, Fragment } from 'react'; +import CoreDataContextProvider from '../../../core-data/src/components/CoreDataContextProvider'; +import PlaceDetails from '../../../core-data/src/components/PlaceDetails'; +import PlacesService from '../../../core-data/src/services/Places'; +import RelatedItem from '../../../core-data/src/components/RelatedItem'; +import RelatedItemsList from '../../../core-data/src/components/RelatedItemsList'; +import RelatedMedia from '../../../core-data/src/components/RelatedMedia'; +import RelatedOrganizations from '../../../core-data/src/components/RelatedOrganizations'; +import RelatedPeople from '../../../core-data/src/components/RelatedPeople'; +import RelatedPlaces from '../../../core-data/src/components/RelatedPlaces'; +import RelatedTaxonomies from '../../../core-data/src/components/RelatedTaxonomies'; + +export default { + title: 'Components/Core Data/PlaceDetails', + component: PlaceDetails +}; + +export const Default = () => ( + + + +); + +export const Sidebar = () => ( + + + +); + +export const Modal = () => { + const [open, setOpen] = useState(false); + + return ( + + + + +
    + +
    +
    + + + + + +
    +
    +
    +
    + +
    + ); +}; + +export const RelatedItems = () => ( + + + + + ( + PlacesService.fetchRelatedMedia(baseUrl, '3aaf97a4-7052-4e2c-9056-4f4146ef0c87', projectIds) + )} + /> + + + ( + PlacesService.fetchRelatedOrganizations(baseUrl, '3aaf97a4-7052-4e2c-9056-4f4146ef0c87', projectIds) + )} + /> + + + ( + PlacesService.fetchRelatedPeople(baseUrl, '3aaf97a4-7052-4e2c-9056-4f4146ef0c87', projectIds) + )} + /> + + + ( + PlacesService.fetchRelatedPlaces(baseUrl, '3aaf97a4-7052-4e2c-9056-4f4146ef0c87', projectIds) + )} + /> + + + ( + PlacesService.fetchRelatedTaxonomies(baseUrl, '3aaf97a4-7052-4e2c-9056-4f4146ef0c87', projectIds) + )} + /> + + + +); diff --git a/packages/storybook/src/core-data/PlaceDetailsPanel.stories.js b/packages/storybook/src/core-data/PlaceDetailsPanel.stories.js deleted file mode 100644 index 83033572..00000000 --- a/packages/storybook/src/core-data/PlaceDetailsPanel.stories.js +++ /dev/null @@ -1,172 +0,0 @@ -// @flow - -import { action } from '@storybook/addon-actions'; -import React, { useState, Fragment } from 'react'; -import PlaceDetailsPanel from '../../../core-data/src/components/PlaceDetailsPanel'; -import place from '../data/Place.json'; -import relatedMedia from '../data/RelatedMedia.json'; -import relatedPlaces from '../data/RelatedPlaces.json'; -import { Button, Modal, Sidebar } from 'semantic-ui-react'; -import { Dialog, Transition } from '@headlessui/react'; -import '../index.css'; - -export default { - title: 'Components/Core Data/PlaceDetailsPanel', - component: PlaceDetailsPanel -}; - -export const Default = () => ( - -); - -export const SidebarVersion = () => { - const [visible, setVisible] = useState(false); - return ( - <> - - setVisible(false)} - place={place} - related={[{ - endpoint: 'media_contents', - ui_label: 'Related Media', - data: relatedMedia - }, { - endpoint: 'places', - ui_label: 'Related Places', - data: relatedPlaces - }]} - /> - - - - ) -}; - -export const ModalVersion = () => { - const [open, setOpen] = useState(false); - return ( - <> - - - setOpen(false)} - place={place} - related={[{ - endpoint: 'media_contents', - ui_label: 'Related Media', - data: relatedMedia - }, { - endpoint: 'places', - ui_label: 'Related Places', - data: relatedPlaces - }]} - /> - - - - - ); -}; - -export const SidebarVersionTailwind = () => { - const [visible, setVisible] = useState(false); - return ( - <> -
    - setVisible(false)} - place={place} - related={[{ - endpoint: 'media_contents', - ui_label: 'Related Media', - data: relatedMedia - }, { - endpoint: 'places', - ui_label: 'Related Places', - data: relatedPlaces - }]} - /> -
    - - - ) -}; - -export const ModalVersionTailwind = () => { - const [open, setOpen] = useState(false); - return ( - <> - - - -
    - - -
    -
    - - - setOpen(false)} - place={place} - related={[{ - endpoint: 'media_contents', - ui_label: 'Related Media', - data: relatedMedia - }, { - endpoint: 'places', - ui_label: 'Related Places', - data: relatedPlaces - }]} - /> - - -
    -
    -
    -
    - - - ); -} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index b397d9f4..a9530df6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11098,6 +11098,11 @@ lucide-react@^0.321.0: resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.321.0.tgz#05a2600e0a6551c117fb4e7b2676b1286389d949" integrity sha512-Fi9VahIna6642U+2nAGSjnXwUBV3WyfFFPQq4yi3w30jtqxDLfSyiYCtCYCYQZ2KWNZc1MDI+rcsa0t+ChdYpw== +lucide-react@^0.362.0: + version "0.362.0" + resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.362.0.tgz#945b7b56358a0d6739dd5bb34782367d5cd60a0f" + integrity sha512-0S+JudK0AD9vyB0zbu1K0aQsy8k9Wq2l03bio6wxqF2FhK2TSp/y+22HfMyv40EURifgxoSwdU8eIcOv0a8gBA== + magic-string@^0.27.0: version "0.27.0" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.27.0.tgz#e4a3413b4bab6d98d2becffd48b4a257effdbbf3" From 0da93e84f79be293bdc60a19760a2babae1a73ed Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 08:49:15 -0400 Subject: [PATCH 068/109] Atlas #4 - Publishing v2.1.0-beta.34 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 2bf6fd90..2b630bcb 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-beta.33", + "version": "2.1.0-beta.34", "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-beta.33", - "@performant-software/shared-components": "^2.1.0-beta.33", + "@performant-software/semantic-components": "^2.1.0-beta.34", + "@performant-software/shared-components": "^2.1.0-beta.34", "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 5cb7067a..ea59ebf1 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-beta.33", + "version": "2.1.0-beta.34", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.33", + "@performant-software/geospatial": "^2.1.0-beta.34", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index c19a38a0..2ccfdc35 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.33", + "version": "2.1.0-beta.34", "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 86874c8d..110dd869 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-beta.33", + "version": "2.1.0-beta.34", "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-beta.33", + "@performant-software/shared-components": "^2.1.0-beta.34", "@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 ff9c1c1c..105f01d8 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.33", + "version": "2.1.0-beta.34", "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 0b3f3411..537275e3 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-beta.33", + "version": "2.1.0-beta.34", "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-beta.33", - "@performant-software/shared-components": "^2.1.0-beta.33", + "@performant-software/semantic-components": "^2.1.0-beta.34", + "@performant-software/shared-components": "^2.1.0-beta.34", "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 4aa08f5a..ba29b432 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.33", + "version": "2.1.0-beta.34", "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 1069e733..e395da22 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.33" + "version": "2.1.0-beta.34" } From aa738f836a24ef9a36d4b78c6ce97245b741fd38 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 08:52:46 -0400 Subject: [PATCH 069/109] Atlas #4 - Adding optional onLoad prop to PlaceDetails --- .../core-data/src/components/PlaceDetails.js | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/packages/core-data/src/components/PlaceDetails.js b/packages/core-data/src/components/PlaceDetails.js index 4c63a221..7539398d 100644 --- a/packages/core-data/src/components/PlaceDetails.js +++ b/packages/core-data/src/components/PlaceDetails.js @@ -1,13 +1,23 @@ // @flow import { Image } from 'lucide-react'; -import React, { useCallback, useMemo } from 'react'; +import React, { useCallback, useEffect, useMemo } from 'react'; import _ from 'underscore'; import PlacesService from '../services/Places'; import { useLoader } from '../hooks/CoreData'; type Props = { - id: string + /** + * The Core Data identifier of the place record. + */ + id: string, + + /** + * (Optional) Callback fired when the place record is loaded. + * + * @param + */ + onLoad: (data) => any }; /** @@ -52,6 +62,15 @@ const PlaceDetails = (props: Props) => { place?.user_defined ? Object.values(place.user_defined) : [] ), [place]); + /** + * Call the onLoad prop if provided when the place changes. + */ + useEffect(() => { + if (props.onLoad && place) { + props.onLoad(place); + } + }, [place]); + return ( <> { image && ( From 05a92b64fb6e1017677ebd3ef70c2dbc583d7890 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:26:33 -0400 Subject: [PATCH 070/109] Atlas #4 - Publishing v2.1.0-beta.35 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 2b630bcb..f4d450a3 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-beta.34", + "version": "2.1.0-beta.35", "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-beta.34", - "@performant-software/shared-components": "^2.1.0-beta.34", + "@performant-software/semantic-components": "^2.1.0-beta.35", + "@performant-software/shared-components": "^2.1.0-beta.35", "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 ea59ebf1..24b7e116 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-beta.34", + "version": "2.1.0-beta.35", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.34", + "@performant-software/geospatial": "^2.1.0-beta.35", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 2ccfdc35..415983c2 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.34", + "version": "2.1.0-beta.35", "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 110dd869..61aa197d 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-beta.34", + "version": "2.1.0-beta.35", "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-beta.34", + "@performant-software/shared-components": "^2.1.0-beta.35", "@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 105f01d8..08731970 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.34", + "version": "2.1.0-beta.35", "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 537275e3..bc38cf50 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-beta.34", + "version": "2.1.0-beta.35", "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-beta.34", - "@performant-software/shared-components": "^2.1.0-beta.34", + "@performant-software/semantic-components": "^2.1.0-beta.35", + "@performant-software/shared-components": "^2.1.0-beta.35", "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 ba29b432..6d592178 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.34", + "version": "2.1.0-beta.35", "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 e395da22..7e885f23 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.34" + "version": "2.1.0-beta.35" } From a2da3c7fb69537735e967c046c13fa5438bb0a2d Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:26:50 -0400 Subject: [PATCH 071/109] Atlas #4 - Adding CoreData utils class --- packages/core-data/src/index.js | 1 + packages/core-data/src/utils/CoreData.js | 27 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 packages/core-data/src/utils/CoreData.js diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index bacb8bd7..b1fe4254 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -48,5 +48,6 @@ export { default as PlacesService } from './services/Places'; // Utilities export { default as Api } from './utils/Api'; +export { default as CoreData } from './utils/CoreData'; export { default as Peripleo } from './utils/Peripleo'; export { default as Typesense } from './utils/Typesense'; diff --git a/packages/core-data/src/utils/CoreData.js b/packages/core-data/src/utils/CoreData.js new file mode 100644 index 00000000..1b39785f --- /dev/null +++ b/packages/core-data/src/utils/CoreData.js @@ -0,0 +1,27 @@ +// @flow + +import { feature, featureCollection } from '@turf/turf'; +import _ from 'underscore'; + +/** + * Converts the passed place to a feature. + * + * @param place + * + * @returns {Feature<*, *>} + */ +const toFeature = (place) => feature(place.geometry, place.properties); + +/** + * Converts the passed collection of places to a feature collection. + * + * @param places + * + * @returns {FeatureCollection} + */ +const toFeatureCollection = (places) => featureCollection(_.map(places, (place) => toFeature(place))); + +export default { + toFeature, + toFeatureCollection +}; From 40bbcf0814b60385a64c7087978f39b7c7ef40fa Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:34:05 -0400 Subject: [PATCH 072/109] Atlas #4 - Publishing v2.1.0-beta.36 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index f4d450a3..0d260e20 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-beta.35", + "version": "2.1.0-beta.36", "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-beta.35", - "@performant-software/shared-components": "^2.1.0-beta.35", + "@performant-software/semantic-components": "^2.1.0-beta.36", + "@performant-software/shared-components": "^2.1.0-beta.36", "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 24b7e116..e0d93c51 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-beta.35", + "version": "2.1.0-beta.36", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.35", + "@performant-software/geospatial": "^2.1.0-beta.36", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 415983c2..a26e350e 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.35", + "version": "2.1.0-beta.36", "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 61aa197d..c9d35072 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-beta.35", + "version": "2.1.0-beta.36", "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-beta.35", + "@performant-software/shared-components": "^2.1.0-beta.36", "@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 08731970..2d229ff4 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.35", + "version": "2.1.0-beta.36", "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 bc38cf50..05d7f1bb 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-beta.35", + "version": "2.1.0-beta.36", "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-beta.35", - "@performant-software/shared-components": "^2.1.0-beta.35", + "@performant-software/semantic-components": "^2.1.0-beta.36", + "@performant-software/shared-components": "^2.1.0-beta.36", "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 6d592178..848b0416 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.35", + "version": "2.1.0-beta.36", "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 7e885f23..eba2fca5 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.35" + "version": "2.1.0-beta.36" } From 1941097b2bb15ecff727ffc10ff9913e68448f33 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:34:26 -0400 Subject: [PATCH 073/109] Atlas #4 - Updating core-data package to export RelatedItem component --- packages/core-data/src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index b1fe4254..8ce67a21 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -18,6 +18,7 @@ export { default as PlaceDetails } from './components/PlaceDetails'; export { default as PlaceMarkers } from './components/PlaceMarkers'; export { default as PlaceResultsList } from './components/PlaceResultsList'; export { default as RefinementListProxy } from './components/RefinementListProxy'; +export { default as RelatedItem } from './components/RelatedItem'; export { default as RelatedItemsList } from './components/RelatedItemsList'; export { default as RelatedList } from './components/RelatedList'; export { default as RelatedMedia } from './components/RelatedMedia'; From a38aa760e045de9b6ed602d1e3ab7945d8802a00 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:51:29 -0400 Subject: [PATCH 074/109] Atlas #4 - Publishing v2.1.0-beta.37 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 0d260e20..5f223e88 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-beta.36", + "version": "2.1.0-beta.37", "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-beta.36", - "@performant-software/shared-components": "^2.1.0-beta.36", + "@performant-software/semantic-components": "^2.1.0-beta.37", + "@performant-software/shared-components": "^2.1.0-beta.37", "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 e0d93c51..23059137 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-beta.36", + "version": "2.1.0-beta.37", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.36", + "@performant-software/geospatial": "^2.1.0-beta.37", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index a26e350e..4d132787 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.36", + "version": "2.1.0-beta.37", "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 c9d35072..da42ec4f 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-beta.36", + "version": "2.1.0-beta.37", "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-beta.36", + "@performant-software/shared-components": "^2.1.0-beta.37", "@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 2d229ff4..6177794c 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.36", + "version": "2.1.0-beta.37", "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 05d7f1bb..8d6efa48 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-beta.36", + "version": "2.1.0-beta.37", "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-beta.36", - "@performant-software/shared-components": "^2.1.0-beta.36", + "@performant-software/semantic-components": "^2.1.0-beta.37", + "@performant-software/shared-components": "^2.1.0-beta.37", "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 848b0416..e24106ee 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.36", + "version": "2.1.0-beta.37", "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 eba2fca5..60a939d1 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.36" + "version": "2.1.0-beta.37" } From 9be203203ceba7d20cc884a800c5e8fd28f5e818 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:53:05 -0400 Subject: [PATCH 075/109] Atlas #4 - Renaming RelatedOrganizations in index.js --- packages/core-data/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index 8ce67a21..3355149a 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -22,7 +22,7 @@ export { default as RelatedItem } from './components/RelatedItem'; export { default as RelatedItemsList } from './components/RelatedItemsList'; export { default as RelatedList } from './components/RelatedList'; export { default as RelatedMedia } from './components/RelatedMedia'; -export { default as RelatedOrganization } from './components/RelatedOrganizations'; +export { default as RelatedOrganizations } from './components/RelatedOrganizations'; export { default as RelatedPeople } from './components/RelatedPeople'; export { default as RelatedPlaces } from './components/RelatedPlaces'; export { default as RelatedTaxonomies } from './components/RelatedTaxonomies'; From 8d59ead67439e0a873060200a83e8dc8cfcbb06f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 10:53:23 -0400 Subject: [PATCH 076/109] Atlas #4 - Updating RelatedItem styles to be inline --- packages/core-data/src/components/RelatedItem.css | 4 ---- packages/core-data/src/components/RelatedItem.js | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 packages/core-data/src/components/RelatedItem.css diff --git a/packages/core-data/src/components/RelatedItem.css b/packages/core-data/src/components/RelatedItem.css deleted file mode 100644 index e6892a5c..00000000 --- a/packages/core-data/src/components/RelatedItem.css +++ /dev/null @@ -1,4 +0,0 @@ -.related-item .accordion-content[data-state="closed"] { - visibility: hidden; - height: 0; -} \ No newline at end of file diff --git a/packages/core-data/src/components/RelatedItem.js b/packages/core-data/src/components/RelatedItem.js index 3f03ef50..60341005 100644 --- a/packages/core-data/src/components/RelatedItem.js +++ b/packages/core-data/src/components/RelatedItem.js @@ -5,7 +5,6 @@ import { AlertCircle, ChevronDown } from 'lucide-react'; import React, { type Node } from 'react'; import i18n from '../i18n/i18n'; import LoadAnimation from './LoadAnimation'; -import './RelatedItem.css'; type Props = { children: Node, @@ -54,7 +53,7 @@ const RelatedItemsList = (props: Props) => ( { props.children } From 7d7409a8596cfcde4ba5e122b258b4aed564c5cf Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 14:39:49 -0400 Subject: [PATCH 077/109] Atlas #4 - Publishing v2.1.0-beta.38 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 5f223e88..62954900 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-beta.37", + "version": "2.1.0-beta.38", "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-beta.37", - "@performant-software/shared-components": "^2.1.0-beta.37", + "@performant-software/semantic-components": "^2.1.0-beta.38", + "@performant-software/shared-components": "^2.1.0-beta.38", "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 23059137..a1a92ffd 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-beta.37", + "version": "2.1.0-beta.38", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -35,7 +35,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.37", + "@performant-software/geospatial": "^2.1.0-beta.38", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 4d132787..c406732c 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.37", + "version": "2.1.0-beta.38", "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 da42ec4f..7dd47d8c 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-beta.37", + "version": "2.1.0-beta.38", "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-beta.37", + "@performant-software/shared-components": "^2.1.0-beta.38", "@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 6177794c..8f4fd37a 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.37", + "version": "2.1.0-beta.38", "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 8d6efa48..c0ff722f 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-beta.37", + "version": "2.1.0-beta.38", "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-beta.37", - "@performant-software/shared-components": "^2.1.0-beta.37", + "@performant-software/semantic-components": "^2.1.0-beta.38", + "@performant-software/shared-components": "^2.1.0-beta.38", "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 e24106ee..a1e40719 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.37", + "version": "2.1.0-beta.38", "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 60a939d1..8d072e17 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.37" + "version": "2.1.0-beta.38" } From 490960165c9b263dff3395ae0b253c657a73f408 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Thu, 28 Mar 2024 14:40:59 -0400 Subject: [PATCH 078/109] Atlas #4 - Re-adding RelatedItem.css; Fixing an issue with importing Tailwind CSS into Storybook --- packages/core-data/src/components/RelatedItem.css | 4 ++++ packages/core-data/src/components/RelatedItem.js | 3 ++- packages/storybook/.storybook/preview.js | 1 - packages/storybook/postcss.config.js | 2 +- packages/storybook/tailwind.config.js | 14 +++++++++++--- 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 packages/core-data/src/components/RelatedItem.css diff --git a/packages/core-data/src/components/RelatedItem.css b/packages/core-data/src/components/RelatedItem.css new file mode 100644 index 00000000..e6892a5c --- /dev/null +++ b/packages/core-data/src/components/RelatedItem.css @@ -0,0 +1,4 @@ +.related-item .accordion-content[data-state="closed"] { + visibility: hidden; + height: 0; +} \ No newline at end of file diff --git a/packages/core-data/src/components/RelatedItem.js b/packages/core-data/src/components/RelatedItem.js index 60341005..3f03ef50 100644 --- a/packages/core-data/src/components/RelatedItem.js +++ b/packages/core-data/src/components/RelatedItem.js @@ -5,6 +5,7 @@ import { AlertCircle, ChevronDown } from 'lucide-react'; import React, { type Node } from 'react'; import i18n from '../i18n/i18n'; import LoadAnimation from './LoadAnimation'; +import './RelatedItem.css'; type Props = { children: Node, @@ -53,7 +54,7 @@ const RelatedItemsList = (props: Props) => ( { props.children } diff --git a/packages/storybook/.storybook/preview.js b/packages/storybook/.storybook/preview.js index 279f98ef..86216c35 100644 --- a/packages/storybook/.storybook/preview.js +++ b/packages/storybook/.storybook/preview.js @@ -5,7 +5,6 @@ import React, { useRef } from 'react'; import ModalContext from '../../semantic-ui/src/context/ModalContext'; import '@peripleo/maplibre/peripleo-maplibre.css'; import '@peripleo/peripleo/default-theme'; -import '../../core-data/dist/style.css'; import '../../geospatial/dist/style.css'; import '../../semantic-ui/dist/style.css'; import '../../shared/dist/style.css'; diff --git a/packages/storybook/postcss.config.js b/packages/storybook/postcss.config.js index 33ad091d..12a703d9 100644 --- a/packages/storybook/postcss.config.js +++ b/packages/storybook/postcss.config.js @@ -3,4 +3,4 @@ module.exports = { tailwindcss: {}, autoprefixer: {}, }, -} +}; diff --git a/packages/storybook/tailwind.config.js b/packages/storybook/tailwind.config.js index 6ad800f2..2740ceb4 100644 --- a/packages/storybook/tailwind.config.js +++ b/packages/storybook/tailwind.config.js @@ -1,11 +1,19 @@ +import coreDataConfig from '@performant-software/core-data/tailwind.config.js'; + /** @type {import('tailwindcss').Config} */ module.exports = { content: [ './src/index.css', - './src/**/*.js' + './src/**/*.js', + '../../node_modules/@performant-software/core-data/src/**/*.{js,jsx,ts,tsx}' ], theme: { - extend: {}, + ...coreDataConfig.theme, + extend: { + ...coreDataConfig.theme?.extend + }, }, - plugins: [], + plugins: [ + ...coreDataConfig.plugins + ] }; From 0582a8bf00d1812acaddb9437853d32f85f9682f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Fri, 29 Mar 2024 10:28:43 -0400 Subject: [PATCH 079/109] Atlas #4 - Publishing v2.1.0-beta.39 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 7 ++++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- yarn.lock | 9 +++++++++ 9 files changed, 25 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 62954900..148f5756 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-beta.38", + "version": "2.1.0-beta.39", "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-beta.38", - "@performant-software/shared-components": "^2.1.0-beta.38", + "@performant-software/semantic-components": "^2.1.0-beta.39", + "@performant-software/shared-components": "^2.1.0-beta.39", "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 a1a92ffd..17505e68 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-beta.38", + "version": "2.1.0-beta.39", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -28,6 +28,7 @@ "i18next": "^23.8.2", "instantsearch.js": "^4.66.0", "lucide-react": "^0.321.0", + "postcss-import": "^16.1.0", "react-instantsearch": "^7.5.4", "react-virtualized-auto-sizer": "^1.0.22", "react-window": "^1.8.10", @@ -35,7 +36,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.38", + "@performant-software/geospatial": "^2.1.0-beta.39", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", @@ -54,4 +55,4 @@ "vite": "^5.1.4", "vite-plugin-copy": "^0.1.6" } -} \ No newline at end of file +} diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index c406732c..6e390057 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.38", + "version": "2.1.0-beta.39", "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 7dd47d8c..0d5d97a3 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-beta.38", + "version": "2.1.0-beta.39", "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-beta.38", + "@performant-software/shared-components": "^2.1.0-beta.39", "@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 8f4fd37a..34274cb2 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.38", + "version": "2.1.0-beta.39", "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 c0ff722f..9bd0e7e9 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-beta.38", + "version": "2.1.0-beta.39", "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-beta.38", - "@performant-software/shared-components": "^2.1.0-beta.38", + "@performant-software/semantic-components": "^2.1.0-beta.39", + "@performant-software/shared-components": "^2.1.0-beta.39", "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 a1e40719..450b2b57 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.38", + "version": "2.1.0-beta.39", "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 8d072e17..05ea213b 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.38" + "version": "2.1.0-beta.39" } diff --git a/yarn.lock b/yarn.lock index a9530df6..dfe7dec4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12184,6 +12184,15 @@ postcss-import@^15.1.0: read-cache "^1.0.0" resolve "^1.1.7" +postcss-import@^16.1.0: + version "16.1.0" + resolved "https://registry.yarnpkg.com/postcss-import/-/postcss-import-16.1.0.tgz#258732175518129667fe1e2e2a05b19b5654b96a" + integrity sha512-7hsAZ4xGXl4MW+OKEWCnF6T5jqBw80/EE9aXg1r2yyn1RsVEU8EtKXbijEODa+rg7iih4bKf7vlvTGYR4CnPNg== + dependencies: + postcss-value-parser "^4.0.0" + read-cache "^1.0.0" + resolve "^1.1.7" + postcss-js@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-js/-/postcss-js-4.0.1.tgz#61598186f3703bab052f1c4f7d805f3991bee9d2" From 972d1a2cfed8103904f20fe5b7aafeadd31d28be Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Fri, 29 Mar 2024 11:49:37 -0400 Subject: [PATCH 080/109] Atlas #4 - Updating "core-data" package to export separate custom CSS and Tailwind CSS --- packages/core-data/README.md | 41 +++++++++++++++++++ packages/core-data/package.json | 5 ++- packages/core-data/postcss.config.js | 1 + .../core-data/src/components/FacetList.js | 1 - .../core-data/src/components/LoadAnimation.js | 1 - .../core-data/src/components/MediaGallery.js | 1 - .../src/components/PlaceResultsList.js | 1 - .../core-data/src/components/RelatedItem.css | 4 -- .../core-data/src/components/RelatedItem.js | 1 - .../src/components/RelatedItemsList.js | 1 - packages/core-data/src/index.css | 8 ++-- .../src/{components => styles}/FacetList.css | 0 .../{components => styles}/LoadAnimation.css | 0 .../{components => styles}/MediaGallery.css | 0 .../PlaceResultsList.css | 0 .../RelatedItemsList.css | 5 +++ packages/core-data/src/tailwind.css | 3 ++ packages/core-data/src/tailwind.js | 3 ++ packages/core-data/tailwind.config.js | 17 +++++--- packages/core-data/vite.config.js | 6 ++- packages/storybook/.storybook/preview.js | 12 ++++++ packages/storybook/tailwind.config.js | 22 +++++----- 22 files changed, 99 insertions(+), 34 deletions(-) delete mode 100644 packages/core-data/src/components/RelatedItem.css rename packages/core-data/src/{components => styles}/FacetList.css (100%) rename packages/core-data/src/{components => styles}/LoadAnimation.css (100%) rename packages/core-data/src/{components => styles}/MediaGallery.css (100%) rename packages/core-data/src/{components => styles}/PlaceResultsList.css (100%) rename packages/core-data/src/{components => styles}/RelatedItemsList.css (88%) create mode 100644 packages/core-data/src/tailwind.css create mode 100644 packages/core-data/src/tailwind.js diff --git a/packages/core-data/README.md b/packages/core-data/README.md index e69de29b..265abb4c 100644 --- a/packages/core-data/README.md +++ b/packages/core-data/README.md @@ -0,0 +1,41 @@ +# core-data + +## CSS +Depending on whether your application using Tailwind CSS, we'll configure the CSS in one of two ways: + +### WITHOUT Tailwind CSS +Import both exported `styles.css` and `tailwind.css` into your application. + +```javascript +// index.js + +import '@performant-software/core-data/styles.css'; +import '@performant-software/core-data/tailwind.css'; +``` + +### WITH Tailwind CSS + +Import **ONLY** the `styles.css` import your application. + +```javascript +// index.js + +import '@performant-software/core-data/styles.css'; +``` + +Include the `core-data` Tailwind config as a `present`, and update the `content` section to source classes from the `core-data` package. + +```javascript +// tailwind.config.js + +import coreDataConfig from '@performant-software/core-data/tailwind.config'; + +export default { + presets: [ + coreDataConfig + ], + content: [ + '../../node_modules/@performant-software/core-data/**/*.{js,jsx,ts,tsx}' + ] +}; +``` \ No newline at end of file diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 17505e68..8f80da82 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -12,8 +12,9 @@ "import": "./dist/index.es.js", "require": "./dist/index.cjs.js" }, - "./style.css": "./dist/style.css", - "./tailwind.config.js": "./dist/tailwind.config.js" + "./style.css": "./dist/packages/core-data/src/index.css", + "./tailwind.css": "./dist/packages/core-data/src/tailwind.css", + "./tailwind.config": "./dist/tailwind.config.js" }, "scripts": { "build": "vite build && flow-copy-source -v src types" diff --git a/packages/core-data/postcss.config.js b/packages/core-data/postcss.config.js index 2421e245..dea48785 100644 --- a/packages/core-data/postcss.config.js +++ b/packages/core-data/postcss.config.js @@ -2,6 +2,7 @@ export default { plugins: { + 'postcss-import': {}, tailwindcss: {}, autoprefixer: {} } diff --git a/packages/core-data/src/components/FacetList.js b/packages/core-data/src/components/FacetList.js index 2cc86069..3900be46 100644 --- a/packages/core-data/src/components/FacetList.js +++ b/packages/core-data/src/components/FacetList.js @@ -1,7 +1,6 @@ // @flow import React, { type Node } from 'react'; -import './FacetList.css'; type Props = { label: string, diff --git a/packages/core-data/src/components/LoadAnimation.js b/packages/core-data/src/components/LoadAnimation.js index 82853c7a..1fafaf08 100644 --- a/packages/core-data/src/components/LoadAnimation.js +++ b/packages/core-data/src/components/LoadAnimation.js @@ -1,7 +1,6 @@ // @flow import React from 'react'; -import './LoadAnimation.css'; type Props = { /** diff --git a/packages/core-data/src/components/MediaGallery.js b/packages/core-data/src/components/MediaGallery.js index 9a508ea2..2a78926f 100644 --- a/packages/core-data/src/components/MediaGallery.js +++ b/packages/core-data/src/components/MediaGallery.js @@ -5,7 +5,6 @@ import Viewer from '@samvera/clover-iiif/viewer'; import { Image, X } from 'lucide-react'; import React from 'react'; import type { MediaContent } from '../types/MediaContent'; -import './MediaGallery.css'; type Props = { /** diff --git a/packages/core-data/src/components/PlaceResultsList.js b/packages/core-data/src/components/PlaceResultsList.js index 78979dea..9388cdfb 100644 --- a/packages/core-data/src/components/PlaceResultsList.js +++ b/packages/core-data/src/components/PlaceResultsList.js @@ -7,7 +7,6 @@ import { FixedSizeList } from 'react-window'; import _ from 'underscore'; import type { Feature } from '../types/Feature'; import type { Place } from '../types/typesense/Place'; -import './PlaceResultsList.css'; /** * Converts the passed place result to a feature. diff --git a/packages/core-data/src/components/RelatedItem.css b/packages/core-data/src/components/RelatedItem.css deleted file mode 100644 index e6892a5c..00000000 --- a/packages/core-data/src/components/RelatedItem.css +++ /dev/null @@ -1,4 +0,0 @@ -.related-item .accordion-content[data-state="closed"] { - visibility: hidden; - height: 0; -} \ No newline at end of file diff --git a/packages/core-data/src/components/RelatedItem.js b/packages/core-data/src/components/RelatedItem.js index 3f03ef50..ef7697cc 100644 --- a/packages/core-data/src/components/RelatedItem.js +++ b/packages/core-data/src/components/RelatedItem.js @@ -5,7 +5,6 @@ import { AlertCircle, ChevronDown } from 'lucide-react'; import React, { type Node } from 'react'; import i18n from '../i18n/i18n'; import LoadAnimation from './LoadAnimation'; -import './RelatedItem.css'; type Props = { children: Node, diff --git a/packages/core-data/src/components/RelatedItemsList.js b/packages/core-data/src/components/RelatedItemsList.js index b58f35e9..8e9a6860 100644 --- a/packages/core-data/src/components/RelatedItemsList.js +++ b/packages/core-data/src/components/RelatedItemsList.js @@ -2,7 +2,6 @@ import * as Accordion from '@radix-ui/react-accordion'; import React, { type Node } from 'react'; -import './RelatedItemsList.css'; type Props = { children: Node diff --git a/packages/core-data/src/index.css b/packages/core-data/src/index.css index bd6213e1..4b143153 100644 --- a/packages/core-data/src/index.css +++ b/packages/core-data/src/index.css @@ -1,3 +1,5 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; \ No newline at end of file +@import './styles/FacetList.css'; +@import './styles/LoadAnimation.css'; +@import './styles/MediaGallery.css'; +@import './styles/PlaceResultsList.css'; +@import './styles/RelatedItemsList.css'; \ No newline at end of file diff --git a/packages/core-data/src/components/FacetList.css b/packages/core-data/src/styles/FacetList.css similarity index 100% rename from packages/core-data/src/components/FacetList.css rename to packages/core-data/src/styles/FacetList.css diff --git a/packages/core-data/src/components/LoadAnimation.css b/packages/core-data/src/styles/LoadAnimation.css similarity index 100% rename from packages/core-data/src/components/LoadAnimation.css rename to packages/core-data/src/styles/LoadAnimation.css diff --git a/packages/core-data/src/components/MediaGallery.css b/packages/core-data/src/styles/MediaGallery.css similarity index 100% rename from packages/core-data/src/components/MediaGallery.css rename to packages/core-data/src/styles/MediaGallery.css diff --git a/packages/core-data/src/components/PlaceResultsList.css b/packages/core-data/src/styles/PlaceResultsList.css similarity index 100% rename from packages/core-data/src/components/PlaceResultsList.css rename to packages/core-data/src/styles/PlaceResultsList.css diff --git a/packages/core-data/src/components/RelatedItemsList.css b/packages/core-data/src/styles/RelatedItemsList.css similarity index 88% rename from packages/core-data/src/components/RelatedItemsList.css rename to packages/core-data/src/styles/RelatedItemsList.css index 52b2daaa..a5b43a04 100644 --- a/packages/core-data/src/components/RelatedItemsList.css +++ b/packages/core-data/src/styles/RelatedItemsList.css @@ -10,6 +10,11 @@ overflow: hidden; } +.related-items-list .accordion-content[data-state="closed"] { + visibility: hidden; + height: 0; +} + .related-items-list .accordion-content[data-state='open'] { animation: slideDown 300ms cubic-bezier(0.87, 0, 0.13, 1); } diff --git a/packages/core-data/src/tailwind.css b/packages/core-data/src/tailwind.css new file mode 100644 index 00000000..5be59b4c --- /dev/null +++ b/packages/core-data/src/tailwind.css @@ -0,0 +1,3 @@ +@import 'tailwindcss/base'; +@import 'tailwindcss/components'; +@import 'tailwindcss/utilities'; \ No newline at end of file diff --git a/packages/core-data/src/tailwind.js b/packages/core-data/src/tailwind.js new file mode 100644 index 00000000..548a0a79 --- /dev/null +++ b/packages/core-data/src/tailwind.js @@ -0,0 +1,3 @@ +// @flow + +import './tailwind.css'; diff --git a/packages/core-data/tailwind.config.js b/packages/core-data/tailwind.config.js index fc17ee62..becf36ff 100644 --- a/packages/core-data/tailwind.config.js +++ b/packages/core-data/tailwind.config.js @@ -1,7 +1,6 @@ /** @type {import('tailwindcss').Config} */ -module.exports = { +export default { content: [ - './src/index.css', './src/**/*.js' ], theme: { @@ -10,10 +9,16 @@ module.exports = { muted: '#0005119e' }, fontFamily: { - sans: ['-apple-system', 'Roboto', 'sans-serif'], - 'dm-display': ['DM Serif Display'], - }, - }, + sans: [ + '-apple-system', + 'Roboto', + 'sans-serif' + ], + 'dm-display': [ + 'DM Serif Display' + ] + } + } }, plugins: [] }; diff --git a/packages/core-data/vite.config.js b/packages/core-data/vite.config.js index bcc27021..2f246f58 100644 --- a/packages/core-data/vite.config.js +++ b/packages/core-data/vite.config.js @@ -29,9 +29,13 @@ export default defineConfig(() => ({ }) ], build: { + cssCodeSplit: true, sourcemap: true, lib: { - entry: './src/index.js', + entry: [ + './src/index.js', + './src/tailwind.js' + ], formats: ['es', 'cjs'], fileName: (format) => `index.${format}.js` }, diff --git a/packages/storybook/.storybook/preview.js b/packages/storybook/.storybook/preview.js index 86216c35..1cd79920 100644 --- a/packages/storybook/.storybook/preview.js +++ b/packages/storybook/.storybook/preview.js @@ -3,12 +3,24 @@ import { DocsContainer } from '@storybook/addon-docs'; import React, { useRef } from 'react'; import ModalContext from '../../semantic-ui/src/context/ModalContext'; + +// Peripleo styles import '@peripleo/maplibre/peripleo-maplibre.css'; import '@peripleo/peripleo/default-theme'; + +// Component package styles +import '../../controlled-vocabulary/dist/style.css'; +import '../../core-data/dist/packages/core-data/src/index.css'; import '../../geospatial/dist/style.css'; import '../../semantic-ui/dist/style.css'; import '../../shared/dist/style.css'; +import '../../user-defined-fields/dist/style.css'; +import '../../visualize/dist/style.css'; + +// Storybook styles import './styles/index.css'; + +// Tailwind styles import '../src/index.css'; /** diff --git a/packages/storybook/tailwind.config.js b/packages/storybook/tailwind.config.js index 2740ceb4..a6a209b6 100644 --- a/packages/storybook/tailwind.config.js +++ b/packages/storybook/tailwind.config.js @@ -1,19 +1,17 @@ -import coreDataConfig from '@performant-software/core-data/tailwind.config.js'; +// eslint-disable-next-line import/no-extraneous-dependencies +import coreDataConfig from '@performant-software/core-data/tailwind.config'; /** @type {import('tailwindcss').Config} */ -module.exports = { +export default { + presets: [ + coreDataConfig + ], content: [ - './src/index.css', - './src/**/*.js', - '../../node_modules/@performant-software/core-data/src/**/*.{js,jsx,ts,tsx}' + './src/**/*.{js,jsx,ts,tsx}', + '../../node_modules/@performant-software/core-data/**/*.{js,jsx,ts,tsx}' ], theme: { - ...coreDataConfig.theme, - extend: { - ...coreDataConfig.theme?.extend - }, + extend: {}, }, - plugins: [ - ...coreDataConfig.plugins - ] + plugins: [] }; From c631af8c5e7a6b29a74695af0511d8a6a916ef69 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Fri, 29 Mar 2024 11:55:31 -0400 Subject: [PATCH 081/109] Atlas #4 - Publishing v2.1.0-beta.40 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 148f5756..8aa167c8 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-beta.39", + "version": "2.1.0-beta.40", "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-beta.39", - "@performant-software/shared-components": "^2.1.0-beta.39", + "@performant-software/semantic-components": "^2.1.0-beta.40", + "@performant-software/shared-components": "^2.1.0-beta.40", "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 8f80da82..38960149 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-beta.39", + "version": "2.1.0-beta.40", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,7 +37,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.39", + "@performant-software/geospatial": "^2.1.0-beta.40", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", @@ -56,4 +56,4 @@ "vite": "^5.1.4", "vite-plugin-copy": "^0.1.6" } -} +} \ No newline at end of file diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 6e390057..0467eee6 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.39", + "version": "2.1.0-beta.40", "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 0d5d97a3..77e5ed58 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-beta.39", + "version": "2.1.0-beta.40", "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-beta.39", + "@performant-software/shared-components": "^2.1.0-beta.40", "@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 34274cb2..4d0ff620 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.39", + "version": "2.1.0-beta.40", "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 9bd0e7e9..bb2381d5 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-beta.39", + "version": "2.1.0-beta.40", "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-beta.39", - "@performant-software/shared-components": "^2.1.0-beta.39", + "@performant-software/semantic-components": "^2.1.0-beta.40", + "@performant-software/shared-components": "^2.1.0-beta.40", "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 450b2b57..60293794 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.39", + "version": "2.1.0-beta.40", "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 05ea213b..c38f7a2e 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.39" + "version": "2.1.0-beta.40" } From d5d4459bd39980591b592b93ffba11c996057e6d Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 07:08:20 -0400 Subject: [PATCH 082/109] Atlas #4 - Adding optional "boundingBoxOptions" and "boundingBoxData" props to LocationMarkers --- .../src/components/SearchResultsLayer.js | 5 +++-- .../geospatial/src/components/LocationMarkers.js | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/core-data/src/components/SearchResultsLayer.js b/packages/core-data/src/components/SearchResultsLayer.js index 98115bec..d5e6e30f 100644 --- a/packages/core-data/src/components/SearchResultsLayer.js +++ b/packages/core-data/src/components/SearchResultsLayer.js @@ -7,6 +7,7 @@ import TypesenseUtils from '../utils/Typesense'; import { useCachedHits, useSearchCompleted } from '../hooks/Typesense'; type Props = { + boundingBoxData?: any, boundingBoxOptions?: any, buffer?: number, fitBoundingBox?: boolean, @@ -44,9 +45,9 @@ const SearchResultsLayer = (props: Props) => { useSearchCompleted(() => { if (props.fitBoundingBox && mapLoaded && data) { const boundingBox = MapUtils.getBoundingBox(data, props.buffer); - map.fitBounds(boundingBox, props.boundingBoxOptions); + map.fitBounds(boundingBox, props.boundingBoxOptions, props.boundingBoxData); } - }, [data, map, mapLoaded, props.boundingBoxOptions, props.buffer, props.fitBoundingBox]); + }, [data, map, mapLoaded, props.boundingBoxData, props.boundingBoxOptions, props.buffer, props.fitBoundingBox]); return ( { useEffect(() => { if (map && props.data && props.fitBoundingBox) { const boundingBox = MapUtils.getBoundingBox(props.data, props.buffer); - map.fitBounds(boundingBox); + map.fitBounds(boundingBox, props.boundingBoxOptions, props.boundingBoxData); } - }, [map, props.buffer, props.data, props.fitBoundingBox]); + }, [map, props.buffer, props.data, props.boundingBoxData, props.boundingBoxOptions, props.fitBoundingBox]); return ( <> From e35528644658d416f441de32c2103f702ae11ffe Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 07:21:47 -0400 Subject: [PATCH 083/109] Atlas #4 - Publishing v2.1.0-beta.41 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 4 ++-- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 8aa167c8..0dfe7429 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-beta.40", + "version": "2.1.0-beta.41", "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-beta.40", - "@performant-software/shared-components": "^2.1.0-beta.40", + "@performant-software/semantic-components": "^2.1.0-beta.41", + "@performant-software/shared-components": "^2.1.0-beta.41", "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 38960149..00610f7f 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-beta.40", + "version": "2.1.0-beta.41", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -37,7 +37,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.40", + "@performant-software/geospatial": "^2.1.0-beta.41", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index 0467eee6..d4eafc75 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.40", + "version": "2.1.0-beta.41", "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 77e5ed58..ce9af472 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-beta.40", + "version": "2.1.0-beta.41", "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-beta.40", + "@performant-software/shared-components": "^2.1.0-beta.41", "@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 4d0ff620..804efb8d 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.40", + "version": "2.1.0-beta.41", "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 bb2381d5..21ae0ea4 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-beta.40", + "version": "2.1.0-beta.41", "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-beta.40", - "@performant-software/shared-components": "^2.1.0-beta.40", + "@performant-software/semantic-components": "^2.1.0-beta.41", + "@performant-software/shared-components": "^2.1.0-beta.41", "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 60293794..cad2c19a 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.40", + "version": "2.1.0-beta.41", "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 c38f7a2e..727e9371 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.40" + "version": "2.1.0-beta.41" } From 3fd0ccc4a433ec0a689ab3fe18896938096874a3 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 10:39:23 -0400 Subject: [PATCH 084/109] Atlas #4 - Adding PlaceLayersSelector component; Updating OverlayLayers to allow GeoJSON data or URL --- packages/core-data/package.json | 3 +- .../core-data/src/components/OverlayLayers.js | 23 +- .../src/components/PlaceLayersSelector.js | 96 + packages/core-data/src/index.js | 1 + .../core-data/PlaceLayersSelector.stories.js | 61 + .../storybook/src/data/GeorgiaBorder.json | 2184 +++++++++++++++++ yarn.lock | 15 + 7 files changed, 2376 insertions(+), 7 deletions(-) create mode 100644 packages/core-data/src/components/PlaceLayersSelector.js create mode 100644 packages/storybook/src/core-data/PlaceLayersSelector.stories.js create mode 100644 packages/storybook/src/data/GeorgiaBorder.json diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 00610f7f..a79c41ea 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -21,6 +21,7 @@ }, "dependencies": { "@radix-ui/react-accordion": "^1.1.2", + "@radix-ui/react-checkbox": "^1.0.4", "@radix-ui/react-dialog": "^1.0.5", "@radix-ui/react-dropdown-menu": "^2.0.6", "@samvera/clover-iiif": "^2.3.2", @@ -56,4 +57,4 @@ "vite": "^5.1.4", "vite-plugin-copy": "^0.1.6" } -} \ No newline at end of file +} diff --git a/packages/core-data/src/components/OverlayLayers.js b/packages/core-data/src/components/OverlayLayers.js index 9db35614..df02dfd6 100644 --- a/packages/core-data/src/components/OverlayLayers.js +++ b/packages/core-data/src/components/OverlayLayers.js @@ -4,11 +4,17 @@ import { MapStyles } from '@performant-software/geospatial'; import { GeoJSONLayer, RasterLayer } from '@peripleo/maplibre'; import React from 'react'; import _ from 'underscore'; -import type { Layer as LayerType } from '../types/RuntimeConfig'; -interface OverlayLayerProps { - overlay: Layer; -} +type Layer = { + layer_type: string, + data?: { [key: string]: any }, + name: string, + url?: string +}; + +type OverlayLayerProps = { + overlay: Layer +}; const OverlayLayer = (props: OverlayLayerProps) => { const { overlay } = props; @@ -17,7 +23,7 @@ const OverlayLayer = (props: OverlayLayerProps) => { return ( ( - _.map(props.overlays, (overlay: any) => ) + _.map(props.overlays, (overlay: LayerType, index: number) => ( + + )) ); export default OverlayLayers; diff --git a/packages/core-data/src/components/PlaceLayersSelector.js b/packages/core-data/src/components/PlaceLayersSelector.js new file mode 100644 index 00000000..95a8aad7 --- /dev/null +++ b/packages/core-data/src/components/PlaceLayersSelector.js @@ -0,0 +1,96 @@ +// @flow + +import * as Checkbox from '@radix-ui/react-checkbox'; +import { CheckSquare2, Square } from 'lucide-react'; +import React, { useCallback, useState } from 'react'; +import _ from 'underscore'; +import OverlayLayers from './OverlayLayers'; +import type { Layer as LayerType } from '../types/RuntimeConfig'; + +type Props = { + label: string, + layers: Array +}; + +const PlaceLayersSelector = (props: Props) => { + const [selectedLayers, setSelectedLayers] = useState([]); + + /** + * Returns true if the passed ID is in the collection of selected IDs. + * + * @type {function(*): boolean} + */ + const isSelected = useCallback(({ name }) => _.findWhere(selectedLayers, { name }), [selectedLayers]); + + /** + * Toggles selection for the passed ID. + * + * @type {(function(*): void)|*} + */ + const onChange = useCallback((layer) => { + if (isSelected(layer)) { + setSelectedLayers((prevSelected) => _.filter(prevSelected, (l) => l.url !== layer.url)); + } else { + setSelectedLayers((prevSelected) => [...prevSelected, layer]); + } + }, [isSelected]); + + if (_.isEmpty(props.layers)) { + return null; + } + + return ( +
    + +

    + { props.label } +

    +
      + { _.map(props.layers, (layer, index) => ( +
    • +
      + onChange(layer)} + > + { isSelected(layer) && ( + + )} + { !isSelected(layer) && ( + + )} + + +
      +
    • + ))} +
    +
    + ); +}; + +export default PlaceLayersSelector; diff --git a/packages/core-data/src/index.js b/packages/core-data/src/index.js index 3355149a..cc160f8c 100644 --- a/packages/core-data/src/index.js +++ b/packages/core-data/src/index.js @@ -15,6 +15,7 @@ export { default as MediaGallery } from './components/MediaGallery'; export { default as OverlayLayers } from './components/OverlayLayers'; export { default as PersistentSearchStateContextProvider } from './components/PersistentSearchStateContextProvider'; export { default as PlaceDetails } from './components/PlaceDetails'; +export { default as PlaceLayersSelector } from './components/PlaceLayersSelector'; export { default as PlaceMarkers } from './components/PlaceMarkers'; export { default as PlaceResultsList } from './components/PlaceResultsList'; export { default as RefinementListProxy } from './components/RefinementListProxy'; diff --git a/packages/storybook/src/core-data/PlaceLayersSelector.stories.js b/packages/storybook/src/core-data/PlaceLayersSelector.stories.js new file mode 100644 index 00000000..1262f310 --- /dev/null +++ b/packages/storybook/src/core-data/PlaceLayersSelector.stories.js @@ -0,0 +1,61 @@ +// @flow + +import { Map, Zoom } from '@peripleo/maplibre'; +import { Controls, Peripleo } from '@peripleo/peripleo'; +import React from 'react'; +import LocationMarkers from '../../../geospatial/src/components/LocationMarkers'; +import mapStyle from '../data/MapStyles.json'; +import PlaceLayersSelector from '../../../core-data/src/components/PlaceLayersSelector'; +import data from '../data/GeorgiaBorder.json'; + +export default { + title: 'Components/Core Data/PlaceLayersSelector', + component: PlaceLayersSelector +}; + +export const Default = () => ( + + + + + +
    + +
    +
    + +
    +); diff --git a/packages/storybook/src/data/GeorgiaBorder.json b/packages/storybook/src/data/GeorgiaBorder.json new file mode 100644 index 00000000..7ae96378 --- /dev/null +++ b/packages/storybook/src/data/GeorgiaBorder.json @@ -0,0 +1,2184 @@ +{ + "_id": "georgia", + "type": "Feature", + "properties": { + "name": "Georgia", + "abbreviation": "GA", + "capital": "Atlanta", + "city": "Atlanta", + "population": 9992167, + "area": 153910, + "waterarea": 4950, + "landarea": 148958, + "houseseats": 14, + "statehood": "1788-01-02", + "group": "US States" + }, + "geometry": { + "coordinates": [ + [ + [ + -84.810477, + 34.987607 + ], + [ + -84.809184, + 34.987569 + ], + [ + -84.808127, + 34.987592 + ], + [ + -84.775852, + 34.9878 + ], + [ + -84.731022, + 34.988088 + ], + [ + -84.727434, + 34.98802 + ], + [ + -84.621483, + 34.988329 + ], + [ + -84.509886, + 34.98801 + ], + [ + -84.509052, + 34.988033 + ], + [ + -84.394903, + 34.98803 + ], + [ + -84.393935, + 34.988068 + ], + [ + -84.321869, + 34.988408 + ], + [ + -84.129555, + 34.987504 + ], + [ + -84.129455, + 34.987504 + ], + [ + -84.029954, + 34.987321 + ], + [ + -84.021357, + 34.98743 + ], + [ + -84.005457, + 34.98744 + ], + [ + -83.936646, + 34.987485 + ], + [ + -83.936413, + 34.987485 + ], + [ + -83.673621, + 34.987111 + ], + [ + -83.620185, + 34.992091 + ], + [ + -83.549381, + 34.992492 + ], + [ + -83.483064, + 34.993737 + ], + [ + -83.108714, + 35.000768 + ], + [ + -83.108535, + 35.000771 + ], + [ + -83.143261, + 34.924756 + ], + [ + -83.242962, + 34.877749 + ], + [ + -83.267293, + 34.832748 + ], + [ + -83.283151, + 34.821328 + ], + [ + -83.32406, + 34.788691 + ], + [ + -83.339129, + 34.741266 + ], + [ + -83.352422, + 34.716111 + ], + [ + -83.352485, + 34.715993 + ], + [ + -83.351392, + 34.714456 + ], + [ + -83.350976, + 34.713243 + ], + [ + -83.351293, + 34.701703 + ], + [ + -83.338194, + 34.687924 + ], + [ + -83.337867, + 34.687681 + ], + [ + -83.291683, + 34.653396 + ], + [ + -83.240669, + 34.624507 + ], + [ + -83.240676, + 34.624307 + ], + [ + -83.167523, + 34.600424 + ], + [ + -83.170978, + 34.598798 + ], + [ + -83.170278, + 34.592398 + ], + [ + -83.106874, + 34.534053 + ], + [ + -83.087189, + 34.515939 + ], + [ + -83.072746, + 34.504349 + ], + [ + -83.052161, + 34.493062 + ], + [ + -83.034712, + 34.483495 + ], + [ + -83.006848, + 34.474376 + ], + [ + -82.995284, + 34.474549 + ], + [ + -82.992671, + 34.479072 + ], + [ + -82.992215, + 34.479198 + ], + [ + -82.979568, + 34.482702 + ], + [ + -82.939067, + 34.486202 + ], + [ + -82.902665, + 34.485902 + ], + [ + -82.882864, + 34.479003 + ], + [ + -82.873831, + 34.471508 + ], + [ + -82.874864, + 34.468891 + ], + [ + -82.848651, + 34.423844 + ], + [ + -82.766078, + 34.293509 + ], + [ + -82.755028, + 34.276067 + ], + [ + -82.74198, + 34.230196 + ], + [ + -82.743461, + 34.227343 + ], + [ + -82.744415, + 34.224913 + ], + [ + -82.74192, + 34.210063 + ], + [ + -82.741491, + 34.208709 + ], + [ + -82.731881, + 34.178363 + ], + [ + -82.717507, + 34.150504 + ], + [ + -82.70414, + 34.141007 + ], + [ + -82.67732, + 34.131657 + ], + [ + -82.668113, + 34.12016 + ], + [ + -82.659077, + 34.103544 + ], + [ + -82.658561, + 34.103118 + ], + [ + -82.654019, + 34.100346 + ], + [ + -82.652175, + 34.099704 + ], + [ + -82.641252, + 34.088914 + ], + [ + -82.640701, + 34.088341 + ], + [ + -82.597079, + 34.01239 + ], + [ + -82.564582, + 33.95581 + ], + [ + -82.564483, + 33.955744 + ], + [ + -82.429164, + 33.865844 + ], + [ + -82.422803, + 33.863754 + ], + [ + -82.408354, + 33.86632 + ], + [ + -82.403881, + 33.865477 + ], + [ + -82.32448, + 33.820033 + ], + [ + -82.301457, + 33.801864 + ], + [ + -82.247472, + 33.752591 + ], + [ + -82.218649, + 33.686299 + ], + [ + -82.196583, + 33.630582 + ], + [ + -82.179854, + 33.615945 + ], + [ + -82.135046, + 33.591044 + ], + [ + -82.12908, + 33.589925 + ], + [ + -82.124841, + 33.591274 + ], + [ + -82.11663, + 33.589723 + ], + [ + -82.098816, + 33.586358 + ], + [ + -82.069039, + 33.575382 + ], + [ + -82.046335, + 33.56383 + ], + [ + -82.028238, + 33.544934 + ], + [ + -82.014293, + 33.530313 + ], + [ + -82.007638, + 33.523335 + ], + [ + -82.007138, + 33.522835 + ], + [ + -81.967037, + 33.480636 + ], + [ + -81.957934, + 33.468632 + ], + [ + -81.912572, + 33.408811 + ], + [ + -81.902737, + 33.331242 + ], + [ + -81.852136, + 33.247544 + ], + [ + -81.851975, + 33.247408 + ], + [ + -81.772251, + 33.18012 + ], + [ + -81.696934, + 33.116551 + ], + [ + -81.620287, + 33.095408 + ], + [ + -81.615756, + 33.092534 + ], + [ + -81.541831, + 33.045654 + ], + [ + -81.51169, + 33.024506 + ], + [ + -81.496637, + 33.010224 + ], + [ + -81.491495, + 32.998572 + ], + [ + -81.494736, + 32.978998 + ], + [ + -81.49983, + 32.963816 + ], + [ + -81.423772, + 32.810514 + ], + [ + -81.404949, + 32.747027 + ], + [ + -81.405134, + 32.744964 + ], + [ + -81.414761, + 32.63744 + ], + [ + -81.418431, + 32.634704 + ], + [ + -81.41866, + 32.629392 + ], + [ + -81.411906, + 32.61841 + ], + [ + -81.389338, + 32.595436 + ], + [ + -81.389258, + 32.595385 + ], + [ + -81.348155, + 32.569294 + ], + [ + -81.328753, + 32.561228 + ], + [ + -81.318255, + 32.559722 + ], + [ + -81.286776, + 32.544831 + ], + [ + -81.275415, + 32.539457 + ], + [ + -81.199029, + 32.467286 + ], + [ + -81.168032, + 32.368391 + ], + [ + -81.140932, + 32.349393 + ], + [ + -81.134332, + 32.341693 + ], + [ + -81.122333, + 32.305395 + ], + [ + -81.120333, + 32.285796 + ], + [ + -81.128034, + 32.276297 + ], + [ + -81.125457, + 32.22713 + ], + [ + -81.122034, + 32.161803 + ], + [ + -81.117234, + 32.117605 + ], + [ + -81.113334, + 32.113205 + ], + [ + -81.06185, + 32.087935 + ], + [ + -81.042833, + 32.084508 + ], + [ + -81.004115, + 32.072225 + ], + [ + -80.885517, + 32.0346 + ], + [ + -80.859111, + 32.023693 + ], + [ + -80.852276, + 32.026676 + ], + [ + -80.84313, + 32.024226 + ], + [ + -80.840549, + 32.011306 + ], + [ + -80.841913, + 32.002643 + ], + [ + -80.848441, + 31.988279 + ], + [ + -80.862814, + 31.969346 + ], + [ + -80.882814, + 31.959075 + ], + [ + -80.897687, + 31.949065 + ], + [ + -80.911207, + 31.943769 + ], + [ + -80.929101, + 31.944964 + ], + [ + -80.930279, + 31.956705 + ], + [ + -80.948491, + 31.95723 + ], + [ + -80.972392, + 31.94127 + ], + [ + -80.975714, + 31.923602 + ], + [ + -80.968494, + 31.915822 + ], + [ + -80.954469, + 31.911768 + ], + [ + -80.941359, + 31.912984 + ], + [ + -80.934508, + 31.90918 + ], + [ + -80.947294, + 31.89621 + ], + [ + -80.971434, + 31.877941 + ], + [ + -80.99269, + 31.857641 + ], + [ + -81.000317, + 31.856744 + ], + [ + -81.014478, + 31.867474 + ], + [ + -81.041548, + 31.876198 + ], + [ + -81.065255, + 31.877095 + ], + [ + -81.058596, + 31.857811 + ], + [ + -81.05907, + 31.850106 + ], + [ + -81.06279, + 31.84474 + ], + [ + -81.076178, + 31.836132 + ], + [ + -81.075812, + 31.829031 + ], + [ + -81.057181, + 31.822687 + ], + [ + -81.050946, + 31.822383 + ], + [ + -81.04794, + 31.824881 + ], + [ + -81.039808, + 31.823 + ], + [ + -81.036958, + 31.819558 + ], + [ + -81.036873, + 31.812721 + ], + [ + -81.047345, + 31.802865 + ], + [ + -81.068116, + 31.768735 + ], + [ + -81.077057, + 31.761256 + ], + [ + -81.097402, + 31.753126 + ], + [ + -81.130634, + 31.722692 + ], + [ + -81.138448, + 31.720934 + ], + [ + -81.154686, + 31.726203 + ], + [ + -81.16067, + 31.728144 + ], + [ + -81.192784, + 31.733245 + ], + [ + -81.198394, + 31.72607 + ], + [ + -81.203572, + 31.719448 + ], + [ + -81.186303, + 31.701509 + ], + [ + -81.161084, + 31.691401 + ], + [ + -81.154624, + 31.693874 + ], + [ + -81.151888, + 31.698411 + ], + [ + -81.149369, + 31.699304 + ], + [ + -81.139394, + 31.699917 + ], + [ + -81.131137, + 31.695774 + ], + [ + -81.135608, + 31.683491 + ], + [ + -81.136408, + 31.674832 + ], + [ + -81.131728, + 31.654484 + ], + [ + -81.133493, + 31.623348 + ], + [ + -81.14997, + 31.593476 + ], + [ + -81.160364, + 31.570436 + ], + [ + -81.173079, + 31.555908 + ], + [ + -81.178822, + 31.55553 + ], + [ + -81.183252, + 31.560058 + ], + [ + -81.186114, + 31.568032 + ], + [ + -81.19438, + 31.568101 + ], + [ + -81.204315, + 31.568183 + ], + [ + -81.214536, + 31.557601 + ], + [ + -81.240699, + 31.552313 + ], + [ + -81.254218, + 31.55594 + ], + [ + -81.260076, + 31.54828 + ], + [ + -81.263905, + 31.532579 + ], + [ + -81.263437, + 31.530932 + ], + [ + -81.258809, + 31.52906 + ], + [ + -81.217948, + 31.527284 + ], + [ + -81.213519, + 31.528152 + ], + [ + -81.199518, + 31.537596 + ], + [ + -81.193016, + 31.535833 + ], + [ + -81.181592, + 31.527697 + ], + [ + -81.17831, + 31.52241 + ], + [ + -81.177254, + 31.517074 + ], + [ + -81.189643, + 31.503588 + ], + [ + -81.204883, + 31.473124 + ], + [ + -81.246911, + 31.422784 + ], + [ + -81.258616, + 31.404425 + ], + [ + -81.278798, + 31.367214 + ], + [ + -81.279338, + 31.351127 + ], + [ + -81.282923, + 31.326491 + ], + [ + -81.274513, + 31.326237 + ], + [ + -81.268027, + 31.324218 + ], + [ + -81.25482, + 31.315452 + ], + [ + -81.260958, + 31.30391 + ], + [ + -81.269906, + 31.294489 + ], + [ + -81.274688, + 31.289454 + ], + [ + -81.276862, + 31.254734 + ], + [ + -81.282842, + 31.24433 + ], + [ + -81.289136, + 31.225487 + ], + [ + -81.288403, + 31.211065 + ], + [ + -81.293359, + 31.206332 + ], + [ + -81.304957, + 31.206173 + ], + [ + -81.314183, + 31.207938 + ], + [ + -81.339028, + 31.186918 + ], + [ + -81.35488, + 31.167204 + ], + [ + -81.360791, + 31.155903 + ], + [ + -81.359349, + 31.149166 + ], + [ + -81.368241, + 31.136534 + ], + [ + -81.38683, + 31.133214 + ], + [ + -81.399677, + 31.134113 + ], + [ + -81.402096, + 31.125383 + ], + [ + -81.403732, + 31.107115 + ], + [ + -81.401209, + 31.086143 + ], + [ + -81.401267, + 31.072781 + ], + [ + -81.415123, + 31.026718 + ], + [ + -81.420474, + 31.016703 + ], + [ + -81.424732, + 31.013678 + ], + [ + -81.432475, + 31.012991 + ], + [ + -81.43471, + 31.014641 + ], + [ + -81.434923, + 31.017804 + ], + [ + -81.44317, + 31.016661 + ], + [ + -81.451444, + 31.015515 + ], + [ + -81.457795, + 31.010259 + ], + [ + -81.45924, + 31.005692 + ], + [ + -81.469298, + 30.996028 + ], + [ + -81.490586, + 30.984952 + ], + [ + -81.493651, + 30.977528 + ], + [ + -81.486966, + 30.969602 + ], + [ + -81.475789, + 30.965976 + ], + [ + -81.472321, + 30.969899 + ], + [ + -81.466814, + 30.97091 + ], + [ + -81.453568, + 30.965573 + ], + [ + -81.447388, + 30.956732 + ], + [ + -81.426929, + 30.956615 + ], + [ + -81.420108, + 30.974076 + ], + [ + -81.415825, + 30.977192 + ], + [ + -81.408484, + 30.977718 + ], + [ + -81.403409, + 30.957914 + ], + [ + -81.405153, + 30.908203 + ], + [ + -81.428577, + 30.836336 + ], + [ + -81.430835, + 30.831156 + ], + [ + -81.44013, + 30.821369 + ], + [ + -81.446927, + 30.81039 + ], + [ + -81.455287, + 30.79093 + ], + [ + -81.460061, + 30.769912 + ], + [ + -81.461065, + 30.753684 + ], + [ + -81.45947, + 30.741979 + ], + [ + -81.449375, + 30.715601 + ], + [ + -81.444124, + 30.709714 + ], + [ + -81.544618, + 30.712636 + ], + [ + -81.606221, + 30.718135 + ], + [ + -81.624298, + 30.736194 + ], + [ + -81.637222, + 30.733835 + ], + [ + -81.719927, + 30.744634 + ], + [ + -81.732627, + 30.749934 + ], + [ + -81.741278, + 30.762681 + ], + [ + -81.759338, + 30.771377 + ], + [ + -81.806652, + 30.789683 + ], + [ + -81.827014, + 30.788933 + ], + [ + -81.840375, + 30.786384 + ], + [ + -81.868608, + 30.792754 + ], + [ + -81.906014, + 30.822176 + ], + [ + -81.999836, + 30.788348 + ], + [ + -82.023213, + 30.781987 + ], + [ + -82.050432, + 30.676266 + ], + [ + -82.049401, + 30.655296 + ], + [ + -82.037609, + 30.633271 + ], + [ + -82.01329, + 30.595665 + ], + [ + -82.005477, + 30.563495 + ], + [ + -82.01699, + 30.519358 + ], + [ + -82.016103, + 30.497355 + ], + [ + -82.050031, + 30.36249 + ], + [ + -82.050069, + 30.362338 + ], + [ + -82.124835, + 30.366564 + ], + [ + -82.165192, + 30.358035 + ], + [ + -82.171508, + 30.359869 + ], + [ + -82.189583, + 30.376213 + ], + [ + -82.204151, + 30.40133 + ], + [ + -82.210291, + 30.42459 + ], + [ + -82.20604, + 30.455507 + ], + [ + -82.21233, + 30.499558 + ], + [ + -82.214385, + 30.566958 + ], + [ + -82.214847, + 30.567009 + ], + [ + -82.249841, + 30.570863 + ], + [ + -82.2581, + 30.571559 + ], + [ + -82.287343, + 30.573458 + ], + [ + -82.374844, + 30.579004 + ], + [ + -82.418915, + 30.581745 + ], + [ + -82.459544, + 30.584272 + ], + [ + -82.459792, + 30.584287 + ], + [ + -82.524899, + 30.588189 + ], + [ + -82.536233, + 30.588885 + ], + [ + -82.545055, + 30.589361 + ], + [ + -82.553159, + 30.589934 + ], + [ + -82.565476, + 30.590622 + ], + [ + -82.569237, + 30.590965 + ], + [ + -82.584002, + 30.591796 + ], + [ + -82.689271, + 30.597719 + ], + [ + -82.689539, + 30.597734 + ], + [ + -82.698618, + 30.598232 + ], + [ + -82.698902, + 30.598271 + ], + [ + -82.877259, + 30.609024 + ], + [ + -82.878779, + 30.609082 + ], + [ + -83.136616, + 30.624346 + ], + [ + -83.15617, + 30.625504 + ], + [ + -83.163309, + 30.625895 + ], + [ + -83.174411, + 30.626444 + ], + [ + -83.187391, + 30.627223 + ], + [ + -83.256218, + 30.631279 + ], + [ + -83.309249, + 30.634405 + ], + [ + -83.30925, + 30.634405 + ], + [ + -83.309455, + 30.634417 + ], + [ + -83.311647, + 30.634577 + ], + [ + -83.340852, + 30.636336 + ], + [ + -83.341011, + 30.636346 + ], + [ + -83.357703, + 30.637359 + ], + [ + -83.37946, + 30.63868 + ], + [ + -83.390062, + 30.639333 + ], + [ + -83.429477, + 30.641519 + ], + [ + -83.429584, + 30.641496 + ], + [ + -83.440021, + 30.642023 + ], + [ + -83.448895, + 30.64241 + ], + [ + -83.611667, + 30.651255 + ], + [ + -83.61172, + 30.651258 + ], + [ + -83.674058, + 30.654747 + ], + [ + -83.676773, + 30.654905 + ], + [ + -83.743729, + 30.658396 + ], + [ + -83.810536, + 30.66188 + ], + [ + -83.820886, + 30.662612 + ], + [ + -83.855216, + 30.664412 + ], + [ + -83.88022, + 30.665832 + ], + [ + -83.880317, + 30.665807 + ], + [ + -84.007391, + 30.672097 + ], + [ + -84.007454, + 30.6721 + ], + [ + -84.039707, + 30.673819 + ], + [ + -84.04181, + 30.673878 + ], + [ + -84.046605, + 30.6742 + ], + [ + -84.057228, + 30.674705 + ], + [ + -84.083753, + 30.675954 + ], + [ + -84.28121, + 30.685256 + ], + [ + -84.282562, + 30.685316 + ], + [ + -84.380719, + 30.689673 + ], + [ + -84.535042, + 30.696523 + ], + [ + -84.53937, + 30.696775 + ], + [ + -84.606249, + 30.699872 + ], + [ + -84.606386, + 30.699865 + ], + [ + -84.863465, + 30.711487 + ], + [ + -84.864693, + 30.711542 + ], + [ + -84.896122, + 30.750591 + ], + [ + -84.941925, + 30.887988 + ], + [ + -84.959626, + 30.910587 + ], + [ + -84.983527, + 30.935486 + ], + [ + -84.998628, + 30.971386 + ], + [ + -85.002368, + 31.000682 + ], + [ + -84.999428, + 31.013843 + ], + [ + -85.022121, + 31.07548 + ], + [ + -85.029736, + 31.096163 + ], + [ + -85.035615, + 31.108192 + ], + [ + -85.076628, + 31.156927 + ], + [ + -85.083582, + 31.15963 + ], + [ + -85.092106, + 31.160293 + ], + [ + -85.100207, + 31.16549 + ], + [ + -85.107516, + 31.186451 + ], + [ + -85.111871, + 31.258388 + ], + [ + -85.101561, + 31.283362 + ], + [ + -85.087651, + 31.308677 + ], + [ + -85.068065, + 31.427586 + ], + [ + -85.046859, + 31.517451 + ], + [ + -85.041305, + 31.540987 + ], + [ + -85.057473, + 31.618624 + ], + [ + -85.059534, + 31.621717 + ], + [ + -85.065236, + 31.624351 + ], + [ + -85.087029, + 31.640966 + ], + [ + -85.12553, + 31.694965 + ], + [ + -85.12653, + 31.716764 + ], + [ + -85.12223, + 31.722764 + ], + [ + -85.11893, + 31.732664 + ], + [ + -85.124501, + 31.763081 + ], + [ + -85.12523, + 31.767063 + ], + [ + -85.130731, + 31.772263 + ], + [ + -85.138668, + 31.780425 + ], + [ + -85.141331, + 31.783163 + ], + [ + -85.141831, + 31.839861 + ], + [ + -85.132931, + 31.88826 + ], + [ + -85.10663, + 31.915159 + ], + [ + -85.08213, + 31.944658 + ], + [ + -85.07233, + 31.964758 + ], + [ + -85.062246, + 31.991857 + ], + [ + -85.050212, + 32.024196 + ], + [ + -85.056029, + 32.063055 + ], + [ + -85.047865, + 32.142033 + ], + [ + -84.995929, + 32.184852 + ], + [ + -84.964828, + 32.194952 + ], + [ + -84.923638, + 32.231539 + ], + [ + -84.92165, + 32.233306 + ], + [ + -84.909052, + 32.26354 + ], + [ + -84.916611, + 32.281177 + ], + [ + -84.93868, + 32.300708 + ], + [ + -85.001874, + 32.322015 + ], + [ + -85.007103, + 32.328362 + ], + [ + -85.008096, + 32.336677 + ], + [ + -84.987386, + 32.381201 + ], + [ + -84.987278, + 32.381623 + ], + [ + -84.979431, + 32.412244 + ], + [ + -84.983831, + 32.445643 + ], + [ + -84.998231, + 32.469842 + ], + [ + -85.000779, + 32.506548 + ], + [ + -85.00103, + 32.510157 + ], + [ + -85.001052, + 32.510477 + ], + [ + -85.001324, + 32.512973 + ], + [ + -85.0071, + 32.523868 + ], + [ + -85.022509, + 32.542923 + ], + [ + -85.044606, + 32.559499 + ], + [ + -85.069583, + 32.58393 + ], + [ + -85.079935, + 32.602889 + ], + [ + -85.080288, + 32.603577 + ], + [ + -85.082454, + 32.607022 + ], + [ + -85.10479, + 32.642542 + ], + [ + -85.114737, + 32.685634 + ], + [ + -85.137136, + 32.745168 + ], + [ + -85.136776, + 32.746512 + ], + [ + -85.13204, + 32.764211 + ], + [ + -85.123421, + 32.772248 + ], + [ + -85.184131, + 32.870525 + ], + [ + -85.221868, + 33.055538 + ], + [ + -85.223261, + 33.06258 + ], + [ + -85.232378, + 33.108077 + ], + [ + -85.236509, + 33.129562 + ], + [ + -85.293902, + 33.428079 + ], + [ + -85.304439, + 33.482884 + ], + [ + -85.313999, + 33.529807 + ], + [ + -85.314091, + 33.530218 + ], + [ + -85.314994, + 33.535898 + ], + [ + -85.322497, + 33.574167 + ], + [ + -85.337974, + 33.653111 + ], + [ + -85.360491, + 33.767958 + ], + [ + -85.361844, + 33.773951 + ], + [ + -85.386693, + 33.901697 + ], + [ + -85.398837, + 33.964129 + ], + [ + -85.421731, + 34.080821 + ], + [ + -85.455057, + 34.250689 + ], + [ + -85.455371, + 34.252854 + ], + [ + -85.458071, + 34.265736 + ], + [ + -85.458693, + 34.269437 + ], + [ + -85.462304, + 34.286365 + ], + [ + -85.502316, + 34.473954 + ], + [ + -85.502454, + 34.474527 + ], + [ + -85.508384, + 34.501212 + ], + [ + -85.512108, + 34.518252 + ], + [ + -85.513699, + 34.524133 + ], + [ + -85.513709, + 34.52417 + ], + [ + -85.51393, + 34.525192 + ], + [ + -85.527127, + 34.588684 + ], + [ + -85.534423, + 34.623789 + ], + [ + -85.541264, + 34.656701 + ], + [ + -85.541267, + 34.656783 + ], + [ + -85.552454, + 34.708138 + ], + [ + -85.552482, + 34.708321 + ], + [ + -85.583145, + 34.860371 + ], + [ + -85.595163, + 34.924171 + ], + [ + -85.595191, + 34.924331 + ], + [ + -85.605165, + 34.984678 + ], + [ + -85.474472, + 34.983972 + ], + [ + -85.363919, + 34.983375 + ], + [ + -85.308257, + 34.984375 + ], + [ + -85.305457, + 34.984475 + ], + [ + -85.301488, + 34.984475 + ], + [ + -85.2945, + 34.984651 + ], + [ + -85.277556, + 34.984975 + ], + [ + -85.275856, + 34.984975 + ], + [ + -85.265055, + 34.985075 + ], + [ + -85.254955, + 34.985175 + ], + [ + -85.235555, + 34.985475 + ], + [ + -85.230354, + 34.985475 + ], + [ + -85.221854, + 34.985475 + ], + [ + -85.220554, + 34.985575 + ], + [ + -85.217854, + 34.985675 + ], + [ + -85.216554, + 34.985675 + ], + [ + -85.185905, + 34.985995 + ], + [ + -85.180553, + 34.986075 + ], + [ + -85.045183, + 34.986883 + ], + [ + -85.045052, + 34.986859 + ], + [ + -84.97986, + 34.987647 + ], + [ + -84.976973, + 34.987669 + ], + [ + -84.955623, + 34.98783 + ], + [ + -84.94442, + 34.987864 + ], + [ + -84.939306, + 34.987916 + ], + [ + -84.861314, + 34.987791 + ], + [ + -84.858032, + 34.987746 + ], + [ + -84.831799, + 34.988004 + ], + [ + -84.82401, + 34.987707 + ], + [ + -84.820478, + 34.987913 + ], + [ + -84.817279, + 34.987753 + ], + [ + -84.810742, + 34.987615 + ], + [ + -84.810477, + 34.987607 + ] + ] + ], + "type": "Polygon" + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index dfe7dec4..1038b97e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2238,6 +2238,21 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.3" +"@radix-ui/react-checkbox@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-checkbox/-/react-checkbox-1.0.4.tgz#98f22c38d5010dd6df4c5744cac74087e3275f4b" + integrity sha512-CBuGQa52aAYnADZVt/KBQzXrwx6TqnlwtcIPGtVt5JkkzQwMOLJjPukimhfKEr4GQNd43C+djUh5Ikopj8pSLg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-controllable-state" "1.0.1" + "@radix-ui/react-use-previous" "1.0.1" + "@radix-ui/react-use-size" "1.0.1" + "@radix-ui/react-collapsible@1.0.3", "@radix-ui/react-collapsible@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-collapsible/-/react-collapsible-1.0.3.tgz#df0e22e7a025439f13f62d4e4a9e92c4a0df5b81" From a88a2f2e6756188dad84738ab8ef038b6d9e11da Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 11:06:52 -0400 Subject: [PATCH 085/109] Atlas #4 - Publishing v2.1.0-beta.42 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 0dfe7429..ae52230b 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-beta.41", + "version": "2.1.0-beta.42", "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-beta.41", - "@performant-software/shared-components": "^2.1.0-beta.41", + "@performant-software/semantic-components": "^2.1.0-beta.42", + "@performant-software/shared-components": "^2.1.0-beta.42", "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 a79c41ea..53ae3fbc 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-beta.41", + "version": "2.1.0-beta.42", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -38,7 +38,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.41", + "@performant-software/geospatial": "^2.1.0-beta.42", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", @@ -57,4 +57,4 @@ "vite": "^5.1.4", "vite-plugin-copy": "^0.1.6" } -} +} \ No newline at end of file diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index d4eafc75..edb1c284 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.41", + "version": "2.1.0-beta.42", "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 ce9af472..ff8a9bcb 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-beta.41", + "version": "2.1.0-beta.42", "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-beta.41", + "@performant-software/shared-components": "^2.1.0-beta.42", "@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 804efb8d..e5f40c07 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.41", + "version": "2.1.0-beta.42", "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 21ae0ea4..d256f550 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-beta.41", + "version": "2.1.0-beta.42", "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-beta.41", - "@performant-software/shared-components": "^2.1.0-beta.41", + "@performant-software/semantic-components": "^2.1.0-beta.42", + "@performant-software/shared-components": "^2.1.0-beta.42", "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 cad2c19a..621bb23c 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.41", + "version": "2.1.0-beta.42", "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 727e9371..d4e6bbe3 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.41" + "version": "2.1.0-beta.42" } From d9ca654394532e53442ef98c2c679c5db9c337fe Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 11:07:17 -0400 Subject: [PATCH 086/109] Atlas #4 - Updating alignment of labels in PlaceLayersSelector component --- packages/core-data/src/components/PlaceLayersSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-data/src/components/PlaceLayersSelector.js b/packages/core-data/src/components/PlaceLayersSelector.js index 95a8aad7..f382005c 100644 --- a/packages/core-data/src/components/PlaceLayersSelector.js +++ b/packages/core-data/src/components/PlaceLayersSelector.js @@ -60,7 +60,7 @@ const PlaceLayersSelector = (props: Props) => { key={index} >
    Date: Tue, 2 Apr 2024 11:13:31 -0400 Subject: [PATCH 087/109] Atlas #4 - Adding className prop to PlaceLayersSelector --- packages/core-data/package.json | 3 ++- packages/core-data/src/components/PlaceLayersSelector.js | 6 ++++-- yarn.lock | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/core-data/package.json b/packages/core-data/package.json index 53ae3fbc..90c863dc 100644 --- a/packages/core-data/package.json +++ b/packages/core-data/package.json @@ -26,6 +26,7 @@ "@radix-ui/react-dropdown-menu": "^2.0.6", "@samvera/clover-iiif": "^2.3.2", "@turf/turf": "^6.5.0", + "clsx": "^2.1.0", "dequal": "^2.0.3", "i18next": "^23.8.2", "instantsearch.js": "^4.66.0", @@ -57,4 +58,4 @@ "vite": "^5.1.4", "vite-plugin-copy": "^0.1.6" } -} \ No newline at end of file +} diff --git a/packages/core-data/src/components/PlaceLayersSelector.js b/packages/core-data/src/components/PlaceLayersSelector.js index f382005c..5d0c1a60 100644 --- a/packages/core-data/src/components/PlaceLayersSelector.js +++ b/packages/core-data/src/components/PlaceLayersSelector.js @@ -1,6 +1,7 @@ // @flow import * as Checkbox from '@radix-ui/react-checkbox'; +import clsx from 'clsx'; import { CheckSquare2, Square } from 'lucide-react'; import React, { useCallback, useState } from 'react'; import _ from 'underscore'; @@ -8,6 +9,7 @@ import OverlayLayers from './OverlayLayers'; import type { Layer as LayerType } from '../types/RuntimeConfig'; type Props = { + className?: string | Array, label: string, layers: Array }; @@ -41,7 +43,7 @@ const PlaceLayersSelector = (props: Props) => { return (
    { { props.label }
      { _.map(props.layers, (layer, index) => (
    • Date: Tue, 2 Apr 2024 11:17:18 -0400 Subject: [PATCH 088/109] Atlas #4 - Publishing v2.1.0-beta.43 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/core-data/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index ae52230b..7aff5358 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-beta.42", + "version": "2.1.0-beta.43", "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-beta.42", - "@performant-software/shared-components": "^2.1.0-beta.42", + "@performant-software/semantic-components": "^2.1.0-beta.43", + "@performant-software/shared-components": "^2.1.0-beta.43", "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 90c863dc..43768acd 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-beta.42", + "version": "2.1.0-beta.43", "description": "A package of components used with the Core Data platform.", "license": "MIT", "main": "./dist/index.cjs.js", @@ -39,7 +39,7 @@ "underscore": "^1.13.2" }, "peerDependencies": { - "@performant-software/geospatial": "^2.1.0-beta.42", + "@performant-software/geospatial": "^2.1.0-beta.43", "@peripleo/maplibre": "^0.4.2", "@peripleo/peripleo": "^0.4.2", "react": ">= 16.13.1 < 19.0.0", @@ -58,4 +58,4 @@ "vite": "^5.1.4", "vite-plugin-copy": "^0.1.6" } -} +} \ No newline at end of file diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index edb1c284..e54e105e 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "2.1.0-beta.42", + "version": "2.1.0-beta.43", "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 ff8a9bcb..bf4309fe 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-beta.42", + "version": "2.1.0-beta.43", "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-beta.42", + "@performant-software/shared-components": "^2.1.0-beta.43", "@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 e5f40c07..ae2de230 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "2.1.0-beta.42", + "version": "2.1.0-beta.43", "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 d256f550..06940fb4 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-beta.42", + "version": "2.1.0-beta.43", "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-beta.42", - "@performant-software/shared-components": "^2.1.0-beta.42", + "@performant-software/semantic-components": "^2.1.0-beta.43", + "@performant-software/shared-components": "^2.1.0-beta.43", "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 621bb23c..9d22ddd9 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "2.1.0-beta.42", + "version": "2.1.0-beta.43", "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 d4e6bbe3..f566022d 100644 --- a/react-components.json +++ b/react-components.json @@ -8,5 +8,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "2.1.0-beta.42" + "version": "2.1.0-beta.43" } From 7bc064a2db723c3b95560c69a70e9036b5240d4e Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 11:33:15 -0400 Subject: [PATCH 089/109] Atlas #4 - Updating "htmlFor" prop on label of PlaceLayersSelector --- packages/core-data/src/components/PlaceLayersSelector.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core-data/src/components/PlaceLayersSelector.js b/packages/core-data/src/components/PlaceLayersSelector.js index 5d0c1a60..b4bb5e98 100644 --- a/packages/core-data/src/components/PlaceLayersSelector.js +++ b/packages/core-data/src/components/PlaceLayersSelector.js @@ -83,7 +83,7 @@ const PlaceLayersSelector = (props: Props) => { From efdc4b2f6f307ce7e436312f4e506615fef39061 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Tue, 2 Apr 2024 12:09:46 -0400 Subject: [PATCH 090/109] Altas #4 - Refactoring RelatedMedia to work with IIIF Collection manifest --- .../core-data/src/components/MediaGallery.js | 33 +++------- .../core-data/src/components/RelatedMedia.js | 63 ++++++++++++++----- packages/core-data/src/services/Places.js | 2 +- 3 files changed, 57 insertions(+), 41 deletions(-) diff --git a/packages/core-data/src/components/MediaGallery.js b/packages/core-data/src/components/MediaGallery.js index 2a78926f..c16e5451 100644 --- a/packages/core-data/src/components/MediaGallery.js +++ b/packages/core-data/src/components/MediaGallery.js @@ -2,25 +2,19 @@ import * as Dialog from '@radix-ui/react-dialog'; import Viewer from '@samvera/clover-iiif/viewer'; -import { Image, X } from 'lucide-react'; +import { X } from 'lucide-react'; import React from 'react'; -import type { MediaContent } from '../types/MediaContent'; type Props = { /** - * The MediaContent record contain the IIIF manifest URL. + * URL of the IIIF manifest to render. */ - defaultItem: MediaContent, + manifestUrl: string, /** * Callback fired when the dialog is closed. */ - onClose: () => void, - - /** - * Title text to display at the top of the dialog. - */ - title?: string + onClose: () => void }; /** @@ -28,9 +22,8 @@ type Props = { */ const MediaGallery = (props: Props) => ( ( - - - { props.title } -
      - { Boolean(props.defaultItem) && ( + { props.manifestUrl && ( @@ -65,6 +51,7 @@ const MediaGallery = (props: Props) => ( asChild >