sanity 6.2.0-next.25 → 6.2.0-next.26

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.
@@ -16623,6 +16623,19 @@ interface BetaFeatures {
16623
16623
  variants?: {
16624
16624
  enabled?: boolean;
16625
16625
  };
16626
+ /**
16627
+ * Control whether the preview of the new document group inventory is
16628
+ * switched on.
16629
+ *
16630
+ * This is the new UI for managing and navigating versions and variants of
16631
+ * documents. It replaces the version chips that currently appear at the top
16632
+ * of the document editor.
16633
+ *
16634
+ * It is switched on automatically when `beta.variants.enabled` is true.
16635
+ */
16636
+ documentGroupInventory?: {
16637
+ enabled?: boolean;
16638
+ };
16626
16639
  }
16627
16640
  /**
16628
16641
  * @internal
@@ -1,4 +1,4 @@
1
- var version = "6.2.0-next.25+49ca53328f";
1
+ var version = "6.2.0-next.26+d9a4a69fb3";
2
2
  let buildVersion;
3
3
  try {
4
4
  buildVersion = process.env.PKG_BUILD_VERSION;
@@ -7,7 +7,7 @@ try {
7
7
  try {
8
8
  buildVersion = buildVersion || // This is replaced by `@sanity/pkg-utils` at build time
9
9
  // and must always be references by its full static name, e.g. no optional chaining, no `if (process && process.env)` etc.
10
- "6.2.0-next.25+49ca53328f";
10
+ "6.2.0-next.26+d9a4a69fb3";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
package/lib/index.js CHANGED
@@ -63826,7 +63826,24 @@ const deprecatedScheduledPublishingPlugin = definePlugin({
63826
63826
  if (typeof enabled == "boolean") return enabled;
63827
63827
  throw new Error(`Expected \`beta.variants.enabled\` to be a boolean, but received ${getPrintableType(enabled)}`);
63828
63828
  }, initialValue);
63829
- }, mediaLibraryEnabledReducer = (opts) => {
63829
+ }, documentGroupInventoryEnabledReducer = ({
63830
+ config,
63831
+ initialValue
63832
+ }) => flattenConfig(config, []).reduce((value, {
63833
+ config: innerConfig
63834
+ }) => {
63835
+ const documentGroupInventory = innerConfig.beta?.documentGroupInventory;
63836
+ if (typeof documentGroupInventory > "u")
63837
+ return value;
63838
+ if (!isRecord$4(documentGroupInventory))
63839
+ throw new Error(`Expected \`beta.documentGroupInventory\` to be an object, but received ${getPrintableType(documentGroupInventory)}`);
63840
+ const enabled = documentGroupInventory.enabled;
63841
+ if (typeof enabled > "u")
63842
+ return value;
63843
+ if (typeof enabled == "boolean")
63844
+ return enabled;
63845
+ throw new Error(`Expected \`beta.documentGroupInventory.enabled\` to be a boolean, but received ${getPrintableType(enabled)}`);
63846
+ }, initialValue), mediaLibraryEnabledReducer = (opts) => {
63830
63847
  const {
63831
63848
  config,
63832
63849
  initialValue
@@ -84581,6 +84598,10 @@ function resolveSource$1({
84581
84598
  type: "source",
84582
84599
  causes: errors
84583
84600
  });
84601
+ const variantsEnabled = variantsEnabledReducer({
84602
+ config,
84603
+ initialValue: !1
84604
+ });
84584
84605
  return {
84585
84606
  type: "source",
84586
84607
  name: config.name,
@@ -84781,10 +84802,15 @@ function resolveSource$1({
84781
84802
  })
84782
84803
  },
84783
84804
  variants: {
84784
- enabled: variantsEnabledReducer({
84805
+ enabled: variantsEnabled
84806
+ },
84807
+ documentGroupInventory: {
84808
+ // The document group inventory is an inherent part of the variants experience.
84809
+ // It cannot be switched off while variants are switched on.
84810
+ enabled: documentGroupInventoryEnabledReducer({
84785
84811
  config,
84786
84812
  initialValue: !1
84787
- })
84813
+ }) || variantsEnabled
84788
84814
  }
84789
84815
  },
84790
84816
  announcements: {