@xyo-network/react-map-model 5.2.10 → 5.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -63,7 +63,7 @@ fitToPoints.value = false;
63
63
  preferDark.value = true;
64
64
 
65
65
  // src/contexts/MapboxAccessToken/Context.ts
66
- import { createContextEx } from "@xyo-network/react-shared";
66
+ import { createContextEx } from "@xylabs/react-shared";
67
67
  var MapboxAccessTokenContext = createContextEx();
68
68
 
69
69
  // src/contexts/MapboxAccessToken/Provider.tsx
@@ -86,7 +86,7 @@ var MapboxAccessTokenProvider = /* @__PURE__ */ __name(({ defaultAccessToken, ..
86
86
  }, "MapboxAccessTokenProvider");
87
87
 
88
88
  // src/contexts/MapboxAccessToken/use.ts
89
- import { useContextEx } from "@xyo-network/react-shared";
89
+ import { useContextEx } from "@xylabs/react-shared";
90
90
  var useMapboxAccessToken = /* @__PURE__ */ __name((required = false) => {
91
91
  return useContextEx(MapboxAccessTokenContext, "MapboxAccessToken", required);
92
92
  }, "useMapboxAccessToken");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/settings/DefaultMapSettings.ts","../../src/AnimatedHeatMapSettings.ts","../../src/contexts/MapboxAccessToken/Context.ts","../../src/contexts/MapboxAccessToken/Provider.tsx","../../src/contexts/MapboxAccessToken/use.ts","../../src/hooks/useFindHashes.tsx","../../src/hooks/useHeatMapColors.tsx","../../src/lib/MapStyle.ts","../../src/types/NetworkLocationAnswerBase.ts"],"sourcesContent":["import type { MapSetting } from './MapSetting.ts'\n\nexport const DefaultMapSettings: () => MapSetting = () => ({\n debugLayer: {\n devMode: true,\n field: 'debugLayer',\n hidden: true,\n label: 'Debug Layer',\n value: false,\n },\n debugLogging: {\n devMode: true,\n field: 'debugLogging',\n hidden: true,\n label: 'Debug Logging',\n value: false,\n },\n dynamicMapResize: {\n devMode: true,\n field: 'dynamicMapResize',\n hidden: true,\n label: 'Auto Map Resize',\n value: true,\n },\n enableControls: {\n devMode: true,\n field: 'enableControls',\n hidden: true,\n label: 'Map Controls',\n value: false,\n },\n fitToPoints: {\n devMode: true,\n field: 'fitToPoints',\n hidden: true,\n label: 'Fit To Points',\n value: false,\n },\n preferDark: {\n devMode: false,\n field: 'preferDark',\n hidden: true,\n label: 'Prefer dark',\n value: false,\n },\n scrollToZoom: {\n devMode: true,\n field: 'scrollToZoom',\n hidden: true,\n label: 'Scroll To Zoom',\n value: false,\n },\n})\n","import { DefaultMapSettings } from './settings/index.ts'\n\nexport const AnimatedHeatMapSettings = DefaultMapSettings()\nconst {\n debugLayer, scrollToZoom, fitToPoints, preferDark,\n} = AnimatedHeatMapSettings\ndebugLayer.hidden = false\nscrollToZoom.value = true\nfitToPoints.value = false\npreferDark.value = true\n","import { createContextEx } from '@xyo-network/react-shared'\n\nimport type { MapboxAccessTokenContextState } from './State.ts'\n\nexport const MapboxAccessTokenContext = createContextEx<MapboxAccessTokenContextState>()\n","import type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { MapboxAccessTokenContext } from './Context.ts'\n\nexport interface MapboxAccessTokenProviderProps {\n defaultAccessToken?: string\n}\n\nexport const MapboxAccessTokenProvider: React.FC<PropsWithChildren<MapboxAccessTokenProviderProps>> = ({ defaultAccessToken, ...props }) => {\n const [accessToken, setAccessToken] = useState<string>()\n\n const value = useMemo(() => ({\n accessToken: accessToken ?? defaultAccessToken, provided: true, setAccessToken,\n }), [accessToken, defaultAccessToken, setAccessToken])\n\n return (\n <MapboxAccessTokenContext\n value={value}\n {...props}\n />\n )\n}\n","import { useContextEx } from '@xyo-network/react-shared'\n\nimport { MapboxAccessTokenContext } from './Context.ts'\n\nexport const useMapboxAccessToken = (required = false) => {\n return useContextEx(MapboxAccessTokenContext, 'MapboxAccessToken', required)\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { ArchivistPreset } from '@xyo-network/react-network'\nimport { useNetwork } from '@xyo-network/react-network'\nimport { useMemo } from 'react'\n\nconst animatedAnswerHashesConst: Hash[] = [\n '79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',\n '531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',\n 'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',\n '29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',\n 'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',\n '1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',\n '1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',\n '973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',\n '463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',\n '15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',\n '32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',\n]\n\nconst staticAnswerHashConst: Hash = 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5'\n\nexport const useFindHashes = () => {\n const { network } = useNetwork()\n const exploreMapHashes = (network?.nodes?.find(node => node.type === 'archivist') as ArchivistPreset)?.explorerMapHashes\n const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || animatedAnswerHashesConst\n const staticAnswerHash = exploreMapHashes?.staticAnswerHash || staticAnswerHashConst\n const foundHashes = useMemo(() => [staticAnswerHash, ...animatedAnswerHashes], [animatedAnswerHashes, staticAnswerHash])\n return foundHashes\n}\n","import { useTheme } from '@mui/material'\n\nimport type { AnimatedHeatMapColorProps, ColorGradientLegendProps } from '../colors/index.ts'\n\nconst useHeatMapColors = () => {\n const theme = useTheme()\n const staticMapColor = '#FFFF75'\n const highUsageColor = '#FF0000'\n\n const heatMapColorProps: AnimatedHeatMapColorProps = {\n highUsageColor,\n lowUsageColor: '#FFB3B3',\n staticMapColor,\n }\n\n const legendProps: ColorGradientLegendProps = {\n endColor: highUsageColor,\n endLabel: 'High',\n heading: 'Network Usage',\n startColor: staticMapColor,\n startLabel: 'Low',\n textColor: theme.vars.palette.common.white,\n }\n\n return { heatMapColorProps, legendProps }\n}\n\nexport { useHeatMapColors }\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const MapStyle = Enum({\n Dark: 'mapbox/dark-v10',\n Light: 'mapbox/light-v10',\n Outdoors: 'mapbox/outdoors-v11',\n Satellite: 'mapbox/satellite-v9',\n SatelliteStreets: 'mapbox/satellite-streets-v11',\n Streets: 'mapbox/streets-v11',\n})\n\nexport type MapStyle = EnumValue<typeof MapStyle>\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type {\n Feature, Point, Polygon,\n} from 'geojson'\n\nexport interface NetworkLocationAnswerBase<T> {\n result: T\n}\n\nexport const NetworkLocationAnswerSchema = 'network.xyo.location.range.answer'\nexport type NetworkLocationAnswerSchema = 'network.xyo.location.range.answer'\nexport type NetworkLocationAnswerPayload = Payload<NetworkLocationAnswerBase<{ features: Feature<Point>[] }>, NetworkLocationAnswerSchema>\nexport const isNetworkLocationAnswer = isPayloadOfSchemaType<NetworkLocationAnswerPayload>(NetworkLocationAnswerSchema)\n\nexport const NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\nexport type NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\nexport type NetworkLocationHeatmapAnswerPayload = Payload<\n NetworkLocationAnswerBase<{ features: Feature<Polygon>[] }>,\n NetworkLocationHeatmapAnswerSchema\n>\nexport const isNetworkLocationHeatmapAnswer = isPayloadOfSchemaType<NetworkLocationHeatmapAnswerPayload>(NetworkLocationHeatmapAnswerSchema)\n\nexport const NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\nexport type NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\nexport type NetworkLocationHeatmapQuadkeyAnswerPayload = Payload<\n NetworkLocationAnswerBase<{ density: number; quadkey: string }[]>,\n NetworkLocationHeatmapQuadkeyAnswerSchema\n>\nexport const isNetworkLocationHeatmapQuadkeyAnswer = isPayloadOfSchemaType<NetworkLocationHeatmapQuadkeyAnswerPayload>(\n NetworkLocationHeatmapQuadkeyAnswerSchema,\n)\n"],"mappings":";;;;AAEO,IAAMA,qBAAuC,8BAAO;EACzDC,YAAY;IACVC,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAC,cAAc;IACZL,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAE,kBAAkB;IAChBN,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAG,gBAAgB;IACdP,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAI,aAAa;IACXR,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAK,YAAY;IACVT,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAM,cAAc;IACZV,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;AACF,IAlDoD;;;ACA7C,IAAMO,0BAA0BC,mBAAAA;AACvC,IAAM,EACJC,YAAYC,cAAcC,aAAaC,WAAU,IAC/CL;AACJE,WAAWI,SAAS;AACpBH,aAAaI,QAAQ;AACrBH,YAAYG,QAAQ;AACpBF,WAAWE,QAAQ;;;ACTnB,SAASC,uBAAuB;AAIzB,IAAMC,2BAA2BD,gBAAAA;;;ACHxC,OAAOE,SAASC,SAASC,gBAAgB;AAQlC,IAAMC,4BAAyF,wBAAC,EAAEC,oBAAoB,GAAGC,MAAAA,M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SAASW,YAAY;AAEd,IAAMC,WAAWD,KAAK;EAC3BE,MAAM;EACNC,OAAO;EACPC,UAAU;EACVC,WAAW;EACXC,kBAAkB;EAClBC,SAAS;AACX,CAAA;;;ACTA,SAASC,6BAA6B;AAS/B,IAAMC,8BAA8B;AAGpC,IAAMC,0BAA0BF,sBAAoDC,2BAAAA;AAEpF,IAAME,qCAAqC;AAM3C,IAAMC,iCAAiCJ,sBAA2DG,kCAAAA;AAElG,IAAME,4CAA4C;AAMlD,IAAMC,wCAAwCN,sBACnDK,yCAAAA;","names":["DefaultMapSettings","debugLayer","devMode","field","hidden","label","value","debugLogging","dynamicMapResize","enableControls","fitToPoints","preferDark","scrollToZoom","AnimatedHeatMapSettings","DefaultMapSettings","debugLayer","scrollToZoom","fitToPoints","preferDark","hidden","value","createContextEx","MapboxAccessTokenContext","React","useMemo","useState","MapboxAccessTokenProvider","defaultAccessToken","props","accessToken","setAccessToken","useState","value","useMemo","provided","MapboxAccessTokenContext","useContextEx","useMapboxAccessToken","required","useContextEx","MapboxAccessTokenContext","useNetwork","useMemo","animatedAnswerHashesConst","staticAnswerHashConst","useFindHashes","network","useNetwork","exploreMapHashes","nodes","find","node","type","explorerMapHashes","animatedAnswerHashes","staticAnswerHash","foundHashes","useMemo","useTheme","useHeatMapColors","theme","useTheme","staticMapColor","highUsageColor","heatMapColorProps","lowUsageColor","legendProps","endColor","endLabel","heading","startColor","startLabel","textColor","vars","palette","common","white","Enum","MapStyle","Dark","Light","Outdoors","Satellite","SatelliteStreets","Streets","isPayloadOfSchemaType","NetworkLocationAnswerSchema","isNetworkLocationAnswer","NetworkLocationHeatmapAnswerSchema","isNetworkLocationHeatmapAnswer","NetworkLocationHeatmapQuadkeyAnswerSchema","isNetworkLocationHeatmapQuadkeyAnswer"]}
1
+ {"version":3,"sources":["../../src/settings/DefaultMapSettings.ts","../../src/AnimatedHeatMapSettings.ts","../../src/contexts/MapboxAccessToken/Context.ts","../../src/contexts/MapboxAccessToken/Provider.tsx","../../src/contexts/MapboxAccessToken/use.ts","../../src/hooks/useFindHashes.tsx","../../src/hooks/useHeatMapColors.tsx","../../src/lib/MapStyle.ts","../../src/types/NetworkLocationAnswerBase.ts"],"sourcesContent":["import type { MapSetting } from './MapSetting.ts'\n\nexport const DefaultMapSettings: () => MapSetting = () => ({\n debugLayer: {\n devMode: true,\n field: 'debugLayer',\n hidden: true,\n label: 'Debug Layer',\n value: false,\n },\n debugLogging: {\n devMode: true,\n field: 'debugLogging',\n hidden: true,\n label: 'Debug Logging',\n value: false,\n },\n dynamicMapResize: {\n devMode: true,\n field: 'dynamicMapResize',\n hidden: true,\n label: 'Auto Map Resize',\n value: true,\n },\n enableControls: {\n devMode: true,\n field: 'enableControls',\n hidden: true,\n label: 'Map Controls',\n value: false,\n },\n fitToPoints: {\n devMode: true,\n field: 'fitToPoints',\n hidden: true,\n label: 'Fit To Points',\n value: false,\n },\n preferDark: {\n devMode: false,\n field: 'preferDark',\n hidden: true,\n label: 'Prefer dark',\n value: false,\n },\n scrollToZoom: {\n devMode: true,\n field: 'scrollToZoom',\n hidden: true,\n label: 'Scroll To Zoom',\n value: false,\n },\n})\n","import { DefaultMapSettings } from './settings/index.ts'\n\nexport const AnimatedHeatMapSettings = DefaultMapSettings()\nconst {\n debugLayer, scrollToZoom, fitToPoints, preferDark,\n} = AnimatedHeatMapSettings\ndebugLayer.hidden = false\nscrollToZoom.value = true\nfitToPoints.value = false\npreferDark.value = true\n","import { createContextEx } from '@xylabs/react-shared'\n\nimport type { MapboxAccessTokenContextState } from './State.ts'\n\nexport const MapboxAccessTokenContext = createContextEx<MapboxAccessTokenContextState>()\n","import type { PropsWithChildren } from 'react'\nimport React, { useMemo, useState } from 'react'\n\nimport { MapboxAccessTokenContext } from './Context.ts'\nimport type { MapboxAccessTokenContextState } from './State.ts'\n\nexport interface MapboxAccessTokenProviderProps {\n defaultAccessToken?: string\n}\n\nexport const MapboxAccessTokenProvider: React.FC<PropsWithChildren<MapboxAccessTokenProviderProps>> = ({ defaultAccessToken, ...props }) => {\n const [accessToken, setAccessToken] = useState<string>()\n\n const value: MapboxAccessTokenContextState = useMemo(() => ({\n accessToken: accessToken ?? defaultAccessToken, provided: true, setAccessToken,\n }), [accessToken, defaultAccessToken, setAccessToken])\n\n return (\n <MapboxAccessTokenContext\n value={value}\n {...props}\n />\n )\n}\n","import { useContextEx } from '@xylabs/react-shared'\n\nimport { MapboxAccessTokenContext } from './Context.ts'\n\nexport const useMapboxAccessToken = (required = false) => {\n return useContextEx(MapboxAccessTokenContext, 'MapboxAccessToken', required)\n}\n","import type { Hash } from '@xylabs/hex'\nimport type { ArchivistPreset } from '@xyo-network/react-network'\nimport { useNetwork } from '@xyo-network/react-network'\nimport { useMemo } from 'react'\n\nconst animatedAnswerHashesConst: Hash[] = [\n '79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',\n '531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',\n 'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',\n '29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',\n 'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',\n '1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',\n '1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',\n '973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',\n '463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',\n '15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',\n '32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',\n]\n\nconst staticAnswerHashConst: Hash = 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5'\n\nexport const useFindHashes = () => {\n const { network } = useNetwork()\n const exploreMapHashes = (network?.nodes?.find(node => node.type === 'archivist') as ArchivistPreset)?.explorerMapHashes\n const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || animatedAnswerHashesConst\n const staticAnswerHash = exploreMapHashes?.staticAnswerHash || staticAnswerHashConst\n const foundHashes = useMemo(() => [staticAnswerHash, ...animatedAnswerHashes], [animatedAnswerHashes, staticAnswerHash])\n return foundHashes\n}\n","import { useTheme } from '@mui/material'\n\nimport type { AnimatedHeatMapColorProps, ColorGradientLegendProps } from '../colors/index.ts'\n\nconst useHeatMapColors = () => {\n const theme = useTheme()\n const staticMapColor = '#FFFF75'\n const highUsageColor = '#FF0000'\n\n const heatMapColorProps: AnimatedHeatMapColorProps = {\n highUsageColor,\n lowUsageColor: '#FFB3B3',\n staticMapColor,\n }\n\n const legendProps: ColorGradientLegendProps = {\n endColor: highUsageColor,\n endLabel: 'High',\n heading: 'Network Usage',\n startColor: staticMapColor,\n startLabel: 'Low',\n textColor: theme.vars.palette.common.white,\n }\n\n return { heatMapColorProps, legendProps }\n}\n\nexport { useHeatMapColors }\n","import type { EnumValue } from '@xylabs/enum'\nimport { Enum } from '@xylabs/enum'\n\nexport const MapStyle = Enum({\n Dark: 'mapbox/dark-v10',\n Light: 'mapbox/light-v10',\n Outdoors: 'mapbox/outdoors-v11',\n Satellite: 'mapbox/satellite-v9',\n SatelliteStreets: 'mapbox/satellite-streets-v11',\n Streets: 'mapbox/streets-v11',\n})\n\nexport type MapStyle = EnumValue<typeof MapStyle>\n","import type { Payload } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type {\n Feature, Point, Polygon,\n} from 'geojson'\n\nexport interface NetworkLocationAnswerBase<T> {\n result: T\n}\n\nexport const NetworkLocationAnswerSchema = 'network.xyo.location.range.answer'\nexport type NetworkLocationAnswerSchema = 'network.xyo.location.range.answer'\nexport type NetworkLocationAnswerPayload = Payload<NetworkLocationAnswerBase<{ features: Feature<Point>[] }>, NetworkLocationAnswerSchema>\nexport const isNetworkLocationAnswer = isPayloadOfSchemaType<NetworkLocationAnswerPayload>(NetworkLocationAnswerSchema)\n\nexport const NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\nexport type NetworkLocationHeatmapAnswerSchema = 'network.xyo.location.heatmap.answer'\nexport type NetworkLocationHeatmapAnswerPayload = Payload<\n NetworkLocationAnswerBase<{ features: Feature<Polygon>[] }>,\n NetworkLocationHeatmapAnswerSchema\n>\nexport const isNetworkLocationHeatmapAnswer = isPayloadOfSchemaType<NetworkLocationHeatmapAnswerPayload>(NetworkLocationHeatmapAnswerSchema)\n\nexport const NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\nexport type NetworkLocationHeatmapQuadkeyAnswerSchema = 'network.xyo.location.heatmap.quadkey.answer'\nexport type NetworkLocationHeatmapQuadkeyAnswerPayload = Payload<\n NetworkLocationAnswerBase<{ density: number; quadkey: string }[]>,\n NetworkLocationHeatmapQuadkeyAnswerSchema\n>\nexport const isNetworkLocationHeatmapQuadkeyAnswer = isPayloadOfSchemaType<NetworkLocationHeatmapQuadkeyAnswerPayload>(\n NetworkLocationHeatmapQuadkeyAnswerSchema,\n)\n"],"mappings":";;;;AAEO,IAAMA,qBAAuC,8BAAO;EACzDC,YAAY;IACVC,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAC,cAAc;IACZL,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAE,kBAAkB;IAChBN,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAG,gBAAgB;IACdP,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAI,aAAa;IACXR,SAAS;IACTC,OAAO;IACPC,QAAQ;IACRC,OAAO;IACPC,OAAO;EACT;EACAK,YAAY;IACVT,SAA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;AAC/D,QAAMY,cAAcC,SAAQ,MAAM;IAACF;OAAqBD;KAAuB;IAACA;IAAsBC;GAAiB;AACvH,SAAOC;AACT,GAP6B;;;ACrB7B,SAASE,gBAAgB;AAIzB,IAAMC,mBAAmB,6BAAA;AACvB,QAAMC,QAAQC,SAAAA;AACd,QAAMC,iBAAiB;AACvB,QAAMC,iBAAiB;AAEvB,QAAMC,oBAA+C;IACnDD;IACAE,eAAe;IACfH;EACF;AAEA,QAAMI,cAAwC;IAC5CC,UAAUJ;IACVK,UAAU;IACVC,SAAS;IACTC,YAAYR;IACZS,YAAY;IACZC,WAAWZ,MAAMa,KAAKC,QAAQC,OAAOC;EACvC;AAEA,SAAO;IAAEZ;IAAmBE;EAAY;AAC1C,GArByB;;;ACHzB,SAASW,YAAY;AAEd,IAAMC,WAAWD,KAAK;EAC3BE,MAAM;EACNC,OAAO;EACPC,UAAU;EACVC,WAAW;EACXC,kBAAkB;EAClBC,SAAS;AACX,CAAA;;;ACTA,SAASC,6BAA6B;AAS/B,IAAMC,8BAA8B;AAGpC,IAAMC,0BAA0BF,sBAAoDC,2BAAAA;AAEpF,IAAME,qCAAqC;AAM3C,IAAMC,iCAAiCJ,sBAA2DG,kCAAAA;AAElG,IAAME,4CAA4C;AAMlD,IAAMC,wCAAwCN,sBACnDK,yCAAAA;","names":["DefaultMapSettings","debugLayer","devMode","field","hidden","label","value","debugLogging","dynamicMapResize","enableControls","fitToPoints","preferDark","scrollToZoom","AnimatedHeatMapSettings","DefaultMapSettings","debugLayer","scrollToZoom","fitToPoints","preferDark","hidden","value","createContextEx","MapboxAccessTokenContext","React","useMemo","useState","MapboxAccessTokenProvider","defaultAccessToken","props","accessToken","setAccessToken","useState","value","useMemo","provided","MapboxAccessTokenContext","useContextEx","useMapboxAccessToken","required","useContextEx","MapboxAccessTokenContext","useNetwork","useMemo","animatedAnswerHashesConst","staticAnswerHashConst","useFindHashes","network","useNetwork","exploreMapHashes","nodes","find","node","type","explorerMapHashes","animatedAnswerHashes","staticAnswerHash","foundHashes","useMemo","useTheme","useHeatMapColors","theme","useTheme","staticMapColor","highUsageColor","heatMapColorProps","lowUsageColor","legendProps","endColor","endLabel","heading","startColor","startLabel","textColor","vars","palette","common","white","Enum","MapStyle","Dark","Light","Outdoors","Satellite","SatelliteStreets","Streets","isPayloadOfSchemaType","NetworkLocationAnswerSchema","isNetworkLocationAnswer","NetworkLocationHeatmapAnswerSchema","isNetworkLocationHeatmapAnswer","NetworkLocationHeatmapQuadkeyAnswerSchema","isNetworkLocationHeatmapQuadkeyAnswer"]}
@@ -1,3 +1,7 @@
1
- import type { MapboxAccessTokenContextState } from './State.ts';
2
- export declare const MapboxAccessTokenContext: import("react").Context<MapboxAccessTokenContextState & import("@xyo-network/react-shared").ContextExState>;
1
+ export declare const MapboxAccessTokenContext: import("react").Context<{
2
+ accessToken?: string;
3
+ setAccessToken?: import("react").Dispatch<string>;
4
+ } & {
5
+ provided: true;
6
+ }>;
3
7
  //# sourceMappingURL=Context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/Context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAE/D,eAAO,MAAM,wBAAwB,6GAAmD,CAAA"}
1
+ {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/Context.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,wBAAwB;;;;;EAAmD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAIhD,MAAM,WAAW,8BAA8B;IAC7C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAajG,CAAA"}
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/Provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,KAA4B,MAAM,OAAO,CAAA;AAKhD,MAAM,WAAW,8BAA8B;IAC7C,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,eAAO,MAAM,yBAAyB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,8BAA8B,CAAC,CAajG,CAAA"}
@@ -1,7 +1,7 @@
1
- import type { ContextExState } from '@xyo-network/react-shared';
1
+ import type { ContextExState } from '@xylabs/react-shared';
2
2
  import type { Dispatch } from 'react';
3
- export interface MapboxAccessTokenContextState extends ContextExState {
3
+ export type MapboxAccessTokenContextState = ContextExState<{
4
4
  accessToken?: string;
5
5
  setAccessToken?: Dispatch<string>;
6
- }
6
+ }>;
7
7
  //# sourceMappingURL=State.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,WAAW,6BAA8B,SAAQ,cAAc;IACnE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAClC"}
1
+ {"version":3,"file":"State.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/State.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAErC,MAAM,MAAM,6BAA6B,GAAG,cAAc,CAAC;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,cAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;CAClC,CAAC,CAAA"}
@@ -1,2 +1,7 @@
1
- export declare const useMapboxAccessToken: (required?: boolean) => Omit<import("./State.ts").MapboxAccessTokenContextState & import("@xyo-network/react-shared").ContextExState, "provided">;
1
+ export declare const useMapboxAccessToken: (required?: boolean) => Omit<{
2
+ accessToken?: string;
3
+ setAccessToken?: import("react").Dispatch<string>;
4
+ } & {
5
+ provided: true;
6
+ }, "provided"> | Omit<never, "provided">;
2
7
  //# sourceMappingURL=use.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,GAAI,kBAAgB,8HAEpD,CAAA"}
1
+ {"version":3,"file":"use.d.ts","sourceRoot":"","sources":["../../../../src/contexts/MapboxAccessToken/use.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,GAAI,kBAAgB;;;;;wCAEpD,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/react-map-model",
3
- "version": "5.2.10",
3
+ "version": "5.3.1",
4
4
  "description": "Common React library for all XYO projects that use React",
5
5
  "keywords": [
6
6
  "xyo",
@@ -39,18 +39,18 @@
39
39
  "module": "dist/browser/index.mjs",
40
40
  "types": "dist/types/index.d.ts",
41
41
  "dependencies": {
42
- "@xylabs/enum": "^4.9.2",
43
- "@xyo-network/payload-model": "^3.14.16",
44
- "@xyo-network/react-network": "^5.2.10",
45
- "@xyo-network/react-shared": "^5.2.10",
42
+ "@xylabs/enum": "^4.9.15",
43
+ "@xylabs/react-shared": "^6.3.0",
44
+ "@xyo-network/payload-model": "^3.15.5",
45
+ "@xyo-network/react-network": "^5.3.1",
46
46
  "geojson": "^0.5.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@mui/icons-material": "^7.1.0",
50
50
  "@mui/material": "^7.1.0",
51
51
  "@types/geojson": "7946.0.16",
52
- "@types/react": "^19.1.3",
53
- "@xylabs/hex": "^4.9.2",
52
+ "@types/react": "^19.1.4",
53
+ "@xylabs/hex": "^4.9.15",
54
54
  "@xylabs/ts-scripts-yarn3": "^6.5.5",
55
55
  "@xylabs/tsconfig-react": "^6.5.5",
56
56
  "react": "^19.1.0",
@@ -1,4 +1,4 @@
1
- import { createContextEx } from '@xyo-network/react-shared'
1
+ import { createContextEx } from '@xylabs/react-shared'
2
2
 
3
3
  import type { MapboxAccessTokenContextState } from './State.ts'
4
4
 
@@ -2,6 +2,7 @@ import type { PropsWithChildren } from 'react'
2
2
  import React, { useMemo, useState } from 'react'
3
3
 
4
4
  import { MapboxAccessTokenContext } from './Context.ts'
5
+ import type { MapboxAccessTokenContextState } from './State.ts'
5
6
 
6
7
  export interface MapboxAccessTokenProviderProps {
7
8
  defaultAccessToken?: string
@@ -10,7 +11,7 @@ export interface MapboxAccessTokenProviderProps {
10
11
  export const MapboxAccessTokenProvider: React.FC<PropsWithChildren<MapboxAccessTokenProviderProps>> = ({ defaultAccessToken, ...props }) => {
11
12
  const [accessToken, setAccessToken] = useState<string>()
12
13
 
13
- const value = useMemo(() => ({
14
+ const value: MapboxAccessTokenContextState = useMemo(() => ({
14
15
  accessToken: accessToken ?? defaultAccessToken, provided: true, setAccessToken,
15
16
  }), [accessToken, defaultAccessToken, setAccessToken])
16
17
 
@@ -1,7 +1,7 @@
1
- import type { ContextExState } from '@xyo-network/react-shared'
1
+ import type { ContextExState } from '@xylabs/react-shared'
2
2
  import type { Dispatch } from 'react'
3
3
 
4
- export interface MapboxAccessTokenContextState extends ContextExState {
4
+ export type MapboxAccessTokenContextState = ContextExState<{
5
5
  accessToken?: string
6
6
  setAccessToken?: Dispatch<string>
7
- }
7
+ }>
@@ -1,4 +1,4 @@
1
- import { useContextEx } from '@xyo-network/react-shared'
1
+ import { useContextEx } from '@xylabs/react-shared'
2
2
 
3
3
  import { MapboxAccessTokenContext } from './Context.ts'
4
4