@sanity/vision 6.9.0-next.9 → 6.9.1-next.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 { t as visionLocaleNamespace } from "./i18n-DWd7qwtK.js";
|
|
2
|
-
import { Component, Fragment, forwardRef,
|
|
2
|
+
import { Component, Fragment, Suspense, forwardRef, use, useEffect, 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";
|
|
@@ -9,6 +9,7 @@ import { SplitPane } from "@rexxars/react-split-pane";
|
|
|
9
9
|
import { ChevronLeftIcon } from "@sanity/icons/ChevronLeft";
|
|
10
10
|
import { ChevronRightIcon } from "@sanity/icons/ChevronRight";
|
|
11
11
|
import { isHotkey } from "is-hotkey-esm";
|
|
12
|
+
import { useEffectEvent } from "use-effect-event";
|
|
12
13
|
import { closeBrackets } from "@codemirror/autocomplete";
|
|
13
14
|
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
|
14
15
|
import { javascriptLanguage } from "@codemirror/lang-javascript";
|
|
@@ -41,7 +42,7 @@ import { JsonInspector } from "@rexxars/react-json-inspector";
|
|
|
41
42
|
import { LinkIcon } from "@sanity/icons/Link";
|
|
42
43
|
import LRU from "quick-lru";
|
|
43
44
|
import { DocumentSheetIcon } from "@sanity/icons/DocumentSheet";
|
|
44
|
-
import {
|
|
45
|
+
import { useObservablePromise } from "react-rx";
|
|
45
46
|
import { catchError, map as map$1, of } from "rxjs";
|
|
46
47
|
const API_VERSIONS = [
|
|
47
48
|
"v1",
|
|
@@ -2641,7 +2642,7 @@ function useDatasets(t0) {
|
|
|
2641
2642
|
} else t2 = $[4];
|
|
2642
2643
|
t1 = t2;
|
|
2643
2644
|
}
|
|
2644
|
-
return
|
|
2645
|
+
return useObservablePromise(t1);
|
|
2645
2646
|
}
|
|
2646
2647
|
function _temp3(err) {
|
|
2647
2648
|
return of(err);
|
|
@@ -2653,36 +2654,37 @@ function _temp(d) {
|
|
|
2653
2654
|
return d.name;
|
|
2654
2655
|
}
|
|
2655
2656
|
function VisionContainer(props) {
|
|
2656
|
-
let $ = c(
|
|
2657
|
+
let $ = c(8), t0;
|
|
2657
2658
|
$[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = { apiVersion: "v2025-06-27" }, $[0] = t0) : t0 = $[0];
|
|
2658
2659
|
let datasetsClient = useClient(t0), t1;
|
|
2659
2660
|
$[1] !== datasetsClient || $[2] !== props.config.datasets ? (t1 = {
|
|
2660
2661
|
client: datasetsClient,
|
|
2661
2662
|
datasets: props.config.datasets
|
|
2662
2663
|
}, $[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
|
-
|
|
2664
|
+
let datasetsPromise = useDatasets(t1), t2;
|
|
2665
|
+
$[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = /* @__PURE__ */ jsx(Flex, {
|
|
2666
|
+
align: "center",
|
|
2667
|
+
height: "fill",
|
|
2668
|
+
justify: "center",
|
|
2669
|
+
children: /* @__PURE__ */ jsx(DelayedSpinner, {})
|
|
2670
|
+
}), $[4] = t2) : t2 = $[4];
|
|
2671
|
+
let t3;
|
|
2672
|
+
return $[5] !== datasetsPromise || $[6] !== props ? (t3 = /* @__PURE__ */ jsx(Suspense, {
|
|
2673
|
+
fallback: t2,
|
|
2674
|
+
children: /* @__PURE__ */ jsx(LoadedVisionContainer, {
|
|
2675
|
+
...props,
|
|
2676
|
+
datasetsPromise
|
|
2677
|
+
})
|
|
2678
|
+
}), $[5] = datasetsPromise, $[6] = props, $[7] = t3) : t3 = $[7], t3;
|
|
2679
|
+
}
|
|
2680
|
+
function LoadedVisionContainer(t0) {
|
|
2681
|
+
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;
|
|
2682
|
+
return $[0] !== datasets || $[1] !== defaultDataset || $[2] !== projectId || $[3] !== props ? (t1 = /* @__PURE__ */ jsx(VisionGui, {
|
|
2681
2683
|
...props,
|
|
2682
2684
|
datasets,
|
|
2683
2685
|
projectId,
|
|
2684
2686
|
defaultDataset
|
|
2685
|
-
}, projectId), $[
|
|
2687
|
+
}, projectId), $[0] = datasets, $[1] = defaultDataset, $[2] = projectId, $[3] = props, $[4] = t1) : t1 = $[4], t1;
|
|
2686
2688
|
}
|
|
2687
2689
|
/**
|
|
2688
2690
|
* @internal
|
|
@@ -2766,4 +2768,4 @@ function SanityVision(props) {
|
|
|
2766
2768
|
}
|
|
2767
2769
|
export { SanityVision as default };
|
|
2768
2770
|
|
|
2769
|
-
//# sourceMappingURL=SanityVision-
|
|
2771
|
+
//# sourceMappingURL=SanityVision-CQ0yUM4l.js.map
|