@vitessce/vit-s 2.0.3-beta.0 → 3.0.0

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.
Files changed (277) hide show
  1. package/dist/index.js +41348 -18
  2. package/dist-tsc/CallbackPublisher.d.ts +18 -0
  3. package/dist-tsc/CallbackPublisher.d.ts.map +1 -0
  4. package/{dist → dist-tsc}/CallbackPublisher.js +6 -12
  5. package/dist-tsc/LoadingIndicator.d.ts +2 -0
  6. package/dist-tsc/LoadingIndicator.d.ts.map +1 -0
  7. package/{dist → dist-tsc}/LoadingIndicator.js +1 -2
  8. package/dist-tsc/TitleInfo.d.ts +2 -0
  9. package/dist-tsc/TitleInfo.d.ts.map +1 -0
  10. package/{dist → dist-tsc}/TitleInfo.js +6 -83
  11. package/dist-tsc/VitS.d.ts +45 -0
  12. package/dist-tsc/VitS.d.ts.map +1 -0
  13. package/dist-tsc/VitS.js +119 -0
  14. package/dist-tsc/VitessceGrid.d.ts +23 -0
  15. package/dist-tsc/VitessceGrid.d.ts.map +1 -0
  16. package/{dist → dist-tsc}/VitessceGrid.js +14 -13
  17. package/dist-tsc/VitessceGrid.test.d.ts +2 -0
  18. package/dist-tsc/VitessceGrid.test.d.ts.map +1 -0
  19. package/{dist → dist-tsc}/VitessceGrid.test.js +8 -4
  20. package/dist-tsc/Warning.d.ts +2 -0
  21. package/dist-tsc/Warning.d.ts.map +1 -0
  22. package/{dist → dist-tsc}/Warning.js +2 -2
  23. package/dist-tsc/classNames.d.ts +8 -0
  24. package/dist-tsc/classNames.d.ts.map +1 -0
  25. package/dist-tsc/data/AbstractLoader.d.ts +22 -0
  26. package/dist-tsc/data/AbstractLoader.d.ts.map +1 -0
  27. package/dist-tsc/data/AbstractLoader.js +18 -0
  28. package/dist-tsc/data/AbstractTwoStepLoader.d.ts +6 -0
  29. package/dist-tsc/data/AbstractTwoStepLoader.d.ts.map +1 -0
  30. package/{dist → dist-tsc}/data/AbstractTwoStepLoader.js +1 -1
  31. package/dist-tsc/data/LoaderResult.d.ts +7 -0
  32. package/dist-tsc/data/LoaderResult.d.ts.map +1 -0
  33. package/dist-tsc/data/index.d.ts +4 -0
  34. package/dist-tsc/data/index.d.ts.map +1 -0
  35. package/dist-tsc/data/index.js +3 -0
  36. package/dist-tsc/data/loader-registry.d.ts +9 -0
  37. package/dist-tsc/data/loader-registry.d.ts.map +1 -0
  38. package/dist-tsc/data/loader-registry.js +27 -0
  39. package/dist-tsc/data-hook-utils.d.ts +69 -0
  40. package/dist-tsc/data-hook-utils.d.ts.map +1 -0
  41. package/{dist → dist-tsc}/data-hook-utils.js +4 -6
  42. package/dist-tsc/data-hooks.d.ts +77 -0
  43. package/dist-tsc/data-hooks.d.ts.map +1 -0
  44. package/{dist → dist-tsc}/data-hooks.js +4 -4
  45. package/dist-tsc/errors/AbstractLoaderError.d.ts +10 -0
  46. package/dist-tsc/errors/AbstractLoaderError.d.ts.map +1 -0
  47. package/dist-tsc/errors/DataSourceFetchError.d.ts +8 -0
  48. package/dist-tsc/errors/DataSourceFetchError.d.ts.map +1 -0
  49. package/{dist → dist-tsc}/errors/DataSourceFetchError.js +1 -1
  50. package/dist-tsc/errors/DatasetNotFoundError.d.ts +6 -0
  51. package/dist-tsc/errors/DatasetNotFoundError.d.ts.map +1 -0
  52. package/{dist → dist-tsc}/errors/DatasetNotFoundError.js +1 -1
  53. package/dist-tsc/errors/LoaderNotFoundError.d.ts +10 -0
  54. package/dist-tsc/errors/LoaderNotFoundError.d.ts.map +1 -0
  55. package/{dist → dist-tsc}/errors/LoaderNotFoundError.js +1 -1
  56. package/dist-tsc/errors/LoaderValidationError.d.ts +10 -0
  57. package/dist-tsc/errors/LoaderValidationError.d.ts.map +1 -0
  58. package/{dist → dist-tsc}/errors/LoaderValidationError.js +1 -1
  59. package/dist-tsc/errors/index.d.ts +6 -0
  60. package/dist-tsc/errors/index.d.ts.map +1 -0
  61. package/{dist → dist-tsc}/errors/index.js +5 -6
  62. package/dist-tsc/hooks.d.ts +80 -0
  63. package/dist-tsc/hooks.d.ts.map +1 -0
  64. package/{dist → dist-tsc}/hooks.js +60 -4
  65. package/dist-tsc/index.d.ts +11 -0
  66. package/dist-tsc/index.d.ts.map +1 -0
  67. package/dist-tsc/index.js +11 -0
  68. package/dist-tsc/plugins.test.fixtures.d.ts +61 -0
  69. package/dist-tsc/plugins.test.fixtures.d.ts.map +1 -0
  70. package/{dist → dist-tsc}/schemas/config-1.0.16.schema.json +21 -41
  71. package/dist-tsc/schemas/obsSets.schema.d.ts +179 -0
  72. package/dist-tsc/schemas/obsSets.schema.d.ts.map +1 -0
  73. package/dist-tsc/schemas/obsSetsTabular.schema.d.ts +57 -0
  74. package/dist-tsc/schemas/obsSetsTabular.schema.d.ts.map +1 -0
  75. package/dist-tsc/schemas/raster.schema.d.ts +239 -0
  76. package/dist-tsc/schemas/raster.schema.d.ts.map +1 -0
  77. package/dist-tsc/shared-mui/components.d.ts +2 -0
  78. package/dist-tsc/shared-mui/components.d.ts.map +1 -0
  79. package/{dist → dist-tsc}/shared-mui/components.js +2 -8
  80. package/dist-tsc/shared-mui/container.d.ts +2 -0
  81. package/dist-tsc/shared-mui/container.d.ts.map +1 -0
  82. package/{dist → dist-tsc}/shared-mui/container.js +1 -1
  83. package/dist-tsc/shared-mui/styles.d.ts +5 -0
  84. package/dist-tsc/shared-mui/styles.d.ts.map +1 -0
  85. package/{dist → dist-tsc}/shared-mui/styles.js +4 -2
  86. package/dist-tsc/shared-plot-options/CellColorEncodingOption.d.ts +2 -0
  87. package/dist-tsc/shared-plot-options/CellColorEncodingOption.d.ts.map +1 -0
  88. package/{dist → dist-tsc}/shared-plot-options/CellColorEncodingOption.js +3 -4
  89. package/dist-tsc/shared-plot-options/OptionSelect.d.ts +2 -0
  90. package/dist-tsc/shared-plot-options/OptionSelect.d.ts.map +1 -0
  91. package/{dist → dist-tsc}/shared-plot-options/OptionSelect.js +2 -2
  92. package/dist-tsc/shared-plot-options/OptionsContainer.d.ts +2 -0
  93. package/dist-tsc/shared-plot-options/OptionsContainer.d.ts.map +1 -0
  94. package/{dist → dist-tsc}/shared-plot-options/OptionsContainer.js +2 -5
  95. package/dist-tsc/shared-plot-options/index.d.ts +5 -0
  96. package/dist-tsc/shared-plot-options/index.d.ts.map +1 -0
  97. package/dist-tsc/shared-plot-options/index.js +4 -0
  98. package/dist-tsc/shared-plot-options/styles.d.ts +2 -0
  99. package/dist-tsc/shared-plot-options/styles.d.ts.map +1 -0
  100. package/{dist → dist-tsc}/shared-plot-options/styles.js +1 -1
  101. package/dist-tsc/state/hooks.d.ts +216 -0
  102. package/dist-tsc/state/hooks.d.ts.map +1 -0
  103. package/{dist → dist-tsc}/state/hooks.js +47 -21
  104. package/dist-tsc/title-styles.d.ts +2 -0
  105. package/dist-tsc/title-styles.d.ts.map +1 -0
  106. package/dist-tsc/title-styles.js +72 -0
  107. package/dist-tsc/view-config-utils.d.ts +30 -0
  108. package/dist-tsc/view-config-utils.d.ts.map +1 -0
  109. package/{dist → dist-tsc}/view-config-utils.js +32 -84
  110. package/dist-tsc/view-config-utils.test.d.ts +2 -0
  111. package/dist-tsc/view-config-utils.test.d.ts.map +1 -0
  112. package/dist-tsc/view-config-utils.test.fixtures.d.ts +1049 -0
  113. package/dist-tsc/view-config-utils.test.fixtures.d.ts.map +1 -0
  114. package/{dist → dist-tsc}/view-config-utils.test.fixtures.js +118 -0
  115. package/dist-tsc/view-config-utils.test.js +209 -0
  116. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts +8 -0
  117. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.d.ts.map +1 -0
  118. package/{dist → dist-tsc}/vitessce-grid-layout/VitessceGridLayout.js +47 -28
  119. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.test.d.ts +2 -0
  120. package/dist-tsc/vitessce-grid-layout/VitessceGridLayout.test.d.ts.map +1 -0
  121. package/{dist → dist-tsc}/vitessce-grid-layout/VitessceGridLayout.test.js +13 -5
  122. package/dist-tsc/vitessce-grid-layout/index.d.ts +2 -0
  123. package/dist-tsc/vitessce-grid-layout/index.d.ts.map +1 -0
  124. package/dist-tsc/vitessce-grid-layout/index.js +1 -0
  125. package/dist-tsc/vitessce-grid-layout/layout-utils.d.ts +15 -0
  126. package/dist-tsc/vitessce-grid-layout/layout-utils.d.ts.map +1 -0
  127. package/{dist → dist-tsc}/vitessce-grid-layout/layout-utils.js +2 -1
  128. package/dist-tsc/vitessce-grid-layout/layout-utils.test.d.ts +2 -0
  129. package/dist-tsc/vitessce-grid-layout/layout-utils.test.d.ts.map +1 -0
  130. package/{dist → dist-tsc}/vitessce-grid-layout/layout-utils.test.js +3 -1
  131. package/dist-tsc/vitessce-grid-utils.d.ts +13 -0
  132. package/dist-tsc/vitessce-grid-utils.d.ts.map +1 -0
  133. package/{dist → dist-tsc}/vitessce-grid-utils.js +15 -14
  134. package/package.json +24 -11
  135. package/src/CallbackPublisher.js +77 -0
  136. package/src/LoadingIndicator.js +33 -0
  137. package/src/TitleInfo.js +167 -0
  138. package/src/VitS.js +202 -0
  139. package/src/VitessceGrid.js +118 -0
  140. package/src/VitessceGrid.test.jsx +57 -0
  141. package/src/Warning.js +62 -0
  142. package/src/classNames.js +8 -0
  143. package/src/data/AbstractLoader.js +23 -0
  144. package/src/data/AbstractTwoStepLoader.js +8 -0
  145. package/src/data/LoaderResult.js +8 -0
  146. package/src/data/index.js +3 -0
  147. package/src/data/loader-registry.js +28 -0
  148. package/src/data-hook-utils.js +195 -0
  149. package/src/data-hooks.js +354 -0
  150. package/src/errors/AbstractLoaderError.js +14 -0
  151. package/src/errors/DataSourceFetchError.js +15 -0
  152. package/src/errors/DatasetNotFoundError.js +23 -0
  153. package/src/errors/LoaderNotFoundError.js +24 -0
  154. package/src/errors/LoaderValidationError.js +23 -0
  155. package/src/errors/index.js +5 -0
  156. package/src/hooks.js +317 -0
  157. package/src/index.js +76 -0
  158. package/src/plugins.test.fixtures.js +78 -0
  159. package/src/schemas/config-0.1.0.schema.json +85 -0
  160. package/src/schemas/config-1.0.0.schema.json +733 -0
  161. package/src/schemas/config-1.0.1.schema.json +909 -0
  162. package/src/schemas/config-1.0.10.schema.json +969 -0
  163. package/src/schemas/config-1.0.11.schema.json +990 -0
  164. package/src/schemas/config-1.0.12.schema.json +997 -0
  165. package/src/schemas/config-1.0.13.schema.json +1013 -0
  166. package/src/schemas/config-1.0.14.schema.json +1048 -0
  167. package/src/schemas/config-1.0.15.schema.json +1048 -0
  168. package/src/schemas/config-1.0.16.schema.json +1089 -0
  169. package/src/schemas/config-1.0.2.schema.json +911 -0
  170. package/src/schemas/config-1.0.3.schema.json +911 -0
  171. package/src/schemas/config-1.0.4.schema.json +949 -0
  172. package/src/schemas/config-1.0.5.schema.json +949 -0
  173. package/src/schemas/config-1.0.6.schema.json +950 -0
  174. package/src/schemas/config-1.0.7.schema.json +950 -0
  175. package/src/schemas/config-1.0.8.schema.json +966 -0
  176. package/src/schemas/config-1.0.9.schema.json +965 -0
  177. package/src/schemas/fixtures/cellSets.good.json +16 -0
  178. package/src/schemas/fixtures/config-1.0.1.bad.json +1 -0
  179. package/src/schemas/fixtures/config-1.0.1.bad.message.json +11 -0
  180. package/src/schemas/fixtures/config-1.0.1.good.json +37 -0
  181. package/src/schemas/fixtures/config-1.0.2.bad.json +1 -0
  182. package/src/schemas/fixtures/config-1.0.2.bad.message.json +11 -0
  183. package/src/schemas/fixtures/config-1.0.2.good.json +38 -0
  184. package/src/schemas/fixtures/config-1.0.3.bad.json +1 -0
  185. package/src/schemas/fixtures/config-1.0.3.bad.message.json +11 -0
  186. package/src/schemas/fixtures/config-1.0.3.good.json +38 -0
  187. package/src/schemas/fixtures/obsSets.bad.json +1 -0
  188. package/src/schemas/fixtures/obsSets.bad.message.json +11 -0
  189. package/src/schemas/fixtures/obsSets.good.json +16 -0
  190. package/src/schemas/fixtures/obsSetsTabular.bad.json +1 -0
  191. package/src/schemas/fixtures/obsSetsTabular.bad.message.json +11 -0
  192. package/src/schemas/fixtures/obsSetsTabular.good.json +26 -0
  193. package/src/schemas/fixtures/raster.bad.json +1 -0
  194. package/src/schemas/fixtures/raster.bad.message.json +11 -0
  195. package/src/schemas/fixtures/raster.good.json +39 -0
  196. package/src/schemas/obsSets.schema.js +195 -0
  197. package/src/schemas/obsSetsTabular.schema.js +39 -0
  198. package/src/schemas/raster.schema.js +121 -0
  199. package/src/schemas/schema-schema.sh +34 -0
  200. package/src/shared-mui/components.js +81 -0
  201. package/src/shared-mui/container.js +212 -0
  202. package/src/shared-mui/styles.js +113 -0
  203. package/src/shared-plot-options/CellColorEncodingOption.js +42 -0
  204. package/src/shared-plot-options/OptionSelect.js +19 -0
  205. package/src/shared-plot-options/OptionsContainer.js +23 -0
  206. package/src/shared-plot-options/index.js +4 -0
  207. package/src/shared-plot-options/styles.js +49 -0
  208. package/src/state/hooks.js +640 -0
  209. package/src/title-styles.js +73 -0
  210. package/src/view-config-utils.js +263 -0
  211. package/src/view-config-utils.test.fixtures.js +893 -0
  212. package/src/view-config-utils.test.jsx +222 -0
  213. package/src/vitessce-grid-layout/VitessceGridLayout.js +179 -0
  214. package/src/vitessce-grid-layout/VitessceGridLayout.test.jsx +64 -0
  215. package/src/vitessce-grid-layout/index.js +1 -0
  216. package/src/vitessce-grid-layout/layout-utils.js +76 -0
  217. package/src/vitessce-grid-layout/layout-utils.test.js +167 -0
  218. package/src/vitessce-grid-utils.js +172 -0
  219. package/dist/VitS.js +0 -117
  220. package/dist/Vitessce.integration.test.js +0 -36
  221. package/dist/Vitessce.js +0 -101
  222. package/dist/component-registry.js +0 -16
  223. package/dist/data/AbstractLoader.js +0 -35
  224. package/dist/data/index.js +0 -3
  225. package/dist/data/loader-registry.js +0 -15
  226. package/dist/errors/OptionsValidationError.js +0 -15
  227. package/dist/export-utils.js +0 -70
  228. package/dist/export-utils.test.js +0 -66
  229. package/dist/file-options-schemas-legacy.js +0 -136
  230. package/dist/file-options-schemas-legacy.test.js +0 -126
  231. package/dist/file-options-schemas.js +0 -322
  232. package/dist/file-options-schemas.test.js +0 -23
  233. package/dist/joint-file-types-legacy.js +0 -278
  234. package/dist/joint-file-types-legacy.test.js +0 -400
  235. package/dist/joint-file-types.js +0 -148
  236. package/dist/joint-file-types.test.js +0 -139
  237. package/dist/loader-registry.js +0 -98
  238. package/dist/plugins.js +0 -154
  239. package/dist/plugins.test.js +0 -30
  240. package/dist/schemas/PrettyJsonSchema.js +0 -34
  241. package/dist/schemas/config-1.0.15.schema.test.js +0 -22
  242. package/dist/schemas/config-1.0.16.schema.test.js +0 -22
  243. package/dist/schemas/obs-sets-tabular.schema.js +0 -37
  244. package/dist/schemas/obs-sets.schema.js +0 -194
  245. package/dist/schemas/schema.test-old.js +0 -50
  246. package/dist/schemas/schema.test.js +0 -46
  247. package/dist/schemas-extra.js +0 -3
  248. package/dist/schemas.js +0 -4
  249. package/dist/shared-plot-options/index.js +0 -4
  250. package/dist/view-config-upgraders.js +0 -525
  251. package/dist/view-config-utils.test.js +0 -66
  252. package/dist/view-config-versions.js +0 -47
  253. package/dist/vitessce-grid-layout/index.js +0 -1
  254. /package/{dist → dist-tsc}/classNames.js +0 -0
  255. /package/{dist → dist-tsc}/data/LoaderResult.js +0 -0
  256. /package/{dist → dist-tsc}/errors/AbstractLoaderError.js +0 -0
  257. /package/{dist → dist-tsc}/plugins.test.fixtures.js +0 -0
  258. /package/{dist → dist-tsc}/schemas/config-0.1.0.schema.json +0 -0
  259. /package/{dist → dist-tsc}/schemas/config-1.0.0.schema.json +0 -0
  260. /package/{dist → dist-tsc}/schemas/config-1.0.1.schema.json +0 -0
  261. /package/{dist → dist-tsc}/schemas/config-1.0.10.schema.json +0 -0
  262. /package/{dist → dist-tsc}/schemas/config-1.0.11.schema.json +0 -0
  263. /package/{dist → dist-tsc}/schemas/config-1.0.12.schema.json +0 -0
  264. /package/{dist → dist-tsc}/schemas/config-1.0.13.schema.json +0 -0
  265. /package/{dist → dist-tsc}/schemas/config-1.0.14.schema.json +0 -0
  266. /package/{dist → dist-tsc}/schemas/config-1.0.15.schema.json +0 -0
  267. /package/{dist → dist-tsc}/schemas/config-1.0.2.schema.json +0 -0
  268. /package/{dist → dist-tsc}/schemas/config-1.0.3.schema.json +0 -0
  269. /package/{dist → dist-tsc}/schemas/config-1.0.4.schema.json +0 -0
  270. /package/{dist → dist-tsc}/schemas/config-1.0.5.schema.json +0 -0
  271. /package/{dist → dist-tsc}/schemas/config-1.0.6.schema.json +0 -0
  272. /package/{dist → dist-tsc}/schemas/config-1.0.7.schema.json +0 -0
  273. /package/{dist → dist-tsc}/schemas/config-1.0.8.schema.json +0 -0
  274. /package/{dist → dist-tsc}/schemas/config-1.0.9.schema.json +0 -0
  275. /package/{dist → dist-tsc}/schemas/obsSets.schema.js +0 -0
  276. /package/{dist → dist-tsc}/schemas/obsSetsTabular.schema.js +0 -0
  277. /package/{dist → dist-tsc}/schemas/raster.schema.js +0 -0
@@ -0,0 +1,640 @@
1
+ /* eslint-disable react-refresh/only-export-components */
2
+ import { useRef, useCallback, useMemo } from 'react';
3
+ import create from 'zustand';
4
+ import createContext from 'zustand/context';
5
+ import shallow from 'zustand/shallow';
6
+ import { isMatch } from 'lodash-es';
7
+ import { CoordinationType } from '@vitessce/constants-internal';
8
+ import { fromEntries, capitalize } from '@vitessce/utils';
9
+
10
+ // Reference: https://github.com/pmndrs/zustand#react-context
11
+ // Reference: https://github.com/pmndrs/zustand/blob/e47ea03/tests/context.test.tsx#L60
12
+ const {
13
+ Provider: ViewConfigProviderLocal,
14
+ useStore: useViewConfigStoreLocal,
15
+ useStoreApi: useViewConfigStoreApiLocal,
16
+ } = createContext();
17
+
18
+ export const ViewConfigProvider = ViewConfigProviderLocal;
19
+ export const useViewConfigStore = useViewConfigStoreLocal;
20
+ export const useViewConfigStoreApi = useViewConfigStoreApiLocal;
21
+
22
+ const {
23
+ Provider: AuxiliaryProviderLocal,
24
+ useStore: useAuxiliaryStoreLocal,
25
+ } = createContext();
26
+
27
+ export const AuxiliaryProvider = AuxiliaryProviderLocal;
28
+ export const useAuxiliaryStore = useAuxiliaryStoreLocal;
29
+
30
+
31
+ /**
32
+ * The useViewConfigStore hook is initialized via the zustand
33
+ * create() function, which sets up both the state variables
34
+ * and the reducer-type functions.
35
+ * References:
36
+ * - https://github.com/react-spring/zustand
37
+ * - https://github.com/pmndrs/zustand/releases/tag/v3.6.0
38
+ * - https://github.com/pmndrs/zustand#using-subscribe-with-selector
39
+ * @returns {function} The useStore hook.
40
+ */
41
+ export const createViewConfigStore = () => create(set => ({
42
+ // State:
43
+ // The viewConfig is an object which must conform to the schema
44
+ // found in src/schemas/config.schema.json.
45
+ viewConfig: null,
46
+ // The loaders object is a mapping from dataset ID to
47
+ // data type to loader object instance.
48
+ loaders: null,
49
+ // Reducer functions which update the state
50
+ // (although technically also part of state):
51
+ setViewConfig: viewConfig => set({ viewConfig }),
52
+ setLoaders: loaders => set({ loaders }),
53
+ setCoordinationValue: ({ parameter, scope, value }) => set(state => ({
54
+ viewConfig: {
55
+ ...state.viewConfig,
56
+ coordinationSpace: {
57
+ ...state.viewConfig.coordinationSpace,
58
+ [parameter]: {
59
+ ...state.viewConfig.coordinationSpace[parameter],
60
+ [scope]: value,
61
+ },
62
+ },
63
+ },
64
+ })),
65
+ removeComponent: uid => set((state) => {
66
+ const newLayout = state.viewConfig.layout.filter(c => c.uid !== uid);
67
+ return {
68
+ viewConfig: {
69
+ ...state.viewConfig,
70
+ layout: newLayout,
71
+ },
72
+ };
73
+ }),
74
+ changeLayout: newComponentProps => set((state) => {
75
+ const newLayout = state.viewConfig.layout
76
+ .slice()
77
+ .map(componentProps => ({
78
+ ...componentProps,
79
+ ...newComponentProps[componentProps.uid],
80
+ }));
81
+ return {
82
+ viewConfig: {
83
+ ...state.viewConfig,
84
+ layout: newLayout,
85
+ },
86
+ };
87
+ }),
88
+ }));
89
+
90
+ /**
91
+ * Hook for getting components' layout from the view config based on
92
+ * matching all coordination scopes.
93
+ * @returns {Object} The components' layout.
94
+ */
95
+ export const useComponentLayout = (component, scopes, coordinationScopes) => useViewConfigStore(
96
+ state => state.viewConfig.layout.filter(l => l.component === component).filter(
97
+ l => scopes.every(scope => l.coordinationScopes[scope]
98
+ === coordinationScopes[scope]),
99
+ ),
100
+ );
101
+
102
+ /**
103
+ * The useAuxiliaryStore hook is initialized via the zustand
104
+ * create() function, which sets up both the state variables
105
+ * and the reducer-type functions.
106
+ * Reference: https://github.com/react-spring/zustand
107
+ * It is meant to be used for non-viewconfig-based coordination between components.
108
+ * For example, as currently happens, the layer controller can coordinate
109
+ * on-load callbacks with spatial view based on whether or not they are
110
+ * coordinated via `spatialImageLayer` - the callbacks are not part of the view config
111
+ * though so they live here.
112
+ * @returns {function} The useStore hook.
113
+ */
114
+ export const createAuxiliaryStore = () => create(set => ({
115
+ auxiliaryStore: null,
116
+ setCoordinationValue: ({ parameter, scope, value }) => set(state => ({
117
+ auxiliaryStore: {
118
+ ...state.auxiliaryStore,
119
+ [parameter]: {
120
+ [scope]: value,
121
+ },
122
+ },
123
+ })),
124
+ }));
125
+
126
+ /**
127
+ * The hover store can be used to store global state
128
+ * related to which component is currently hovered,
129
+ * which is required for tooltip / crossover elements.
130
+ * @returns {function} The useStore hook.
131
+ */
132
+ const useHoverStore = create(set => ({
133
+ // Components may need to know if they are the "hover source"
134
+ // for tooltip interactions. This value should be a unique
135
+ // component ID, such as its index in the view config layout.
136
+ componentHover: null,
137
+ setComponentHover: componentHover => set({ componentHover }),
138
+ }));
139
+
140
+ /**
141
+ * The warning store can be used to store global state
142
+ * related to app warning messages.
143
+ * @returns {function} The useStore hook.
144
+ */
145
+ const useWarnStore = create(set => ({
146
+ // Want a global state to collect warning messages
147
+ // that occur anywhere in the app.
148
+ warning: null,
149
+ setWarning: warning => set({ warning }),
150
+ }));
151
+
152
+ /**
153
+ * The view info store can be used to store component-level
154
+ * viewInfo objects,
155
+ * which are required for tooltip / crossover elements.
156
+ * @returns {function} The useStore hook.
157
+ */
158
+ const useViewInfoStore = create(set => ({
159
+ // The viewInfo object is a mapping from
160
+ // component IDs to component view info objects.
161
+ // Each view info object must have a project() function.
162
+ viewInfo: {},
163
+ setComponentViewInfo: (uuid, viewInfo) => set(state => ({
164
+ viewInfo: {
165
+ ...state.viewInfo,
166
+ [uuid]: viewInfo,
167
+ },
168
+ })),
169
+ }));
170
+
171
+ /**
172
+ * The grid size store can be used to store a
173
+ * counter which updates on each window or react-grid-layout
174
+ * resize event.
175
+ * @returns {function} The useStore hook.
176
+ */
177
+ const useGridSizeStore = create(set => ({
178
+ resizeCount: {},
179
+ incrementResizeCount: () => set(state => ({
180
+ resizeCount: state.resizeCount + 1,
181
+ })),
182
+ }));
183
+
184
+ /**
185
+ * The useCoordination hook returns both the
186
+ * values and setter functions for the coordination objects
187
+ * in a particular coordination scope mapping.
188
+ * This hook is intended to be used within the ___Subscriber
189
+ * components to allow them to "hook into" only those coordination
190
+ * objects and setter functions of relevance.
191
+ * @param {string[]} parameters Array of coordination types.
192
+ * @param {object} coordinationScopes Mapping of coordination types
193
+ * to scope names.
194
+ * @returns {array} Returns a tuple [values, setters]
195
+ * where values is an object containing all coordination values,
196
+ * and setters is an object containing all coordination setter
197
+ * functions for the values in `values`, named with a "set"
198
+ * prefix.
199
+ */
200
+ export function useCoordination(parameters, coordinationScopes) {
201
+ const setCoordinationValue = useViewConfigStore(state => state.setCoordinationValue);
202
+
203
+ const values = useViewConfigStore((state) => {
204
+ const { coordinationSpace } = state.viewConfig;
205
+ return fromEntries(parameters.map((parameter) => {
206
+ if (coordinationSpace && coordinationSpace[parameter]) {
207
+ const value = coordinationSpace[parameter][coordinationScopes[parameter]];
208
+ return [parameter, value];
209
+ }
210
+ return [parameter, undefined];
211
+ }));
212
+ }, shallow);
213
+
214
+ const setters = useMemo(() => fromEntries(parameters.map((parameter) => {
215
+ const setterName = `set${capitalize(parameter)}`;
216
+ const setterFunc = value => setCoordinationValue({
217
+ parameter,
218
+ scope: coordinationScopes[parameter],
219
+ value,
220
+ });
221
+ return [setterName, setterFunc];
222
+ // eslint-disable-next-line react-hooks/exhaustive-deps
223
+ })), [parameters, coordinationScopes]);
224
+
225
+ return [values, setters];
226
+ }
227
+
228
+ export function useMultiCoordinationValues(parameter, coordinationScopes) {
229
+ const scopes = coordinationScopes[parameter];
230
+
231
+ // Mapping from dataset coordination scope name to dataset uid
232
+ const vals = useViewConfigStore((state) => {
233
+ const { coordinationSpace } = state.viewConfig;
234
+ // Convert a single scope to an array of scopes to be consistent.
235
+ const scopesArr = Array.isArray(scopes) ? scopes : [scopes];
236
+ return fromEntries(scopesArr.map((scope) => {
237
+ if (coordinationSpace && coordinationSpace[parameter]) {
238
+ const value = coordinationSpace[parameter][scope];
239
+ return [scope, value];
240
+ }
241
+ return [scope, undefined];
242
+ // eslint-disable-next-line no-unused-vars
243
+ }).filter(([k, v]) => v !== undefined));
244
+ }, shallow);
245
+
246
+ return vals;
247
+ }
248
+
249
+ /**
250
+ * Get a mapping from dataset coordination scopes to dataset UIDs.
251
+ * @param {object} coordinationScopes The coordination scope mapping object for a view.
252
+ * @returns {object} Mapping from dataset coordination scope names to dataset UIDs.
253
+ */
254
+ export function useDatasetUids(coordinationScopes) {
255
+ return useMultiCoordinationValues(CoordinationType.DATASET, coordinationScopes);
256
+ }
257
+
258
+ /**
259
+ * Use coordination values and coordination setter functions corresponding to
260
+ * {coordinationType}-specific coordination scopes for each coordination type.
261
+ * @param {string[]} parameters An array of coordination types supported by a view.
262
+ * @param {object} coordinationScopes The coordination scope mapping object for a view.
263
+ * @param {object} coordinationScopesBy The per-coordinationType coordination scope
264
+ * mapping object for a view.
265
+ * @param {string} byType The {coordinationType} to use for per-{coordinationType} coordination
266
+ * scope mappings.
267
+ * @returns {array} [cValues, cSetters] where
268
+ * cValues is a mapping from coordination scope name to { coordinationType: coordinationValue },
269
+ * and cSetters is a mapping from coordination scope name to { setCoordinationType }
270
+ * setter functions.
271
+ */
272
+ export function useComplexCoordination(
273
+ parameters, coordinationScopes, coordinationScopesBy, byType,
274
+ ) {
275
+ const setCoordinationValue = useViewConfigStore(state => state.setCoordinationValue);
276
+
277
+ const typeScopes = coordinationScopes[byType];
278
+ const byTypeScopes = coordinationScopesBy[byType];
279
+
280
+ // Convert a single scope to an array of scopes to be consistent.
281
+ const typeScopesArr = Array.isArray(typeScopes) ? typeScopes : [typeScopes];
282
+
283
+ const values = useViewConfigStore((state) => {
284
+ const { coordinationSpace } = state.viewConfig;
285
+ return fromEntries(typeScopesArr.map((datasetScope) => {
286
+ const datasetValues = fromEntries(parameters.map((parameter) => {
287
+ if (coordinationSpace && coordinationSpace[parameter]) {
288
+ let value;
289
+ const parameterSpace = coordinationSpace[parameter];
290
+ const parameterScopeGlobal = coordinationScopes[parameter];
291
+ const parameterScopeByDataset = byTypeScopes?.[parameter];
292
+ if (parameterScopeByDataset && parameterScopeByDataset[datasetScope]) {
293
+ value = parameterSpace[parameterScopeByDataset[datasetScope]];
294
+ } else if (parameterScopeGlobal) {
295
+ value = parameterSpace[parameterScopeGlobal];
296
+ } else {
297
+ console.error(`coordination scope for ${parameter} was not found.`);
298
+ }
299
+ return [parameter, value];
300
+ }
301
+ return [parameter, undefined];
302
+ }));
303
+ return [datasetScope, datasetValues];
304
+ }));
305
+ }, shallow);
306
+
307
+ const setters = useMemo(() => fromEntries(typeScopesArr.map((datasetScope) => {
308
+ const datasetSetters = fromEntries(parameters.map((parameter) => {
309
+ const setterName = `set${capitalize(parameter)}`;
310
+ let setterFunc;
311
+ const parameterScopeGlobal = coordinationScopes[parameter];
312
+ const parameterScopeByDataset = byTypeScopes?.[parameter];
313
+ if (parameterScopeByDataset && parameterScopeByDataset[datasetScope]) {
314
+ setterFunc = value => setCoordinationValue({
315
+ parameter,
316
+ scope: parameterScopeByDataset[datasetScope],
317
+ value,
318
+ });
319
+ } else if (parameterScopeGlobal) {
320
+ setterFunc = value => setCoordinationValue({
321
+ parameter,
322
+ scope: parameterScopeGlobal,
323
+ value,
324
+ });
325
+ } else {
326
+ console.error(`coordination scope for ${parameter} was not found.`);
327
+ }
328
+ return [setterName, setterFunc];
329
+ }));
330
+ return [datasetScope, datasetSetters];
331
+ // eslint-disable-next-line react-hooks/exhaustive-deps
332
+ })), [parameters, coordinationScopes]);
333
+
334
+ return [values, setters];
335
+ }
336
+
337
+ /**
338
+ * Use coordination values and coordination setter functions corresponding to
339
+ * dataset-specific coordination scopes for each coordination type.
340
+ * @param {string[]} parameters An array of coordination types supported by a view.
341
+ * @param {object} coordinationScopes The coordination scope mapping object for a view.
342
+ * @param {object} coordinationScopesBy The per-coordinationType coordination scope
343
+ * mapping object for a view.
344
+ * @returns {array} [cValues, cSetters] where
345
+ * cValues is a mapping from coordination scope name to { coordinationType: coordinationValue },
346
+ * and cSetters is a mapping from coordination scope name to { setCoordinationType }
347
+ * setter functions.
348
+ */
349
+ export function useMultiDatasetCoordination(parameters, coordinationScopes, coordinationScopesBy) {
350
+ return useComplexCoordination(
351
+ parameters, coordinationScopes, coordinationScopesBy,
352
+ CoordinationType.DATASET,
353
+ );
354
+ }
355
+
356
+ const AUXILIARY_COORDINATION_TYPES_MAP = {
357
+ spatialImageLayer: ['imageLayerCallbacks', 'areLoadingImageChannels'],
358
+ spatialSegmentationLayer: ['segmentationLayerCallbacks', 'areLoadingSegmentationChannels'],
359
+ };
360
+
361
+ /**
362
+ * The maps the coordination types of incoming scopes to new types
363
+ * for the auxiliary store.
364
+ * @param {object} coordinationScopes Mapping of coordination types
365
+ * to scope names.
366
+ * @returns {object} Mapping of coordination types
367
+ * to new scope names for the auxiliary store.
368
+ */
369
+ const mapCoordinationScopes = (coordinationScopes) => {
370
+ const newCoordinationScopes = {};
371
+ Object.keys(coordinationScopes).forEach((key) => {
372
+ const newCoordinationTypes = AUXILIARY_COORDINATION_TYPES_MAP[key] || [];
373
+ newCoordinationTypes.forEach((coordinationType) => {
374
+ newCoordinationScopes[coordinationType || key] = coordinationScopes[key];
375
+ });
376
+ });
377
+ return newCoordinationScopes;
378
+ };
379
+
380
+ const mapParameters = parameters => parameters
381
+ .map(parameter => AUXILIARY_COORDINATION_TYPES_MAP[parameter]).filter(Boolean).flat();
382
+
383
+ /**
384
+ * The useAuxiliaryCoordination hook returns both the
385
+ * values and setter functions for the auxiliary coordination objects
386
+ * in a particular coordination scope mapping.
387
+ * This hook is intended to be used within the ___Subscriber
388
+ * components to allow them to "hook into" only those auxiliary coordination
389
+ * objects and setter functions of relevance, for example "on load" callbacks.
390
+ * @param {string[]} parameters Array of coordination types.
391
+ * @param {object} coordinationScopes Mapping of coordination types
392
+ * to scope names.
393
+ * @returns {array} Returns a tuple [values, setters]
394
+ * where values is an object containing all coordination values,
395
+ * and setters is an object containing all coordination setter
396
+ * functions for the values in `values`, named with a "set"
397
+ * prefix.
398
+ */
399
+ export function useAuxiliaryCoordination(parameters, coordinationScopes) {
400
+ const setCoordinationValue = useAuxiliaryStore(state => state.setCoordinationValue);
401
+ const mappedCoordinationScopes = mapCoordinationScopes(coordinationScopes);
402
+ const mappedParameters = mapParameters(parameters);
403
+ const values = useAuxiliaryStore((state) => {
404
+ const { auxiliaryStore } = state;
405
+ return fromEntries(mappedParameters.map((parameter) => {
406
+ if (auxiliaryStore && auxiliaryStore[parameter]) {
407
+ const value = auxiliaryStore[parameter][mappedCoordinationScopes[parameter]];
408
+ return [parameter, value];
409
+ }
410
+ return [parameter, undefined];
411
+ }));
412
+ }, shallow);
413
+ const setters = useMemo(() => fromEntries(mappedParameters.map((parameter) => {
414
+ const setterName = `set${capitalize(parameter)}`;
415
+ const setterFunc = value => setCoordinationValue({
416
+ parameter,
417
+ scope: mappedCoordinationScopes[parameter],
418
+ value,
419
+ });
420
+ return [setterName, setterFunc];
421
+ // eslint-disable-next-line react-hooks/exhaustive-deps
422
+ })), [parameters, coordinationScopes]);
423
+
424
+ return [values, setters];
425
+ }
426
+
427
+ /**
428
+ * Obtain the loaders object from
429
+ * the global app state.
430
+ * @returns {object} The loaders object
431
+ * in the `useViewConfigStore` store.
432
+ */
433
+ export function useLoaders() {
434
+ return useViewConfigStore(state => state.loaders);
435
+ }
436
+
437
+ /**
438
+ * Find a specific loader instance for a particular dataset, data type, and view
439
+ * coordination values (mapping from coordination types to coordination values).
440
+ * Uses lodash/isMatch to perform matching against the file definition's
441
+ * coordination value mapping.
442
+ * @param {object} loaders The value returned by useLoaders.
443
+ * @param {string} dataset The dataset UID.
444
+ * @param {string} dataType The data type for the matching file.
445
+ * @param {object} viewCoordinationValues Current coordination values
446
+ * from the view. Match these against a subset of file definition coordination
447
+ * values.
448
+ * @returns The matching loader instance or `null`.
449
+ */
450
+ export function useMatchingLoader(loaders, dataset, dataType, viewCoordinationValues) {
451
+ return useMemo(() => {
452
+ if (!loaders[dataset]) {
453
+ return null;
454
+ }
455
+ const loaderInternMap = loaders[dataset].loaders[dataType];
456
+ if (!loaderInternMap) {
457
+ return null;
458
+ }
459
+ const loaderKeys = Array.from(loaderInternMap.keys());
460
+ const matchingKey = loaderKeys
461
+ .find(fileCoordinationValues => isMatch(fileCoordinationValues, viewCoordinationValues));
462
+ if (!matchingKey) {
463
+ return null;
464
+ }
465
+ return loaderInternMap.get(matchingKey);
466
+ }, [loaders, dataset, dataType, viewCoordinationValues]);
467
+ }
468
+
469
+ /**
470
+ * Find a specific loader instance for a particular dataset, data type, and view
471
+ * coordination values (mapping from coordination types to coordination values).
472
+ * Uses lodash/isMatch to perform matching against the file definition's
473
+ * coordination value mapping.
474
+ * @param {object} loaders The value returned by useLoaders.
475
+ * @param {string} dataset The dataset UID.
476
+ * @param {string} dataType The data type for the matching file.
477
+ * @param {object} viewCoordinationValues Current coordination values
478
+ * from the view. Match these against a subset of file definition coordination
479
+ * values.
480
+ * @returns The matching loader instance or `null`.
481
+ */
482
+ export function useMatchingLoaders(loaders, dataset, dataType, viewCoordinationValuesObj) {
483
+ return useMemo(() => {
484
+ if (!loaders[dataset]) {
485
+ return null;
486
+ }
487
+ const loaderInternMap = loaders[dataset].loaders[dataType];
488
+ if (!loaderInternMap) {
489
+ return null;
490
+ }
491
+ const loaderKeys = Array.from(loaderInternMap.keys());
492
+ function getLoader(viewCoordinationValues) {
493
+ const matchingKey = loaderKeys
494
+ .find(fileCoordinationValues => isMatch(fileCoordinationValues, viewCoordinationValues));
495
+ return loaderInternMap.get(matchingKey);
496
+ }
497
+ return fromEntries(
498
+ Object.entries(viewCoordinationValuesObj).map(([key, viewCoordinationValues]) => ([
499
+ key,
500
+ getLoader(viewCoordinationValues),
501
+ ])),
502
+ );
503
+ }, [loaders, dataset, dataType, viewCoordinationValuesObj]);
504
+ }
505
+
506
+ /**
507
+ * Obtain the view config layout array from
508
+ * the global app state.
509
+ * @returns {object[]} The layout array
510
+ * in the `useViewConfigStore` store.
511
+ */
512
+ export function useLayout() {
513
+ return useViewConfigStore(state => state.viewConfig?.layout);
514
+ }
515
+
516
+ /**
517
+ * Obtain the component removal function from
518
+ * the global app state.
519
+ * @returns {function} The remove component function
520
+ * in the `useViewInfoStore` store.
521
+ */
522
+ export function useRemoveComponent() {
523
+ return useViewConfigStore(state => state.removeComponent);
524
+ }
525
+
526
+ /**
527
+ * Obtain the component prop setter function from
528
+ * the global app state.
529
+ * @returns {function} The set component props function
530
+ * in the `useViewInfoStore` store.
531
+ */
532
+ export function useChangeLayout() {
533
+ return useViewConfigStore(state => state.changeLayout);
534
+ }
535
+
536
+ /**
537
+ * Obtain the loaders setter function from
538
+ * the global app state.
539
+ * @returns {function} The loaders setter function
540
+ * in the `useViewConfigStore` store.
541
+ */
542
+ export function useSetLoaders() {
543
+ return useViewConfigStore(state => state.setLoaders);
544
+ }
545
+
546
+ /**
547
+ * Obtain the view config setter function from
548
+ * the global app state.
549
+ * @returns {function} The view config setter function
550
+ * in the `useViewConfigStore` store.
551
+ */
552
+ export function useSetViewConfig(viewConfigStoreApi) {
553
+ const setViewConfigRef = useRef(viewConfigStoreApi.getState().setViewConfig);
554
+ const setViewConfig = setViewConfigRef.current;
555
+ return setViewConfig;
556
+ }
557
+
558
+ /**
559
+ * Obtain the component hover value from
560
+ * the global app state.
561
+ * @returns {number} The hovered component ID
562
+ * in the `useHoverStore` store.
563
+ */
564
+ export function useComponentHover() {
565
+ return useHoverStore(state => state.componentHover);
566
+ }
567
+
568
+ /**
569
+ * Obtain the component hover setter function from
570
+ * the global app state.
571
+ * @returns {function} The component hover setter function
572
+ * in the `useHoverStore` store.
573
+ */
574
+ export function useSetComponentHover() {
575
+ return useHoverStore(state => state.setComponentHover);
576
+ }
577
+
578
+ /**
579
+ * Obtain the warning message from
580
+ * the global app state.
581
+ * @returns {string} The warning message
582
+ * in the `useWarnStore` store.
583
+ */
584
+ export function useWarning() {
585
+ return useWarnStore(state => state.warning);
586
+ }
587
+
588
+ /**
589
+ * Obtain the warning setter function from
590
+ * the global app state.
591
+ * @returns {function} The warning setter function
592
+ * in the `useWarnStore` store.
593
+ */
594
+ export function useSetWarning() {
595
+ return useWarnStore(state => state.setWarning);
596
+ }
597
+
598
+ /**
599
+ * Obtain the component view info value from
600
+ * the global app state.
601
+ * @returns {object} The view info object for the component
602
+ * in the `useViewInfoStore` store.
603
+ */
604
+ export function useComponentViewInfo(uuid) {
605
+ return useViewInfoStore(useCallback(state => state.viewInfo[uuid], [uuid]));
606
+ }
607
+
608
+ /**
609
+ * Obtain the component view info setter function from
610
+ * the global app state.
611
+ * @returns {function} The component view info setter function
612
+ * in the `useViewInfoStore` store.
613
+ */
614
+ export function useSetComponentViewInfo(uuid) {
615
+ const setViewInfoRef = useRef(useViewInfoStore.getState().setComponentViewInfo);
616
+ const setComponentViewInfo = useCallback(
617
+ viewInfo => setViewInfoRef.current(uuid, viewInfo),
618
+ [uuid],
619
+ );
620
+ return setComponentViewInfo;
621
+ }
622
+
623
+ /**
624
+ * Obtain the grid resize count value
625
+ * from the global app state.
626
+ * @returns {number} The grid resize increment value.
627
+ */
628
+ export function useGridResize() {
629
+ return useGridSizeStore(state => state.resizeCount);
630
+ }
631
+
632
+ /**
633
+ * Obtain the grid resize count increment function
634
+ * from the global app state.
635
+ * @returns {function} The grid resize count increment
636
+ * function.
637
+ */
638
+ export function useEmitGridResize() {
639
+ return useGridSizeStore(state => state.incrementResizeCount);
640
+ }
@@ -0,0 +1,73 @@
1
+ import { makeStyles } from '@material-ui/core';
2
+
3
+ export const useTitleStyles = makeStyles(theme => ({
4
+ title: {
5
+ color: theme.palette.primaryForeground,
6
+ overflowX: 'hidden',
7
+ display: 'flex',
8
+ flexDirection: 'row',
9
+ flexShrink: '0',
10
+ },
11
+ titleLeft: {
12
+ flexShrink: '1',
13
+ textOverflow: 'ellipsis',
14
+ whiteSpace: 'nowrap',
15
+ },
16
+ titleInfo: {
17
+ width: '100%',
18
+ textOverflow: 'ellipsis',
19
+ whiteSpace: 'nowrap',
20
+ overflow: 'hidden',
21
+ fontSize: '80% !important',
22
+ opacity: '.8',
23
+ padding: '0 4px',
24
+ justifyContent: 'center',
25
+ lineHeight: '25px !important',
26
+ flexShrink: '1',
27
+ textAlign: 'right !important',
28
+ },
29
+ titleButtons: {
30
+ display: 'flex',
31
+ flexDirection: 'row',
32
+ flexGrow: '1',
33
+ flexShrink: '0',
34
+ justifyContent: 'right',
35
+ '& div': {
36
+ display: 'inline-block',
37
+ },
38
+ },
39
+ card: {
40
+ border: `1px solid ${theme.palette.cardBorder}`,
41
+ flex: '1 1 auto',
42
+ minHeight: '1px',
43
+ padding: '12px',
44
+ marginTop: '8px',
45
+ marginBottom: '8px',
46
+ position: 'relative',
47
+ display: 'flex',
48
+ flexDirection: 'column',
49
+ minWidth: '0',
50
+ wordWrap: 'break-word',
51
+ backgroundClip: 'border-box',
52
+ borderRadius: '4px',
53
+ },
54
+ noScrollCard: {
55
+ backgroundColor: theme.palette.secondaryBackground,
56
+ color: theme.palette.secondaryForeground,
57
+ },
58
+ scrollCard: {
59
+ backgroundColor: theme.palette.primaryBackground,
60
+ color: theme.palette.primaryForeground,
61
+ '& a': {
62
+ color: theme.palette.primaryForegroundActive,
63
+ },
64
+ overflowY: 'auto',
65
+ },
66
+ spatialCard: {
67
+ backgroundColor: theme.palette.black,
68
+ color: theme.palette.white,
69
+ '& a': {
70
+ color: theme.palette.white,
71
+ },
72
+ },
73
+ }));