@vitessce/schemas 3.9.6 → 4.0.0-test.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 (2) hide show
  1. package/dist/index.js +13 -18
  2. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -5417,13 +5417,12 @@ function upgradeFrom0_1_0(config, datasetUid = null) {
5417
5417
  };
5418
5418
  const layout = [];
5419
5419
  config.staticLayout.forEach((componentDef) => {
5420
- var _a, _b, _c;
5421
5420
  let newComponentDef = {
5422
5421
  ...componentDef,
5423
5422
  coordinationScopes: {}
5424
5423
  };
5425
5424
  if (componentDef.component === "scatterplot") {
5426
- if (((_a = componentDef.props) == null ? void 0 : _a.mapping) && typeof componentDef.props.mapping === "string") {
5425
+ if (componentDef.props?.mapping && typeof componentDef.props.mapping === "string") {
5427
5426
  coordinationSpace.embeddingType[componentDef.props.mapping] = componentDef.props.mapping;
5428
5427
  newComponentDef = {
5429
5428
  ...newComponentDef,
@@ -5433,7 +5432,7 @@ function upgradeFrom0_1_0(config, datasetUid = null) {
5433
5432
  }
5434
5433
  };
5435
5434
  }
5436
- if ((_b = componentDef.props) == null ? void 0 : _b.view) {
5435
+ if (componentDef.props?.view) {
5437
5436
  const newScopeValues = upgradeReplaceViewProp(
5438
5437
  "embedding",
5439
5438
  componentDef.props.view,
@@ -5449,7 +5448,7 @@ function upgradeFrom0_1_0(config, datasetUid = null) {
5449
5448
  }
5450
5449
  }
5451
5450
  if (componentDef.component === "spatial") {
5452
- if ((_c = componentDef == null ? void 0 : componentDef.props) == null ? void 0 : _c.view) {
5451
+ if (componentDef?.props?.view) {
5453
5452
  const newScopeValues = upgradeReplaceViewProp(
5454
5453
  "spatial",
5455
5454
  componentDef.props.view,
@@ -5543,7 +5542,6 @@ function upgradeFrom1_0_0(config) {
5543
5542
  };
5544
5543
  }
5545
5544
  function upgradeFrom1_0_1(config) {
5546
- var _a;
5547
5545
  const layout = config.layout.map((component) => {
5548
5546
  const newComponent = { ...component };
5549
5547
  if (newComponent.component === "layerController") {
@@ -5555,9 +5553,8 @@ function upgradeFrom1_0_1(config) {
5555
5553
  return newComponent;
5556
5554
  });
5557
5555
  const newConfig = cloneDeep(config);
5558
- Object.keys(((_a = newConfig == null ? void 0 : newConfig.coordinationSpace) == null ? void 0 : _a.spatialRasterLayers) || {}).forEach((key) => {
5559
- var _a2, _b;
5560
- if ((_b = (_a2 = newConfig.coordinationSpace) == null ? void 0 : _a2.spatialRasterLayers) == null ? void 0 : _b[key]) {
5556
+ Object.keys(newConfig?.coordinationSpace?.spatialRasterLayers || {}).forEach((key) => {
5557
+ if (newConfig.coordinationSpace?.spatialRasterLayers?.[key]) {
5561
5558
  newConfig.coordinationSpace.spatialRasterLayers[key].forEach((layer, index) => {
5562
5559
  if (newConfig.coordinationSpace) {
5563
5560
  newConfig.coordinationSpace.spatialRasterLayers[key][index].type = ["bitmask", "raster"].includes(layer.type) ? layer.type : "raster";
@@ -5701,7 +5698,7 @@ function upgradeFrom1_0_11(config) {
5701
5698
  datasets,
5702
5699
  coordinationSpace
5703
5700
  } = newConfig;
5704
- if (coordinationSpace == null ? void 0 : coordinationSpace.embeddingType) {
5701
+ if (coordinationSpace?.embeddingType) {
5705
5702
  const embeddingTypes = Object.values(coordinationSpace.embeddingType);
5706
5703
  datasets.forEach((dataset, i) => {
5707
5704
  const { files } = dataset;
@@ -5734,7 +5731,7 @@ function upgradeFrom1_0_12(config) {
5734
5731
  if (options && "factors" in options && Array.isArray(options.factors)) {
5735
5732
  const obsLabelsTypeScopes = [];
5736
5733
  options.factors.forEach((olt) => {
5737
- const nextScope = getNextScope(Object.keys((coordinationSpace == null ? void 0 : coordinationSpace.obsLabelsType) || {}));
5734
+ const nextScope = getNextScope(Object.keys(coordinationSpace?.obsLabelsType || {}));
5738
5735
  newCoordinationSpace.obsLabelsType = {
5739
5736
  ...newCoordinationSpace.obsLabelsType,
5740
5737
  // Need to remove the obs/ prefix.
@@ -5748,8 +5745,7 @@ function upgradeFrom1_0_12(config) {
5748
5745
  });
5749
5746
  });
5750
5747
  function getDatasetUidForView(viewDef) {
5751
- var _a, _b;
5752
- if (((_a = viewDef.coordinationScopes) == null ? void 0 : _a.dataset) && typeof ((_b = viewDef.coordinationScopes) == null ? void 0 : _b.dataset) === "string") {
5748
+ if (viewDef.coordinationScopes?.dataset && typeof viewDef.coordinationScopes?.dataset === "string") {
5753
5749
  return newCoordinationSpace.dataset[viewDef.coordinationScopes.dataset];
5754
5750
  }
5755
5751
  if (datasets.length > 0) {
@@ -5812,8 +5808,7 @@ function upgradeFrom1_0_14(config) {
5812
5808
  };
5813
5809
  newLayout.forEach((viewDef) => {
5814
5810
  Object.entries(propAnalogies).forEach(([oldProp, newType]) => {
5815
- var _a;
5816
- if ((_a = viewDef.props) == null ? void 0 : _a[oldProp]) {
5811
+ if (viewDef.props?.[oldProp]) {
5817
5812
  log.warn(`Warning: the '${oldProp}' prop on the ${viewDef.component} view is deprecated. Please use the '${newType}' coordination type instead.`);
5818
5813
  }
5819
5814
  });
@@ -5830,7 +5825,7 @@ function upgradeFrom1_0_15(config) {
5830
5825
  const newLayout = layout.map((view) => {
5831
5826
  const { coordinationScopes } = view;
5832
5827
  const newCoordinationScopes = {};
5833
- if ((coordinationScopes == null ? void 0 : coordinationScopes.dataset) && Array.isArray(coordinationScopes.dataset)) {
5828
+ if (coordinationScopes?.dataset && Array.isArray(coordinationScopes.dataset)) {
5834
5829
  const coordinationScopesBy = {
5835
5830
  dataset: {}
5836
5831
  };
@@ -9359,7 +9354,7 @@ const VERSIONED_CONFIG_SCHEMAS = {
9359
9354
  };
9360
9355
  function refineCoordinationTypes(config, ctx) {
9361
9356
  if ("version" in config) {
9362
- const version = config == null ? void 0 : config.version;
9357
+ const version = config?.version;
9363
9358
  const deprecatedCoordinationTypes = Object.entries(CoordinationType).filter(([prevConstant, v]) => semverExports.gte(version, v[2])).map(([prevConstant]) => prevConstant);
9364
9359
  deprecatedCoordinationTypes.forEach((prevConstant) => {
9365
9360
  const newTypeName = CoordinationType[prevConstant][3];
@@ -9375,11 +9370,11 @@ function refineCoordinationTypes(config, ctx) {
9375
9370
  }
9376
9371
  }
9377
9372
  function upgradeAndParse(config, onConfigUpgrade = null) {
9378
- if ((config == null ? void 0 : config.version) === latestConfigSchema.shape.version.value) {
9373
+ if (config?.version === latestConfigSchema.shape.version.value) {
9379
9374
  return latestConfigSchema.parse(config);
9380
9375
  }
9381
9376
  const versions = SCHEMA_HANDLERS.map(([zodSchema]) => configSchemaToVersion(zodSchema));
9382
- if (versions.includes(config == null ? void 0 : config.version)) {
9377
+ if (versions.includes(config?.version)) {
9383
9378
  const versionIndex = versions.indexOf(config.version);
9384
9379
  let upgradable = SCHEMA_HANDLERS[versionIndex][0];
9385
9380
  SCHEMA_HANDLERS.slice(versionIndex, SCHEMA_HANDLERS.length).forEach((versionInfo) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitessce/schemas",
3
- "version": "3.9.6",
3
+ "version": "4.0.0-test.0",
4
4
  "author": "HIDIVE Lab at HMS",
5
5
  "homepage": "http://vitessce.io",
6
6
  "repository": {
@@ -23,11 +23,11 @@
23
23
  "semver": "^7.3.8",
24
24
  "uuid": "^9.0.0",
25
25
  "zod": "^3.21.4",
26
- "@vitessce/constants": "3.9.6",
27
- "@vitessce/constants-internal": "3.9.6",
28
- "@vitessce/plugins": "3.9.6",
29
- "@vitessce/utils": "3.9.6",
30
- "@vitessce/globals": "3.9.6"
26
+ "@vitessce/utils": "4.0.0-test.0",
27
+ "@vitessce/globals": "4.0.0-test.0",
28
+ "@vitessce/constants-internal": "4.0.0-test.0",
29
+ "@vitessce/constants": "4.0.0-test.0",
30
+ "@vitessce/plugins": "4.0.0-test.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "json-schema-to-zod": "^0.6.3",