@vitessce/layer-controller 3.2.0 → 3.2.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.
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { B as BaseDecoder } from "./index-64da21ec.js";
2
+ import { B as BaseDecoder } from "./index-f8a9f462.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
- import React__default, { Children, isValidElement, cloneElement, useState, useEffect, useCallback, useId, useRef, forwardRef } from "react";
2
+ import React__default, { Children, isValidElement, cloneElement, useState, useEffect, useCallback, useContext, useRef, forwardRef } from "react";
3
3
  import { PopperMenu, TitleInfo, useLoaders, useCoordination, useAuxiliaryCoordination, useComponentLayout, useClosestVitessceContainerSize, useWindowDimensions, useObsLocationsData, useObsSegmentationsData, useImageData, useReady } from "@vitessce/vit-s";
4
4
  import * as ReactDOM from "react-dom";
5
5
  import ReactDOM__default from "react-dom";
@@ -135596,16 +135596,16 @@ function addDecoder(cases, importFn) {
135596
135596
  }
135597
135597
  cases.forEach((c) => registry$1.set(c, importFn));
135598
135598
  }
135599
- addDecoder([void 0, 1], () => import("./raw-0ae87697.js").then((m) => m.default));
135600
- addDecoder(5, () => import("./lzw-f5a9e721.js").then((m) => m.default));
135599
+ addDecoder([void 0, 1], () => import("./raw-dd52cf7d.js").then((m) => m.default));
135600
+ addDecoder(5, () => import("./lzw-3b2cc6cd.js").then((m) => m.default));
135601
135601
  addDecoder(6, () => {
135602
135602
  throw new Error("old style JPEG compression is not supported.");
135603
135603
  });
135604
- addDecoder(7, () => import("./jpeg-29889288.js").then((m) => m.default));
135605
- addDecoder([8, 32946], () => import("./deflate-4152c8e9.js").then((m) => m.default));
135606
- addDecoder(32773, () => import("./packbits-5fc9c646.js").then((m) => m.default));
135607
- addDecoder(34887, () => import("./lerc-899a010f.js").then((m) => m.default));
135608
- addDecoder(50001, () => import("./webimage-1731afb4.js").then((m) => m.default));
135604
+ addDecoder(7, () => import("./jpeg-932c57f1.js").then((m) => m.default));
135605
+ addDecoder([8, 32946], () => import("./deflate-22ea8fc3.js").then((m) => m.default));
135606
+ addDecoder(32773, () => import("./packbits-c8220e7f.js").then((m) => m.default));
135607
+ addDecoder(34887, () => import("./lerc-0db1b156.js").then((m) => m.default));
135608
+ addDecoder(50001, () => import("./webimage-d7166a5a.js").then((m) => m.default));
135609
135609
  function decodeRowAcc(row, stride) {
135610
135610
  let length2 = row.length - stride;
135611
135611
  let offset4 = 0;
@@ -147770,6 +147770,132 @@ function VectorLayerController(props2) {
147770
147770
  ] })
147771
147771
  ] }) });
147772
147772
  }
147773
+ const $b5e257d569688ac6$var$defaultContext = {
147774
+ prefix: String(Math.round(Math.random() * 1e10)),
147775
+ current: 0
147776
+ };
147777
+ const $b5e257d569688ac6$var$SSRContext = /* @__PURE__ */ React__default.createContext($b5e257d569688ac6$var$defaultContext);
147778
+ const $b5e257d569688ac6$var$IsSSRContext = /* @__PURE__ */ React__default.createContext(false);
147779
+ let $b5e257d569688ac6$var$canUseDOM = Boolean(typeof window !== "undefined" && window.document && window.document.createElement);
147780
+ let $b5e257d569688ac6$var$componentIds = /* @__PURE__ */ new WeakMap();
147781
+ function $b5e257d569688ac6$var$useCounter(isDisabled = false) {
147782
+ let ctx = useContext($b5e257d569688ac6$var$SSRContext);
147783
+ let ref = useRef(null);
147784
+ if (ref.current === null && !isDisabled) {
147785
+ var _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner;
147786
+ let currentOwner = (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = React__default.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED === void 0 ? void 0 : (_React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner = _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner) === null || _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner === void 0 ? void 0 : _React___SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED_ReactCurrentOwner.current;
147787
+ if (currentOwner) {
147788
+ let prevComponentValue = $b5e257d569688ac6$var$componentIds.get(currentOwner);
147789
+ if (prevComponentValue == null)
147790
+ $b5e257d569688ac6$var$componentIds.set(currentOwner, {
147791
+ id: ctx.current,
147792
+ state: currentOwner.memoizedState
147793
+ });
147794
+ else if (currentOwner.memoizedState !== prevComponentValue.state) {
147795
+ ctx.current = prevComponentValue.id;
147796
+ $b5e257d569688ac6$var$componentIds.delete(currentOwner);
147797
+ }
147798
+ }
147799
+ ref.current = ++ctx.current;
147800
+ }
147801
+ return ref.current;
147802
+ }
147803
+ function $b5e257d569688ac6$var$useLegacySSRSafeId(defaultId) {
147804
+ let ctx = useContext($b5e257d569688ac6$var$SSRContext);
147805
+ if (ctx === $b5e257d569688ac6$var$defaultContext && !$b5e257d569688ac6$var$canUseDOM)
147806
+ console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
147807
+ let counter2 = $b5e257d569688ac6$var$useCounter(!!defaultId);
147808
+ let prefix2 = ctx === $b5e257d569688ac6$var$defaultContext && false ? "react-aria" : `react-aria${ctx.prefix}`;
147809
+ return defaultId || `${prefix2}-${counter2}`;
147810
+ }
147811
+ function $b5e257d569688ac6$var$useModernSSRSafeId(defaultId) {
147812
+ let id = React__default.useId();
147813
+ let [didSSR] = useState($b5e257d569688ac6$export$535bd6ca7f90a273());
147814
+ let prefix2 = didSSR || false ? "react-aria" : `react-aria${$b5e257d569688ac6$var$defaultContext.prefix}`;
147815
+ return defaultId || `${prefix2}-${id}`;
147816
+ }
147817
+ const $b5e257d569688ac6$export$619500959fc48b26 = typeof React__default["useId"] === "function" ? $b5e257d569688ac6$var$useModernSSRSafeId : $b5e257d569688ac6$var$useLegacySSRSafeId;
147818
+ function $b5e257d569688ac6$var$getSnapshot() {
147819
+ return false;
147820
+ }
147821
+ function $b5e257d569688ac6$var$getServerSnapshot() {
147822
+ return true;
147823
+ }
147824
+ function $b5e257d569688ac6$var$subscribe(onStoreChange) {
147825
+ return () => {
147826
+ };
147827
+ }
147828
+ function $b5e257d569688ac6$export$535bd6ca7f90a273() {
147829
+ if (typeof React__default["useSyncExternalStore"] === "function")
147830
+ return React__default["useSyncExternalStore"]($b5e257d569688ac6$var$subscribe, $b5e257d569688ac6$var$getSnapshot, $b5e257d569688ac6$var$getServerSnapshot);
147831
+ return useContext($b5e257d569688ac6$var$IsSSRContext);
147832
+ }
147833
+ const $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c = typeof document !== "undefined" ? React__default.useLayoutEffect : () => {
147834
+ };
147835
+ let $bdb11010cef70236$var$idsUpdaterMap = /* @__PURE__ */ new Map();
147836
+ function $bdb11010cef70236$export$f680877a34711e37(defaultId) {
147837
+ let [value, setValue] = useState(defaultId);
147838
+ let nextId = useRef(null);
147839
+ let res = $b5e257d569688ac6$export$619500959fc48b26(value);
147840
+ let updateValue = useCallback((val) => {
147841
+ nextId.current = val;
147842
+ }, []);
147843
+ $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue);
147844
+ $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
147845
+ let r2 = res;
147846
+ return () => {
147847
+ $bdb11010cef70236$var$idsUpdaterMap.delete(r2);
147848
+ };
147849
+ }, [
147850
+ res
147851
+ ]);
147852
+ useEffect(() => {
147853
+ let newId = nextId.current;
147854
+ if (newId) {
147855
+ nextId.current = null;
147856
+ setValue(newId);
147857
+ }
147858
+ });
147859
+ return res;
147860
+ }
147861
+ let $bbed8b41f857bcc0$var$transitionsByElement = /* @__PURE__ */ new Map();
147862
+ let $bbed8b41f857bcc0$var$transitionCallbacks = /* @__PURE__ */ new Set();
147863
+ function $bbed8b41f857bcc0$var$setupGlobalEvents() {
147864
+ if (typeof window === "undefined")
147865
+ return;
147866
+ let onTransitionStart = (e2) => {
147867
+ let transitions2 = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
147868
+ if (!transitions2) {
147869
+ transitions2 = /* @__PURE__ */ new Set();
147870
+ $bbed8b41f857bcc0$var$transitionsByElement.set(e2.target, transitions2);
147871
+ e2.target.addEventListener("transitioncancel", onTransitionEnd);
147872
+ }
147873
+ transitions2.add(e2.propertyName);
147874
+ };
147875
+ let onTransitionEnd = (e2) => {
147876
+ let properties = $bbed8b41f857bcc0$var$transitionsByElement.get(e2.target);
147877
+ if (!properties)
147878
+ return;
147879
+ properties.delete(e2.propertyName);
147880
+ if (properties.size === 0) {
147881
+ e2.target.removeEventListener("transitioncancel", onTransitionEnd);
147882
+ $bbed8b41f857bcc0$var$transitionsByElement.delete(e2.target);
147883
+ }
147884
+ if ($bbed8b41f857bcc0$var$transitionsByElement.size === 0) {
147885
+ for (let cb of $bbed8b41f857bcc0$var$transitionCallbacks)
147886
+ cb();
147887
+ $bbed8b41f857bcc0$var$transitionCallbacks.clear();
147888
+ }
147889
+ };
147890
+ document.body.addEventListener("transitionrun", onTransitionStart);
147891
+ document.body.addEventListener("transitionend", onTransitionEnd);
147892
+ }
147893
+ if (typeof document !== "undefined") {
147894
+ if (document.readyState !== "loading")
147895
+ $bbed8b41f857bcc0$var$setupGlobalEvents();
147896
+ else
147897
+ document.addEventListener("DOMContentLoaded", $bbed8b41f857bcc0$var$setupGlobalEvents);
147898
+ }
147773
147899
  const DOMAIN_OPTIONS = ["Full", "Min/Max"];
147774
147900
  function VolumeDropdown({
147775
147901
  loader: loaderWithMeta,
@@ -148047,11 +148173,11 @@ function LayerOptions({
148047
148173
  const hasViewableResolutions = Boolean(Array.from({
148048
148174
  length: loader.data.length
148049
148175
  }).filter((_, res) => canLoadResolution(loader.data, res)).length);
148050
- const globalSelectionSliderId = useId();
148051
- const colormapSelectId = useId();
148052
- const domainSelectorId = useId();
148053
- const opacitySliderId = useId();
148054
- const zeroTransparentId = useId();
148176
+ const globalSelectionSliderId = $bdb11010cef70236$export$f680877a34711e37();
148177
+ const colormapSelectId = $bdb11010cef70236$export$f680877a34711e37();
148178
+ const domainSelectorId = $bdb11010cef70236$export$f680877a34711e37();
148179
+ const opacitySliderId = $bdb11010cef70236$export$f680877a34711e37();
148180
+ const zeroTransparentId = $bdb11010cef70236$export$f680877a34711e37();
148055
148181
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Grid$1, { container: true, direction: "column", style: { width: "100%" }, children: [
148056
148182
  hasZStack && !disable3d && hasViewableResolutions && /* @__PURE__ */ jsxRuntimeExports.jsx(
148057
148183
  VolumeDropdown,
@@ -148421,7 +148547,7 @@ function LayerController(props2) {
148421
148547
  channelRef.current = channels2;
148422
148548
  return void 0;
148423
148549
  }, [channels2]);
148424
- const layerControlsId = useId();
148550
+ const layerControlsId = $bdb11010cef70236$export$f680877a34711e37();
148425
148551
  const firstSelection = ((_a2 = channels2[0]) == null ? void 0 : _a2.selection) || {};
148426
148552
  const { data, channels: channelOptions } = loader;
148427
148553
  const [tab, setTab] = useState(0);
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, L, V, d, c, e, f, b, h, u } from "./index-64da21ec.js";
1
+ import { a, L, V, d, c, e, f, b, h, u } from "./index-f8a9f462.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-64da21ec.js";
1
+ import { B as BaseDecoder } from "./index-f8a9f462.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,5 +1,5 @@
1
1
  import { i as inflate_1 } from "./pako.esm-68f84e2a.js";
2
- import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-64da21ec.js";
2
+ import { g as getDefaultExportFromCjs, B as BaseDecoder } from "./index-f8a9f462.js";
3
3
  import "react";
4
4
  import "@vitessce/vit-s";
5
5
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-64da21ec.js";
1
+ import { B as BaseDecoder } from "./index-f8a9f462.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-64da21ec.js";
1
+ import { B as BaseDecoder } from "./index-f8a9f462.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-64da21ec.js";
1
+ import { B as BaseDecoder } from "./index-f8a9f462.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1,4 +1,4 @@
1
- import { B as BaseDecoder } from "./index-64da21ec.js";
1
+ import { B as BaseDecoder } from "./index-f8a9f462.js";
2
2
  import "react";
3
3
  import "@vitessce/vit-s";
4
4
  import "react-dom";
@@ -1 +1 @@
1
- {"version":3,"file":"LayerController.d.ts","sourceRoot":"","sources":["../src/LayerController.js"],"names":[],"mappings":"AA4EA;;;;;;;GAOG;AACH,iEAuhBC"}
1
+ {"version":3,"file":"LayerController.d.ts","sourceRoot":"","sources":["../src/LayerController.js"],"names":[],"mappings":"AA6EA;;;;;;;GAOG;AACH,iEAuhBC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React, { useState, useRef, useEffect, useId } from 'react';
2
+ import React, { useState, useRef, useEffect } from 'react';
3
+ import { useId } from 'react-aria';
3
4
  import { viv } from '@vitessce/gl';
4
5
  import { GLOBAL_LABELS, getSourceFromLoader, isRgb, getMultiSelectionStats, DOMAINS, canLoadResolution, } from '@vitessce/spatial-utils';
5
6
  import { Grid, Button, Slider, Tabs, Tab, InputLabel, Accordion, AccordionDetails, AccordionSummary, } from '@material-ui/core';
@@ -1 +1 @@
1
- {"version":3,"file":"LayerOptions.d.ts","sourceRoot":"","sources":["../src/LayerOptions.js"],"names":[],"mappings":";AA8UA;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyIC"}
1
+ {"version":3,"file":"LayerOptions.d.ts","sourceRoot":"","sources":["../src/LayerOptions.js"],"names":[],"mappings":";AA+UA;;;;;;;;;;;;;GAaG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyIC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import React, { useId } from 'react';
2
+ import React from 'react';
3
+ import { useId } from 'react-aria';
3
4
  import { range } from 'lodash-es';
4
5
  import { Matrix4 } from 'math.gl';
5
6
  import { Grid, Slider, InputLabel, Select, Checkbox } from '@material-ui/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/layer-controller",
3
- "version": "3.2.0",
3
+ "version": "3.2.1",
4
4
  "author": "Gehlenborg Lab",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -20,11 +20,12 @@
20
20
  "@material-ui/icons": "~4.11.2",
21
21
  "lodash-es": "^4.17.21",
22
22
  "math.gl": "^3.5.6",
23
- "@vitessce/constants-internal": "3.2.0",
24
- "@vitessce/gl": "3.2.0",
25
- "@vitessce/spatial-utils": "3.2.0",
26
- "@vitessce/utils": "3.2.0",
27
- "@vitessce/vit-s": "3.2.0"
23
+ "react-aria": "^3.28.0",
24
+ "@vitessce/constants-internal": "3.2.1",
25
+ "@vitessce/gl": "3.2.1",
26
+ "@vitessce/spatial-utils": "3.2.1",
27
+ "@vitessce/utils": "3.2.1",
28
+ "@vitessce/vit-s": "3.2.1"
28
29
  },
29
30
  "devDependencies": {
30
31
  "react": "^18.0.0",
@@ -1,4 +1,5 @@
1
- import React, { useState, useRef, useEffect, useId } from 'react';
1
+ import React, { useState, useRef, useEffect } from 'react';
2
+ import { useId } from 'react-aria';
2
3
  import { viv } from '@vitessce/gl';
3
4
  import {
4
5
  GLOBAL_LABELS,
@@ -1,4 +1,5 @@
1
- import React, { useId } from 'react';
1
+ import React from 'react';
2
+ import { useId } from 'react-aria';
2
3
  import { range } from 'lodash-es';
3
4
  import { Matrix4 } from 'math.gl';
4
5
  import { Grid, Slider, InputLabel, Select, Checkbox } from '@material-ui/core';