@sanity/vision 6.13.0-next.7 → 6.13.0-next.83

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.
@@ -35,7 +35,7 @@ import { UnpublishIcon } from "@sanity/icons/Unpublish";
35
35
  import { UsersIcon } from "@sanity/icons/Users";
36
36
  import { Code } from "@sanity/ui/code";
37
37
  import { Menu, MenuButton, MenuItem } from "@sanity/ui/menu";
38
- import isEqual from "lodash-es/isEqual.js";
38
+ import { dequal } from "dequal/lite";
39
39
  import { uuid } from "@sanity/uuid";
40
40
  import { map, startWith } from "rxjs/operators";
41
41
  import { PlayIcon } from "@sanity/icons/Play";
@@ -844,12 +844,12 @@ function QueryRecall(t0) {
844
844
  if (queries?.some((q) => {
845
845
  if (q.shared) return !1;
846
846
  let savedQueryObj = getStateFromUrl(q.url);
847
- return savedQueryObj && savedQueryObj.query === currentQuery && isEqual(savedQueryObj.params, currentParams);
847
+ return savedQueryObj && savedQueryObj.query === currentQuery && dequal(savedQueryObj.params, currentParams);
848
848
  })) {
849
849
  let duplicateQuery = queries?.find((q_0) => {
850
850
  if (q_0.shared) return !1;
851
851
  let savedQueryObj_0 = getStateFromUrl(q_0.url);
852
- return savedQueryObj_0 && savedQueryObj_0.query === currentQuery && isEqual(savedQueryObj_0.params, currentParams);
852
+ return savedQueryObj_0 && savedQueryObj_0.query === currentQuery && dequal(savedQueryObj_0.params, currentParams);
853
853
  });
854
854
  toast.push({
855
855
  closable: !0,
@@ -916,7 +916,7 @@ function QueryRecall(t0) {
916
916
  let clearPending = () => setPendingUnshareKeys((prev_0) => prev_0.filter((key) => key !== query_0._key)), nextQueryObj = getStateFromUrl(query_0.url), duplicatePersonalQuery = queries?.find((existingQuery) => {
917
917
  if (existingQuery._key === query_0._key || existingQuery.shared) return !1;
918
918
  let existingQueryObj = getStateFromUrl(existingQuery.url);
919
- return nextQueryObj && existingQueryObj && existingQueryObj.query === nextQueryObj.query && isEqual(existingQueryObj.params, nextQueryObj.params);
919
+ return nextQueryObj && existingQueryObj && existingQueryObj.query === nextQueryObj.query && dequal(existingQueryObj.params, nextQueryObj.params);
920
920
  }), unsharedQueryTitle = query_0.title || t("label.untitled-query");
921
921
  if (duplicatePersonalQuery) {
922
922
  toast.push({
@@ -981,12 +981,12 @@ function QueryRecall(t0) {
981
981
  if (queries?.some((q_1) => {
982
982
  if (q_1._key === query_2._key) return !1;
983
983
  let savedQueryObj_1 = getStateFromUrl(q_1.url);
984
- return savedQueryObj_1 && savedQueryObj_1.query === currentQuery && isEqual(savedQueryObj_1.params, currentParams);
984
+ return savedQueryObj_1 && savedQueryObj_1.query === currentQuery && dequal(savedQueryObj_1.params, currentParams);
985
985
  })) {
986
986
  let duplicateQuery_0 = queries?.find((q_2) => {
987
987
  if (q_2._key === query_2._key) return !1;
988
988
  let savedQueryObj_2 = getStateFromUrl(q_2.url);
989
- return savedQueryObj_2 && savedQueryObj_2.query === currentQuery && isEqual(savedQueryObj_2.params, currentParams);
989
+ return savedQueryObj_2 && savedQueryObj_2.query === currentQuery && dequal(savedQueryObj_2.params, currentParams);
990
990
  });
991
991
  toast.push({
992
992
  closable: !0,
@@ -1122,7 +1122,7 @@ function QueryRecall(t0) {
1122
1122
  t36
1123
1123
  ]
1124
1124
  }), $[113] = t20, $[114] = t23, $[115] = t36, $[116] = t14) : t14 = $[116], T1 = QueryList, t13 = "vision-query-recall-list", T0 = Stack, t11 = 3, t12 = filteredQueries?.map((q_5, index) => {
1125
- let queryObj = getStateFromUrl(q_5.url), fullQueryPreview = queryObj?.query || "", shortQueryPreview = fullQueryPreview.split("{")[0], isSelected = selectedUrl === q_5.url, canMutateQuery = !q_5.shared || q_5.isOwnedByCurrentUser, areQueriesEqual = queryObj && currentQuery === queryObj.query && isEqual(currentParams, queryObj.params), isEdited = isSelected && !areQueriesEqual && canMutateQuery;
1125
+ let queryObj = getStateFromUrl(q_5.url), fullQueryPreview = queryObj?.query || "", shortQueryPreview = fullQueryPreview.split("{")[0], isSelected = selectedUrl === q_5.url, canMutateQuery = !q_5.shared || q_5.isOwnedByCurrentUser, areQueriesEqual = queryObj && currentQuery === queryObj.query && dequal(currentParams, queryObj.params), isEdited = isSelected && !areQueriesEqual && canMutateQuery;
1126
1126
  return /* @__PURE__ */ jsx(Card, {
1127
1127
  paddingX: compactMode ? 3 : 4,
1128
1128
  paddingY: compactMode ? 3 : 4,
@@ -2474,7 +2474,7 @@ function VisionGui(props) {
2474
2474
  }, $[55] = apiVersion, $[56] = client, $[57] = customApiVersion, $[58] = dataset, $[59] = isValidApiVersion, $[60] = localStorage, $[61] = params.parsed, $[62] = perspective, $[63] = perspectiveStack, $[64] = query, $[65] = queryInProgress, $[66] = scheduledDraftsStack, $[67] = selectedVariantName, $[68] = t, $[69] = t22) : t22 = $[69];
2475
2475
  let handleQueryExecution = t22, t23;
2476
2476
  $[70] !== handleQueryExecution || $[71] !== localStorage ? (t23 = (newPerspective) => {
2477
- newPerspective !== void 0 && !isSupportedPerspective(newPerspective) || (setPerspectiveState(newPerspective), localStorage.set("perspective", newPerspective), handleQueryExecution({ perspective: newPerspective }));
2477
+ (newPerspective === void 0 || isSupportedPerspective(newPerspective)) && (setPerspectiveState(newPerspective), localStorage.set("perspective", newPerspective), handleQueryExecution({ perspective: newPerspective }));
2478
2478
  }, $[70] = handleQueryExecution, $[71] = localStorage, $[72] = t23) : t23 = $[72];
2479
2479
  let setPerspective = t23, t24;
2480
2480
  $[73] !== handleQueryExecution || $[74] !== localStorage ? (t24 = (evt) => {
@@ -2952,4 +2952,4 @@ function SanityVision(props) {
2952
2952
  }
2953
2953
  export { SanityVision as default };
2954
2954
 
2955
- //# sourceMappingURL=SanityVision-II_F9zA2.js.map
2955
+ //# sourceMappingURL=SanityVision-CLaQvTR9.js.map