@sanity/sdk-react 2.11.0 → 2.11.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.
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { ClientError, CorsOriginError } from "@sanity/client";
4
4
  import { getAuthState, getNodeState, getIsInDashboardState, isStudioConfig, setAuthToken, AuthStateType, getLoginUrlState, observeOrganizationVerificationState, handleAuthCallback, logout, isProjectUserNotFoundClientError, getClientErrorApiDescription, getClientErrorApiBody, isImportError, getCorsErrorProjectId, createSanityInstance, isDatasetResource, agentGenerate, agentPatch, agentPrompt, agentTransform, agentTranslate, getTokenState, getCurrentUserState, getDashboardOrganizationId, getClientState, getOrCreateController, getOrCreateChannel, releaseChannel, isMediaLibraryResource, isCanvasResource, getFavoritesState, resolveFavoritesState, resolveDatasets, getDatasetsState, applyDocumentActions, resolveDocument, getDocumentState, subscribeDocumentEvents, getPermissionsState, getDocumentSyncStatus, editDocument, getQueryKey, parseQueryKey, getQueryState, resolveQuery, createGroqSearchFilter, resolveOrganization, getOrganizationState, resolveOrganizations, getOrganizationsState, getPresence, getProjectionState, resolveProjection, transformProjectionToPreview, PREVIEW_PROJECTION, resolveProject, getProjectState, resolveProjects, getProjectsState, getActiveReleasesState, getPerspectiveState, getUsersKey, parseUsersKey, getUsersState, resolveUsers, loadMoreUsers } from "@sanity/sdk";
5
5
  export * from "@sanity/sdk";
6
6
  import { createContext, useContext, useSyncExternalStore, useRef, useEffect, useState, Suspense, StrictMode, useCallback, useMemo, useInsertionEffect, useTransition } from "react";
7
- import { ErrorBoundary } from "react-error-boundary";
7
+ import { getErrorMessage, ErrorBoundary } from "react-error-boundary";
8
8
  import { SDK_CHANNEL_NAME, SDK_NODE_NAME } from "@sanity/message-protocol";
9
9
  import { firstValueFrom, filter, identity, Observable, startWith, distinctUntilChanged, switchMap, EMPTY } from "rxjs";
10
10
  import { initTelemetry, isDeepEqual, trackHookMounted, pickProperties } from "@sanity/sdk/_internal";
@@ -288,7 +288,7 @@ function CorsErrorComponent(t0) {
288
288
  t1 = t3;
289
289
  const corsUrl = t1;
290
290
  let t4;
291
- return $[2] !== corsUrl || $[3] !== error?.message || $[4] !== projectId ? (t4 = /* @__PURE__ */ jsx(Error$1, { heading: "Before you continue\u2026", ...projectId ? {
291
+ return $[2] !== corsUrl || $[3] !== error || $[4] !== projectId ? (t4 = /* @__PURE__ */ jsx(Error$1, { heading: "Before you continue\u2026", ...projectId ? {
292
292
  description: "To access your content, you need to <strong>add the following URL as a CORS origin</strong> to your Sanity project.",
293
293
  code: origin,
294
294
  cta: {
@@ -296,8 +296,8 @@ function CorsErrorComponent(t0) {
296
296
  href: corsUrl
297
297
  }
298
298
  } : {
299
- description: error?.message
300
- } }), $[2] = corsUrl, $[3] = error?.message, $[4] = projectId, $[5] = t4) : t4 = $[5], t4;
299
+ description: getErrorMessage(error)
300
+ } }), $[2] = corsUrl, $[3] = error, $[4] = projectId, $[5] = t4) : t4 = $[5], t4;
301
301
  }
302
302
  function isInIframe() {
303
303
  return typeof window < "u" && window.self !== window.top;
@@ -1801,7 +1801,7 @@ function useUsers(options) {
1801
1801
  loadMore
1802
1802
  };
1803
1803
  }
1804
- var version = "2.11.0";
1804
+ var version = "2.11.1";
1805
1805
  function getEnv(key) {
1806
1806
  if (typeof import.meta < "u" && import.meta.env)
1807
1807
  return import.meta.env[key];