@aics/vole-app 3.4.4 → 3.6.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 (72) hide show
  1. package/es/aics-image-viewer/components/App/index.js +15 -5
  2. package/es/aics-image-viewer/components/ChannelsWidget.js +3 -1
  3. package/es/aics-image-viewer/components/ChannelsWidgetRow.js +29 -16
  4. package/es/aics-image-viewer/components/ColorPicker/index.js +9 -1
  5. package/es/aics-image-viewer/components/ControlPanel/CopySettingsButton.js +445 -0
  6. package/es/aics-image-viewer/components/ControlPanel/index.js +16 -5
  7. package/es/aics-image-viewer/components/ControlPanel/styles.css +29 -2
  8. package/es/aics-image-viewer/components/StyleProvider/index.js +17 -2
  9. package/es/aics-image-viewer/components/Toolbar/ViewModeRadioButtons.js +1 -1
  10. package/es/aics-image-viewer/components/Toolbar/index.js +1 -1
  11. package/es/aics-image-viewer/components/Toolbar/styles.css +0 -10
  12. package/es/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/index.js +3 -2
  13. package/es/aics-image-viewer/components/dimension_sliders/AxisClipSliders.js +21 -8
  14. package/es/aics-image-viewer/components/dimension_sliders/RotationSliders.js +6 -8
  15. package/es/aics-image-viewer/components/dimension_sliders/SliderRows.js +8 -6
  16. package/es/aics-image-viewer/components/shared/ContextualAlert.js +101 -0
  17. package/es/aics-image-viewer/components/shared/ControlPanelRow/index.js +4 -2
  18. package/es/aics-image-viewer/components/shared/ControlPanelRow/styles.css +4 -3
  19. package/es/aics-image-viewer/components/useVolume.js +59 -25
  20. package/es/aics-image-viewer/shared/constants.js +25 -1
  21. package/es/aics-image-viewer/shared/types.js +1 -1
  22. package/es/aics-image-viewer/shared/utils/controlPointsToLut.js +4 -0
  23. package/es/aics-image-viewer/shared/utils/parseSnapshot.js +205 -0
  24. package/es/aics-image-viewer/shared/utils/{urlParsing.js → parseUrl.js} +55 -191
  25. package/es/aics-image-viewer/shared/utils/permissions.js +46 -0
  26. package/es/aics-image-viewer/shared/utils/test/camera.test.js +1 -2
  27. package/es/aics-image-viewer/shared/utils/test/{urlParsing.test.js → parseUrl.test.js} +28 -25
  28. package/es/aics-image-viewer/shared/utils/test/storage.test.js +2 -2
  29. package/es/aics-image-viewer/shared/utils/test/viewerChannelSettings.test.js +1 -1
  30. package/es/aics-image-viewer/state/deserialize.js +443 -331
  31. package/es/aics-image-viewer/state/reset.js +1 -1
  32. package/es/aics-image-viewer/state/serialize.js +168 -78
  33. package/es/aics-image-viewer/state/subscribers.js +1 -1
  34. package/es/aics-image-viewer/state/test/deserialize.test.js +63 -77
  35. package/es/aics-image-viewer/state/test/reset.test.js +2 -2
  36. package/es/aics-image-viewer/state/test/serialize.test.js +42 -43
  37. package/es/aics-image-viewer/state/test/test_data.js +119 -1
  38. package/es/aics-image-viewer/state/types.js +157 -245
  39. package/es/aics-image-viewer/state/util.js +39 -1
  40. package/es/index.js +4 -2
  41. package/package.json +26 -44
  42. package/type-declarations/aics-image-viewer/components/App/types.d.ts +3 -3
  43. package/type-declarations/aics-image-viewer/components/ChannelsWidget.d.ts +3 -0
  44. package/type-declarations/aics-image-viewer/components/ChannelsWidgetRow.d.ts +3 -0
  45. package/type-declarations/aics-image-viewer/components/ControlPanel/CopySettingsButton.d.ts +11 -0
  46. package/type-declarations/aics-image-viewer/components/Toolbar/ViewModeRadioButtons.d.ts +1 -1
  47. package/type-declarations/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/index.d.ts +4 -3
  48. package/type-declarations/aics-image-viewer/components/dimension_sliders/AxisClipSliders.d.ts +7 -6
  49. package/type-declarations/aics-image-viewer/components/dimension_sliders/SliderRows.d.ts +1 -2
  50. package/type-declarations/aics-image-viewer/components/shared/ContextualAlert.d.ts +29 -0
  51. package/type-declarations/aics-image-viewer/components/shared/ControlPanelRow/index.d.ts +1 -0
  52. package/type-declarations/aics-image-viewer/components/useVolume.d.ts +3 -0
  53. package/type-declarations/aics-image-viewer/shared/constants.d.ts +2 -2
  54. package/type-declarations/aics-image-viewer/shared/types.d.ts +2 -2
  55. package/type-declarations/aics-image-viewer/shared/utils/controlPointsToLut.d.ts +1 -1
  56. package/type-declarations/aics-image-viewer/shared/utils/parseSnapshot.d.ts +49 -0
  57. package/type-declarations/aics-image-viewer/shared/utils/{urlParsing.d.ts → parseUrl.d.ts} +3 -24
  58. package/type-declarations/aics-image-viewer/shared/utils/permissions.d.ts +7 -0
  59. package/type-declarations/aics-image-viewer/shared/utils/viewerChannelSettings.d.ts +1 -1
  60. package/type-declarations/aics-image-viewer/state/deserialize.d.ts +70 -35
  61. package/type-declarations/aics-image-viewer/state/reset.d.ts +1 -1
  62. package/type-declarations/aics-image-viewer/state/serialize.d.ts +44 -10
  63. package/type-declarations/aics-image-viewer/state/types.d.ts +265 -159
  64. package/type-declarations/aics-image-viewer/state/util.d.ts +3 -1
  65. package/type-declarations/index.d.ts +5 -3
  66. package/es/Globals.d.js +0 -0
  67. package/es/aics-image-viewer/shared/enums.js +0 -18
  68. package/es/aics-image-viewer/shared/utils/firebase/index.js +0 -109
  69. package/type-declarations/aics-image-viewer/shared/enums.d.ts +0 -15
  70. package/type-declarations/aics-image-viewer/shared/utils/firebase/index.d.ts +0 -69
  71. package/type-declarations/aics-image-viewer/shared/utils/math.d.ts +0 -1
  72. /package/es/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/styles.css +0 -0
@@ -1,109 +0,0 @@
1
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
5
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
6
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
- // TODO: These types are shared with Cell Feature Explorer. Can they be moved to
11
- // a shared package?
12
-
13
- function isDevOrStagingSite(host) {
14
- // first condition is for testing with no client
15
- return !host || host.includes("localhost") || host.includes("staging") || host.includes("stg");
16
- }
17
- var FirebaseRequest = /*#__PURE__*/_createClass(
18
- // TODO: These properties are private and unused. Remove?
19
-
20
- function FirebaseRequest(firestore) {
21
- var _this = this;
22
- _classCallCheck(this, FirebaseRequest);
23
- _defineProperty(this, "getDoc", function (docPath) {
24
- return _this.firestore.doc(docPath).get();
25
- });
26
- _defineProperty(this, "getAvailableDatasets", function () {
27
- return _this.firestore.collection("dataset-descriptions").get().then(function (snapShot) {
28
- var datasets = [];
29
- snapShot.forEach(function (doc) {
30
- var metadata = doc.data();
31
- /** if running the site in a local development env or on staging.cfe.allencell.org
32
- * include all cards, otherwise, only include cards with a production flag.
33
- * this is based on hostname instead of a build time variable so we don't
34
- * need a separate build for staging and production
35
- */
36
-
37
- if (isDevOrStagingSite(location.hostname)) {
38
- datasets.push(metadata);
39
- } else if (metadata.production) {
40
- datasets.push(metadata);
41
- }
42
- });
43
- return datasets;
44
- });
45
- });
46
- _defineProperty(this, "setCollectionRef", function (id) {
47
- _this.collectionRef = _this.firestore.collection("cfe-datasets").doc(id);
48
- });
49
- _defineProperty(this, "getManifest", function (ref) {
50
- return _this.firestore.doc(ref).get().then(function (manifestDoc) {
51
- return manifestDoc.data();
52
- });
53
- });
54
- _defineProperty(this, "selectDataset", function (ref) {
55
- return _this.getManifest(ref).then(function (data) {
56
- _this.featuresDataPath = data.featuresDataPath;
57
- _this.thumbnailRoot = data.thumbnailRoot;
58
- _this.downloadRoot = data.downloadRoot;
59
- _this.volumeViewerDataRoot = data.volumeViewerDataRoot;
60
- _this.featuresDisplayOrder = data.featuresDisplayOrder;
61
- _this.cellLineDataPath = data.cellLineDataPath;
62
- _this.fileInfoPath = data.fileInfoPath;
63
- _this.featuresDataOrder = data.featuresDataOrder;
64
- _this.featureDefsPath = data.featureDefsPath;
65
- _this.albumPath = data.albumPath;
66
- return _objectSpread({}, data);
67
- });
68
- });
69
- _defineProperty(this, "getFileInfoByCellId", function (cellId) {
70
- return _this.getDoc("".concat(_this.fileInfoPath, "/").concat(cellId)).then(function (doc) {
71
- var data = doc.data();
72
- if (!data) {
73
- return;
74
- }
75
- return _objectSpread(_objectSpread({}, data), {}, {
76
- CellId: data.CellId.toString(),
77
- FOVId: data.FOVId.toString()
78
- });
79
- });
80
- });
81
- _defineProperty(this, "getFileInfoByArrayOfCellIds", function (cellIds) {
82
- return Promise.all(cellIds.map(function (id) {
83
- return _this.getDoc("".concat(_this.fileInfoPath, "/").concat(id)).then(function (doc) {
84
- var data = doc.data();
85
- if (!data) {
86
- return;
87
- }
88
- return _objectSpread(_objectSpread({}, data), {}, {
89
- CellId: data.CellId.toString(),
90
- FOVId: data.FOVId.toString()
91
- });
92
- });
93
- }));
94
- });
95
- this.firestore = firestore;
96
- this.featuresDataPath = "";
97
- this.cellLineDataPath = "";
98
- this.thumbnailRoot = "";
99
- this.downloadRoot = "";
100
- this.volumeViewerDataRoot = "";
101
- this.featuresDisplayOrder = [];
102
- this.fileInfoPath = "";
103
- this.datasetId = "";
104
- this.featuresDataOrder = [];
105
- this.albumPath = "";
106
- this.featureDefsPath = "";
107
- this.collectionRef = firestore.collection("cfe-datasets").doc("v1");
108
- });
109
- export default FirebaseRequest;
@@ -1,15 +0,0 @@
1
- export declare enum ViewMode {
2
- threeD = "3D",
3
- xy = "XY",
4
- xz = "XZ",
5
- yz = "YZ"
6
- }
7
- export declare enum RenderMode {
8
- volumetric = "volumetric",
9
- maxProject = "maxproject",
10
- pathTrace = "pathtrace"
11
- }
12
- export declare enum ImageType {
13
- segmentedCell = "cell",
14
- fullField = "fov"
15
- }
@@ -1,69 +0,0 @@
1
- import type { DocumentData, FirebaseFirestore } from "@firebase/firestore-types";
2
- export interface DatasetMetaData {
3
- name: string;
4
- version: string;
5
- datasets?: {
6
- [key: string]: DatasetMetaData;
7
- };
8
- id: string;
9
- description: string;
10
- image: string;
11
- link?: string;
12
- manifest?: string;
13
- production?: boolean;
14
- userData: {
15
- isNew: boolean;
16
- inReview: boolean;
17
- totalTaggedStructures: number;
18
- totalCells: number;
19
- totalFOVs: number;
20
- };
21
- }
22
- export interface FileInfo {
23
- CellId: string;
24
- CellLineName: string;
25
- FOVId: string;
26
- structureProteinName: string;
27
- fovThumbnailPath: string;
28
- fovVolumeviewerPath: string;
29
- thumbnailPath: string;
30
- volumeviewerPath: string;
31
- }
32
- interface ManifestDocumentData extends DocumentData {
33
- featuresDataPath: string;
34
- cellLineDataPath: string;
35
- thumbnailRoot: string;
36
- downloadRoot: string;
37
- volumeViewerDataRoot: string;
38
- featuresDisplayOrder: string[];
39
- defaultXAxis: string;
40
- defaultYAxis: string;
41
- fileInfoPath: string;
42
- featuresDataOrder: string[];
43
- albumPath: string;
44
- featureDefsPath: string;
45
- }
46
- declare class FirebaseRequest {
47
- private firestore;
48
- private fileInfoPath;
49
- private collectionRef;
50
- private featuresDataPath;
51
- private cellLineDataPath;
52
- private thumbnailRoot;
53
- private downloadRoot;
54
- private volumeViewerDataRoot;
55
- private featuresDisplayOrder;
56
- private datasetId;
57
- private featuresDataOrder;
58
- private albumPath;
59
- private featureDefsPath;
60
- constructor(firestore: FirebaseFirestore);
61
- private getDoc;
62
- getAvailableDatasets: () => Promise<DatasetMetaData[]>;
63
- setCollectionRef: (id: string) => void;
64
- private getManifest;
65
- selectDataset: (ref: string) => Promise<ManifestDocumentData>;
66
- getFileInfoByCellId: (cellId: string) => Promise<FileInfo | undefined>;
67
- getFileInfoByArrayOfCellIds: (cellIds: string[]) => Promise<(FileInfo | undefined)[]>;
68
- }
69
- export default FirebaseRequest;
@@ -1 +0,0 @@
1
- export declare function clamp(value: number, min: number, max: number): number;