sanity 5.3.0-next.17 → 5.3.0-next.19

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.
@@ -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
- "5.3.0-next.17+e6f4485432";
10
+ "5.3.0-next.19+94462ad1f5";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
@@ -15353,7 +15353,7 @@ declare interface TimelineOptions {
15353
15353
  /** @internal */
15354
15354
  declare interface TimelineState {
15355
15355
  chunks: Chunk[]
15356
- diff: ObjectDiff_2<Annotation_2, Record<string, any>> | null
15356
+ diff: ObjectDiff_2<Annotation_2> | null
15357
15357
  /** null is used here when the chunks hasn't loaded / is not known */
15358
15358
  hasMoreChunks: boolean | null
15359
15359
  isLoading: boolean
package/lib/desk.d.ts CHANGED
@@ -13165,7 +13165,7 @@ declare interface TimelineOptions {
13165
13165
  /** @internal */
13166
13166
  declare interface TimelineState {
13167
13167
  chunks: Chunk[]
13168
- diff: ObjectDiff<Annotation, Record<string, any>> | null
13168
+ diff: ObjectDiff<Annotation> | null
13169
13169
  /** null is used here when the chunks hasn't loaded / is not known */
13170
13170
  hasMoreChunks: boolean | null
13171
13171
  isLoading: boolean
package/lib/index.d.ts CHANGED
@@ -15770,7 +15770,7 @@ export declare interface TimelineOptions {
15770
15770
  /** @internal */
15771
15771
  export declare interface TimelineState {
15772
15772
  chunks: Chunk[]
15773
- diff: ObjectDiff_2<Annotation, Record<string, any>> | null
15773
+ diff: ObjectDiff_2<Annotation> | null
15774
15774
  /** null is used here when the chunks hasn't loaded / is not known */
15775
15775
  hasMoreChunks: boolean | null
15776
15776
  isLoading: boolean
package/lib/index.js CHANGED
@@ -8997,7 +8997,7 @@ function _temp3$J(innerController_0) {
8997
8997
  chunks,
8998
8998
  diff: innerController_0.sinceTime ? innerController_0.currentObjectDiff() : null,
8999
8999
  isLoading: innerController_0.isLoading,
9000
- isPristine: timelineReady ? chunks.length === 0 && hasMoreChunks === !1 : null,
9000
+ isPristine: timelineReady ? chunks.length === 0 && !hasMoreChunks : null,
9001
9001
  hasMoreChunks: !innerController_0.timeline.reachedEarliestEntry,
9002
9002
  lastNonDeletedRevId: lastNonDeletedChunk?.[0]?.id,
9003
9003
  onOlderRevision: innerController_0.onOlderRevision(),
@@ -30062,7 +30062,7 @@ function useScrollSelectionIntoView(scrollElement) {
30062
30062
  }
30063
30063
  function useSpellCheck() {
30064
30064
  const spellCheckOption = usePortableTextEditor().schemaTypes.block.options?.spellCheck, isChrome96 = typeof navigator > "u" ? !1 : /Chrome\/96/.test(navigator.userAgent);
30065
- return spellCheckOption === void 0 && isChrome96 === !0 ? !1 : spellCheckOption;
30065
+ return spellCheckOption === void 0 && isChrome96 ? !1 : spellCheckOption;
30066
30066
  }
30067
30067
  const DefaultComponent = (dProps) => {
30068
30068
  const $ = c(2);
@@ -30353,12 +30353,12 @@ const CollapseMenu = forwardRef(function(props2, ref) {
30353
30353
  let t10;
30354
30354
  if ($[30] !== collapsedIntersections || $[31] !== menuOptions) {
30355
30355
  let t112;
30356
- $[33] !== collapsedIntersections ? (t112 = (optionElement_1) => collapsedIntersections[optionElement_1.key]?.intersects === !1, $[33] = collapsedIntersections, $[34] = t112) : t112 = $[34], t10 = menuOptions.filter(t112), $[30] = collapsedIntersections, $[31] = menuOptions, $[32] = t10;
30356
+ $[33] !== collapsedIntersections ? (t112 = (optionElement_1) => !collapsedIntersections[optionElement_1.key]?.intersects, $[33] = collapsedIntersections, $[34] = t112) : t112 = $[34], t10 = menuOptions.filter(t112), $[30] = collapsedIntersections, $[31] = menuOptions, $[32] = t10;
30357
30357
  } else
30358
30358
  t10 = $[32];
30359
30359
  const overflowingCollapsedOptionElements = t10, shouldCollapse = overflowingExpandedElements.length > 0;
30360
30360
  let t11;
30361
- $[35] !== collapsedElements || $[36] !== collapsedIntersections || $[37] !== menuOptions || $[38] !== shouldCollapse ? (t11 = shouldCollapse ? collapsedElements.filter((optionElement_2) => collapsedIntersections[optionElement_2.key]?.intersects === !0) : menuOptions, $[35] = collapsedElements, $[36] = collapsedIntersections, $[37] = menuOptions, $[38] = shouldCollapse, $[39] = t11) : t11 = $[39];
30361
+ $[35] !== collapsedElements || $[36] !== collapsedIntersections || $[37] !== menuOptions || $[38] !== shouldCollapse ? (t11 = shouldCollapse ? collapsedElements.filter((optionElement_2) => collapsedIntersections[optionElement_2.key]?.intersects) : menuOptions, $[35] = collapsedElements, $[36] = collapsedIntersections, $[37] = menuOptions, $[38] = shouldCollapse, $[39] = t11) : t11 = $[39];
30362
30362
  const visibleMenuOptions = t11;
30363
30363
  let t12;
30364
30364
  $[40] !== menuButtonProps?.button ? (t12 = menuButtonProps?.button || /* @__PURE__ */ jsx(ContextMenuButton, {}), $[40] = menuButtonProps?.button, $[41] = t12) : t12 = $[41];
@@ -30812,7 +30812,7 @@ const MenuButtonMemo = memo(MenuButton), StyledMenuItem = styled(MenuItem$1)`
30812
30812
  const title = item.type.title || upperFirst(item.type.name);
30813
30813
  return /* @__PURE__ */ jsx(CollapseMenuButton, { "aria-label": t(item.inline ? "inputs.portable-text.action.insert-inline-object-aria-label" : "inputs.portable-text.action.insert-block-aria-label", {
30814
30814
  typeName: title
30815
- }), mode: "bleed", disabled: disabled || isVoidFocus && item.inline === !0 || !!item.type.deprecated, "data-testid": `${item.type.name}-insert-menu-button`, icon: item.icon, onClick: item.handle, text: title, tooltipText: t(item.type.deprecated ? item.type.deprecated.reason : item.inline ? "inputs.portable-text.action.insert-inline-object" : "inputs.portable-text.action.insert-block", {
30815
+ }), mode: "bleed", disabled: disabled || isVoidFocus && item.inline || !!item.type.deprecated, "data-testid": `${item.type.name}-insert-menu-button`, icon: item.icon, onClick: item.handle, text: title, tooltipText: t(item.type.deprecated ? item.type.deprecated.reason : item.inline ? "inputs.portable-text.action.insert-inline-object" : "inputs.portable-text.action.insert-block", {
30816
30816
  typeName: title
30817
30817
  }), tooltipProps: {
30818
30818
  disabled,
@@ -42209,13 +42209,13 @@ function FormBuilderProvider(props2) {
42209
42209
  $[3] !== fieldActions ? (t5 = {
42210
42210
  actions: fieldActions
42211
42211
  }, $[3] = fieldActions, $[4] = t5) : t5 = $[4];
42212
- const t6 = file?.directUploads !== !1;
42212
+ const t6 = file?.directUploads ?? !0;
42213
42213
  let t7;
42214
42214
  $[5] !== file.assetSources || $[6] !== t6 ? (t7 = {
42215
42215
  assetSources: file.assetSources,
42216
42216
  directUploads: t6
42217
42217
  }, $[5] = file.assetSources, $[6] = t6, $[7] = t7) : t7 = $[7];
42218
- const t8 = filterField || _temp$2k, t9 = image?.directUploads !== !1;
42218
+ const t8 = filterField || _temp$2k, t9 = image?.directUploads ?? !0;
42219
42219
  let t10;
42220
42220
  $[8] !== image.assetSources || $[9] !== t9 ? (t10 = {
42221
42221
  assetSources: image.assetSources,
@@ -45516,7 +45516,8 @@ const STATE_TTL_MS = 6e4, ORG_ACTIVE_RELEASE_COUNT_RESOURCE_CACHE_NAMESPACE = "o
45516
45516
  function createOrgActiveReleaseCountStore(client, activeReleasesCount) {
45517
45517
  const latestFetchState = new BehaviorSubject(null), staleFlag$ = new BehaviorSubject(!1), activeReleaseCountAtFetch = new BehaviorSubject(null);
45518
45518
  return {
45519
- orgActiveReleaseCount$: latestFetchState.pipe(switchMap$1((state) => state === null || staleFlag$.getValue() === !0 || activeReleaseCountAtFetch.getValue() !== activeReleasesCount ? (staleFlag$.next(!1), fetchReleaseLimits(client, "orgActiveReleaseCount").pipe(tap$1(() => activeReleaseCountAtFetch.next(activeReleasesCount)), map$1((data) => data.orgMeteredActiveReleaseCount), catchError$1((error) => {
45519
+ orgActiveReleaseCount$: latestFetchState.pipe(switchMap$1((state) => state === null || // oxlint-disable-next-line no-unnecessary-boolean-literal-compare
45520
+ staleFlag$.getValue() === !0 || activeReleaseCountAtFetch.getValue() !== activeReleasesCount ? (staleFlag$.next(!1), fetchReleaseLimits(client, "orgActiveReleaseCount").pipe(tap$1(() => activeReleaseCountAtFetch.next(activeReleasesCount)), map$1((data) => data.orgMeteredActiveReleaseCount), catchError$1((error) => {
45520
45521
  if (console.error("Failed to fetch org release count", error), !state) throw error;
45521
45522
  return of(state);
45522
45523
  }), switchMap$1((nextState) => (latestFetchState.next(nextState), timer(STATE_TTL_MS).subscribe(() => {
@@ -56431,7 +56432,7 @@ const useHasCopyToDraftOption = (documentType, fromRelease) => {
56431
56432
  $[23] !== isPublished || $[24] !== release || $[25] !== showCopyToReleaseMenuItem ? (t5 = !isPublished && (showCopyToReleaseMenuItem || release) && /* @__PURE__ */ jsx(MenuDivider, {}), $[23] = isPublished, $[24] = release, $[25] = showCopyToReleaseMenuItem, $[26] = t5) : t5 = $[26];
56432
56433
  let t6;
56433
56434
  $[27] !== disabled || $[28] !== hasDiscardPermission || $[29] !== isPublished || $[30] !== locked || $[31] !== onDiscard || $[32] !== t ? (t6 = !isPublished && /* @__PURE__ */ jsx(MenuItem, { icon: TrashIcon, onClick: onDiscard, text: t("release.action.discard-version"), tone: "critical", disabled: disabled || locked || !hasDiscardPermission, tooltipProps: {
56434
- disabled: hasDiscardPermission === !0,
56435
+ disabled: hasDiscardPermission,
56435
56436
  content: t("release.action.permission.error")
56436
56437
  } }), $[27] = disabled, $[28] = hasDiscardPermission, $[29] = isPublished, $[30] = locked, $[31] = onDiscard, $[32] = t, $[33] = t6) : t6 = $[33];
56437
56438
  let t7;
@@ -57526,12 +57527,15 @@ function resolveConditionalProperty(property, context) {
57526
57527
  parent,
57527
57528
  value
57528
57529
  } = context;
57529
- return typeof property == "boolean" || property === void 0 ? !!property : property({
57530
- document: document2,
57531
- parent,
57532
- value,
57533
- currentUser
57534
- }) === !0;
57530
+ return typeof property == "boolean" || property === void 0 ? !!property : (
57531
+ // oxlint-disable-next-line no-unnecessary-boolean-literal-compare - we can't trust the return value here is actually a boolean at runtime
57532
+ property({
57533
+ document: document2,
57534
+ parent,
57535
+ value,
57536
+ currentUser
57537
+ }) === !0
57538
+ );
57535
57539
  }
57536
57540
  function setAtPath(currentTree, path, value) {
57537
57541
  if (path.length === 0)
@@ -70240,7 +70244,7 @@ function CommentsInspectorInner(props2) {
70240
70244
  let t19, t20;
70241
70245
  $[60] !== getComment || $[61] !== loading || $[62] !== onClearSelectedComment || $[63] !== scrollToComment || $[64] !== setSelectedPath || $[65] !== setStatus || $[66] !== telemetry ? (t19 = () => {
70242
70246
  const commentToScrollTo = getComment(commentIdParamRef.current || "");
70243
- !loading && commentToScrollTo && didScrollToCommentFromParam.current === !1 && (setStatus(commentToScrollTo.status || "open"), setSelectedPath({
70247
+ !loading && commentToScrollTo && !didScrollToCommentFromParam.current && (setStatus(commentToScrollTo.status || "open"), setSelectedPath({
70244
70248
  fieldPath: commentToScrollTo.target.path?.field || null,
70245
70249
  origin: "url",
70246
70250
  threadId: commentToScrollTo.threadId || null
@@ -70610,7 +70614,7 @@ function CreateLinkedDocumentBannerContent(props2) {
70610
70614
  let t3;
70611
70615
  if ($[3] !== infoOpen ? (t3 = (event) => {
70612
70616
  event.key === "Escape" && infoOpen && setInfoOpen(!1);
70613
- }, $[3] = infoOpen, $[4] = t3) : t3 = $[4], useGlobalKeyDown(t3), metadata?.ejected !== !1)
70617
+ }, $[3] = infoOpen, $[4] = t3) : t3 = $[4], useGlobalKeyDown(t3), metadata?.ejected)
70614
70618
  return null;
70615
70619
  let t4;
70616
70620
  $[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */ jsx(CreateSvg, {}), $[5] = t4) : t4 = $[5];
@@ -74181,11 +74185,11 @@ const TaskCreated = defineEvent({
74181
74185
  function reducer$1(state, action) {
74182
74186
  switch (action.type) {
74183
74187
  case "TOGGLE_TASKS_VIEW":
74184
- return action.payload === !1 ? {
74185
- ...initialState,
74188
+ return action.payload ? {
74189
+ ...state,
74186
74190
  isOpen: action.payload
74187
74191
  } : {
74188
- ...state,
74192
+ ...initialState,
74189
74193
  isOpen: action.payload
74190
74194
  };
74191
74195
  case "CREATE_TASK":
@@ -82580,7 +82584,7 @@ function NewDocumentList(props2) {
82580
82584
  }, $[0] = onDocumentClick, $[1] = t0) : t0 = $[1];
82581
82585
  const handleDocumentClick = t0;
82582
82586
  let t1;
82583
- $[2] !== options ? (t1 = (index) => options[index]?.hasPermission === !1, $[2] = options, $[3] = t1) : t1 = $[3];
82587
+ $[2] !== options ? (t1 = (index) => options[index]?.hasPermission ?? !0, $[2] = options, $[3] = t1) : t1 = $[3];
82584
82588
  const getItemDisabled = t1;
82585
82589
  let t2;
82586
82590
  $[4] !== currentUser || $[5] !== handleDocumentClick || $[6] !== preview ? (t2 = (item) => /* @__PURE__ */ jsx(NewDocumentListOption, { currentUser, onClick: handleDocumentClick, option: item, preview }, item.id), $[4] = currentUser, $[5] = handleDocumentClick, $[6] = preview, $[7] = t2) : t2 = $[7];
@@ -87390,7 +87394,7 @@ function resolveIntentState(tools, prevState, nextState) {
87390
87394
  } : prev;
87391
87395
  if (!isRecord$4(canHandle))
87392
87396
  return prev;
87393
- const score = weightedParams.reduce((prevScore, weightedParam) => weightedParam in params && canHandle[weightedParam] === !0 ? prevScore + 1 : prevScore, 0);
87397
+ const score = weightedParams.reduce((prevScore, weightedParam) => weightedParam in params && canHandle[weightedParam] ? prevScore + 1 : prevScore, 0);
87394
87398
  return score > prev.score ? {
87395
87399
  score,
87396
87400
  tool