@sanity/vision 6.9.0-next.13 → 6.9.0-next.17
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 { t as visionLocaleNamespace } from "./i18n-DWd7qwtK.js";
|
|
2
|
-
import { Component, Fragment, forwardRef, useEffect, useEffectEvent, useImperativeHandle, useRef, useState } from "react";
|
|
2
|
+
import { Component, Fragment, Suspense, forwardRef, use, useEffect, useEffectEvent, useImperativeHandle, useRef, useState } from "react";
|
|
3
3
|
import { ContextMenuButton, Translate, UserAvatar, getReleaseIdFromReleaseDocumentId, isCardinalityOneRelease, sortReleases, useActiveReleases, useClient, useCurrentUser, useDataset, useDateTimeFormat, useKeyValueStore, usePerspective, useScheduledDraftsEnabled, useTranslation, useWorkspace } from "sanity";
|
|
4
4
|
import { IntentLink } from "sanity/router";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
@@ -41,7 +41,7 @@ import { JsonInspector } from "@rexxars/react-json-inspector";
|
|
|
41
41
|
import { LinkIcon } from "@sanity/icons/Link";
|
|
42
42
|
import LRU from "quick-lru";
|
|
43
43
|
import { DocumentSheetIcon } from "@sanity/icons/DocumentSheet";
|
|
44
|
-
import {
|
|
44
|
+
import { useObservablePromise } from "react-rx";
|
|
45
45
|
import { catchError, map as map$1, of } from "rxjs";
|
|
46
46
|
const API_VERSIONS = [
|
|
47
47
|
"v1",
|
|
@@ -2641,7 +2641,7 @@ function useDatasets(t0) {
|
|
|
2641
2641
|
} else t2 = $[4];
|
|
2642
2642
|
t1 = t2;
|
|
2643
2643
|
}
|
|
2644
|
-
return
|
|
2644
|
+
return useObservablePromise(t1);
|
|
2645
2645
|
}
|
|
2646
2646
|
function _temp3(err) {
|
|
2647
2647
|
return of(err);
|
|
@@ -2653,36 +2653,37 @@ function _temp(d) {
|
|
|
2653
2653
|
return d.name;
|
|
2654
2654
|
}
|
|
2655
2655
|
function VisionContainer(props) {
|
|
2656
|
-
let $ = c(
|
|
2656
|
+
let $ = c(8), t0;
|
|
2657
2657
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "v2025-06-27" }, $[0] = t0) : t0 = $[0];
|
|
2658
2658
|
let datasetsClient = useClient(t0), t1;
|
|
2659
2659
|
$[1] !== datasetsClient || $[2] !== props.config.datasets ? (t1 = {
|
|
2660
2660
|
client: datasetsClient,
|
|
2661
2661
|
datasets: props.config.datasets
|
|
2662
2662
|
}, $[1] = datasetsClient, $[2] = props.config.datasets, $[3] = t1) : t1 = $[3];
|
|
2663
|
-
let
|
|
2664
|
-
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2663
|
+
let datasetsPromise = useDatasets(t1), t2;
|
|
2664
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = /* @__PURE__ */ jsx(Flex, {
|
|
2665
|
+
align: "center",
|
|
2666
|
+
height: "fill",
|
|
2667
|
+
justify: "center",
|
|
2668
|
+
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
2669
|
+
}), $[4] = t2) : t2 = $[4];
|
|
2670
|
+
let t3;
|
|
2671
|
+
return $[5] !== datasetsPromise || $[6] !== props ? (t3 = /* @__PURE__ */ jsx(Suspense, {
|
|
2672
|
+
fallback: t2,
|
|
2673
|
+
children: /* @__PURE__ */ jsx(LoadedVisionContainer, {
|
|
2674
|
+
...props,
|
|
2675
|
+
datasetsPromise
|
|
2676
|
+
})
|
|
2677
|
+
}), $[5] = datasetsPromise, $[6] = props, $[7] = t3) : t3 = $[7], t3;
|
|
2678
|
+
}
|
|
2679
|
+
function LoadedVisionContainer(t0) {
|
|
2680
|
+
let $ = c(5), { datasetsPromise, ...props } = t0, loadedDatasets = use(datasetsPromise), datasets = loadedDatasets instanceof Error ? [props.client.config().dataset || "production"] : loadedDatasets, projectId = props.client.config().projectId, defaultDataset = props.config.defaultDataset || props.client.config().dataset || datasets[0], t1;
|
|
2681
|
+
return $[0] !== datasets || $[1] !== defaultDataset || $[2] !== projectId || $[3] !== props ? (t1 = /* @__PURE__ */ jsx(VisionGui, {
|
|
2681
2682
|
...props,
|
|
2682
2683
|
datasets,
|
|
2683
2684
|
projectId,
|
|
2684
2685
|
defaultDataset
|
|
2685
|
-
}, projectId), $[
|
|
2686
|
+
}, projectId), $[0] = datasets, $[1] = defaultDataset, $[2] = projectId, $[3] = props, $[4] = t1) : t1 = $[4], t1;
|
|
2686
2687
|
}
|
|
2687
2688
|
/**
|
|
2688
2689
|
* @internal
|
|
@@ -2766,4 +2767,4 @@ function SanityVision(props) {
|
|
|
2766
2767
|
}
|
|
2767
2768
|
export { SanityVision as default };
|
|
2768
2769
|
|
|
2769
|
-
//# sourceMappingURL=SanityVision-
|
|
2770
|
+
//# sourceMappingURL=SanityVision-BkNU10dg.js.map
|