@xyo-network/react-map 2.45.9 → 2.45.10

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.
@@ -1,28 +1,25 @@
1
1
  import { useNetwork } from '@xyo-network/react-network';
2
- const parseAnimatedAnswerHashes = () => {
3
- return [
4
- '79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',
5
- '531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',
6
- 'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',
7
- '29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',
8
- 'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',
9
- '1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',
10
- '1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',
11
- '973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',
12
- '463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',
13
- '15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',
14
- '32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',
15
- ];
16
- };
17
- const parseStaticAnswerHash = () => {
18
- return 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5';
19
- };
20
- const useFindHashes = () => {
2
+ import { useMemo } from 'react';
3
+ const animatedAnswerHashesConst = [
4
+ '79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',
5
+ '531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',
6
+ 'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',
7
+ '29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',
8
+ 'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',
9
+ '1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',
10
+ '1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',
11
+ '973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',
12
+ '463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',
13
+ '15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',
14
+ '32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',
15
+ ];
16
+ const staticAnswerHashConst = 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5';
17
+ export const useFindHashes = () => {
21
18
  const { network } = useNetwork();
22
19
  const exploreMapHashes = network?.nodes?.find((node) => node.type === 'archivist')?.explorerMapHashes;
23
- const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || parseAnimatedAnswerHashes();
24
- const staticAnswerHash = exploreMapHashes?.staticAnswerHash || parseStaticAnswerHash();
25
- return [staticAnswerHash, ...animatedAnswerHashes];
20
+ const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || animatedAnswerHashesConst;
21
+ const staticAnswerHash = exploreMapHashes?.staticAnswerHash || staticAnswerHashConst;
22
+ const foundHashes = useMemo(() => [staticAnswerHash, ...animatedAnswerHashes], [animatedAnswerHashes, staticAnswerHash]);
23
+ return foundHashes;
26
24
  };
27
- export { useFindHashes };
28
25
  //# sourceMappingURL=useFindHashes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFindHashes.js","sourceRoot":"","sources":["../../../src/hooks/useFindHashes.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,4BAA4B,CAAA;AAE3E,MAAM,yBAAyB,GAAG,GAAG,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AC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,CAAA;IAChC,MAAM,gBAAgB,GAAI,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW,CAAwB,EAAE,iBAAiB,CAAA;IAC7H,MAAM,oBAAoB,GAAG,gBAAgB,EAAE,oBAAoB,IAAI,yBAAyB,CAAA;IAChG,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,gBAAgB,IAAI,qBAAqB,CAAA;IACpF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,gBAAgB,EAAE,GAAG,oBAAoB,CAAC,EAAE,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC,CAAA;IACxH,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA"}
@@ -1,3 +1,2 @@
1
- declare const useFindHashes: () => string[];
2
- export { useFindHashes };
1
+ export declare const useFindHashes: () => string[];
3
2
  //# sourceMappingURL=useFindHashes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useFindHashes.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFindHashes.tsx"],"names":[],"mappings":"AAsBA,QAAA,MAAM,aAAa,gBAOlB,CAAA;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
1
+ {"version":3,"file":"useFindHashes.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFindHashes.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,aAAa,gBAOzB,CAAA"}
package/package.json CHANGED
@@ -18,10 +18,10 @@
18
18
  "@xyo-network/archivist": "^2.51.9",
19
19
  "@xyo-network/module": "^2.51.9",
20
20
  "@xyo-network/payload-model": "^2.51.9",
21
- "@xyo-network/react-app-settings": "^2.45.9",
22
- "@xyo-network/react-archivist": "^2.45.9",
23
- "@xyo-network/react-network": "^2.45.9",
24
- "@xyo-network/react-shared": "^2.45.9",
21
+ "@xyo-network/react-app-settings": "^2.45.10",
22
+ "@xyo-network/react-archivist": "^2.45.10",
23
+ "@xyo-network/react-network": "^2.45.10",
24
+ "@xyo-network/react-shared": "^2.45.10",
25
25
  "@xyo-network/sdk-geo": "^2.8.0",
26
26
  "geojson": "^0.5.0",
27
27
  "mapbox-gl": "^2.13.0"
@@ -86,5 +86,5 @@
86
86
  },
87
87
  "sideEffects": false,
88
88
  "types": "dist/types/index.d.ts",
89
- "version": "2.45.9"
89
+ "version": "2.45.10"
90
90
  }
@@ -1,32 +1,27 @@
1
1
  import { useNetwork, XyoArchivistPreset } from '@xyo-network/react-network'
2
+ import { useMemo } from 'react'
2
3
 
3
- const parseAnimatedAnswerHashes = () => {
4
- return [
5
- '79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',
6
- '531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',
7
- 'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',
8
- '29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',
9
- 'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',
10
- '1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',
11
- '1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',
12
- '973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',
13
- '463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',
14
- '15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',
15
- '32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',
16
- ]
17
- }
4
+ const animatedAnswerHashesConst = [
5
+ '79af071f451fc7af10d009dc63236ef9a9b211732c1ee0c06f028fcecf2336c5',
6
+ '531bfba6d8dfefd3bcc888aca54cdbbd4574ed2b3ec551b230845a1f9a608898',
7
+ 'c874412b4faa4947de81372fd1ba12fdd6f43f5e408622b7f357cb2bcb3f17cb',
8
+ '29d3f8b882c61a82a1a1675782a27e797ea7196f45a23b4409680ab8b8d5f14e',
9
+ 'cfd20f80ac073fd9518f4ef3f43d2a1f5e4e56e40c2677f38d6f6fecd05df60c',
10
+ '1354fa73497519a39aed19fc99bdbae78a880a1eafb2f7898d607e07db36528d',
11
+ '1043b0d25eacfc5013ae9dba780305a6fbf01a43543bd871d7c00537fca142a9',
12
+ '973dfc5df142851ced258d52d0ac2784e814000ac22e35776f772256b0d4dde9',
13
+ '463808eb74d3d87e6563970e0301a493577f8cd1b501e6e0ffa5e027ad2cea95',
14
+ '15b21acea2e3fd9d1ace3768a72636ee7bdf67a6f8e0807bfa2273dea2207555',
15
+ '32d377bfe7ebe382598c54dd13f8af7510e0a1e2fd2e913311fdd58e517e5e2e,',
16
+ ]
18
17
 
19
- const parseStaticAnswerHash = () => {
20
- return 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5'
21
- }
18
+ const staticAnswerHashConst = 'c7bbf61f61cfd4a1b2def160c28136fc1d100d39fbdb67b227a2c6e558d9d3a5'
22
19
 
23
- const useFindHashes = () => {
20
+ export const useFindHashes = () => {
24
21
  const { network } = useNetwork()
25
22
  const exploreMapHashes = (network?.nodes?.find((node) => node.type === 'archivist') as XyoArchivistPreset)?.explorerMapHashes
26
- const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || parseAnimatedAnswerHashes()
27
- const staticAnswerHash = exploreMapHashes?.staticAnswerHash || parseStaticAnswerHash()
28
-
29
- return [staticAnswerHash, ...animatedAnswerHashes]
23
+ const animatedAnswerHashes = exploreMapHashes?.animatedAnswerHashes || animatedAnswerHashesConst
24
+ const staticAnswerHash = exploreMapHashes?.staticAnswerHash || staticAnswerHashConst
25
+ const foundHashes = useMemo(() => [staticAnswerHash, ...animatedAnswerHashes], [animatedAnswerHashes, staticAnswerHash])
26
+ return foundHashes
30
27
  }
31
-
32
- export { useFindHashes }