From 5ac835b8b0ef288b2c83ab152e3757557bf7c66d Mon Sep 17 00:00:00 2001 From: Solomon Negusse Date: Mon, 2 Oct 2023 20:43:03 -0500 Subject: [PATCH 01/23] fetch widget metadata from RW API --- components/modals/meta/actions.js | 10 +++++++--- components/modals/meta/component.jsx | 9 +++++---- .../forest-change/tree-loss-primary/index.js | 2 +- layouts/dashboards/component.jsx | 2 +- layouts/embed/widget/component.jsx | 2 +- layouts/map/component.jsx | 2 +- services/metadata.js | 14 ++++++++++++-- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/components/modals/meta/actions.js b/components/modals/meta/actions.js index 75f2e2629c..3669e4789e 100644 --- a/components/modals/meta/actions.js +++ b/components/modals/meta/actions.js @@ -8,13 +8,17 @@ export const setModalMetaSettings = createThunkAction('setModalMetaSettings'); export const getModalMetaData = createThunkAction( 'getModalMetaData', - (metaKey) => (dispatch, getState) => { + ({metakey, metaType}) => (dispatch, getState) => { const { modalMeta } = getState(); if (modalMeta && !modalMeta.loading) { dispatch(setModalMetaLoading({ loading: true, error: false })); - getMetadata(metaKey) + getMetadata(metakey, metaType) .then((response) => { - dispatch(setModalMetaData(response.data)); + if (metaType === 'widget') { + dispatch(setModalMetaData(response.data[0].info)) + } else { + dispatch(setModalMetaData(response.data)); + } }) .catch(() => { dispatch(setModalMetaLoading({ loading: false, error: true })); diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index 117130146a..e875b3a234 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -15,6 +15,7 @@ class ModalMeta extends PureComponent { setModalMetaClosed: PropTypes.func, metaData: PropTypes.object, getModalMetaData: PropTypes.func, + metaType: PropTypes.string, metakey: PropTypes.string, tableData: PropTypes.object, loading: PropTypes.bool, @@ -23,16 +24,16 @@ class ModalMeta extends PureComponent { }; componentDidMount() { - const { getModalMetaData, metakey } = this.props; + const { getModalMetaData, metakey, metaType } = this.props; if (metakey) { - getModalMetaData(metakey); + getModalMetaData({metakey, metaType}); } } componentDidUpdate(prevProps) { - const { getModalMetaData, metakey, metaData } = this.props; + const { getModalMetaData, metakey, metaData, metaType } = this.props; if (metakey && metakey !== prevProps.metakey) { - getModalMetaData(metakey); + getModalMetaData({metakey, metaType}); } if ( diff --git a/components/widgets/forest-change/tree-loss-primary/index.js b/components/widgets/forest-change/tree-loss-primary/index.js index 841768d210..dbff89f7c0 100644 --- a/components/widgets/forest-change/tree-loss-primary/index.js +++ b/components/widgets/forest-change/tree-loss-primary/index.js @@ -75,7 +75,7 @@ export default { pendingKeys: ['threshold', 'years'], refetchKeys: ['landCategory', 'threshold'], dataType: 'lossPrimary', - metaKey: 'widget_primary_forest_loss', + metaKey: '641b158b-f5be-40ae-9b13-8c5c35925b59', datasets: [ { dataset: POLITICAL_BOUNDARIES_DATASET, diff --git a/layouts/dashboards/component.jsx b/layouts/dashboards/component.jsx index 7b6fc84339..5814b6abc9 100644 --- a/layouts/dashboards/component.jsx +++ b/layouts/dashboards/component.jsx @@ -216,7 +216,7 @@ class DashboardsPage extends PureComponent { - + {widgetAnchor && ( )} diff --git a/layouts/embed/widget/component.jsx b/layouts/embed/widget/component.jsx index 3d9d241c17..5c9966489d 100644 --- a/layouts/embed/widget/component.jsx +++ b/layouts/embed/widget/component.jsx @@ -16,7 +16,7 @@ const WidgetEmbedPage = ({ widget, trase }) => (
- + diff --git a/layouts/map/component.jsx b/layouts/map/component.jsx index 5186f784a3..80231c32d9 100644 --- a/layouts/map/component.jsx +++ b/layouts/map/component.jsx @@ -96,7 +96,7 @@ class MainMapComponent extends PureComponent { )} - + diff --git a/services/metadata.js b/services/metadata.js index bf14a83d4a..1dc586a69a 100644 --- a/services/metadata.js +++ b/services/metadata.js @@ -1,6 +1,16 @@ -import { metadataRequest } from 'utils/request'; +import { metadataRequest, rwRequest } from 'utils/request'; -export const getMetadata = (slug) => metadataRequest.get(slug); +export const getMetadata = (slug, metaType) => { + if (metaType === 'widget') { + return rwRequest.get(`widget/${slug}`) + .then((resp) => { + const dataset = resp.data?.dataset; + return rwRequest.get(`dataset/${dataset}/widget/${slug}/metadata`) + }) + } + + return metadataRequest.get(slug); +} export default { getMetadata, From 59a34b61db73cf2f1b165ed38b7a3c37874f3dfb Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Thu, 2 May 2024 11:45:25 -0300 Subject: [PATCH 02/23] chore(metadata): return logic to set metadata for widgets --- components/modals/meta/actions.js | 33 ++++++++++--------- .../forest-change/tree-loss-primary/index.js | 2 +- services/metadata.js | 12 +++---- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/components/modals/meta/actions.js b/components/modals/meta/actions.js index 3669e4789e..d7292ddd08 100644 --- a/components/modals/meta/actions.js +++ b/components/modals/meta/actions.js @@ -8,23 +8,24 @@ export const setModalMetaSettings = createThunkAction('setModalMetaSettings'); export const getModalMetaData = createThunkAction( 'getModalMetaData', - ({metakey, metaType}) => (dispatch, getState) => { - const { modalMeta } = getState(); - if (modalMeta && !modalMeta.loading) { - dispatch(setModalMetaLoading({ loading: true, error: false })); - getMetadata(metakey, metaType) - .then((response) => { - if (metaType === 'widget') { - dispatch(setModalMetaData(response.data[0].info)) - } else { - dispatch(setModalMetaData(response.data)); - } - }) - .catch(() => { - dispatch(setModalMetaLoading({ loading: false, error: true })); - }); + ({ metakey, metaType }) => + (dispatch, getState) => { + const { modalMeta } = getState(); + if (modalMeta && !modalMeta.loading) { + dispatch(setModalMetaLoading({ loading: true, error: false })); + getMetadata(metakey, metaType) + .then((response) => { + if (metaType === 'widget') { + dispatch(setModalMetaData(response.data)); + } else { + dispatch(setModalMetaData(response.data)); + } + }) + .catch(() => { + dispatch(setModalMetaLoading({ loading: false, error: true })); + }); + } } - } ); export const setModalMetaClosed = createThunkAction( diff --git a/components/widgets/forest-change/tree-loss-primary/index.js b/components/widgets/forest-change/tree-loss-primary/index.js index dbff89f7c0..841768d210 100644 --- a/components/widgets/forest-change/tree-loss-primary/index.js +++ b/components/widgets/forest-change/tree-loss-primary/index.js @@ -75,7 +75,7 @@ export default { pendingKeys: ['threshold', 'years'], refetchKeys: ['landCategory', 'threshold'], dataType: 'lossPrimary', - metaKey: '641b158b-f5be-40ae-9b13-8c5c35925b59', + metaKey: 'widget_primary_forest_loss', datasets: [ { dataset: POLITICAL_BOUNDARIES_DATASET, diff --git a/services/metadata.js b/services/metadata.js index 1dc586a69a..431d89c7bd 100644 --- a/services/metadata.js +++ b/services/metadata.js @@ -1,16 +1,12 @@ -import { metadataRequest, rwRequest } from 'utils/request'; +import { metadataRequest } from 'utils/request'; export const getMetadata = (slug, metaType) => { if (metaType === 'widget') { - return rwRequest.get(`widget/${slug}`) - .then((resp) => { - const dataset = resp.data?.dataset; - return rwRequest.get(`dataset/${dataset}/widget/${slug}/metadata`) - }) + return metadataRequest.get(slug); } - + return metadataRequest.get(slug); -} +}; export default { getMetadata, From a410ff3833e99cad999a93e768f7ee555acf5ab6 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 3 May 2024 14:52:00 -0300 Subject: [PATCH 03/23] feat(metadata): add new request method to cover metadata for widgets while we update metadata for layers --- components/modals/meta/actions.js | 2 ++ pages/api/metadata/[...params].js | 5 +++-- pages/api/widget-metadata/[...params].js | 18 ++++++++++++++++++ services/metadata.js | 6 +++--- utils/proxies.js | 1 + utils/request.js | 14 ++++++++++++-- 6 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 pages/api/widget-metadata/[...params].js diff --git a/components/modals/meta/actions.js b/components/modals/meta/actions.js index d7292ddd08..3e4c46e741 100644 --- a/components/modals/meta/actions.js +++ b/components/modals/meta/actions.js @@ -11,8 +11,10 @@ export const getModalMetaData = createThunkAction( ({ metakey, metaType }) => (dispatch, getState) => { const { modalMeta } = getState(); + if (modalMeta && !modalMeta.loading) { dispatch(setModalMetaLoading({ loading: true, error: false })); + getMetadata(metakey, metaType) .then((response) => { if (metaType === 'widget') { diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 92ce9c4962..202bc3a579 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -1,14 +1,15 @@ -import { GFW_METADATA_API, GFW_STAGING_METADATA_API } from 'utils/apis'; +import { GFW_DATA_API, GFW_STAGING_DATA_API } from 'utils/apis'; import axios from 'axios'; const ENVIRONMENT = process.env.NEXT_PUBLIC_RW_FEATURE_ENV; const GFW_METADATA_API_URL = - ENVIRONMENT === 'staging' ? GFW_STAGING_METADATA_API : GFW_METADATA_API; + ENVIRONMENT === 'staging' ? GFW_STAGING_DATA_API : GFW_DATA_API; export default async (req, res) => { try { const path = req.query.params.join('/'); const url = `${GFW_METADATA_API_URL}/${path}/`; + const response = await axios.get(url); return res.status(200).json(response.data); diff --git a/pages/api/widget-metadata/[...params].js b/pages/api/widget-metadata/[...params].js new file mode 100644 index 0000000000..f9e4816f09 --- /dev/null +++ b/pages/api/widget-metadata/[...params].js @@ -0,0 +1,18 @@ +import { GFW_METADATA_API, GFW_STAGING_METADATA_API } from 'utils/apis'; +import axios from 'axios'; + +const ENVIRONMENT = process.env.NEXT_PUBLIC_FEATURE_ENV; +const GFW_METADATA_API_URL = + ENVIRONMENT === 'staging' ? GFW_STAGING_METADATA_API : GFW_METADATA_API; + +export default async (req, res) => { + try { + const path = req.query.params.join('/'); + const url = `${GFW_METADATA_API_URL}/${path}/`; + const response = await axios.get(url); + + return res.status(200).json(response.data); + } catch (error) { + return res.status(400).end(error.message); + } +}; diff --git a/services/metadata.js b/services/metadata.js index 431d89c7bd..951dcae114 100644 --- a/services/metadata.js +++ b/services/metadata.js @@ -1,11 +1,11 @@ -import { metadataRequest } from 'utils/request'; +import { metadataRequest, metadataWidgetRequest } from 'utils/request'; export const getMetadata = (slug, metaType) => { if (metaType === 'widget') { - return metadataRequest.get(slug); + return metadataWidgetRequest.get(slug); } - return metadataRequest.get(slug); + return metadataRequest.get(`dataset/${slug}`); }; export default { diff --git a/utils/proxies.js b/utils/proxies.js index d2d3134ff8..49993b3f7d 100644 --- a/utils/proxies.js +++ b/utils/proxies.js @@ -3,6 +3,7 @@ export const PROXIES = { DATA_API: '/api/data', DATAMART_API: '/api/datamart', METADATA_API: '/api/metadata', + WIDGET_METADATA_API: '/api/widget-metadata', RESOURCE_WATCH_API: '/api/gfw/v1', PLANET_API: '/api/planet-mosaics', PLANET_TILES: '/api/planet-tiles', diff --git a/utils/request.js b/utils/request.js index c9124fa81d..73b1f2c8af 100644 --- a/utils/request.js +++ b/utils/request.js @@ -17,7 +17,7 @@ const ENVIRONMENT = process.env.NEXT_PUBLIC_FEATURE_ENV; // We never use the staging api const GFW_API_URL = GFW_API; -const GFW_METADATA_API_URL = +const GFW_WIDGET_METADATA_API_URL = ENVIRONMENT === 'staging' ? GFW_STAGING_METADATA_API : GFW_METADATA_API; const DATA_API_URL = ENVIRONMENT === 'staging' ? GFW_STAGING_DATA_API : GFW_DATA_API; @@ -78,13 +78,23 @@ export const dataMartRequest = axios.create({ export const metadataRequest = axios.create({ ...defaultRequestConfig, ...(isServer && { - baseURL: GFW_METADATA_API_URL, + baseURL: DATA_API_URL, }), ...(!isServer && { baseURL: PROXIES.METADATA_API, }), }); +export const metadataWidgetRequest = axios.create({ + ...defaultRequestConfig, + ...(isServer && { + baseURL: GFW_WIDGET_METADATA_API_URL, + }), + ...(!isServer && { + baseURL: PROXIES.WIDGET_METADATA_API, + }), +}); + export const rwRequest = axios.create({ ...defaultRequestConfig, ...(isServer && { From 0d2a6303e326a539dc7ad106a9a933c38fc5813c Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Mon, 6 May 2024 16:28:09 -0300 Subject: [PATCH 04/23] chore(metadata): remove ArcGIS button --- components/modals/meta/component.jsx | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index e875b3a234..cc915cb8cd 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -26,14 +26,14 @@ class ModalMeta extends PureComponent { componentDidMount() { const { getModalMetaData, metakey, metaType } = this.props; if (metakey) { - getModalMetaData({metakey, metaType}); + getModalMetaData({ metakey, metaType }); } } componentDidUpdate(prevProps) { const { getModalMetaData, metakey, metaData, metaType } = this.props; if (metakey && metakey !== prevProps.metakey) { - getModalMetaData({metakey, metaType}); + getModalMetaData({ metakey, metaType }); } if ( @@ -51,15 +51,8 @@ class ModalMeta extends PureComponent { getContent() { const { metaData, tableData, loading, error, locationName } = this.props; - const { - subtitle, - overview, - citation, - map_service, - learn_more, - download_data, - amazon_link, - } = metaData || {}; + const { subtitle, overview, citation, learn_more, download_data } = + metaData || {}; const parsedCitation = citation && @@ -109,7 +102,7 @@ class ModalMeta extends PureComponent {
{this.parseContent(parsedCitation)}
)} - {(learn_more || download_data || map_service || amazon_link) && ( + {(learn_more || download_data) && (
{learn_more && ( DOWNLOAD DATA )} - {(map_service || amazon_link) && ( - - - - )}
)} From 23adfe30988d87a127cfaeb558169023c88d5279 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Mon, 6 May 2024 16:28:42 -0300 Subject: [PATCH 05/23] chore(metadata): fix modal component name for the map --- layouts/map/component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/map/component.jsx b/layouts/map/component.jsx index 80231c32d9..420cca0487 100644 --- a/layouts/map/component.jsx +++ b/layouts/map/component.jsx @@ -16,7 +16,7 @@ import MyGFWProvider from 'providers/mygfw-provider'; import MetaProvider from 'providers/meta-provider'; import ModalWelcome from 'components/modals/welcome'; -import MetaModal from 'components/modals/meta'; +import ModalMeta from 'components/modals/meta'; import ShareModal from 'components/modals/share'; import AreaOfInterestModal from 'components/modals/area-of-interest'; import ClimateModal from 'components/modals/climate'; @@ -96,7 +96,7 @@ class MainMapComponent extends PureComponent { )} - + From 6e58e49e83f6a349917a6d96f180077e49ce460b Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 24 May 2024 13:36:26 -0300 Subject: [PATCH 06/23] testing new metadata response --- components/modals/meta/actions.js | 3 ++- components/modals/meta/component.jsx | 1 + components/modals/meta/selectors.js | 2 -- pages/api/metadata/[...params].js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/modals/meta/actions.js b/components/modals/meta/actions.js index 3e4c46e741..1601c291f0 100644 --- a/components/modals/meta/actions.js +++ b/components/modals/meta/actions.js @@ -17,10 +17,11 @@ export const getModalMetaData = createThunkAction( getMetadata(metakey, metaType) .then((response) => { + console.log('XPTO', response); if (metaType === 'widget') { dispatch(setModalMetaData(response.data)); } else { - dispatch(setModalMetaData(response.data)); + dispatch(setModalMetaData(response.data.metadata)); } }) .catch(() => { diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index cc915cb8cd..aaf85bd767 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -31,6 +31,7 @@ class ModalMeta extends PureComponent { } componentDidUpdate(prevProps) { + console.log('componentDidUpdate', this.props); const { getModalMetaData, metakey, metaData, metaType } = this.props; if (metakey && metakey !== prevProps.metakey) { getModalMetaData({ metakey, metaType }); diff --git a/components/modals/meta/selectors.js b/components/modals/meta/selectors.js index 78ba5216d9..8f7a3676e6 100644 --- a/components/modals/meta/selectors.js +++ b/components/modals/meta/selectors.js @@ -10,8 +10,6 @@ const META_FIELDS = [ 'overview', 'learn_more', 'download_data', - 'map_service', - 'amazon_link', ]; const TABLE_FIELDS = [ 'function', diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 202bc3a579..25ba087458 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -12,7 +12,7 @@ export default async (req, res) => { const response = await axios.get(url); - return res.status(200).json(response.data); + return res.status(200).json(response.data.data); } catch (error) { return res.status(400).end(error.message); } From 7070b87bba3d30ce80b48ef99b7ad015b4667d05 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Mon, 10 Jun 2024 17:20:54 -0300 Subject: [PATCH 07/23] feat(metadata): add requests to get the full metadata object For testing purposes I set the dataset and the version as hardcoded We will remove it as soon as the test get finished --- components/modals/meta/actions.js | 1 - components/modals/meta/component.jsx | 1 - components/modals/meta/selectors.js | 4 ++-- pages/api/metadata/[...params].js | 24 ++++++++++++++++++++---- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/components/modals/meta/actions.js b/components/modals/meta/actions.js index 1601c291f0..ae374bd8d1 100644 --- a/components/modals/meta/actions.js +++ b/components/modals/meta/actions.js @@ -17,7 +17,6 @@ export const getModalMetaData = createThunkAction( getMetadata(metakey, metaType) .then((response) => { - console.log('XPTO', response); if (metaType === 'widget') { dispatch(setModalMetaData(response.data)); } else { diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index aaf85bd767..cc915cb8cd 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -31,7 +31,6 @@ class ModalMeta extends PureComponent { } componentDidUpdate(prevProps) { - console.log('componentDidUpdate', this.props); const { getModalMetaData, metakey, metaData, metaType } = this.props; if (metakey && metakey !== prevProps.metakey) { getModalMetaData({ metakey, metaType }); diff --git a/components/modals/meta/selectors.js b/components/modals/meta/selectors.js index 8f7a3676e6..d43daca4ff 100644 --- a/components/modals/meta/selectors.js +++ b/components/modals/meta/selectors.js @@ -16,8 +16,8 @@ const TABLE_FIELDS = [ 'resolution', 'geographic_coverage', 'source', - 'frequency_of_updates', - 'date_of_content', + 'content_date', + 'update_frequency', 'cautions', 'license', ]; diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 25ba087458..198a61bec8 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -7,13 +7,29 @@ const GFW_METADATA_API_URL = export default async (req, res) => { try { - const path = req.query.params.join('/'); - const url = `${GFW_METADATA_API_URL}/${path}/`; + // const path = req.query.params.join('/'); + // const url = `${GFW_METADATA_API_URL}/${path}`; // ${path} + const url = `${GFW_METADATA_API_URL}/dataset/birdlife_endemic_bird_areas`; + const datasetMetadata = await axios.get(url); + // const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`); + const datasetVersionMetadata = await axios.get( + `${GFW_METADATA_API_URL}/dataset/gfw_integrated_alerts/v20240605/metadata` + ); - const response = await axios.get(url); + const response = { + ...datasetMetadata.data.data, + metadata: { + ...datasetMetadata.data.data.metadata, + ...datasetVersionMetadata.data.data, + }, + }; - return res.status(200).json(response.data.data); + return res.status(200).json(response); } catch (error) { + if (error.response) { + return res.status(400).end(error.response.data.message); + } + return res.status(400).end(error.message); } }; From dd78b5bc3330d2459a2198c9f8292c9fdabfaa25 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 11 Jun 2024 14:50:41 -0300 Subject: [PATCH 08/23] feat(metadata): improve the parseContent method to convert markdown to html --- components/modals/meta/component.jsx | 37 +++++++++++----------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index cc915cb8cd..055eaf60c8 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -84,7 +84,7 @@ class ModalMeta extends PureComponent { dangerouslySetInnerHTML={{ __html: lowerCase(key) }} // eslint-disable-line />
- {this.parseContent(tableData[key])} +

{this.parseMarkdownURLToHTML(tableData[key])}

) : null @@ -93,13 +93,17 @@ class ModalMeta extends PureComponent { {overview && (

Overview

-
{this.parseContent(overview)}
+
+

{this.parseMarkdownURLToHTML(overview)}

+
)} {parsedCitation && (
Citation
-
{this.parseContent(parsedCitation)}
+
+

{this.parseMarkdownURLToHTML(parsedCitation)}

+
)} {(learn_more || download_data) && ( @@ -130,26 +134,15 @@ class ModalMeta extends PureComponent { ); } - parseContent = (html) => { - return ( -
- {ReactHtmlParser(html, { - transform: (node) => - node.name === 'a' ? ( - - {node.children[0].data} - - ) : ( - '' - ), - })} -
+ parseMarkdownURLToHTML = (markdown) => { + const markdownRegex = /\[([^\]]+)\]\(([^)]+)\)/g; + + const htmlAnchor = markdown.replace( + markdownRegex, + '$1' ); + + return <>{ReactHtmlParser(htmlAnchor)}; }; render() { From 8bbc258d317db4f190fbe928641e79c9520e4310 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 11 Jun 2024 14:51:08 -0300 Subject: [PATCH 09/23] feat(metadata): avoid merging null properties to metadata object --- pages/api/metadata/[...params].js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 198a61bec8..a7cd20b4fd 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -16,14 +16,25 @@ export default async (req, res) => { `${GFW_METADATA_API_URL}/dataset/gfw_integrated_alerts/v20240605/metadata` ); + const dataVersionMetadataObject = datasetVersionMetadata.data.data; + const response = { ...datasetMetadata.data.data, metadata: { ...datasetMetadata.data.data.metadata, - ...datasetVersionMetadata.data.data, }, }; + /* + * Merging the metadata from the second request + * avoiding overwrite the object properties with null value + */ + Object.keys(dataVersionMetadataObject).forEach((key) => { + if (dataVersionMetadataObject[key] !== null) { + response.metadata[key] = dataVersionMetadataObject[key]; + } + }); + return res.status(200).json(response); } catch (error) { if (error.response) { From 298492355b4ab2355481eb213b2cac9e73df3e43 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 10 Sep 2024 11:42:37 -0300 Subject: [PATCH 10/23] feat(metadata): remove hardcoded endpoint --- pages/api/metadata/[...params].js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index a7cd20b4fd..11f63959a5 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -7,14 +7,10 @@ const GFW_METADATA_API_URL = export default async (req, res) => { try { - // const path = req.query.params.join('/'); - // const url = `${GFW_METADATA_API_URL}/${path}`; // ${path} - const url = `${GFW_METADATA_API_URL}/dataset/birdlife_endemic_bird_areas`; + const path = req.query.params.join('/'); + const url = `${GFW_METADATA_API_URL}/${path}`; const datasetMetadata = await axios.get(url); - // const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`); - const datasetVersionMetadata = await axios.get( - `${GFW_METADATA_API_URL}/dataset/gfw_integrated_alerts/v20240605/metadata` - ); + const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`); const dataVersionMetadataObject = datasetVersionMetadata.data.data; From 7bf24867654a64ad1148fd59512ca9d2200630d1 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Wed, 25 Sep 2024 14:26:16 -0300 Subject: [PATCH 11/23] fix(metadata): add string validation to replace markdown --- components/modals/meta/component.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index 055eaf60c8..92b1323ed9 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -136,6 +136,7 @@ class ModalMeta extends PureComponent { parseMarkdownURLToHTML = (markdown) => { const markdownRegex = /\[([^\]]+)\]\(([^)]+)\)/g; + if (typeof markdown !== 'string') return markdown; const htmlAnchor = markdown.replace( markdownRegex, From 6678fdf881cc6fe146c43423bb7213ae6ef1b57f Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Wed, 25 Sep 2024 17:43:52 -0300 Subject: [PATCH 12/23] feat(metadata): add safe path validation --- data/metadata.json | 58 +++++++++++++++++++++++++++++++ pages/api/metadata/[...params].js | 17 +++++---- 2 files changed, 69 insertions(+), 6 deletions(-) create mode 100644 data/metadata.json diff --git a/data/metadata.json b/data/metadata.json new file mode 100644 index 0000000000..cead296d25 --- /dev/null +++ b/data/metadata.json @@ -0,0 +1,58 @@ +[ + "umd_landsat_alerts", + "gfw_integrated_alerts", + "umd_glad_sentinel2_alerts", + "wur_radd_alerts", + "nasa_viirs_fire_alerts", + "umd_tree_cover_loss_from_fires", + "umd_tree_cover_gain_from_height", + "umd_tree_cover_loss", + "gfw_emerging_hot_spots", + "tsc_tree_cover_loss_drivers", + "umd_adm0_net_tree_cover_change_from_height", + "umd_tree_cover_density_2000", + "umd_tree_cover_density_2000", + "wri_tropical_tree_cover", + "wri_tropical_tree_cover", + "umd_regional_primary_forest_2001", + "umd_tree_cover_height_2020", + "wcs_forest_landscape_integrity_index", + "ifl_intact_forest_landscapes", + "esa_land_cover_2015", + "umd_soy_planted_area", + "gfw_planted_forests", + "gfw_peatlands", + "gmw_global_mangrove_extent", + "mapbiomas_bra_land_cover", + "ibge_bra_biomes", + "idn_land_cover_2017", + "gfw_managed_forests", + "gfw_mining_concessions", + "gfw_oil_palm", + "gfw_west_africa_cocoa_plot_density", + "gfw_universal_mill_list", + "rspo_oil_palm", + "gfw_oil_gas", + "gfw_wood_fiber", + "wdpa_protected_areas", + "intl_rivers_dam_hotspots", + "landmark_indigenous_and_community_lands", + "landmark_natural_resource_rights", + "licadho_khm_economic_land_concessions", + "haka_idn_leuser", + "idn_forest_area", + "idn_forest_moratorium", + "osinfor_per_forest_concessions", + "osinfor_per_forest_concessions", + "osinfor_peru_permanent_production_forests", + "gfw_forest_carbon_gross_emissions", + "gfw_forest_carbon_net_flux", + "gfw_forest_carbon_gross_removals", + "whrc_aboveground_biomass_stock_2000", + "birdlife_biodiversity_intactness", + "birdlife_biodiversity_significance", + "birdlife_alliance_for_zero_extinction_sites", + "birdlife_key_biodiversity_areas", + "ci_biodiversity_hotspots", + "birdlife_endemic_bird_areas" +] \ No newline at end of file diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 11f63959a5..797559402a 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -1,14 +1,19 @@ -import { GFW_DATA_API, GFW_STAGING_DATA_API } from 'utils/apis'; +import { GFW_DATA_API } from 'utils/apis'; import axios from 'axios'; -const ENVIRONMENT = process.env.NEXT_PUBLIC_RW_FEATURE_ENV; -const GFW_METADATA_API_URL = - ENVIRONMENT === 'staging' ? GFW_STAGING_DATA_API : GFW_DATA_API; +import METADATA_LIST from '../../../data/metadata.json'; export default async (req, res) => { try { - const path = req.query.params.join('/'); - const url = `${GFW_METADATA_API_URL}/${path}`; + const userPath = req.query.params[1]; + const safePath = METADATA_LIST.includes(userPath); + + if (!safePath) { + return res.status(400).end('Invalid path'); + } + + const url = `${GFW_DATA_API}/dataset/${userPath}`; + const datasetMetadata = await axios.get(url); const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`); From e9f2cf599e52c2b43531186cd530557f40ab44ae Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Wed, 25 Sep 2024 19:36:58 -0300 Subject: [PATCH 13/23] feat(metadata): add RW API request for external metadatas some datasets are not on Data API, for that reason we are still requesting RW API for a few cases --- data/metadata-exception.json | 6 ++++++ pages/api/metadata/[...params].js | 27 ++++++++++++++++++--------- services/metadata.js | 2 +- 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 data/metadata-exception.json diff --git a/data/metadata-exception.json b/data/metadata-exception.json new file mode 100644 index 0000000000..bd9c321e1d --- /dev/null +++ b/data/metadata-exception.json @@ -0,0 +1,6 @@ +[ + "places_to_watch", + "nasa_fire_weather", + "waqi_air_quality", + "global_population_jrc" +] \ No newline at end of file diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 797559402a..1f64ec4b37 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -1,22 +1,35 @@ -import { GFW_DATA_API } from 'utils/apis'; +import { GFW_DATA_API, GFW_METADATA_API } from 'utils/apis'; import axios from 'axios'; import METADATA_LIST from '../../../data/metadata.json'; +import METADATA_EXCEPTION_LIST from '../../../data/metadata-exception.json'; // a list of metadatas that aren't on Data API export default async (req, res) => { try { - const userPath = req.query.params[1]; - const safePath = METADATA_LIST.includes(userPath); + const userPath = req.query.params[0]; + const isSafePath = + METADATA_LIST.includes(userPath) || + METADATA_EXCEPTION_LIST.includes(userPath); + const isExternalMetadata = METADATA_EXCEPTION_LIST.includes(userPath); - if (!safePath) { + if (!isSafePath) { return res.status(400).end('Invalid path'); } + if (isExternalMetadata) { + const url = `${GFW_METADATA_API}/${userPath}`; + const response = await axios.get(url); + const transformedResponse = { + metadata: response.data, + }; + + return res.status(200).json(transformedResponse); + } + const url = `${GFW_DATA_API}/dataset/${userPath}`; const datasetMetadata = await axios.get(url); const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`); - const dataVersionMetadataObject = datasetVersionMetadata.data.data; const response = { @@ -38,10 +51,6 @@ export default async (req, res) => { return res.status(200).json(response); } catch (error) { - if (error.response) { - return res.status(400).end(error.response.data.message); - } - return res.status(400).end(error.message); } }; diff --git a/services/metadata.js b/services/metadata.js index 951dcae114..8eed8ba8a8 100644 --- a/services/metadata.js +++ b/services/metadata.js @@ -5,7 +5,7 @@ export const getMetadata = (slug, metaType) => { return metadataWidgetRequest.get(slug); } - return metadataRequest.get(`dataset/${slug}`); + return metadataRequest.get(slug); }; export default { From 5facb7768ebc8325fd0775d1e3c4efe47ed8f997 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Thu, 26 Sep 2024 16:51:54 -0300 Subject: [PATCH 14/23] feat(metadata): improve safePaths and add more metadata to JSON --- data/metadata.json | 5 ++++- pages/api/metadata/[...params].js | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/data/metadata.json b/data/metadata.json index cead296d25..8d148384ed 100644 --- a/data/metadata.json +++ b/data/metadata.json @@ -39,6 +39,7 @@ "landmark_indigenous_and_community_lands", "landmark_natural_resource_rights", "licadho_khm_economic_land_concessions", + "khm_protected_areas", "haka_idn_leuser", "idn_forest_area", "idn_forest_moratorium", @@ -54,5 +55,7 @@ "birdlife_alliance_for_zero_extinction_sites", "birdlife_key_biodiversity_areas", "ci_biodiversity_hotspots", - "birdlife_endemic_bird_areas" + "birdlife_endemic_bird_areas", + "osm_logging_roads", + "per_protected_areas" ] \ No newline at end of file diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 1f64ec4b37..5d4dd8efff 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -7,17 +7,17 @@ import METADATA_EXCEPTION_LIST from '../../../data/metadata-exception.json'; // export default async (req, res) => { try { const userPath = req.query.params[0]; - const isSafePath = - METADATA_LIST.includes(userPath) || - METADATA_EXCEPTION_LIST.includes(userPath); const isExternalMetadata = METADATA_EXCEPTION_LIST.includes(userPath); + const safePaths = [...METADATA_LIST, ...METADATA_EXCEPTION_LIST].filter( + (path) => path === userPath + ); - if (!isSafePath) { + if (safePaths.length === 0) { return res.status(400).end('Invalid path'); } if (isExternalMetadata) { - const url = `${GFW_METADATA_API}/${userPath}`; + const url = `${GFW_METADATA_API}/${safePaths[0]}`; const response = await axios.get(url); const transformedResponse = { metadata: response.data, @@ -26,7 +26,7 @@ export default async (req, res) => { return res.status(200).json(transformedResponse); } - const url = `${GFW_DATA_API}/dataset/${userPath}`; + const url = `${GFW_DATA_API}/dataset/${safePaths[0]}`; const datasetMetadata = await axios.get(url); const datasetVersionMetadata = await axios.get(`${url}/latest/metadata`); From e51164a6ec0b34cb88f88f63a4efb9c5b4b7da17 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Thu, 3 Oct 2024 13:03:59 -0300 Subject: [PATCH 15/23] feat(metadata): add markdown lib to replace parse method --- components/modals/meta/component.jsx | 21 +-- package.json | 1 + yarn.lock | 189 +++++++++++++++++++++++---- 3 files changed, 166 insertions(+), 45 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index 92b1323ed9..846c6d66f1 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -1,9 +1,10 @@ import React, { PureComponent } from 'react'; +import { Remark } from 'react-remark'; + import PropTypes from 'prop-types'; import isEmpty from 'lodash/isEmpty'; import lowerCase from 'lodash/lowerCase'; import moment from 'moment'; -import ReactHtmlParser from 'react-html-parser'; import { trackEvent } from 'utils/analytics'; import { Button, NoContent } from '@worldresources/gfw-components'; @@ -84,7 +85,7 @@ class ModalMeta extends PureComponent { dangerouslySetInnerHTML={{ __html: lowerCase(key) }} // eslint-disable-line />
-

{this.parseMarkdownURLToHTML(tableData[key])}

+ {tableData[key]}
) : null @@ -94,7 +95,7 @@ class ModalMeta extends PureComponent {

Overview

-

{this.parseMarkdownURLToHTML(overview)}

+ {overview}
)} @@ -102,7 +103,7 @@ class ModalMeta extends PureComponent {
Citation
-

{this.parseMarkdownURLToHTML(parsedCitation)}

+ {parsedCitation}
)} @@ -134,18 +135,6 @@ class ModalMeta extends PureComponent { ); } - parseMarkdownURLToHTML = (markdown) => { - const markdownRegex = /\[([^\]]+)\]\(([^)]+)\)/g; - if (typeof markdown !== 'string') return markdown; - - const htmlAnchor = markdown.replace( - markdownRegex, - '$1' - ); - - return <>{ReactHtmlParser(htmlAnchor)}; - }; - render() { const { metakey, setModalMetaClosed, metaData, loading } = this.props; const { title } = metaData || {}; diff --git a/package.json b/package.json index 1f63b06e8d..a94f010ffe 100644 --- a/package.json +++ b/package.json @@ -158,6 +158,7 @@ "react-portal": "^4.2.1", "react-pose": "^3.3.6", "react-redux": "^7.2.2", + "react-remark": "^2.1.0", "react-scroll": "^1.7.16", "react-simple-maps": "^2.0.0", "react-slick": "^0.25.2", diff --git a/yarn.lock b/yarn.lock index 3253b12872..7e8ec8207f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2540,6 +2540,13 @@ resolved "https://registry.yarnpkg.com/@mapbox/geojson-types/-/geojson-types-1.0.2.tgz#9aecf642cb00eab1080a57c4f949a65b4a5846d6" integrity sha512-e9EBqHHv3EORHrSfbR9DqecPNn+AmuAoQxV6aL8Xu30bJMJR1o8PZLZzpk1Wq7/NfCbuhmakHTPYRhoqLsXRnw== +"@mapbox/hast-util-table-cell-style@^0.2.0": + version "0.2.1" + resolved "https://registry.yarnpkg.com/@mapbox/hast-util-table-cell-style/-/hast-util-table-cell-style-0.2.1.tgz#b8e92afdd38b668cf0762400de980073d2ade101" + integrity sha512-LyQz4XJIdCdY/+temIhD/Ed0x/p4GAOUycpFSEK2Ads1CPKZy6b7V/2ROEtQiLLQ8soIs0xe/QAoR6kwpyW/yw== + dependencies: + unist-util-visit "^1.4.1" + "@mapbox/jsonlint-lines-primitives@^2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@mapbox/jsonlint-lines-primitives/-/jsonlint-lines-primitives-2.0.2.tgz#ce56e539f83552b58d10d672ea4d6fc9adc7b234" @@ -3927,6 +3934,11 @@ resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.7.tgz#5b06ad6894b236a1d2bd6b2f07850ca5c59cf4d6" integrity sha512-cputDpIbFgLUaGQn6Vqg3/YsJwxUwHLO13v3i5ouxT4lat0khip9AEWxtERujXV9wxIB1EyF97BSJFt6vpdI8g== +"@types/unist@^2.0.3": + version "2.0.11" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.11.tgz#11af57b127e32487774841f7a4e54eab166d03c4" + integrity sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA== + "@types/uuid@8.3.4": version "8.3.4" resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" @@ -5736,6 +5748,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +comma-separated-tokens@^1.0.0: + version "1.0.8" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" + integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== + commander@2, commander@^2.11.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -9379,6 +9396,19 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hast-to-hyperscript@^9.0.0: + version "9.0.1" + resolved "https://registry.yarnpkg.com/hast-to-hyperscript/-/hast-to-hyperscript-9.0.1.tgz#9b67fd188e4c81e8ad66f803855334173920218d" + integrity sha512-zQgLKqF+O2F72S1aa4y2ivxzSlko3MAvxkwG8ehGmNiqd98BIN3JM1rAJPmplEyLmGLO2QZYJtIneOSZ2YbJuA== + dependencies: + "@types/unist" "^2.0.3" + comma-separated-tokens "^1.0.0" + property-information "^5.3.0" + space-separated-tokens "^1.0.0" + style-to-object "^0.3.0" + unist-util-is "^4.0.0" + web-namespaces "^1.0.0" + hat@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/hat/-/hat-0.0.3.tgz#bb014a9e64b3788aed8005917413d4ff3d502d8a" @@ -11722,6 +11752,13 @@ md5.js@^1.3.4: inherits "^2.0.1" safe-buffer "^5.1.2" +mdast-util-definitions@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-4.0.0.tgz#c5c1a84db799173b4dcf7643cda999e440c24db2" + integrity sha512-k8AJ6aNnUkB7IE+5azR9h81O5EQ/cTDXtWdMq9Kk5KcEW/8ritU5CeLg/9HhOC++nALHBlaogJ5jz0Ybk3kPMQ== + dependencies: + unist-util-visit "^2.0.0" + mdast-util-from-markdown@^0.8.0: version "0.8.5" resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-0.8.5.tgz#d1ef2ca42bc377ecb0463a987910dae89bd9a28c" @@ -11733,6 +11770,20 @@ mdast-util-from-markdown@^0.8.0: parse-entities "^2.0.0" unist-util-stringify-position "^2.0.0" +mdast-util-to-hast@^10.2.0: + version "10.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz#61875526a017d8857b71abc9333942700b2d3604" + integrity sha512-JoPBfJ3gBnHZ18icCwHR50orC9kNH81tiR1gs01D8Q5YpV6adHNO9nKNuFBCJQ941/32PT1a63UF/DitmS3amQ== + dependencies: + "@types/mdast" "^3.0.0" + "@types/unist" "^2.0.0" + mdast-util-definitions "^4.0.0" + mdurl "^1.0.0" + unist-builder "^2.0.0" + unist-util-generated "^1.0.0" + unist-util-position "^3.0.0" + unist-util-visit "^2.0.0" + mdast-util-to-markdown@^0.6.0: version "0.6.5" resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" @@ -11760,6 +11811,11 @@ mdn-data@2.0.4: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.4.tgz#699b3c38ac6f1d728091a64650b65d388502fd5b" integrity sha512-iV3XNKw06j5Q7mi6h+9vbx23Tv7JkjEVgKHW4pimwyDGWm0OIQntJJ+u1C6mg6mK1EaTv42XQ7w76yuzH7M2cA== +mdurl@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/mdurl/-/mdurl-1.0.1.tgz#fe85b2ec75a59037f2adfec100fd6c601761152e" + integrity sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g== + media-typer@0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" @@ -13943,6 +13999,13 @@ property-expr@^2.0.5: resolved "https://registry.yarnpkg.com/property-expr/-/property-expr-2.0.5.tgz#278bdb15308ae16af3e3b9640024524f4dc02cb4" integrity sha512-IJUkICM5dP5znhCckHSv30Q4b5/JA5enCtkRHYaOVOAocnH/1BQEYTC5NMfT3AVl/iXKdr3aqQbQn9DxyWknwA== +property-information@^5.3.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-5.6.0.tgz#61675545fb23002f245c6540ec46077d4da3ed69" + integrity sha512-YUHSPk+A30YPv+0Qf8i9Mbfe/C0hdPXk1s1jPVToV8pk8BQtpw10ct89Eo7OWkutrwqvT0eicAxlOg3dOAu8JA== + dependencies: + xtend "^4.0.0" + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -14548,6 +14611,16 @@ react-refresh@0.8.3: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.8.3.tgz#721d4657672d400c5e3c75d063c4a85fb2d5d68f" integrity sha512-X8jZHc7nCMjaCqoU+V2I0cOhNW+QMBwSUkeXnTi8IPe6zaRWfn60ZzvFDZqWPfmSJfjub7dDW1SP0jaHWLu/hg== +react-remark@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/react-remark/-/react-remark-2.1.0.tgz#dd68a32ab2d022e598b27dbfb754400e8f68555c" + integrity sha512-7dEPxRGQ23sOdvteuRGaQAs9cEOH/BOeCN4CqsJdk3laUDIDYRCWnM6a3z92PzXHUuxIRLXQNZx7SiO0ijUcbw== + dependencies: + rehype-react "^6.0.0" + remark-parse "^9.0.0" + remark-rehype "^8.0.0" + unified "^9.0.0" + react-resize-detector@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/react-resize-detector/-/react-resize-detector-7.1.2.tgz#8ef975dd8c3d56f9a5160ac382ef7136dcd2d86c" @@ -14923,6 +14996,14 @@ registry-url@3.1.0: dependencies: rc "^1.0.1" +rehype-react@^6.0.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/rehype-react/-/rehype-react-6.2.1.tgz#9b9bf188451ad6f63796b784fe1f51165c67b73a" + integrity sha512-f9KIrjktvLvmbGc7si25HepocOg4z0MuNOtweigKzBcDjiGSTGhyz6VSgaV5K421Cq1O+z4/oxRJ5G9owo0KVg== + dependencies: + "@mapbox/hast-util-table-cell-style" "^0.2.0" + hast-to-hyperscript "^9.0.0" + release-zalgo@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/release-zalgo/-/release-zalgo-1.0.0.tgz#09700b7e5074329739330e535c5a90fb67851730" @@ -14966,6 +15047,13 @@ remark-parse@^9.0.0: dependencies: mdast-util-from-markdown "^0.8.0" +remark-rehype@^8.0.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-8.1.0.tgz#610509a043484c1e697437fa5eb3fd992617c945" + integrity sha512-EbCu9kHgAxKmW1yEYjx3QafMyGY3q8noUbNUI5xyKbaFP89wbhDrKxyIQNukNYthzjNHZu6J7hwFg7hRm1svYA== + dependencies: + mdast-util-to-hast "^10.2.0" + remark-stringify@^9.0.0: version "9.0.1" resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-9.0.1.tgz#576d06e910548b0a7191a71f27b33f1218862894" @@ -15838,6 +15926,11 @@ source-map@^0.7.4: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== +space-separated-tokens@^1.0.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" + integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== + spawn-to-readstream@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/spawn-to-readstream/-/spawn-to-readstream-0.1.3.tgz#96768b72739ac64ffa77c8ce2cbf98c2d21d8dbf" @@ -16120,7 +16213,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, 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== @@ -16146,15 +16239,6 @@ string-width@^3.0.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, 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== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - string-width@^5.0.1, string-width@^5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" @@ -16238,7 +16322,7 @@ stringify-object@^3.3.0: is-obj "^1.0.1" is-regexp "^1.0.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@6.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== @@ -16252,13 +16336,6 @@ strip-ansi@6.0.0: dependencies: ansi-regex "^5.0.0" -strip-ansi@6.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== - dependencies: - ansi-regex "^5.0.1" - strip-ansi@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" @@ -16384,6 +16461,13 @@ style-to-object@0.4.1: dependencies: inline-style-parser "0.1.1" +style-to-object@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-0.3.0.tgz#b1b790d205991cc783801967214979ee19a76e46" + integrity sha512-CzFnRRXhzWIdItT3OmF8SQfWyahHhjq3HwcMNCNLn+N7klOOqPjMeG/4JSu77D7ypZdGvSzvkrbyeTMizz2VrA== + dependencies: + inline-style-parser "0.1.1" + style-value-types@^3.0.6, style-value-types@^3.1.7: version "3.2.0" resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-3.2.0.tgz#eb89cab1340823fa7876f3e289d29d99c92111bb" @@ -17360,7 +17444,7 @@ unidecode@0.1.8: resolved "https://registry.yarnpkg.com/unidecode/-/unidecode-0.1.8.tgz#efbb301538bc45246a9ac8c559d72f015305053e" integrity sha512-SdoZNxCWpN2tXTCrGkPF/0rL2HEq+i2gwRG1ReBvx8/0yTzC3enHfugOf8A9JBShVwwrRIkLX0YcDUGbzjbVCA== -unified@^9.1.0: +unified@^9.0.0, unified@^9.1.0: version "9.2.2" resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== @@ -17389,6 +17473,11 @@ unique-string@^1.0.0: dependencies: crypto-random-string "^1.0.0" +unist-builder@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/unist-builder/-/unist-builder-2.0.3.tgz#77648711b5d86af0942f334397a33c5e91516436" + integrity sha512-f98yt5pnlMWlzP539tPc4grGMsFaQQlP/vM396b00jngsiINumNmsY8rkXjfoi1c6QaM8nQ3vaGDuoKWbe/1Uw== + unist-util-find-all-after@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/unist-util-find-all-after/-/unist-util-find-all-after-3.0.2.tgz#fdfecd14c5b7aea5e9ef38d5e0d5f774eeb561f6" @@ -17396,11 +17485,26 @@ unist-util-find-all-after@^3.0.2: dependencies: unist-util-is "^4.0.0" +unist-util-generated@^1.0.0: + version "1.1.6" + resolved "https://registry.yarnpkg.com/unist-util-generated/-/unist-util-generated-1.1.6.tgz#5ab51f689e2992a472beb1b35f2ce7ff2f324d4b" + integrity sha512-cln2Mm1/CZzN5ttGK7vkoGw+RZ8VcUH6BtGbq98DDtRGquAAOXig1mrBQYelOwMXYS8rK+vZDyyojSjp7JX+Lg== + +unist-util-is@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-3.0.0.tgz#d9e84381c2468e82629e4a5be9d7d05a2dd324cd" + integrity sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A== + unist-util-is@^4.0.0: version "4.1.0" resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== +unist-util-position@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" + integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== + unist-util-stringify-position@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" @@ -17408,6 +17512,37 @@ unist-util-stringify-position@^2.0.0: dependencies: "@types/unist" "^2.0.2" +unist-util-visit-parents@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz#25e43e55312166f3348cae6743588781d112c1e9" + integrity sha512-DyN5vD4NE3aSeB+PXYNKxzGsfocxp6asDc2XXE3b0ekO2BaRUpBicbbUygfSvYfUz1IkmjFR1YF7dPklraMZ2g== + dependencies: + unist-util-is "^3.0.0" + +unist-util-visit-parents@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz#65a6ce698f78a6b0f56aa0e88f13801886cdaef6" + integrity sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^4.0.0" + +unist-util-visit@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" + integrity sha512-AvGNk7Bb//EmJZyhtRUnNMEpId/AZ5Ph/KUpTI09WHQuDZHKovQ1oEv3mfmKpWKtoMzyMC4GLBm1Zy5k12fjIw== + dependencies: + unist-util-visit-parents "^2.0.0" + +unist-util-visit@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" + integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== + dependencies: + "@types/unist" "^2.0.0" + unist-util-is "^4.0.0" + unist-util-visit-parents "^3.0.0" + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -17828,6 +17963,11 @@ wcwidth@^1.0.1: dependencies: defaults "^1.0.3" +web-namespaces@^1.0.0: + version "1.1.4" + resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" + integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -18008,7 +18148,7 @@ workerpool@6.2.1: resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.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== @@ -18026,15 +18166,6 @@ 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 47b406d5dcc9158cbb3072c21258aedc2512f960 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Thu, 28 Nov 2024 13:52:55 -0300 Subject: [PATCH 16/23] feat(metadata): add resolution description and validate content_date properties We have three different properties to display the content date: content_date_description, content_date_range, and content_date, in this order of priority. --- components/modals/meta/component.jsx | 35 ++++++++++++++++++++++++---- components/modals/meta/selectors.js | 4 +++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index 846c6d66f1..8616912d66 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -50,6 +50,31 @@ class ModalMeta extends PureComponent { } } + /** + * We have 3 different properties to display the content date: + * content_date_description, content_date_range and content_date, in this order of priority + * @returns An object cointaing metadata rows with the correct content_date + */ + setContentDate() { + const { + tableData: { content_date_range, content_date_description, ...rest }, + } = this.props; + + if (content_date_description) { + return { ...rest, content_date: content_date_description }; + } + + if (content_date_description && content_date_range) { + const { start_date, end_date } = content_date_range; + return { + ...rest, + content_date: `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`, + }; + } + + return rest; + } + getContent() { const { metaData, tableData, loading, error, locationName } = this.props; const { subtitle, overview, citation, learn_more, download_data } = @@ -61,6 +86,8 @@ class ModalMeta extends PureComponent { .replaceAll('[selected area name]', locationName) .replaceAll('[date]', moment().format('DD/MM/YYYY')); + const tableDataWithContentDate = this.setContentDate(tableData); + return (
{error && !loading && ( @@ -76,16 +103,16 @@ class ModalMeta extends PureComponent { dangerouslySetInnerHTML={{ __html: subtitle }} // eslint-disable-line />
- {tableData && - Object.keys(tableData).map((key) => - tableData[key] ? ( + {tableDataWithContentDate && + Object.keys(tableDataWithContentDate).map((key) => + tableDataWithContentDate[key] ? (
- {tableData[key]} + {tableDataWithContentDate[key]}
) : null diff --git a/components/modals/meta/selectors.js b/components/modals/meta/selectors.js index d43daca4ff..95e8849c05 100644 --- a/components/modals/meta/selectors.js +++ b/components/modals/meta/selectors.js @@ -13,10 +13,12 @@ const META_FIELDS = [ ]; const TABLE_FIELDS = [ 'function', - 'resolution', + 'resolution_description', 'geographic_coverage', 'source', 'content_date', + 'content_date_description', + 'content_date_range', 'update_frequency', 'cautions', 'license', From 0a5a51e0aa292698c7d84be1da77b0c20cb6ac9f Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 3 Dec 2024 11:51:28 -0300 Subject: [PATCH 17/23] chore(comment): fix metadata comment --- pages/api/metadata/[...params].js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/api/metadata/[...params].js b/pages/api/metadata/[...params].js index 5d4dd8efff..0842e534cf 100644 --- a/pages/api/metadata/[...params].js +++ b/pages/api/metadata/[...params].js @@ -2,7 +2,7 @@ import { GFW_DATA_API, GFW_METADATA_API } from 'utils/apis'; import axios from 'axios'; import METADATA_LIST from '../../../data/metadata.json'; -import METADATA_EXCEPTION_LIST from '../../../data/metadata-exception.json'; // a list of metadatas that aren't on Data API +import METADATA_EXCEPTION_LIST from '../../../data/metadata-exception.json'; // a list of metadata that isn't on Data API export default async (req, res) => { try { From eede9cc24d7f44dda49e6d4fde2cd3056255ae2a Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 13 Dec 2024 16:13:54 -0300 Subject: [PATCH 18/23] feat(react): Bump react to v18 --- package.json | 4 ++-- yarn.lock | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index a94f010ffe..cb4d1a4571 100644 --- a/package.json +++ b/package.json @@ -140,10 +140,10 @@ "query-string": "^6.11.1", "rc-slider": "8.6.3", "rc-tooltip": "3.7.0", - "react": "^17.0.2", + "react": "18", "react-content-loader": "^5.0.2", "react-datepicker": "^3.3.0", - "react-dom": "17.0.2", + "react-dom": "18", "react-dotdotdot": "^1.3.1", "react-dropzone": "^4.2.13", "react-facebook-pixel": "^1.0.3", diff --git a/yarn.lock b/yarn.lock index 7e8ec8207f..ae96920a63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14405,14 +14405,13 @@ react-datepicker@^3.3.0: react-onclickoutside "^6.10.0" react-popper "^1.3.8" -react-dom@17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-17.0.2.tgz#ecffb6845e3ad8dbfcdc498f0d0a939736502c23" - integrity sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA== +react-dom@18: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" + integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" - scheduler "^0.20.2" + scheduler "^0.23.2" react-dotdotdot@^1.3.1: version "1.3.1" @@ -14735,13 +14734,12 @@ react-youtube@^7.9.0: prop-types "15.7.2" youtube-player "5.5.2" -react@^17.0.2: - version "17.0.2" - resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" - integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== +react@18: + version "18.3.1" + resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" + integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" read-pkg-up@^1.0.1: version "1.0.1" @@ -15467,13 +15465,12 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -scheduler@^0.20.2: - version "0.20.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" - integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== +scheduler@^0.23.2: + version "0.23.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" + integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== dependencies: loose-envify "^1.1.0" - object-assign "^4.1.1" schema-utils@^1.0.0: version "1.0.0" From d696328cd9a2ce40a1f58d086dc4a3bd43c6f585 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Fri, 13 Dec 2024 16:14:25 -0300 Subject: [PATCH 19/23] feat(markdown): add react-markdown to parse md to html --- components/modals/meta/component.jsx | 33 +- package.json | 2 + yarn.lock | 722 ++++++++++++++++++++++++++- 3 files changed, 748 insertions(+), 9 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index 8616912d66..ac5817e130 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -1,5 +1,6 @@ import React, { PureComponent } from 'react'; -import { Remark } from 'react-remark'; +import ReactMarkdown from 'react-markdown'; +import rehypeRaw from 'rehype-raw'; import PropTypes from 'prop-types'; import isEmpty from 'lodash/isEmpty'; @@ -57,22 +58,32 @@ class ModalMeta extends PureComponent { */ setContentDate() { const { - tableData: { content_date_range, content_date_description, ...rest }, + tableData: { + resolution_description, + content_date_range, + content_date_description, + ...rest + }, } = this.props; if (content_date_description) { - return { ...rest, content_date: content_date_description }; + return { + resolution: resolution_description, + content_date: content_date_description, + ...rest, + }; } if (content_date_description && content_date_range) { const { start_date, end_date } = content_date_range; return { - ...rest, + resolution: resolution_description, content_date: `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`, + ...rest, }; } - return rest; + return { resolution: resolution_description, ...rest }; } getContent() { @@ -112,7 +123,9 @@ class ModalMeta extends PureComponent { dangerouslySetInnerHTML={{ __html: lowerCase(key) }} // eslint-disable-line />
- {tableDataWithContentDate[key]} + + {tableDataWithContentDate[key]} +
) : null @@ -122,7 +135,9 @@ class ModalMeta extends PureComponent {

Overview

- {overview} + + {overview} +
)} @@ -130,7 +145,9 @@ class ModalMeta extends PureComponent {
Citation
- {parsedCitation} + + {parsedCitation} +
)} diff --git a/package.json b/package.json index cb4d1a4571..9bc6e668a2 100644 --- a/package.json +++ b/package.json @@ -153,6 +153,7 @@ "react-intersection-observer": "^8.31.1", "react-joyride": "^2.2.1", "react-map-gl": "^5.2.7", + "react-markdown": "9.0.1", "react-modal": "^3.11.2", "react-outside-click-handler": "^1.3.0", "react-portal": "^4.2.1", @@ -173,6 +174,7 @@ "recharts": "2.4.3", "redux": "^4.0.5", "redux-actions": "^2.6.5", + "rehype-raw": "7.0.0", "release": "^6.3.0", "reselect": "4.0.0", "responsive-loader": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index ae96920a63..07f97167f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3657,6 +3657,25 @@ resolved "https://registry.yarnpkg.com/@types/d3-timer/-/d3-timer-3.0.0.tgz#e2505f1c21ec08bda8915238e397fb71d2fc54ce" integrity sha512-HNB/9GHqu7Fo8AQiugyJbv6ZxYz58wef0esl4Mv828w1ZKpAshw/uFWVDUcIB9KKFeFKoxS3cHY07FFgtTRZ1g== +"@types/debug@^4.0.0": + version "4.1.12" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" + integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== + dependencies: + "@types/ms" "*" + +"@types/estree-jsx@^1.0.0": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree-jsx/-/estree-jsx-1.0.5.tgz#858a88ea20f34fe65111f005a689fa1ebf70dc18" + integrity sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg== + dependencies: + "@types/estree" "*" + +"@types/estree@*", "@types/estree@^1.0.0": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + "@types/find-cache-dir@^3.2.1": version "3.2.1" resolved "https://registry.yarnpkg.com/@types/find-cache-dir/-/find-cache-dir-3.2.1.tgz#7b959a4b9643a1e6a1a5fe49032693cc36773501" @@ -3702,6 +3721,13 @@ resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.41.tgz#f6ecf57d1b12d2befcce00e928a6a097c22980aa" integrity sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA== +"@types/hast@^3.0.0": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa" + integrity sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ== + dependencies: + "@types/unist" "*" + "@types/hoist-non-react-statics@^3.3.0": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -3803,6 +3829,13 @@ dependencies: "@types/unist" "^2" +"@types/mdast@^4.0.0": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-4.0.4.tgz#7ccf72edd2f1aa7dd3437e180c64373585804dd6" + integrity sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA== + dependencies: + "@types/unist" "*" + "@types/minimatch@*": version "5.1.2" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" @@ -3813,6 +3846,11 @@ resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== +"@types/ms@*": + version "0.7.34" + resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.34.tgz#10964ba0dee6ac4cd462e2795b6bebd407303433" + integrity sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g== + "@types/node@*": version "20.4.2" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.4.2.tgz#129cc9ae69f93824f92fac653eebfb4812ab4af9" @@ -3929,6 +3967,11 @@ resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.2.tgz#38ecb64f01aa0d02b7c8f4222d7c38af6316fef8" integrity sha512-txGIh+0eDFzKGC25zORnswy+br1Ha7hj5cMVwKIU7+s0U2AxxJru/jZSMU6OC9MJWP6+pc/hc6ZjyZShpsyY2g== +"@types/unist@*", "@types/unist@^3.0.0": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.3.tgz#acaab0f919ce69cce629c2d4ed2eb4adc1b6c20c" + integrity sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q== + "@types/unist@^2", "@types/unist@^2.0.0", "@types/unist@^2.0.2": version "2.0.7" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.7.tgz#5b06ad6894b236a1d2bd6b2f07850ca5c59cf4d6" @@ -3978,6 +4021,11 @@ resolved "https://registry.yarnpkg.com/@tyriar/fibonacci-heap/-/fibonacci-heap-2.0.9.tgz#df3dcbdb1b9182168601f6318366157ee16666e9" integrity sha512-bYuSNomfn4hu2tPiDN+JZtnzCpSpbJ/PNeulmocDy3xN2X5OkJL65zo6rPZp65cPPhLF9vfT/dgE+RtFRCSxOA== +"@ungap/structured-clone@^1.0.0": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.1.tgz#28fa185f67daaf7b7a1a8c1d445132c5d979f8bd" + integrity sha512-fEzPV3hSkSMltkw152tJKNARhOupqbH96MZWyRjNaYZOMIzbrTeQDG+MTc6Mr2pgzFQzFxAfmhGDNP5QK++2ZA== + "@wordpress/api-fetch@^3.19.1": version "3.23.1" resolved "https://registry.yarnpkg.com/@wordpress/api-fetch/-/api-fetch-3.23.1.tgz#2a9eb9304bbb19395bf83bc51c7f63e7b32b1369" @@ -4797,6 +4845,11 @@ bail@^1.0.0: resolved "https://registry.yarnpkg.com/bail/-/bail-1.0.5.tgz#b6fa133404a392cbc1f8c4bf63f5953351e7a776" integrity sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ== +bail@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/bail/-/bail-2.0.2.tgz#d26f5cd8fe5d6f832a31517b9f7c356040ba6d5d" + integrity sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -5350,6 +5403,11 @@ caw@^2.0.0, caw@^2.0.1: tunnel-agent "^0.6.0" url-to-options "^1.0.1" +ccount@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" + integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== + chalk@2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.2.tgz#250dc96b07491bfd601e648d66ddf5f60c7a5c65" @@ -5422,21 +5480,41 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== +character-entities-html4@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" + integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== + character-entities-legacy@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== +character-entities-legacy@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" + integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== + character-entities@^1.0.0: version "1.2.4" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== +character-entities@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.2.tgz#2d09c2e72cd9523076ccb21157dff66ad43fcc22" + integrity sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ== + character-reference-invalid@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== +character-reference-invalid@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" + integrity sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw== + chardet@^0.4.0: version "0.4.2" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" @@ -5753,6 +5831,11 @@ comma-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz#632b80b6117867a158f1080ad498b2fbe7e3f5ea" integrity sha512-GHuDRO12Sypu2cV70d1dkA2EUmXHgntrzbpvOB+Qy+49ypNfGgFQIC2fhhXbnyrJRynDCAARsT7Ou0M6hirpfw== +comma-separated-tokens@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz#4e89c9458acb61bc8fef19f4529973b2392839ee" + integrity sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg== + commander@2, commander@^2.11.0, commander@^2.8.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -6615,6 +6698,13 @@ deck.gl@7.3.6: "@deck.gl/mesh-layers" "7.3.6" "@deck.gl/react" "7.3.6" +decode-named-character-reference@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/decode-named-character-reference/-/decode-named-character-reference-1.0.2.tgz#daabac9690874c394c81e4162a0304b35d824f0e" + integrity sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg== + dependencies: + character-entities "^2.0.0" + decode-uri-component@^0.2.0: version "0.2.2" resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.2.tgz#e69dbe25d37941171dd540e024c444cd5188e1e9" @@ -6819,7 +6909,7 @@ depd@~1.1.2: resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" integrity sha512-7emPTl6Dpo6JRXOXjLRxck+FlLRX5847cLKEn00PLAgc3g2hTZZgr+e4c2v6QpSmLeFP3n5yUo7ft6avBK/5jQ== -dequal@^2.0.2, dequal@^2.0.3: +dequal@^2.0.0, dequal@^2.0.2, dequal@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/dequal/-/dequal-2.0.3.tgz#2644214f1997d39ed0ee0ece72335490a7ac67be" integrity sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA== @@ -6842,6 +6932,13 @@ detect-newline@^3.0.0: resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== +devlop@^1.0.0, devlop@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/devlop/-/devlop-1.1.0.tgz#4db7c2ca4dc6e0e834c30be70c94bbc976dc7018" + integrity sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA== + dependencies: + dequal "^2.0.0" + diff-sequences@^29.4.3: version "29.4.3" resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" @@ -7774,6 +7871,11 @@ estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== +estree-util-is-identifier-name@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz#0b5ef4c4ff13508b34dcd01ecfa945f61fce5dbd" + integrity sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg== + estree-walker@^0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.6.1.tgz#53049143f40c6eb918b23671d1fe3219f3a1b362" @@ -9409,6 +9511,98 @@ hast-to-hyperscript@^9.0.0: unist-util-is "^4.0.0" web-namespaces "^1.0.0" +hast-util-from-parse5@^8.0.0: + version "8.0.2" + resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-8.0.2.tgz#29b42758ba96535fd6021f0f533c000886c0f00f" + integrity sha512-SfMzfdAi/zAoZ1KkFEyyeXBn7u/ShQrfd675ZEE9M3qj+PMFX05xubzRyF76CCSJu8au9jgVxDV1+okFvgZU4A== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + devlop "^1.0.0" + hastscript "^9.0.0" + property-information "^6.0.0" + vfile "^6.0.0" + vfile-location "^5.0.0" + web-namespaces "^2.0.0" + +hast-util-parse-selector@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz#352879fa86e25616036037dd8931fb5f34cb4a27" + integrity sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A== + dependencies: + "@types/hast" "^3.0.0" + +hast-util-raw@^9.0.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/hast-util-raw/-/hast-util-raw-9.1.0.tgz#79b66b26f6f68fb50dfb4716b2cdca90d92adf2e" + integrity sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw== + dependencies: + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + "@ungap/structured-clone" "^1.0.0" + hast-util-from-parse5 "^8.0.0" + hast-util-to-parse5 "^8.0.0" + html-void-elements "^3.0.0" + mdast-util-to-hast "^13.0.0" + parse5 "^7.0.0" + unist-util-position "^5.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + web-namespaces "^2.0.0" + zwitch "^2.0.0" + +hast-util-to-jsx-runtime@^2.0.0: + version "2.3.2" + resolved "https://registry.yarnpkg.com/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.2.tgz#6d11b027473e69adeaa00ca4cfb5bb68e3d282fa" + integrity sha512-1ngXYb+V9UT5h+PxNRa1O1FYguZK/XL+gkeqvp7EdHlB9oHUG0eYRo/vY5inBdcqo3RkPMC58/H94HvkbfGdyg== + dependencies: + "@types/estree" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/unist" "^3.0.0" + comma-separated-tokens "^2.0.0" + devlop "^1.0.0" + estree-util-is-identifier-name "^3.0.0" + hast-util-whitespace "^3.0.0" + mdast-util-mdx-expression "^2.0.0" + mdast-util-mdx-jsx "^3.0.0" + mdast-util-mdxjs-esm "^2.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + style-to-object "^1.0.0" + unist-util-position "^5.0.0" + vfile-message "^4.0.0" + +hast-util-to-parse5@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/hast-util-to-parse5/-/hast-util-to-parse5-8.0.0.tgz#477cd42d278d4f036bc2ea58586130f6f39ee6ed" + integrity sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw== + dependencies: + "@types/hast" "^3.0.0" + comma-separated-tokens "^2.0.0" + devlop "^1.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + web-namespaces "^2.0.0" + zwitch "^2.0.0" + +hast-util-whitespace@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz#7778ed9d3c92dd9e8c5c8f648a49c21fc51cb621" + integrity sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw== + dependencies: + "@types/hast" "^3.0.0" + +hastscript@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-9.0.0.tgz#2b76b9aa3cba8bf6d5280869f6f6f7165c230763" + integrity sha512-jzaLBGavEDKHrc5EfFImKN7nZKKBdSLIdGvCwDZ9TfzbF2ffXiov8CKE445L2Z1Ek2t/m4SKQ2j6Ipv7NyUolw== + dependencies: + "@types/hast" "^3.0.0" + comma-separated-tokens "^2.0.0" + hast-util-parse-selector "^4.0.0" + property-information "^6.0.0" + space-separated-tokens "^2.0.0" + hat@0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/hat/-/hat-0.0.3.tgz#bb014a9e64b3788aed8005917413d4ff3d502d8a" @@ -9504,6 +9698,16 @@ html-tags@^3.1.0: resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-3.3.1.tgz#a04026a18c882e4bba8a01a3d39cfe465d40b5ce" integrity sha512-ztqyC3kLto0e9WbNp0aeP+M3kTt+nbaIveGmUxAtZa+8iFgKLUOD4YKM5j+f3QD89bra7UeumolZHKuOXnTmeQ== +html-url-attributes@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/html-url-attributes/-/html-url-attributes-3.0.1.tgz#83b052cd5e437071b756cd74ae70f708870c2d87" + integrity sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ== + +html-void-elements@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-void-elements/-/html-void-elements-3.0.0.tgz#fc9dbd84af9e747249034d4d62602def6517f1d7" + integrity sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg== + htmlparser2@8.0.2: version "8.0.2" resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.2.tgz#f002151705b383e62433b5cf466f5b716edaec21" @@ -9891,6 +10095,11 @@ inline-style-parser@0.1.1: resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== +inline-style-parser@0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.2.4.tgz#f4af5fe72e612839fcd453d989a586566d695f22" + integrity sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q== + inquirer@5.2.0: version "5.2.0" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-5.2.0.tgz#db350c2b73daca77ff1243962e9f22f099685726" @@ -9987,6 +10196,11 @@ is-alphabetical@^1.0.0: resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== +is-alphabetical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" + integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== + is-alphanumerical@^1.0.0: version "1.0.4" resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" @@ -9995,6 +10209,14 @@ is-alphanumerical@^1.0.0: is-alphabetical "^1.0.0" is-decimal "^1.0.0" +is-alphanumerical@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" + integrity sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw== + dependencies: + is-alphabetical "^2.0.0" + is-decimal "^2.0.0" + is-arguments@^1.0.4, is-arguments@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" @@ -10108,6 +10330,11 @@ is-decimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== +is-decimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" + integrity sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A== + is-descriptor@^0.1.0: version "0.1.6" resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" @@ -10194,6 +10421,11 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== +is-hexadecimal@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" + integrity sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg== + is-installed-globally@^0.4.0, is-installed-globally@~0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" @@ -10289,6 +10521,11 @@ is-plain-obj@^2.0.0, is-plain-obj@^2.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== +is-plain-obj@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0" + integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg== + is-plain-object@^2.0.3, is-plain-object@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" @@ -11544,6 +11781,11 @@ longest-streak@^2.0.0: resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== +longest-streak@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.1.0.tgz#62fa67cd958742a1574af9f39866364102d90cd4" + integrity sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g== + longest@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" @@ -11770,6 +12012,74 @@ mdast-util-from-markdown@^0.8.0: parse-entities "^2.0.0" unist-util-stringify-position "^2.0.0" +mdast-util-from-markdown@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.2.tgz#4850390ca7cf17413a9b9a0fbefcd1bc0eb4160a" + integrity sha512-uZhTV/8NBuw0WHkPTrCqDOl0zVe1BIng5ZtHoDk49ME1qqcjYmmLmOf0gELgcRMxN4w2iuIeVso5/6QymSrgmA== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + mdast-util-to-string "^4.0.0" + micromark "^4.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-decode-string "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + unist-util-stringify-position "^4.0.0" + +mdast-util-mdx-expression@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz#43f0abac9adc756e2086f63822a38c8d3c3a5096" + integrity sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-mdx-jsx@^3.0.0: + version "3.1.3" + resolved "https://registry.yarnpkg.com/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.1.3.tgz#76b957b3da18ebcfd0de3a9b4451dcd6fdec2320" + integrity sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + ccount "^2.0.0" + devlop "^1.1.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + parse-entities "^4.0.0" + stringify-entities "^4.0.0" + unist-util-stringify-position "^4.0.0" + vfile-message "^4.0.0" + +mdast-util-mdxjs-esm@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz#019cfbe757ad62dd557db35a695e7314bcc9fa97" + integrity sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg== + dependencies: + "@types/estree-jsx" "^1.0.0" + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + devlop "^1.0.0" + mdast-util-from-markdown "^2.0.0" + mdast-util-to-markdown "^2.0.0" + +mdast-util-phrasing@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz#7cc0a8dec30eaf04b7b1a9661a92adb3382aa6e3" + integrity sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w== + dependencies: + "@types/mdast" "^4.0.0" + unist-util-is "^6.0.0" + mdast-util-to-hast@^10.2.0: version "10.2.0" resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-10.2.0.tgz#61875526a017d8857b71abc9333942700b2d3604" @@ -11784,6 +12094,21 @@ mdast-util-to-hast@^10.2.0: unist-util-position "^3.0.0" unist-util-visit "^2.0.0" +mdast-util-to-hast@^13.0.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-hast/-/mdast-util-to-hast-13.2.0.tgz#5ca58e5b921cc0a3ded1bc02eed79a4fe4fe41f4" + integrity sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA== + dependencies: + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + "@ungap/structured-clone" "^1.0.0" + devlop "^1.0.0" + micromark-util-sanitize-uri "^2.0.0" + trim-lines "^3.0.0" + unist-util-position "^5.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + mdast-util-to-markdown@^0.6.0: version "0.6.5" resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" @@ -11796,11 +12121,33 @@ mdast-util-to-markdown@^0.6.0: repeat-string "^1.0.0" zwitch "^1.0.0" +mdast-util-to-markdown@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz#f910ffe60897f04bb4b7e7ee434486f76288361b" + integrity sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA== + dependencies: + "@types/mdast" "^4.0.0" + "@types/unist" "^3.0.0" + longest-streak "^3.0.0" + mdast-util-phrasing "^4.0.0" + mdast-util-to-string "^4.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-decode-string "^2.0.0" + unist-util-visit "^5.0.0" + zwitch "^2.0.0" + mdast-util-to-string@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== +mdast-util-to-string@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz#7a5121475556a04e7eddeb67b264aae79d312814" + integrity sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg== + dependencies: + "@types/mdast" "^4.0.0" + mdn-data@2.0.14: version "2.0.14" resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-2.0.14.tgz#7113fc4281917d63ce29b43446f701e68c25ba50" @@ -11892,6 +12239,200 @@ mgrs@1.0.0: resolved "https://registry.yarnpkg.com/mgrs/-/mgrs-1.0.0.tgz#fb91588e78c90025672395cb40b25f7cd6ad1829" integrity sha512-awNbTOqCxK1DBGjalK3xqWIstBZgN6fxsMSiXLs9/spqWkF2pAhb2rrYCFSsr1/tT7PhcDGjZndG8SWYn0byYA== +micromark-core-commonmark@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-2.0.2.tgz#6a45bbb139e126b3f8b361a10711ccc7c6e15e93" + integrity sha512-FKjQKbxd1cibWMM1P9N+H8TwlgGgSkWZMmfuVucLCHaYqeSvJ0hFeHsIa65pA2nYbes0f8LDHPMrd9X7Ujxg9w== + dependencies: + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-factory-destination "^2.0.0" + micromark-factory-label "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-factory-title "^2.0.0" + micromark-factory-whitespace "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-classify-character "^2.0.0" + micromark-util-html-tag-name "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-destination@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz#8fef8e0f7081f0474fbdd92deb50c990a0264639" + integrity sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-label@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz#5267efa97f1e5254efc7f20b459a38cb21058ba1" + integrity sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg== + dependencies: + devlop "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-space@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz#36d0212e962b2b3121f8525fc7a3c7c029f334fc" + integrity sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-title@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz#237e4aa5d58a95863f01032d9ee9b090f1de6e94" + integrity sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-factory-whitespace@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz#06b26b2983c4d27bfcc657b33e25134d4868b0b1" + integrity sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ== + dependencies: + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-character@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/micromark-util-character/-/micromark-util-character-2.1.1.tgz#2f987831a40d4c510ac261e89852c4e9703ccda6" + integrity sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q== + dependencies: + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-chunked@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz#47fbcd93471a3fccab86cff03847fc3552db1051" + integrity sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-classify-character@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz#d399faf9c45ca14c8b4be98b1ea481bced87b629" + integrity sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-combine-extensions@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz#2a0f490ab08bff5cc2fd5eec6dd0ca04f89b30a9" + integrity sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg== + dependencies: + micromark-util-chunked "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-decode-numeric-character-reference@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz#fcf15b660979388e6f118cdb6bf7d79d73d26fe5" + integrity sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-decode-string@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz#6cb99582e5d271e84efca8e61a807994d7161eb2" + integrity sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ== + dependencies: + decode-named-character-reference "^1.0.0" + micromark-util-character "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-encode@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz#0d51d1c095551cfaac368326963cf55f15f540b8" + integrity sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw== + +micromark-util-html-tag-name@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz#e40403096481986b41c106627f98f72d4d10b825" + integrity sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA== + +micromark-util-normalize-identifier@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz#c30d77b2e832acf6526f8bf1aa47bc9c9438c16d" + integrity sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q== + dependencies: + micromark-util-symbol "^2.0.0" + +micromark-util-resolve-all@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz#e1a2d62cdd237230a2ae11839027b19381e31e8b" + integrity sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg== + dependencies: + micromark-util-types "^2.0.0" + +micromark-util-sanitize-uri@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz#ab89789b818a58752b73d6b55238621b7faa8fd7" + integrity sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ== + dependencies: + micromark-util-character "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-symbol "^2.0.0" + +micromark-util-subtokenize@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/micromark-util-subtokenize/-/micromark-util-subtokenize-2.0.3.tgz#70ffb99a454bd8c913c8b709c3dc97baefb65f96" + integrity sha512-VXJJuNxYWSoYL6AJ6OQECCFGhIU2GGHMw8tahogePBrjkG8aCCas3ibkp7RnVOSTClg2is05/R7maAhF1XyQMg== + dependencies: + devlop "^1.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + +micromark-util-symbol@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz#e5da494e8eb2b071a0d08fb34f6cefec6c0a19b8" + integrity sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q== + +micromark-util-types@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-2.0.1.tgz#a3edfda3022c6c6b55bfb049ef5b75d70af50709" + integrity sha512-534m2WhVTddrcKVepwmVEVnUAmtrx9bfIjNoQHRqfnvdaHQiFytEhJoTgpWJvDEXCO5gLTQh3wYC1PgOJA4NSQ== + +micromark@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/micromark/-/micromark-4.0.1.tgz#294c2f12364759e5f9e925a767ae3dfde72223ff" + integrity sha512-eBPdkcoCNvYcxQOAKAlceo5SNdzZWfF+FcSupREAzdAh9rRmE239CEQAiTwIgblwnoM8zzj35sZ5ZwvSEOF6Kw== + dependencies: + "@types/debug" "^4.0.0" + debug "^4.0.0" + decode-named-character-reference "^1.0.0" + devlop "^1.0.0" + micromark-core-commonmark "^2.0.0" + micromark-factory-space "^2.0.0" + micromark-util-character "^2.0.0" + micromark-util-chunked "^2.0.0" + micromark-util-combine-extensions "^2.0.0" + micromark-util-decode-numeric-character-reference "^2.0.0" + micromark-util-encode "^2.0.0" + micromark-util-normalize-identifier "^2.0.0" + micromark-util-resolve-all "^2.0.0" + micromark-util-sanitize-uri "^2.0.0" + micromark-util-subtokenize "^2.0.0" + micromark-util-symbol "^2.0.0" + micromark-util-types "^2.0.0" + micromark@~2.11.0: version "2.11.4" resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" @@ -13033,6 +13574,19 @@ parse-entities@^2.0.0: is-decimal "^1.0.0" is-hexadecimal "^1.0.0" +parse-entities@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-4.0.2.tgz#61d46f5ed28e4ee62e9ddc43d6b010188443f159" + integrity sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw== + dependencies: + "@types/unist" "^2.0.0" + character-entities-legacy "^3.0.0" + character-reference-invalid "^2.0.0" + decode-named-character-reference "^1.0.0" + is-alphanumerical "^2.0.0" + is-decimal "^2.0.0" + is-hexadecimal "^2.0.0" + parse-git-config@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/parse-git-config/-/parse-git-config-1.1.1.tgz#d3a9984317132f57398712bba438e129590ddf8c" @@ -14006,6 +14560,11 @@ property-information@^5.3.0: dependencies: xtend "^4.0.0" +property-information@^6.0.0: + version "6.5.0" + resolved "https://registry.yarnpkg.com/property-information/-/property-information-6.5.0.tgz#6212fbb52ba757e92ef4fb9d657563b933b7ffec" + integrity sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig== + proto-list@~1.2.1: version "1.2.4" resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" @@ -14519,6 +15078,22 @@ react-map-gl@^5.2.7: resize-observer-polyfill "^1.5.1" viewport-mercator-project "^7.0.4" +react-markdown@9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-9.0.1.tgz#c05ddbff67fd3b3f839f8c648e6fb35d022397d1" + integrity sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg== + dependencies: + "@types/hast" "^3.0.0" + devlop "^1.0.0" + hast-util-to-jsx-runtime "^2.0.0" + html-url-attributes "^3.0.0" + mdast-util-to-hast "^13.0.0" + remark-parse "^11.0.0" + remark-rehype "^11.0.0" + unified "^11.0.0" + unist-util-visit "^5.0.0" + vfile "^6.0.0" + react-modal@^3.11.2: version "3.16.1" resolved "https://registry.yarnpkg.com/react-modal/-/react-modal-3.16.1.tgz#34018528fc206561b1a5467fc3beeaddafb39b2b" @@ -14994,6 +15569,15 @@ registry-url@3.1.0: dependencies: rc "^1.0.1" +rehype-raw@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/rehype-raw/-/rehype-raw-7.0.0.tgz#59d7348fd5dbef3807bbaa1d443efd2dd85ecee4" + integrity sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww== + dependencies: + "@types/hast" "^3.0.0" + hast-util-raw "^9.0.0" + vfile "^6.0.0" + rehype-react@^6.0.0: version "6.2.1" resolved "https://registry.yarnpkg.com/rehype-react/-/rehype-react-6.2.1.tgz#9b9bf188451ad6f63796b784fe1f51165c67b73a" @@ -15038,6 +15622,16 @@ release@^6.3.0: tagged-versions "1.3.0" update-check "1.3.2" +remark-parse@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-11.0.0.tgz#aa60743fcb37ebf6b069204eb4da304e40db45a1" + integrity sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA== + dependencies: + "@types/mdast" "^4.0.0" + mdast-util-from-markdown "^2.0.0" + micromark-util-types "^2.0.0" + unified "^11.0.0" + remark-parse@^9.0.0: version "9.0.0" resolved "https://registry.yarnpkg.com/remark-parse/-/remark-parse-9.0.0.tgz#4d20a299665880e4f4af5d90b7c7b8a935853640" @@ -15045,6 +15639,17 @@ remark-parse@^9.0.0: dependencies: mdast-util-from-markdown "^0.8.0" +remark-rehype@^11.0.0: + version "11.1.1" + resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-11.1.1.tgz#f864dd2947889a11997c0a2667cd6b38f685bca7" + integrity sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ== + dependencies: + "@types/hast" "^3.0.0" + "@types/mdast" "^4.0.0" + mdast-util-to-hast "^13.0.0" + unified "^11.0.0" + vfile "^6.0.0" + remark-rehype@^8.0.0: version "8.1.0" resolved "https://registry.yarnpkg.com/remark-rehype/-/remark-rehype-8.1.0.tgz#610509a043484c1e697437fa5eb3fd992617c945" @@ -15928,6 +16533,11 @@ space-separated-tokens@^1.0.0: resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz#85f32c3d10d9682007e917414ddc5c26d1aa6899" integrity sha512-q/JSVd1Lptzhf5bkYm4ob4iWPjx0KiRe3sRFBNrVqbJkFaBm5vbbowy1mymoPNLRa52+oadOhJ+K49wsSeSjTA== +space-separated-tokens@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f" + integrity sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q== + spawn-to-readstream@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/spawn-to-readstream/-/spawn-to-readstream-0.1.3.tgz#96768b72739ac64ffa77c8ce2cbf98c2d21d8dbf" @@ -16310,6 +16920,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" +stringify-entities@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-4.0.4.tgz#b3b79ef5f277cc4ac73caeb0236c5ba939b3a4f3" + integrity sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg== + dependencies: + character-entities-html4 "^2.0.0" + character-entities-legacy "^3.0.0" + stringify-object@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629" @@ -16465,6 +17083,13 @@ style-to-object@^0.3.0: dependencies: inline-style-parser "0.1.1" +style-to-object@^1.0.0: + version "1.0.8" + resolved "https://registry.yarnpkg.com/style-to-object/-/style-to-object-1.0.8.tgz#67a29bca47eaa587db18118d68f9d95955e81292" + integrity sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g== + dependencies: + inline-style-parser "0.2.4" + style-value-types@^3.0.6, style-value-types@^3.1.7: version "3.2.0" resolved "https://registry.yarnpkg.com/style-value-types/-/style-value-types-3.2.0.tgz#eb89cab1340823fa7876f3e289d29d99c92111bb" @@ -17122,6 +17747,11 @@ tree-changes@^0.9.1, tree-changes@^0.9.2: "@gilbarbara/deep-equal" "^0.1.1" is-lite "^0.8.2" +trim-lines@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/trim-lines/-/trim-lines-3.0.1.tgz#d802e332a07df861c48802c04321017b1bd87338" + integrity sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg== + trim-newlines@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613" @@ -17149,6 +17779,11 @@ trough@^1.0.0: resolved "https://registry.yarnpkg.com/trough/-/trough-1.0.5.tgz#b8b639cefad7d0bb2abd37d433ff8293efa5f406" integrity sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA== +trough@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f" + integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw== + ts-dedent@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-2.2.0.tgz#39e4bd297cd036292ae2394eb3412be63f563bb5" @@ -17441,6 +18076,19 @@ unidecode@0.1.8: resolved "https://registry.yarnpkg.com/unidecode/-/unidecode-0.1.8.tgz#efbb301538bc45246a9ac8c559d72f015305053e" integrity sha512-SdoZNxCWpN2tXTCrGkPF/0rL2HEq+i2gwRG1ReBvx8/0yTzC3enHfugOf8A9JBShVwwrRIkLX0YcDUGbzjbVCA== +unified@^11.0.0: + version "11.0.5" + resolved "https://registry.yarnpkg.com/unified/-/unified-11.0.5.tgz#f66677610a5c0a9ee90cab2b8d4d66037026d9e1" + integrity sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA== + dependencies: + "@types/unist" "^3.0.0" + bail "^2.0.0" + devlop "^1.0.0" + extend "^3.0.0" + is-plain-obj "^4.0.0" + trough "^2.0.0" + vfile "^6.0.0" + unified@^9.0.0, unified@^9.1.0: version "9.2.2" resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" @@ -17497,11 +18145,25 @@ unist-util-is@^4.0.0: resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-4.1.0.tgz#976e5f462a7a5de73d94b706bac1b90671b57797" integrity sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg== +unist-util-is@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/unist-util-is/-/unist-util-is-6.0.0.tgz#b775956486aff107a9ded971d996c173374be424" + integrity sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-position@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-3.1.0.tgz#1c42ee6301f8d52f47d14f62bbdb796571fa2d47" integrity sha512-w+PkwCbYSFw8vpgWD0v7zRCl1FpY3fjDSQ3/N/wNd9Ffa4gPi8+4keqt99N3XW6F99t/mUzp2xAhNmfKWp95QA== +unist-util-position@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-position/-/unist-util-position-5.0.0.tgz#678f20ab5ca1207a97d7ea8a388373c9cf896be4" + integrity sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA== + dependencies: + "@types/unist" "^3.0.0" + unist-util-stringify-position@^2.0.0: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz#cce3bfa1cdf85ba7375d1d5b17bdc4cada9bd9da" @@ -17509,6 +18171,13 @@ unist-util-stringify-position@^2.0.0: dependencies: "@types/unist" "^2.0.2" +unist-util-stringify-position@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz#449c6e21a880e0855bf5aabadeb3a740314abac2" + integrity sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ== + dependencies: + "@types/unist" "^3.0.0" + unist-util-visit-parents@^2.0.0: version "2.1.2" resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-2.1.2.tgz#25e43e55312166f3348cae6743588781d112c1e9" @@ -17524,6 +18193,14 @@ unist-util-visit-parents@^3.0.0: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" +unist-util-visit-parents@^6.0.0: + version "6.0.1" + resolved "https://registry.yarnpkg.com/unist-util-visit-parents/-/unist-util-visit-parents-6.0.1.tgz#4d5f85755c3b8f0dc69e21eca5d6d82d22162815" + integrity sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.1.tgz#4724aaa8486e6ee6e26d7ff3c8685960d560b1e3" @@ -17540,6 +18217,15 @@ unist-util-visit@^2.0.0: unist-util-is "^4.0.0" unist-util-visit-parents "^3.0.0" +unist-util-visit@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-5.0.0.tgz#a7de1f31f72ffd3519ea71814cccf5fd6a9217d6" + integrity sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg== + dependencies: + "@types/unist" "^3.0.0" + unist-util-is "^6.0.0" + unist-util-visit-parents "^6.0.0" + universalify@^0.1.0: version "0.1.2" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" @@ -17831,6 +18517,14 @@ verror@^1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vfile-location@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-5.0.3.tgz#cb9eacd20f2b6426d19451e0eafa3d0a846225c3" + integrity sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg== + dependencies: + "@types/unist" "^3.0.0" + vfile "^6.0.0" + vfile-message@^2.0.0: version "2.0.4" resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-2.0.4.tgz#5b43b88171d409eae58477d13f23dd41d52c371a" @@ -17839,6 +18533,14 @@ vfile-message@^2.0.0: "@types/unist" "^2.0.0" unist-util-stringify-position "^2.0.0" +vfile-message@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/vfile-message/-/vfile-message-4.0.2.tgz#c883c9f677c72c166362fd635f21fc165a7d1181" + integrity sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw== + dependencies: + "@types/unist" "^3.0.0" + unist-util-stringify-position "^4.0.0" + vfile@^4.0.0: version "4.2.1" resolved "https://registry.yarnpkg.com/vfile/-/vfile-4.2.1.tgz#03f1dce28fc625c625bc6514350fbdb00fa9e624" @@ -17849,6 +18551,14 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" +vfile@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/vfile/-/vfile-6.0.3.tgz#3652ab1c496531852bf55a6bac57af981ebc38ab" + integrity sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q== + dependencies: + "@types/unist" "^3.0.0" + vfile-message "^4.0.0" + victory-vendor@^36.6.8: version "36.6.11" resolved "https://registry.yarnpkg.com/victory-vendor/-/victory-vendor-36.6.11.tgz#acae770717c2dae541a54929c304ecab5ab6ac2a" @@ -17965,6 +18675,11 @@ web-namespaces@^1.0.0: resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== +web-namespaces@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" + integrity sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ== + webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" @@ -18452,3 +19167,8 @@ zwitch@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== + +zwitch@^2.0.0: + version "2.0.4" + resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.4.tgz#c827d4b0acb76fc3e685a4c6ec2902d51070e9d7" + integrity sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A== From 4a2620ab6698912cc0aebf4199673393a70e2579 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Mon, 16 Dec 2024 10:33:02 -0300 Subject: [PATCH 20/23] feat(markdown): improve validation for content date --- components/modals/meta/component.jsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index ac5817e130..324eee11ed 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -62,6 +62,7 @@ class ModalMeta extends PureComponent { resolution_description, content_date_range, content_date_description, + content_date, ...rest }, } = this.props; @@ -74,16 +75,18 @@ class ModalMeta extends PureComponent { }; } - if (content_date_description && content_date_range) { + if (content_date_range) { const { start_date, end_date } = content_date_range; + const date = `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`; + return { resolution: resolution_description, - content_date: `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`, + content_date: date, ...rest, }; } - return { resolution: resolution_description, ...rest }; + return { resolution: resolution_description, content_date, ...rest }; } getContent() { From 02382aa7ca0661356d6e5433dfc3c7485e3c9ba9 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 17 Dec 2024 16:12:08 -0300 Subject: [PATCH 21/23] chore(metadata): get back the same metadata order from RW API --- components/modals/meta/component.jsx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index 324eee11ed..b988cb8fa2 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -67,26 +67,22 @@ class ModalMeta extends PureComponent { }, } = this.props; + let contentDate = content_date; + if (content_date_description) { - return { - resolution: resolution_description, - content_date: content_date_description, - ...rest, - }; + contentDate = content_date_description; } if (content_date_range) { const { start_date, end_date } = content_date_range; - const date = `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`; - - return { - resolution: resolution_description, - content_date: date, - ...rest, - }; + contentDate = `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`; } - return { resolution: resolution_description, content_date, ...rest }; + const entries = Object.entries(rest); + entries.splice(1, 0, ['resolution', resolution_description]); + entries.splice(-2, 0, ['content_date', contentDate]); + + return Object.fromEntries(entries); } getContent() { From 1239e3aef7ba7ebaa12bc2426f612372c1edc551 Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 17 Dec 2024 16:39:24 -0300 Subject: [PATCH 22/23] chore(metadata): improve validations --- components/modals/meta/component.jsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index b988cb8fa2..e216dd65f8 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -60,25 +60,26 @@ class ModalMeta extends PureComponent { const { tableData: { resolution_description, - content_date_range, + content_date_range = {}, content_date_description, content_date, ...rest }, } = this.props; + const entries = Object.entries(rest); + const { start_date = null, end_date = null } = content_date_range; + let contentDate = content_date; - if (content_date_description) { - contentDate = content_date_description; + if (start_date && end_date) { + contentDate = `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`; } - if (content_date_range) { - const { start_date, end_date } = content_date_range; - contentDate = `${start_date.slice(0, 4)}-${end_date.slice(0, 4)}`; + if (content_date_description) { + contentDate = content_date_description; } - const entries = Object.entries(rest); entries.splice(1, 0, ['resolution', resolution_description]); entries.splice(-2, 0, ['content_date', contentDate]); From 71a2c6a1e7bc609516873804991bb98ffe7f969a Mon Sep 17 00:00:00 2001 From: Willian Viana Date: Tue, 17 Dec 2024 16:39:52 -0300 Subject: [PATCH 23/23] chore(metadata): remove download data We won't use this property anymore --- components/modals/meta/component.jsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/components/modals/meta/component.jsx b/components/modals/meta/component.jsx index e216dd65f8..6276b0564b 100644 --- a/components/modals/meta/component.jsx +++ b/components/modals/meta/component.jsx @@ -162,15 +162,6 @@ class ModalMeta extends PureComponent { )} - {download_data && ( - - - - )}
)}