@vitessce/vit-s 4.0.8 → 4.0.9

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.
package/dist/index.js CHANGED
@@ -3291,7 +3291,7 @@ function requireReactIs() {
3291
3291
  return reactIs.exports;
3292
3292
  }
3293
3293
  var reactIsExports = /* @__PURE__ */ requireReactIs();
3294
- function isPlainObject$1(item) {
3294
+ function isPlainObject$2(item) {
3295
3295
  if (typeof item !== "object" || item === null) {
3296
3296
  return false;
3297
3297
  }
@@ -3299,7 +3299,7 @@ function isPlainObject$1(item) {
3299
3299
  return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
3300
3300
  }
3301
3301
  function deepClone(source) {
3302
- if (/* @__PURE__ */ React$1.isValidElement(source) || reactIsExports.isValidElementType(source) || !isPlainObject$1(source)) {
3302
+ if (/* @__PURE__ */ React$1.isValidElement(source) || reactIsExports.isValidElementType(source) || !isPlainObject$2(source)) {
3303
3303
  return source;
3304
3304
  }
3305
3305
  const output = {};
@@ -3314,15 +3314,15 @@ function deepmerge(target, source, options = {
3314
3314
  const output = options.clone ? {
3315
3315
  ...target
3316
3316
  } : target;
3317
- if (isPlainObject$1(target) && isPlainObject$1(source)) {
3317
+ if (isPlainObject$2(target) && isPlainObject$2(source)) {
3318
3318
  Object.keys(source).forEach((key) => {
3319
3319
  if (/* @__PURE__ */ React$1.isValidElement(source[key]) || reactIsExports.isValidElementType(source[key])) {
3320
3320
  output[key] = source[key];
3321
- } else if (isPlainObject$1(source[key]) && // Avoid prototype pollution
3322
- Object.prototype.hasOwnProperty.call(target, key) && isPlainObject$1(target[key])) {
3321
+ } else if (isPlainObject$2(source[key]) && // Avoid prototype pollution
3322
+ Object.prototype.hasOwnProperty.call(target, key) && isPlainObject$2(target[key])) {
3323
3323
  output[key] = deepmerge(target[key], source[key], options);
3324
3324
  } else if (options.clone) {
3325
- output[key] = isPlainObject$1(source[key]) ? deepClone(source[key]) : source[key];
3325
+ output[key] = isPlainObject$2(source[key]) ? deepClone(source[key]) : source[key];
3326
3326
  } else {
3327
3327
  output[key] = source[key];
3328
3328
  }
@@ -4537,7 +4537,7 @@ function extendSxProp$1(props) {
4537
4537
  } else if (typeof inSx === "function") {
4538
4538
  finalSx = (...args) => {
4539
4539
  const result = inSx(...args);
4540
- if (!isPlainObject$1(result)) {
4540
+ if (!isPlainObject$2(result)) {
4541
4541
  return systemProps;
4542
4542
  }
4543
4543
  return {
@@ -4804,7 +4804,7 @@ function createStyled2(input = {}) {
4804
4804
  return processStyle(props, style2);
4805
4805
  };
4806
4806
  }
4807
- if (isPlainObject$1(style2)) {
4807
+ if (isPlainObject$2(style2)) {
4808
4808
  const serialized = preprocessStyles(style2);
4809
4809
  if (!serialized.variants) {
4810
4810
  return serialized.style;
@@ -6900,7 +6900,7 @@ const zIndex = {
6900
6900
  tooltip: 1500
6901
6901
  };
6902
6902
  function isSerializable(val) {
6903
- return isPlainObject$1(val) || typeof val === "undefined" || typeof val === "string" || typeof val === "boolean" || typeof val === "number" || Array.isArray(val);
6903
+ return isPlainObject$2(val) || typeof val === "undefined" || typeof val === "string" || typeof val === "boolean" || typeof val === "number" || Array.isArray(val);
6904
6904
  }
6905
6905
  function stringifyTheme(baseTheme = {}) {
6906
6906
  const serializableTheme = {
@@ -6912,7 +6912,7 @@ function stringifyTheme(baseTheme = {}) {
6912
6912
  const [key, value] = array[index];
6913
6913
  if (!isSerializable(value) || key.startsWith("unstable_")) {
6914
6914
  delete object[key];
6915
- } else if (isPlainObject$1(value)) {
6915
+ } else if (isPlainObject$2(value)) {
6916
6916
  object[key] = {
6917
6917
  ...value
6918
6918
  };
@@ -21821,6 +21821,13 @@ const withConsolidatedMetadata = defineStoreExtension(async (store, opts = {}) =
21821
21821
  function extendStore(store, ...extensions) {
21822
21822
  return applyExtensions(store, extensions);
21823
21823
  }
21824
+ async function relaxedFetch(...args) {
21825
+ const response = await fetch(...args);
21826
+ if (response.status === 403) {
21827
+ return new Response(null, { status: 404 });
21828
+ }
21829
+ return response;
21830
+ }
21824
21831
  function transformEntriesForZipFileStore(entries) {
21825
21832
  const topLevelZarrDirectories = new Set(Object.keys(entries).map((k) => k.split("/")[0]).filter((firstPathItem) => firstPathItem?.endsWith(".zarr")));
21826
21833
  if (topLevelZarrDirectories.size === 0) {
@@ -21951,7 +21958,7 @@ function hashQueryKeyByOptions(queryKey, options) {
21951
21958
  function hashKey(queryKey) {
21952
21959
  return JSON.stringify(
21953
21960
  queryKey,
21954
- (_, val) => isPlainObject(val) ? Object.keys(val).sort().reduce((result, key) => {
21961
+ (_, val) => isPlainObject$1(val) ? Object.keys(val).sort().reduce((result, key) => {
21955
21962
  result[key] = val[key];
21956
21963
  return result;
21957
21964
  }, {}) : val
@@ -21974,7 +21981,7 @@ function replaceEqualDeep(a2, b) {
21974
21981
  return a2;
21975
21982
  }
21976
21983
  const array = isPlainArray(a2) && isPlainArray(b);
21977
- if (array || isPlainObject(a2) && isPlainObject(b)) {
21984
+ if (array || isPlainObject$1(a2) && isPlainObject$1(b)) {
21978
21985
  const aItems = array ? a2 : Object.keys(a2);
21979
21986
  const aSize = aItems.length;
21980
21987
  const bItems = array ? b : Object.keys(b);
@@ -22012,7 +22019,7 @@ function shallowEqualObjects(a2, b) {
22012
22019
  function isPlainArray(value) {
22013
22020
  return Array.isArray(value) && value.length === Object.keys(value).length;
22014
22021
  }
22015
- function isPlainObject(o2) {
22022
+ function isPlainObject$1(o2) {
22016
22023
  if (!hasObjectPrototype(o2)) {
22017
22024
  return false;
22018
22025
  }
@@ -29975,7 +29982,7 @@ const latestFileDefSchema = z.object({
29975
29982
  options: fileOptionsSchema.optional(),
29976
29983
  requestInit: requestInit.optional(),
29977
29984
  // New: file def can have coordinationValues.
29978
- coordinationValues: z.record(z.string()).optional()
29985
+ coordinationValues: z.record(z.any()).optional()
29979
29986
  });
29980
29987
  const datasetsSchema1_0_13 = z.array(z.object({
29981
29988
  uid: z.string(),
@@ -30006,7 +30013,8 @@ const configSchema1_0_16 = configSchema1_0_13.extend({
30006
30013
  h: z.number().int().optional(),
30007
30014
  // Updates coordinationScopes and coordinationScopesBy
30008
30015
  coordinationScopes: componentCoordinationScopes.optional(),
30009
- coordinationScopesBy: componentCoordinationScopesBy.optional()
30016
+ coordinationScopesBy: componentCoordinationScopesBy.optional(),
30017
+ coordinationValues: z.record(z.any()).optional()
30010
30018
  }))
30011
30019
  });
30012
30020
  const configSchema1_0_17 = configSchema1_0_16.extend({
@@ -30763,6 +30771,12 @@ function extent(values2, valueof) {
30763
30771
  }
30764
30772
  return [min2, max2];
30765
30773
  }
30774
+ function getAnnotationFrameCoordinationValues(annotationStory, annotationFrameIndex, viewUid) {
30775
+ if (typeof annotationFrameIndex !== "number") {
30776
+ return void 0;
30777
+ }
30778
+ return annotationStory?.frames?.[annotationFrameIndex]?.layout?.find((v) => v.uid === viewUid)?.coordinationValues;
30779
+ }
30766
30780
  configSchema1_0_0.shape.coordinationSpace.unwrap();
30767
30781
  configSchema1_0_0.shape.layout.element.shape.coordinationScopes.unwrap();
30768
30782
  function upgradeReplaceViewProp(prefix2, view, coordinationSpace) {
@@ -33261,7 +33275,8 @@ const ViewType$1 = {
33261
33275
  TREEMAP: "treemap",
33262
33276
  SAMPLE_SET_PAIR_MANAGER: "sampleSetPairManager",
33263
33277
  FEATURE_STATS_TABLE: "featureStatsTable",
33264
- SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector"
33278
+ SINGLE_OBS_SET_SELECTOR: "singleObsSetSelector",
33279
+ ANNOTATION_CONTROLLER: "annotationController"
33265
33280
  };
33266
33281
  const DataType$1 = {
33267
33282
  OBS_LABELS: "obsLabels",
@@ -33282,7 +33297,8 @@ const DataType$1 = {
33282
33297
  COMPARISON_METADATA: "comparisonMetadata",
33283
33298
  FEATURE_STATS: "featureStats",
33284
33299
  FEATURE_SET_STATS: "featureSetStats",
33285
- OBS_SET_STATS: "obsSetStats"
33300
+ OBS_SET_STATS: "obsSetStats",
33301
+ ANNOTATION_STORY: "annotationStory"
33286
33302
  };
33287
33303
  const AsyncFunctionType = {
33288
33304
  GET_TERM_MAPPING: "getTermMapping"
@@ -33307,6 +33323,7 @@ const FileType$1 = {
33307
33323
  OBS_SETS_CSV: "obsSets.csv",
33308
33324
  OBS_SETS_JSON: "obsSets.json",
33309
33325
  SAMPLE_SETS_CSV: "sampleSets.csv",
33326
+ ANNOTATION_STORY_JSON: "annotationStory.json",
33310
33327
  // OME-Zarr
33311
33328
  IMAGE_OME_ZARR: "image.ome-zarr",
33312
33329
  OBS_SEGMENTATIONS_OME_ZARR: "obsSegmentations.ome-zarr",
@@ -33591,7 +33608,15 @@ const CoordinationType$1 = {
33591
33608
  FEATURE_POINT_FOLD_CHANGE_THRESHOLD: "featurePointFoldChangeThreshold",
33592
33609
  FEATURE_LABEL_FOLD_CHANGE_THRESHOLD: "featureLabelFoldChangeThreshold",
33593
33610
  // Treemap
33594
- HIERARCHY_LEVELS: "hierarchyLevels"
33611
+ HIERARCHY_LEVELS: "hierarchyLevels",
33612
+ // Annotation frames
33613
+ ANNOTATION_STORY: "annotationStory",
33614
+ ANNOTATION_FRAME_INDEX: "annotationFrameIndex",
33615
+ ANNOTATION_SHAPES: "annotationShapes",
33616
+ ANNOTATION_OVERLAY_VISIBLE: "annotationOverlayVisible",
33617
+ ANNOTATION_TRANSITION_DURATION: "annotationTransitionDuration",
33618
+ ANNOTATION_SEMANTIC_ZOOM: "annotationSemanticZoom",
33619
+ ANNOTATION_EDITABLE: "annotationEditable"
33595
33620
  };
33596
33621
  const STATUS = {
33597
33622
  LOADING: "loading",
@@ -33612,6 +33637,7 @@ const STATUS = {
33612
33637
  [FileType$1.OBS_SEGMENTATIONS_JSON]: DataType$1.OBS_SEGMENTATIONS,
33613
33638
  [FileType$1.OBS_SETS_CSV]: DataType$1.OBS_SETS,
33614
33639
  [FileType$1.OBS_SETS_JSON]: DataType$1.OBS_SETS,
33640
+ [FileType$1.ANNOTATION_STORY_JSON]: DataType$1.ANNOTATION_STORY,
33615
33641
  [FileType$1.IMAGE_OME_ZARR]: DataType$1.IMAGE,
33616
33642
  [FileType$1.OBS_SEGMENTATIONS_OME_ZARR]: DataType$1.OBS_SEGMENTATIONS,
33617
33643
  [FileType$1.OBS_FEATURE_MATRIX_ANNDATA_ZARR]: DataType$1.OBS_FEATURE_MATRIX,
@@ -33734,7 +33760,8 @@ const DATA_TYPE_COORDINATION_VALUE_USAGE = {
33734
33760
  [DataType$1.OBS_SET_STATS]: [
33735
33761
  CoordinationType$1.OBS_TYPE
33736
33762
  // TODO: should sampleType, obsSetSelection, and/or sampleSetSelection be used here?
33737
- ]
33763
+ ],
33764
+ [DataType$1.ANNOTATION_STORY]: []
33738
33765
  };
33739
33766
  ({
33740
33767
  // For AnnData:
@@ -33867,7 +33894,9 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
33867
33894
  CoordinationType$1.SPATIAL_TARGET_Z,
33868
33895
  CoordinationType$1.SPATIAL_AXIS_FIXED,
33869
33896
  CoordinationType$1.SPATIAL_ORBIT_AXIS,
33870
- CoordinationType$1.FEATURE_AGGREGATION_STRATEGY
33897
+ CoordinationType$1.FEATURE_AGGREGATION_STRATEGY,
33898
+ // Annotation shapes are specific to a view's coordinate system.
33899
+ CoordinationType$1.ANNOTATION_SHAPES
33871
33900
  ];
33872
33901
  ({
33873
33902
  [ViewType$1.NEUROGLANCER]: [
@@ -33959,7 +33988,14 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
33959
33988
  CoordinationType$1.EMBEDDING_CONTOURS_FILLED,
33960
33989
  CoordinationType$1.EMBEDDING_CONTOUR_PERCENTILES,
33961
33990
  CoordinationType$1.CONTOUR_COLOR_ENCODING,
33962
- CoordinationType$1.CONTOUR_COLOR
33991
+ CoordinationType$1.CONTOUR_COLOR,
33992
+ CoordinationType$1.ANNOTATION_STORY,
33993
+ CoordinationType$1.ANNOTATION_SHAPES,
33994
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
33995
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
33996
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
33997
+ CoordinationType$1.ANNOTATION_EDITABLE,
33998
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
33963
33999
  ],
33964
34000
  [ViewType$1.DUAL_SCATTERPLOT]: [
33965
34001
  CoordinationType$1.DATASET,
@@ -34075,7 +34111,14 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
34075
34111
  CoordinationType$1.ADDITIONAL_OBS_SETS,
34076
34112
  CoordinationType$1.MOLECULE_HIGHLIGHT,
34077
34113
  CoordinationType$1.TOOLTIPS_VISIBLE,
34078
- CoordinationType$1.PHOTOMETRIC_INTERPRETATION
34114
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
34115
+ CoordinationType$1.ANNOTATION_STORY,
34116
+ CoordinationType$1.ANNOTATION_SHAPES,
34117
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
34118
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
34119
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
34120
+ CoordinationType$1.ANNOTATION_EDITABLE,
34121
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
34079
34122
  ],
34080
34123
  [ViewType$1.SPATIAL_BETA]: [
34081
34124
  CoordinationType$1.META_COORDINATION_SCOPES,
@@ -34153,7 +34196,27 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
34153
34196
  CoordinationType$1.SPATIAL_CHANNEL_LABELS_ORIENTATION,
34154
34197
  CoordinationType$1.SPATIAL_CHANNEL_LABEL_SIZE,
34155
34198
  CoordinationType$1.SPATIAL_CHANNELS_SORT_ORDER,
34156
- CoordinationType$1.PHOTOMETRIC_INTERPRETATION
34199
+ CoordinationType$1.PHOTOMETRIC_INTERPRETATION,
34200
+ CoordinationType$1.ANNOTATION_STORY,
34201
+ CoordinationType$1.ANNOTATION_SHAPES,
34202
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
34203
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
34204
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
34205
+ CoordinationType$1.ANNOTATION_EDITABLE,
34206
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
34207
+ ],
34208
+ [ViewType$1.ANNOTATION_CONTROLLER]: [
34209
+ CoordinationType$1.DATASET,
34210
+ CoordinationType$1.ANNOTATION_STORY,
34211
+ CoordinationType$1.ANNOTATION_FRAME_INDEX,
34212
+ CoordinationType$1.ANNOTATION_OVERLAY_VISIBLE,
34213
+ CoordinationType$1.ANNOTATION_TRANSITION_DURATION,
34214
+ CoordinationType$1.ANNOTATION_EDITABLE,
34215
+ CoordinationType$1.ANNOTATION_SEMANTIC_ZOOM
34216
+ // Note: the annotation controller also needs to read the coordination state
34217
+ // of all other views/coordination types via the full config.
34218
+ // Note: we get/set the CoordinationType.ANNOTATION_SHAPES from the full config,
34219
+ // as this info is view-specific rather than global to the story.
34157
34220
  ],
34158
34221
  [ViewType$1.HEATMAP]: [
34159
34222
  CoordinationType$1.DATASET,
@@ -34562,7 +34625,7 @@ const AUTO_INDEPENDENT_COORDINATION_TYPES = [
34562
34625
  CoordinationType$1.HIERARCHY_LEVELS
34563
34626
  ]
34564
34627
  });
34565
- const version = "4.0.8";
34628
+ const version = "4.0.9";
34566
34629
  const META_VERSION = {
34567
34630
  version
34568
34631
  };
@@ -34823,7 +34886,15 @@ function buildConfigSchema(pluginFileTypes, pluginJointFileTypes, pluginCoordina
34823
34886
  w: z.number().int().optional(),
34824
34887
  h: z.number().int().optional(),
34825
34888
  coordinationScopes: componentCoordinationScopes.optional(),
34826
- coordinationScopesBy: componentCoordinationScopesBy.optional()
34889
+ coordinationScopesBy: componentCoordinationScopesBy.optional(),
34890
+ coordinationValues: z.object(
34891
+ // For view-level coordinationValues, the value schemas are used directly
34892
+ // (there is no coordination scope name as an intermediary).
34893
+ Object.fromEntries(pluginCoordinationTypes.map((ct) => [
34894
+ ct.name,
34895
+ ct.valueSchema.optional()
34896
+ ]))
34897
+ ).describe("Mapping from coordination types to values, for values which do not need to be coordinated with other views. These take precedence over coordinationScopes.").optional()
34827
34898
  })).describe("The layout array defines the views, or components, rendered in the grid."),
34828
34899
  initStrategy: z.enum(["none", "auto"]).describe("The initialization strategy determines how missing coordination objects and coordination scope mappings are initially filled in.")
34829
34900
  });
@@ -35246,6 +35317,124 @@ z.object({
35246
35317
  radius: z.number(),
35247
35318
  opacity: z.number()
35248
35319
  });
35320
+ const shapeBaseObj = z.object({
35321
+ uid: z.string(),
35322
+ text: z.string().optional(),
35323
+ strokeColor: z.array(z.number()).length(3).optional(),
35324
+ strokeWidth: z.number().optional(),
35325
+ // SVG-style dash pattern, e.g. "10 5" or "10 20 30 10". "none" or omitted = solid.
35326
+ strokeDashArray: z.string().optional(),
35327
+ visible: z.boolean().optional()
35328
+ // TODO: define unit modes for x and y axes
35329
+ // ("pixels" vs "normalized" vs "physical" etc.)
35330
+ // TODO: a coordinate system identifier (e.g., "DeckGL" for now,
35331
+ // but a coordinate system from OME-NGFF/SpatialData eventually?)
35332
+ });
35333
+ const rectangleShapeObj = shapeBaseObj.extend({
35334
+ type: z.literal("rectangle"),
35335
+ // OME-XML field names verbatim (upper-left origin)
35336
+ x: z.number(),
35337
+ y: z.number(),
35338
+ width: z.number(),
35339
+ height: z.number(),
35340
+ fillColor: z.array(z.number()).length(3).optional(),
35341
+ fillOpacity: z.number().optional()
35342
+ });
35343
+ const lineShapeObj = shapeBaseObj.extend({
35344
+ type: z.literal("line"),
35345
+ // OME-XML field names verbatim
35346
+ x1: z.number(),
35347
+ y1: z.number(),
35348
+ x2: z.number(),
35349
+ y2: z.number(),
35350
+ markerStart: z.enum(["Arrow", "Tick"]).nullable().optional(),
35351
+ markerEnd: z.enum(["Arrow", "Tick"]).nullable().optional(),
35352
+ textPosition: z.enum(["start", "middle", "end"]).optional(),
35353
+ textBufferPx: z.number().optional()
35354
+ });
35355
+ const ellipseShapeObj = shapeBaseObj.extend({
35356
+ type: z.literal("ellipse"),
35357
+ // OME-XML field names verbatim (centre point + radii)
35358
+ x1: z.number(),
35359
+ y1: z.number(),
35360
+ radiusX: z.number(),
35361
+ radiusY: z.number(),
35362
+ fillColor: z.array(z.number()).length(3).optional(),
35363
+ fillOpacity: z.number().optional()
35364
+ });
35365
+ const polygonShapeObj = shapeBaseObj.extend({
35366
+ type: z.literal("polygon"),
35367
+ // OME-XML: array of [x, y] coordinate pairs, closed automatically
35368
+ points: z.array(z.tuple([z.number(), z.number()])),
35369
+ fillColor: z.array(z.number()).length(3).optional(),
35370
+ fillOpacity: z.number().optional()
35371
+ });
35372
+ const polylineShapeObj = shapeBaseObj.extend({
35373
+ type: z.literal("polyline"),
35374
+ // OME-XML: array of [x, y] coordinate pairs, open (not closed)
35375
+ points: z.array(z.tuple([z.number(), z.number()])),
35376
+ markerStart: z.enum(["Arrow", "Tick"]).nullable().optional(),
35377
+ markerEnd: z.enum(["Arrow", "Tick"]).nullable().optional()
35378
+ });
35379
+ const annotationShapeObj = z.discriminatedUnion("type", [
35380
+ rectangleShapeObj,
35381
+ lineShapeObj,
35382
+ ellipseShapeObj,
35383
+ polygonShapeObj,
35384
+ polylineShapeObj
35385
+ ]);
35386
+ z.array(annotationShapeObj);
35387
+ const annotationFrameObj = z.object({
35388
+ uid: z.string(),
35389
+ title: z.string().optional(),
35390
+ description: z.string().optional(),
35391
+ descriptionType: z.enum(["text", "markdown"]).optional(),
35392
+ // A frame can define per-view: coordinationValues
35393
+ // (if the view's state should not be coordinated with other views)
35394
+ // or per-view coordinationScopes/coordinationScopesBy
35395
+ // (if at this frame, the view should be coordinated with other views).
35396
+ // We can also define a frame-level coordination space,
35397
+ // which will be merged with the global coordination space.
35398
+ // TODO: datasets
35399
+ // TODO: coordinationSpace
35400
+ layout: z.array(
35401
+ // Note: for now, we will infer view objects which have a uid
35402
+ // that is present in the global layout, and do NOT have x/y/w/h defined,
35403
+ // to mean that in this frame, the layout and set of views is unchanged
35404
+ // from the global layout.
35405
+ // This will allow each frame to omit the full list of views from the layout,
35406
+ // and only specify the views whose coordination state is changing in this frame.
35407
+ // If a frame includes a view with a uid that is not present
35408
+ // in the global layout, then that view will be added to the layout at this frame.
35409
+ // This frame should also define x/y/w/h for all views,
35410
+ // since it will otherwise be ambiguous how to layout the updated set of views
35411
+ // for this frame.
35412
+ z.object({
35413
+ // The view UID. If this view uid is not present in the global layout,
35414
+ // it will be added to the layout at this frame,
35415
+ // and will need to have its coordination values initialized to their defaults
35416
+ // for any that were not fully specified.
35417
+ uid: z.string(),
35418
+ coordinationValues: z.record(
35419
+ z.string(),
35420
+ // The coordination type name, e.g. "embeddingType"
35421
+ z.any()
35422
+ ).optional()
35423
+ // TODO: support coordinationScopes/coordinationScopesBy for per-view coordination
35424
+ // at this frame.
35425
+ // TODO: view x/y/w/h once we support view layout changes per-frame.
35426
+ })
35427
+ ).optional()
35428
+ });
35429
+ z.object({
35430
+ // TODO: schema version for the story schema?
35431
+ // Same as current Vitessce schema version?
35432
+ uid: z.string(),
35433
+ title: z.string().optional(),
35434
+ description: z.string().optional(),
35435
+ descriptionType: z.enum(["text", "markdown"]).optional(),
35436
+ frames: z.array(annotationFrameObj)
35437
+ });
35249
35438
  class VitessceError extends Error {
35250
35439
  constructor(message) {
35251
35440
  super(message);
@@ -35678,8 +35867,10 @@ class VitessceConfigView {
35678
35867
  * @param {number} y The y-coordinate of the view in the layout.
35679
35868
  * @param {number} w The width of the view in the layout.
35680
35869
  * @param {number} h The height of the view in the layout.
35870
+ * @param {object} coordinationValues A mapping from coordination type names
35871
+ * to coordination values which this view defines directly.
35681
35872
  */
35682
- constructor(component, coordinationScopes, x, y, w, h, uid) {
35873
+ constructor(component, coordinationScopes, x, y, w, h, uid, coordinationValues) {
35683
35874
  this.view = {
35684
35875
  component,
35685
35876
  coordinationScopes,
@@ -35689,7 +35880,8 @@ class VitessceConfigView {
35689
35880
  y,
35690
35881
  w,
35691
35882
  h,
35692
- uid
35883
+ uid,
35884
+ coordinationValues
35693
35885
  };
35694
35886
  }
35695
35887
  /**
@@ -35723,6 +35915,21 @@ class VitessceConfigView {
35723
35915
  this.view.coordinationScopesBy = nextCoordinationScopesBy;
35724
35916
  return this;
35725
35917
  }
35918
+ /**
35919
+ * Set coordination values on this view directly, without a coordination
35920
+ * scope in the coordination space as an intermediary.
35921
+ * These values take precedence over any coordination scope
35922
+ * (from coordinationScopes or metaCoordinationScopes) for the same type.
35923
+ * @param {object} cValues A mapping from coordination type names to values.
35924
+ * @returns {VitessceConfigView} This, to allow chaining.
35925
+ */
35926
+ setCoordinationValues(cValues) {
35927
+ this.view.coordinationValues = {
35928
+ ...this.view.coordinationValues || {},
35929
+ ...cValues
35930
+ };
35931
+ return this;
35932
+ }
35726
35933
  /**
35727
35934
  * Attach meta coordination scopes to this view.
35728
35935
  * @param {VitessceConfigMetaCoordinationScope} metaScope A meta coordination scope instance.
@@ -35808,6 +36015,9 @@ class CoordinationLevel {
35808
36015
  return this.cachedValue !== null;
35809
36016
  }
35810
36017
  }
36018
+ function CL(value) {
36019
+ return new CoordinationLevel(value);
36020
+ }
35811
36021
  class VitessceConfigCoordinationScope {
35812
36022
  /**
35813
36023
  * Construct a new coordination scope instance.
@@ -36230,7 +36440,8 @@ class VitessceConfig {
36230
36440
  url: f2.url,
36231
36441
  fileType: f2.fileType,
36232
36442
  coordinationValues: f2.coordinationValues,
36233
- options: f2.options
36443
+ options: f2.options,
36444
+ requestInit: f2.requestInit
36234
36445
  });
36235
36446
  });
36236
36447
  });
@@ -36246,7 +36457,7 @@ class VitessceConfig {
36246
36457
  }
36247
36458
  });
36248
36459
  config2.layout.forEach((c) => {
36249
- const newView = new VitessceConfigView(c.component, c.coordinationScopes, c.x, c.y, c.w, c.h, c.uid);
36460
+ const newView = new VitessceConfigView(c.component, c.coordinationScopes, c.x, c.y, c.w, c.h, c.uid, c.coordinationValues);
36250
36461
  vc.config.layout.push(newView);
36251
36462
  });
36252
36463
  return vc;
@@ -36499,7 +36710,7 @@ function getStore(parsedUrl) {
36499
36710
  }
36500
36711
  return fileType.endsWith(".zip") ? ZipFileStore.fromUrl(url, {
36501
36712
  transformEntries: transformEntriesForZipFileStore
36502
- }) : new FetchStore(url);
36713
+ }) : new FetchStore(url, { fetch: relaxedFetch });
36503
36714
  }
36504
36715
  function ensureStores(parsedUrls) {
36505
36716
  return parsedUrls.map((parsedUrl) => {
@@ -37082,6 +37293,122 @@ function getParameterScopeBy(parameter, byType, typeScope, coordinationScopes, c
37082
37293
  }
37083
37294
  return parameterScopeGlobal;
37084
37295
  }
37296
+ function hasCoordinationValue(coordinationValues, parameter) {
37297
+ return coordinationValues !== void 0 && parameter in coordinationValues;
37298
+ }
37299
+ const COORDINATION_LEVEL_SENTINEL = "$CL";
37300
+ function isPlainObject(value) {
37301
+ return value !== null && typeof value === "object" && !Array.isArray(value);
37302
+ }
37303
+ function isMultiLevelValue(value) {
37304
+ return isPlainObject(value) && Object.hasOwn(value, COORDINATION_LEVEL_SENTINEL);
37305
+ }
37306
+ function toArray(value) {
37307
+ if (value === void 0 || value === null) return [];
37308
+ return Array.isArray(value) ? value : [value];
37309
+ }
37310
+ function reviveCoordinationLevels(value) {
37311
+ if (Array.isArray(value)) {
37312
+ return value.map(reviveCoordinationLevels);
37313
+ }
37314
+ if (isMultiLevelValue(value)) {
37315
+ return CL(reviveCoordinationLevels(value[COORDINATION_LEVEL_SENTINEL]));
37316
+ }
37317
+ if (isPlainObject(value)) {
37318
+ return Object.fromEntries(
37319
+ Object.entries(value).map(([k, v]) => [k, reviveCoordinationLevels(v)])
37320
+ );
37321
+ }
37322
+ return value;
37323
+ }
37324
+ function applyAnnotationFrameToViewConfig(viewConfig, viewUid, frameCoordinationValues, scopePrefix) {
37325
+ const { coordinationSpace = {}, layout } = viewConfig;
37326
+ const viewObj = layout.find((l) => l.uid === viewUid);
37327
+ if (!viewObj || !frameCoordinationValues) {
37328
+ return viewConfig;
37329
+ }
37330
+ const META = CoordinationType$1.META_COORDINATION_SCOPES;
37331
+ const META_BY = CoordinationType$1.META_COORDINATION_SCOPES_BY;
37332
+ const newSpace = { ...coordinationSpace };
37333
+ const newViewObj = { ...viewObj };
37334
+ const setViewValue = (coordinationType, value) => {
37335
+ newViewObj.coordinationValues = {
37336
+ ...newViewObj.coordinationValues,
37337
+ [coordinationType]: value
37338
+ };
37339
+ };
37340
+ const entries = Object.entries(frameCoordinationValues);
37341
+ const singleLevelEntries = entries.filter(([, value]) => !isMultiLevelValue(value));
37342
+ const multiLevelEntries = entries.filter(([, value]) => isMultiLevelValue(value));
37343
+ const resolvedScopes = getScopes(viewObj.coordinationScopes || {}, coordinationSpace[META]);
37344
+ singleLevelEntries.forEach(([coordinationType, value]) => {
37345
+ const scopes = toArray(resolvedScopes[coordinationType]);
37346
+ if (hasCoordinationValue(viewObj.coordinationValues, coordinationType) || scopes.length === 0) {
37347
+ setViewValue(coordinationType, value);
37348
+ return;
37349
+ }
37350
+ newSpace[coordinationType] = {
37351
+ ...newSpace[coordinationType],
37352
+ ...Object.fromEntries(scopes.map((scope) => [scope, value]))
37353
+ };
37354
+ });
37355
+ if (multiLevelEntries.length > 0) {
37356
+ const {
37357
+ coordinationSpace: generatedSpace,
37358
+ coordinationScopes: generatedScopes
37359
+ } = getCoordinationSpaceAndScopes(
37360
+ Object.fromEntries(multiLevelEntries.map(([coordinationType, value]) => [
37361
+ coordinationType,
37362
+ reviveCoordinationLevels(value)
37363
+ ])),
37364
+ scopePrefix
37365
+ );
37366
+ Object.entries(generatedSpace).forEach(([coordinationType, scopeValues]) => {
37367
+ if ([META, META_BY, CoordinationType$1.DATASET].includes(coordinationType)) return;
37368
+ newSpace[coordinationType] = {
37369
+ ...newSpace[coordinationType],
37370
+ ...scopeValues
37371
+ };
37372
+ });
37373
+ const newTypeScopes = generatedSpace[META]?.[generatedScopes[META]?.[0]] || {};
37374
+ const newTypeScopesBy = generatedSpace[META_BY]?.[generatedScopes[META_BY]?.[0]] || {};
37375
+ const viewMetaScopes = toArray(viewObj.coordinationScopes?.[META]);
37376
+ Object.entries(newTypeScopes).forEach(([coordinationType, scopes]) => {
37377
+ const owner = [...viewMetaScopes].reverse().find((m) => Object.hasOwn(newSpace[META]?.[m] || {}, coordinationType));
37378
+ if (owner) {
37379
+ newSpace[META] = {
37380
+ ...newSpace[META],
37381
+ [owner]: { ...newSpace[META][owner], [coordinationType]: scopes }
37382
+ };
37383
+ } else {
37384
+ newViewObj.coordinationScopes = {
37385
+ ...newViewObj.coordinationScopes,
37386
+ [coordinationType]: scopes
37387
+ };
37388
+ }
37389
+ });
37390
+ const viewMetaScopesBy = toArray(viewObj.coordinationScopes?.[META_BY]);
37391
+ Object.entries(newTypeScopesBy).forEach(([primaryType, primaryObj]) => {
37392
+ const owner = [...viewMetaScopesBy].reverse().find((m) => Object.hasOwn(newSpace[META_BY]?.[m] || {}, primaryType)) ?? viewMetaScopesBy.at(-1);
37393
+ if (owner) {
37394
+ newSpace[META_BY] = {
37395
+ ...newSpace[META_BY],
37396
+ [owner]: { ...newSpace[META_BY][owner], [primaryType]: primaryObj }
37397
+ };
37398
+ } else {
37399
+ newViewObj.coordinationScopesBy = {
37400
+ ...newViewObj.coordinationScopesBy,
37401
+ [primaryType]: primaryObj
37402
+ };
37403
+ }
37404
+ });
37405
+ }
37406
+ return {
37407
+ ...viewConfig,
37408
+ coordinationSpace: newSpace,
37409
+ layout: layout.map((l) => l.uid === viewUid ? newViewObj : l)
37410
+ };
37411
+ }
37085
37412
  const createViewConfigStore = (initialLoaders, initialConfig) => create()(subscribeWithSelector((set) => ({
37086
37413
  // State:
37087
37414
  // The viewConfig is an object which must conform to the schema
@@ -37109,9 +37436,29 @@ const createViewConfigStore = (initialLoaders, initialConfig) => create()(subscr
37109
37436
  coordinationScopes,
37110
37437
  byType,
37111
37438
  typeScope,
37112
- coordinationScopesBy
37439
+ coordinationScopesBy,
37440
+ // The viewUid is only required to write back to view-level coordinationValues.
37441
+ viewUid
37113
37442
  }) => set((state) => {
37114
- const { coordinationSpace } = state.viewConfig;
37443
+ const { coordinationSpace, layout } = state.viewConfig;
37444
+ const viewObj = viewUid === void 0 ? void 0 : layout.find((l) => l.uid === viewUid);
37445
+ const coordinationValues = viewObj?.coordinationValues;
37446
+ const byTypeScope = byType ? coordinationScopesBy?.[byType]?.[parameter]?.[typeScope] : void 0;
37447
+ if (viewUid !== void 0 && hasCoordinationValue(coordinationValues, parameter) && !byTypeScope) {
37448
+ return {
37449
+ viewConfig: {
37450
+ ...state.viewConfig,
37451
+ layout: layout.map((l) => l.uid === viewUid ? {
37452
+ ...l,
37453
+ coordinationValues: {
37454
+ ...coordinationValues,
37455
+ [parameter]: value
37456
+ }
37457
+ } : l)
37458
+ },
37459
+ mostRecentConfigSource: "internal"
37460
+ };
37461
+ }
37115
37462
  let scope;
37116
37463
  if (!byType) {
37117
37464
  scope = getParameterScope(parameter, coordinationScopes);
@@ -37217,6 +37564,19 @@ const createViewConfigStore = (initialLoaders, initialConfig) => create()(subscr
37217
37564
  mostRecentConfigSource: "internal"
37218
37565
  };
37219
37566
  }),
37567
+ applyAnnotationFrameCoordination: ({
37568
+ viewUid,
37569
+ frameCoordinationValues,
37570
+ scopePrefix
37571
+ }) => set((state) => ({
37572
+ viewConfig: applyAnnotationFrameToViewConfig(
37573
+ state.viewConfig,
37574
+ viewUid,
37575
+ frameCoordinationValues,
37576
+ scopePrefix
37577
+ ),
37578
+ mostRecentConfigSource: "internal"
37579
+ })),
37220
37580
  removeImageChannelInMetaCoordinationScopes: (coordinationScopesRaw, layerScope, channelScope) => set((state) => {
37221
37581
  const { coordinationSpace } = state.viewConfig;
37222
37582
  return {
@@ -37317,10 +37677,13 @@ const useGridSizeStore = create((set) => ({
37317
37677
  resizeCount: state.resizeCount + 1
37318
37678
  }))
37319
37679
  }));
37320
- function useInitialCoordination(parameters, coordinationScopes) {
37680
+ function useInitialCoordination(parameters, coordinationScopes, coordinationValues) {
37321
37681
  const values2 = useViewConfigStoreShallow((state) => {
37322
37682
  const { coordinationSpace } = state.initialViewConfig;
37323
37683
  return Object.fromEntries(parameters.map((parameter) => {
37684
+ if (coordinationValues && hasCoordinationValue(coordinationValues, parameter)) {
37685
+ return [parameter, coordinationValues[parameter]];
37686
+ }
37324
37687
  if (coordinationSpace && coordinationSpace[parameter]) {
37325
37688
  const value = coordinationSpace[parameter][coordinationScopes[parameter]];
37326
37689
  return [parameter, value];
@@ -37330,11 +37693,14 @@ function useInitialCoordination(parameters, coordinationScopes) {
37330
37693
  });
37331
37694
  return values2;
37332
37695
  }
37333
- function useCoordination(parameters, coordinationScopes) {
37696
+ function useCoordination(parameters, coordinationScopes, coordinationValues, viewUid) {
37334
37697
  const setCoordinationValue = useViewConfigStore((state) => state.setCoordinationValue);
37335
37698
  const values2 = useViewConfigStoreShallow((state) => {
37336
37699
  const { coordinationSpace } = state.viewConfig;
37337
37700
  return Object.fromEntries(parameters.map((parameter) => {
37701
+ if (coordinationValues && hasCoordinationValue(coordinationValues, parameter)) {
37702
+ return [parameter, coordinationValues[parameter]];
37703
+ }
37338
37704
  if (coordinationSpace) {
37339
37705
  const parameterScope = getParameterScope(parameter, coordinationScopes);
37340
37706
  if (coordinationSpace && coordinationSpace[parameter]) {
@@ -37350,10 +37716,11 @@ function useCoordination(parameters, coordinationScopes) {
37350
37716
  const setterFunc = (value) => setCoordinationValue({
37351
37717
  parameter,
37352
37718
  coordinationScopes,
37719
+ viewUid,
37353
37720
  value
37354
37721
  });
37355
37722
  return [setterName, setterFunc];
37356
- })), [parameters, coordinationScopes]);
37723
+ })), [parameters, coordinationScopes, viewUid]);
37357
37724
  return [values2, setters];
37358
37725
  }
37359
37726
  function useMultiCoordinationScopes(parameter, coordinationScopes) {
@@ -37478,7 +37845,7 @@ function useMultiCoordinationValues(parameter, coordinationScopes) {
37478
37845
  function useDatasetUids(coordinationScopes) {
37479
37846
  return useMultiCoordinationValues(CoordinationType$1.DATASET, coordinationScopes);
37480
37847
  }
37481
- function useComplexCoordination(parameters, coordinationScopes, coordinationScopesBy, byType) {
37848
+ function useComplexCoordination(parameters, coordinationScopes, coordinationScopesBy, byType, coordinationValues, viewUid) {
37482
37849
  const setCoordinationValue = useViewConfigStore((state) => state.setCoordinationValue);
37483
37850
  const parameterSpaces = useViewConfigStoreShallow((state) => {
37484
37851
  const { coordinationSpace } = state.viewConfig;
@@ -37490,6 +37857,9 @@ function useComplexCoordination(parameters, coordinationScopes, coordinationScop
37490
37857
  const typeScopesArr = Array.isArray(typeScopes) ? typeScopes : [typeScopes];
37491
37858
  return Object.fromEntries(typeScopesArr.map((datasetScope) => {
37492
37859
  const datasetValues = Object.fromEntries(parameters.map((parameter, i2) => {
37860
+ if (coordinationValues && hasCoordinationValue(coordinationValues, parameter) && !coordinationScopesBy?.[byType]?.[parameter]?.[datasetScope]) {
37861
+ return [parameter, coordinationValues[parameter]];
37862
+ }
37493
37863
  if (parameterSpaces[i2]) {
37494
37864
  const parameterSpace = parameterSpaces[i2];
37495
37865
  const parameterScope = getParameterScopeBy(
@@ -37513,7 +37883,7 @@ function useComplexCoordination(parameters, coordinationScopes, coordinationScop
37513
37883
  }));
37514
37884
  }
37515
37885
  return {};
37516
- }, [byType, coordinationScopes, coordinationScopesBy, parameterSpaces]);
37886
+ }, [byType, coordinationScopes, coordinationScopesBy, parameterSpaces, coordinationValues]);
37517
37887
  const setters = useMemo(() => {
37518
37888
  const typeScopes = getParameterScope(byType, coordinationScopes);
37519
37889
  if (typeScopes) {
@@ -37527,6 +37897,7 @@ function useComplexCoordination(parameters, coordinationScopes, coordinationScop
37527
37897
  typeScope: datasetScope,
37528
37898
  coordinationScopes,
37529
37899
  coordinationScopesBy,
37900
+ viewUid,
37530
37901
  value
37531
37902
  });
37532
37903
  return [setterName, setterFunc];
@@ -37535,7 +37906,7 @@ function useComplexCoordination(parameters, coordinationScopes, coordinationScop
37535
37906
  }));
37536
37907
  }
37537
37908
  return {};
37538
- }, [coordinationScopes]);
37909
+ }, [coordinationScopes, viewUid]);
37539
37910
  return [values2, setters];
37540
37911
  }
37541
37912
  function useCoordinationScopes(coordinationScopes) {
@@ -37568,7 +37939,31 @@ function useCoordinationScopesBy(coordinationScopes, coordinationScopesBy) {
37568
37939
  }, [coordinationScopes, coordinationScopesBy, metaSpaceBy]);
37569
37940
  return vals;
37570
37941
  }
37571
- function useComplexCoordinationSecondary(parameters, coordinationScopes, coordinationScopesBy, primaryType, secondaryType) {
37942
+ function useRawViewMapping(viewUid) {
37943
+ const viewObj = useViewConfigStoreShallow((state) => {
37944
+ const { layout } = state.viewConfig;
37945
+ return layout.find((l) => l.uid === viewUid);
37946
+ });
37947
+ return useMemo(() => [
37948
+ viewObj?.coordinationScopes,
37949
+ viewObj?.coordinationScopesBy,
37950
+ viewObj?.coordinationValues
37951
+ ], [viewObj]);
37952
+ }
37953
+ function useViewMapping(viewUid) {
37954
+ const [
37955
+ coordinationScopesRaw,
37956
+ coordinationScopesByRaw,
37957
+ coordinationValues
37958
+ ] = useRawViewMapping(viewUid);
37959
+ const coordinationScopes = useCoordinationScopes(coordinationScopesRaw || {});
37960
+ const coordinationScopesBy = useCoordinationScopesBy(
37961
+ coordinationScopesRaw || {},
37962
+ coordinationScopesByRaw || {}
37963
+ );
37964
+ return [coordinationScopes, coordinationScopesBy, coordinationValues];
37965
+ }
37966
+ function useComplexCoordinationSecondary(parameters, coordinationScopes, coordinationScopesBy, primaryType, secondaryType, coordinationValues, viewUid) {
37572
37967
  const coordinationScopesFake = useMemo(() => {
37573
37968
  if (coordinationScopesBy?.[primaryType]?.[secondaryType]) {
37574
37969
  return {
@@ -37590,7 +37985,9 @@ function useComplexCoordinationSecondary(parameters, coordinationScopes, coordin
37590
37985
  parameters,
37591
37986
  coordinationScopesFake,
37592
37987
  coordinationScopesBy,
37593
- secondaryType
37988
+ secondaryType,
37989
+ coordinationValues,
37990
+ viewUid
37594
37991
  );
37595
37992
  const nestedValues = useMemo(() => {
37596
37993
  const result = {};
@@ -37725,6 +38122,63 @@ function useSetLoaders() {
37725
38122
  function useMergeCoordination() {
37726
38123
  return useViewConfigStore((state) => state.mergeCoordination);
37727
38124
  }
38125
+ const ANNOTATION_FRAME_COORDINATION_TYPES = [
38126
+ CoordinationType$1.ANNOTATION_STORY,
38127
+ CoordinationType$1.ANNOTATION_FRAME_INDEX
38128
+ ];
38129
+ function getAnnotationFrameUpdate(annotationStory, prevFrameIndex, annotationFrameIndex, viewUid) {
38130
+ if (typeof annotationFrameIndex !== "number") {
38131
+ if (typeof prevFrameIndex === "number") {
38132
+ return {
38133
+ frameCoordinationValues: { [CoordinationType$1.ANNOTATION_SHAPES]: null },
38134
+ scopePrefix: ""
38135
+ };
38136
+ }
38137
+ return null;
38138
+ }
38139
+ const frame = annotationStory?.frames?.[annotationFrameIndex];
38140
+ if (!frame) {
38141
+ return null;
38142
+ }
38143
+ const frameCoordinationValues = getAnnotationFrameCoordinationValues(
38144
+ annotationStory,
38145
+ annotationFrameIndex,
38146
+ viewUid
38147
+ );
38148
+ return {
38149
+ frameCoordinationValues: {
38150
+ [CoordinationType$1.ANNOTATION_SHAPES]: null,
38151
+ ...frameCoordinationValues
38152
+ },
38153
+ scopePrefix: `annotation_${annotationStory.uid}_${frame.uid}_${viewUid}_`
38154
+ };
38155
+ }
38156
+ function useAnnotationFrameCoordination(viewUid, coordinationScopes, coordinationValues) {
38157
+ const [{
38158
+ annotationStory,
38159
+ annotationFrameIndex
38160
+ }] = useCoordination(
38161
+ ANNOTATION_FRAME_COORDINATION_TYPES,
38162
+ coordinationScopes,
38163
+ coordinationValues
38164
+ );
38165
+ const applyAnnotationFrameCoordination = useViewConfigStore(
38166
+ (state) => state.applyAnnotationFrameCoordination
38167
+ );
38168
+ const prevFrameIndexRef = useRef(void 0);
38169
+ useEffect(() => {
38170
+ const update2 = getAnnotationFrameUpdate(
38171
+ annotationStory,
38172
+ prevFrameIndexRef.current,
38173
+ annotationFrameIndex,
38174
+ viewUid
38175
+ );
38176
+ prevFrameIndexRef.current = annotationFrameIndex;
38177
+ if (update2) {
38178
+ applyAnnotationFrameCoordination({ viewUid, ...update2 });
38179
+ }
38180
+ }, [annotationStory, annotationFrameIndex, viewUid]);
38181
+ }
37728
38182
  function useViewConfig() {
37729
38183
  return useViewConfigStore((state) => state.viewConfig);
37730
38184
  }
@@ -43979,6 +44433,7 @@ function VitessceGridLayout(props) {
43979
44433
  onRemoveComponent,
43980
44434
  onLayoutChange: onLayoutChangeProp,
43981
44435
  isBounded,
44436
+ areAnnotationsEditable,
43982
44437
  pageMode,
43983
44438
  children
43984
44439
  } = props;
@@ -44071,7 +44526,8 @@ function VitessceGridLayout(props) {
44071
44526
  viewTypes,
44072
44527
  fileTypes,
44073
44528
  coordinationTypes,
44074
- stores
44529
+ stores,
44530
+ areAnnotationsEditable
44075
44531
  }
44076
44532
  )))];
44077
44533
  }));
@@ -44092,11 +44548,12 @@ function VitessceGridLayout(props) {
44092
44548
  viewTypes,
44093
44549
  fileTypes,
44094
44550
  coordinationTypes,
44095
- stores
44551
+ stores,
44552
+ areAnnotationsEditable
44096
44553
  }
44097
44554
  )));
44098
44555
  }), contextValue];
44099
- }, [gridComponents, getComponent, onRemoveComponent, theme]);
44556
+ }, [gridComponents, getComponent, onRemoveComponent, theme, areAnnotationsEditable]);
44100
44557
  return pageMode ? /* @__PURE__ */ React__default.createElement(PageModeViewContext.Provider, { value: pageModeViews }, children) : gridLayouts && gridComponents && gridBreakpoints && gridCols && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, style2, /* @__PURE__ */ React__default.createElement(
44101
44558
  ResponsiveHeightGridLayout,
44102
44559
  {
@@ -46622,7 +47079,8 @@ function VitessceGrid(props) {
46622
47079
  stores,
46623
47080
  pageMode,
46624
47081
  children,
46625
- queryClient
47082
+ queryClient,
47083
+ areAnnotationsEditable
46626
47084
  } = props;
46627
47085
  const [rowHeight, containerRef] = useRowHeight(config2, initialRowHeight, height2, margin, padding);
46628
47086
  const onResize = useEmitGridResize();
@@ -46690,7 +47148,8 @@ function VitessceGrid(props) {
46690
47148
  onLayoutChange: changeLayoutPostMount,
46691
47149
  isBounded,
46692
47150
  onResize,
46693
- onResizeStop: onResize
47151
+ onResizeStop: onResize,
47152
+ areAnnotationsEditable
46694
47153
  },
46695
47154
  children
46696
47155
  ) : null
@@ -46983,7 +47442,8 @@ function VitS(props) {
46983
47442
  pageMode = false,
46984
47443
  children,
46985
47444
  debugMode = DEFAULT_DEBUG_MODE,
46986
- logLevel = DEFAULT_LOG_LEVEL
47445
+ logLevel = DEFAULT_LOG_LEVEL,
47446
+ areAnnotationsEditable = true
46987
47447
  } = props;
46988
47448
  const [debugErrors, setDebugErrors] = useState([]);
46989
47449
  const viewTypes = useMemo(() => viewTypesProp || [], [viewTypesProp]);
@@ -47168,7 +47628,8 @@ function VitS(props) {
47168
47628
  theme,
47169
47629
  isBounded,
47170
47630
  stores: mergedStores,
47171
- queryClient
47631
+ queryClient,
47632
+ areAnnotationsEditable
47172
47633
  },
47173
47634
  children
47174
47635
  ), /* @__PURE__ */ React__default.createElement(
@@ -47960,6 +48421,17 @@ function useFeatureSetStatsData(loaders, dataset, isRequired, matchOn, volcanoOp
47960
48421
  DataType$1.FEATURE_SET_STATS
47961
48422
  );
47962
48423
  }
48424
+ function useAnnotationStoryData(loaders, dataset, isRequired, coordinationSetters, initialCoordinationValues, matchOn) {
48425
+ return useDataType(
48426
+ DataType$1.ANNOTATION_STORY,
48427
+ loaders,
48428
+ dataset,
48429
+ isRequired,
48430
+ coordinationSetters,
48431
+ initialCoordinationValues,
48432
+ matchOn
48433
+ );
48434
+ }
47963
48435
  function useObsSetStatsData(loaders, dataset, isRequired, matchOn, volcanoOptions) {
47964
48436
  return useComparativeDataType(
47965
48437
  loaders,
@@ -49429,6 +49901,8 @@ export {
49429
49901
  shallowDiffByLayerCoordinationWithKeys,
49430
49902
  shallowDiffByLayerWithKeys,
49431
49903
  useAddImageChannelInMetaCoordinationScopes,
49904
+ useAnnotationFrameCoordination,
49905
+ useAnnotationStoryData,
49432
49906
  useAsyncFunction,
49433
49907
  useAuxiliaryCoordination,
49434
49908
  useClosestVitessceContainerSize,
@@ -49488,6 +49962,7 @@ export {
49488
49962
  useStyles as usePlotOptionsStyles,
49489
49963
  usePointMultiObsFeatureMatrixIndices,
49490
49964
  usePointMultiObsLabels,
49965
+ useRawViewMapping,
49491
49966
  useReady,
49492
49967
  useRemoveImageChannelInMetaCoordinationScopes,
49493
49968
  useSampleEdgesData,
@@ -49511,6 +49986,7 @@ export {
49511
49986
  useViewConfig,
49512
49987
  useViewConfigStore,
49513
49988
  useViewConfigStoreApi,
49989
+ useViewMapping,
49514
49990
  useVitessceContainer,
49515
49991
  useWarning,
49516
49992
  useWindowDimensions