sanity 5.29.0-next.13 → 5.29.0-next.14

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,4 +1,4 @@
1
- var version = "5.29.0-next.13+054950f5ec";
1
+ var version = "5.29.0-next.14+30f89d5b82";
2
2
  let buildVersion;
3
3
  try {
4
4
  buildVersion = process.env.PKG_BUILD_VERSION;
@@ -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.29.0-next.13+054950f5ec";
10
+ "5.29.0-next.14+30f89d5b82";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
package/lib/structure.js CHANGED
@@ -387,7 +387,7 @@ function _temp$1(prevState, nextState) {
387
387
  };
388
388
  }
389
389
  function IncomingReferencesType(t0) {
390
- const $ = c(69), {
390
+ const $ = c(73), {
391
391
  type,
392
392
  referenced,
393
393
  onLinkDocument,
@@ -403,37 +403,43 @@ function IncomingReferencesType(t0) {
403
403
  getClient
404
404
  } = useSource(), displayedId = displayed?._id;
405
405
  let t1;
406
- $[0] !== displayedId || $[1] !== documentPreviewStore || $[2] !== filter2 || $[3] !== filterParams || $[4] !== getClient || $[5] !== type.type ? (t1 = getIncomingReferences({
406
+ $[0] !== filter2 ? (t1 = () => filter2, $[0] = filter2, $[1] = t1) : t1 = $[1];
407
+ const [memoizedFilter] = useState(t1);
408
+ let t2;
409
+ $[2] !== filterParams ? (t2 = () => filterParams, $[2] = filterParams, $[3] = t2) : t2 = $[3];
410
+ const [memoizedFilterParams] = useState(t2);
411
+ let t3;
412
+ $[4] !== displayedId || $[5] !== documentPreviewStore || $[6] !== getClient || $[7] !== memoizedFilter || $[8] !== memoizedFilterParams || $[9] !== type.type ? (t3 = getIncomingReferences({
407
413
  documentId: displayedId,
408
414
  documentPreviewStore,
409
415
  type: type.type,
410
- filter: filter2,
411
- filterParams,
416
+ filter: memoizedFilter,
417
+ filterParams: memoizedFilterParams,
412
418
  getClient
413
- }), $[0] = displayedId, $[1] = documentPreviewStore, $[2] = filter2, $[3] = filterParams, $[4] = getClient, $[5] = type.type, $[6] = t1) : t1 = $[6];
414
- const references$ = t1, {
419
+ }), $[4] = displayedId, $[5] = documentPreviewStore, $[6] = getClient, $[7] = memoizedFilter, $[8] = memoizedFilterParams, $[9] = type.type, $[10] = t3) : t3 = $[10];
420
+ const references$ = t3, {
415
421
  documents,
416
422
  loading
417
423
  } = useObservable(references$, INITIAL_STATE), schema = useSchema(), {
418
424
  t
419
425
  } = useTranslation(structureLocaleNamespace);
420
- let t2;
421
- $[7] !== schema || $[8] !== type.type ? (t2 = schema.get(type.type), $[7] = schema, $[8] = type.type, $[9] = t2) : t2 = $[9];
422
- const schemaType = t2, client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS), [isAdding, setIsAdding] = useState(!1), [newReferenceId, setNewReferenceId] = useState(null), {
426
+ let t4;
427
+ $[11] !== schema || $[12] !== type.type ? (t4 = schema.get(type.type), $[11] = schema, $[12] = type.type, $[13] = t4) : t4 = $[13];
428
+ const schemaType = t4, client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS), [isAdding, setIsAdding] = useState(!1), [newReferenceId, setNewReferenceId] = useState(null), {
423
429
  editState
424
430
  } = useDocumentPane(), toast = useToast();
425
- let t3;
426
- $[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
431
+ let t5;
432
+ $[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
427
433
  setIsAdding(_temp);
428
- }, $[10] = t3) : t3 = $[10];
429
- const handleAdd = t3, publishedExists = !!editState?.published;
430
- let t4;
431
- $[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = async (documentId) => {
434
+ }, $[14] = t5) : t5 = $[14];
435
+ const handleAdd = t5, publishedExists = !!editState?.published;
436
+ let t6;
437
+ $[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t6 = async (documentId) => {
432
438
  setIsAdding(!1), setNewReferenceId(documentId);
433
- }, $[11] = t4) : t4 = $[11];
434
- const handleCreateNewReference = t4;
435
- let t5;
436
- $[12] !== client || $[13] !== onLinkDocument || $[14] !== publishedExists || $[15] !== referenced.id || $[16] !== referenced.type || $[17] !== schemaType?.liveEdit || $[18] !== toast ? (t5 = async (documentId_0) => {
439
+ }, $[15] = t6) : t6 = $[15];
440
+ const handleCreateNewReference = t6;
441
+ let t7;
442
+ $[16] !== client || $[17] !== onLinkDocument || $[18] !== publishedExists || $[19] !== referenced.id || $[20] !== referenced.type || $[21] !== schemaType?.liveEdit || $[22] !== toast ? (t7 = async (documentId_0) => {
437
443
  setIsAdding(!1), setNewReferenceId(documentId_0);
438
444
  const liveEdit = !!schemaType?.liveEdit, document = await client.fetch("*[_id == $id][0]", {
439
445
  id: documentId_0
@@ -456,47 +462,47 @@ function IncomingReferencesType(t0) {
456
462
  return;
457
463
  }
458
464
  isPublishedId(documentId_0) && !liveEdit && (linkedDocument._id = getDraftId(documentId_0)), await client.createOrReplace(linkedDocument);
459
- }, $[12] = client, $[13] = onLinkDocument, $[14] = publishedExists, $[15] = referenced.id, $[16] = referenced.type, $[17] = schemaType?.liveEdit, $[18] = toast, $[19] = t5) : t5 = $[19];
460
- const handleLinkDocument = t5;
461
- let t6, t7;
462
- $[20] !== documents || $[21] !== newReferenceId ? (t6 = () => {
465
+ }, $[16] = client, $[17] = onLinkDocument, $[18] = publishedExists, $[19] = referenced.id, $[20] = referenced.type, $[21] = schemaType?.liveEdit, $[22] = toast, $[23] = t7) : t7 = $[23];
466
+ const handleLinkDocument = t7;
467
+ let t8, t9;
468
+ $[24] !== documents || $[25] !== newReferenceId ? (t8 = () => {
463
469
  documents.length > 0 && newReferenceId && documents.find((document_0) => getPublishedId(document_0._id) === getPublishedId(newReferenceId)) && setNewReferenceId(null);
464
- }, t7 = [documents, newReferenceId], $[20] = documents, $[21] = newReferenceId, $[22] = t6, $[23] = t7) : (t6 = $[22], t7 = $[23]), useEffect(t6, t7);
465
- let t8;
466
- $[24] !== actions || $[25] !== referenced.id ? (t8 = (document_1) => /* @__PURE__ */ jsx(IncomingReferenceDocument, { document: document_1, referenceToId: referenced.id, actions }), $[24] = actions, $[25] = referenced.id, $[26] = t8) : t8 = $[26];
467
- const renderItem = t8;
470
+ }, t9 = [documents, newReferenceId], $[24] = documents, $[25] = newReferenceId, $[26] = t8, $[27] = t9) : (t8 = $[26], t9 = $[27]), useEffect(t8, t9);
471
+ let t10;
472
+ $[28] !== actions || $[29] !== referenced.id ? (t10 = (document_1) => /* @__PURE__ */ jsx(IncomingReferenceDocument, { document: document_1, referenceToId: referenced.id, actions }), $[28] = actions, $[29] = referenced.id, $[30] = t10) : t10 = $[30];
473
+ const renderItem = t10;
468
474
  if (!schemaType)
469
475
  return null;
470
476
  if (loading) {
471
- let t92;
472
- $[27] !== t ? (t92 = t("incoming-references-input.types-loading"), $[27] = t, $[28] = t92) : t92 = $[28];
473
- let t102;
474
- return $[29] !== t92 ? (t102 = /* @__PURE__ */ jsx(LoadingBlock, { showText: !0, title: t92 }), $[29] = t92, $[30] = t102) : t102 = $[30], t102;
477
+ let t112;
478
+ $[31] !== t ? (t112 = t("incoming-references-input.types-loading"), $[31] = t, $[32] = t112) : t112 = $[32];
479
+ let t122;
480
+ return $[33] !== t112 ? (t122 = /* @__PURE__ */ jsx(LoadingBlock, { showText: !0, title: t112 }), $[33] = t112, $[34] = t122) : t122 = $[34], t122;
475
481
  }
476
- let t9;
477
- $[31] !== schemaType?.title || $[32] !== shouldRenderTitle || $[33] !== type.title ? (t9 = shouldRenderTitle && /* @__PURE__ */ jsx(Box, { paddingY: 2, paddingX: 0, children: /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: type.title || schemaType?.title }) }), $[31] = schemaType?.title, $[32] = shouldRenderTitle, $[33] = type.title, $[34] = t9) : t9 = $[34];
478
- let t10;
479
- $[35] !== documents || $[36] !== isAdding || $[37] !== newReferenceId || $[38] !== renderItem || $[39] !== schemaType?.title || $[40] !== t || $[41] !== type.title ? (t10 = documents.length > 0 ? /* @__PURE__ */ jsx(IncomingReferencesListContainer, { $itemCount: documents.length, children: /* @__PURE__ */ jsx(CommandList, { activeItemDataAttr: "data-hovered", ariaLabel: t("incoming-references-input.list-label", {
480
- type: type.title || schemaType?.title
481
- }), canReceiveFocus: !0, fixedHeight: !0, getItemKey: (index) => documents[index]._id, itemHeight: INCOMING_REFERENCES_ITEM_HEIGHT, items: documents, onlyShowSelectionWhenActive: !0, overscan: 5, renderItem, wrapAround: !1 }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "center", padding: 2, hidden: isAdding || !!newReferenceId, children: /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: t("incoming-references-input.no-items") }) }) }), $[35] = documents, $[36] = isAdding, $[37] = newReferenceId, $[38] = renderItem, $[39] = schemaType?.title, $[40] = t, $[41] = type.title, $[42] = t10) : t10 = $[42];
482
482
  let t11;
483
- $[43] !== newReferenceId || $[44] !== schemaType ? (t11 = newReferenceId && /* @__PURE__ */ jsx(SanityDefaultPreview, { icon: schemaType.icon, layout: "default", isPlaceholder: !0 }), $[43] = newReferenceId, $[44] = schemaType, $[45] = t11) : t11 = $[45];
483
+ $[35] !== schemaType?.title || $[36] !== shouldRenderTitle || $[37] !== type.title ? (t11 = shouldRenderTitle && /* @__PURE__ */ jsx(Box, { paddingY: 2, paddingX: 0, children: /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: type.title || schemaType?.title }) }), $[35] = schemaType?.title, $[36] = shouldRenderTitle, $[37] = type.title, $[38] = t11) : t11 = $[38];
484
484
  let t12;
485
- $[46] !== creationAllowed || $[47] !== fieldName || $[48] !== handleLinkDocument || $[49] !== isAdding || $[50] !== referenced || $[51] !== type.type ? (t12 = isAdding && /* @__PURE__ */ jsx(AddIncomingReference, { type: type.type, referenced, onCreateNewReference: handleCreateNewReference, onLinkDocument: handleLinkDocument, creationAllowed, fieldName }), $[46] = creationAllowed, $[47] = fieldName, $[48] = handleLinkDocument, $[49] = isAdding, $[50] = referenced, $[51] = type.type, $[52] = t12) : t12 = $[52];
485
+ $[39] !== documents || $[40] !== isAdding || $[41] !== newReferenceId || $[42] !== renderItem || $[43] !== schemaType?.title || $[44] !== t || $[45] !== type.title ? (t12 = documents.length > 0 ? /* @__PURE__ */ jsx(IncomingReferencesListContainer, { $itemCount: documents.length, children: /* @__PURE__ */ jsx(CommandList, { activeItemDataAttr: "data-hovered", ariaLabel: t("incoming-references-input.list-label", {
486
+ type: type.title || schemaType?.title
487
+ }), canReceiveFocus: !0, fixedHeight: !0, getItemKey: (index) => documents[index]._id, itemHeight: INCOMING_REFERENCES_ITEM_HEIGHT, items: documents, onlyShowSelectionWhenActive: !0, overscan: 5, renderItem, wrapAround: !1 }) }) : /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Flex, { align: "center", justify: "center", padding: 2, hidden: isAdding || !!newReferenceId, children: /* @__PURE__ */ jsx(Text, { size: 1, muted: !0, children: t("incoming-references-input.no-items") }) }) }), $[39] = documents, $[40] = isAdding, $[41] = newReferenceId, $[42] = renderItem, $[43] = schemaType?.title, $[44] = t, $[45] = type.title, $[46] = t12) : t12 = $[46];
486
488
  let t13;
487
- $[53] !== t10 || $[54] !== t11 || $[55] !== t12 ? (t13 = /* @__PURE__ */ jsxs(Card, { radius: 2, padding: 1, border: !0, tone: "default", children: [
488
- t10,
489
- t11,
490
- t12
491
- ] }), $[53] = t10, $[54] = t11, $[55] = t12, $[56] = t13) : t13 = $[56];
489
+ $[47] !== newReferenceId || $[48] !== schemaType ? (t13 = newReferenceId && /* @__PURE__ */ jsx(SanityDefaultPreview, { icon: schemaType.icon, layout: "default", isPlaceholder: !0 }), $[47] = newReferenceId, $[48] = schemaType, $[49] = t13) : t13 = $[49];
492
490
  let t14;
493
- $[57] !== creationAllowed || $[58] !== fieldName || $[59] !== onLinkDocument || $[60] !== referenced.id || $[61] !== referenced.type || $[62] !== t || $[63] !== type.type ? (t14 = onLinkDocument ? /* @__PURE__ */ jsx(Button, { size: "large", disabled: !1, icon: AddIcon, mode: "ghost", onClick: handleAdd, text: t("incoming-references-input.add-reference-item") }) : /* @__PURE__ */ jsx(CreateNewIncomingReference, { type: type.type, referenceToId: referenced.id, referenceToType: referenced.type, creationAllowed, onCreateNewReference: handleCreateNewReference, fieldName }), $[57] = creationAllowed, $[58] = fieldName, $[59] = onLinkDocument, $[60] = referenced.id, $[61] = referenced.type, $[62] = t, $[63] = type.type, $[64] = t14) : t14 = $[64];
491
+ $[50] !== creationAllowed || $[51] !== fieldName || $[52] !== handleLinkDocument || $[53] !== isAdding || $[54] !== referenced || $[55] !== type.type ? (t14 = isAdding && /* @__PURE__ */ jsx(AddIncomingReference, { type: type.type, referenced, onCreateNewReference: handleCreateNewReference, onLinkDocument: handleLinkDocument, creationAllowed, fieldName }), $[50] = creationAllowed, $[51] = fieldName, $[52] = handleLinkDocument, $[53] = isAdding, $[54] = referenced, $[55] = type.type, $[56] = t14) : t14 = $[56];
494
492
  let t15;
495
- return $[65] !== t13 || $[66] !== t14 || $[67] !== t9 ? (t15 = /* @__PURE__ */ jsxs(Stack, { space: 2, marginBottom: 2, children: [
496
- t9,
493
+ $[57] !== t12 || $[58] !== t13 || $[59] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Card, { radius: 2, padding: 1, border: !0, tone: "default", children: [
494
+ t12,
497
495
  t13,
498
496
  t14
499
- ] }), $[65] = t13, $[66] = t14, $[67] = t9, $[68] = t15) : t15 = $[68], t15;
497
+ ] }), $[57] = t12, $[58] = t13, $[59] = t14, $[60] = t15) : t15 = $[60];
498
+ let t16;
499
+ $[61] !== creationAllowed || $[62] !== fieldName || $[63] !== onLinkDocument || $[64] !== referenced.id || $[65] !== referenced.type || $[66] !== t || $[67] !== type.type ? (t16 = onLinkDocument ? /* @__PURE__ */ jsx(Button, { size: "large", disabled: !1, icon: AddIcon, mode: "ghost", onClick: handleAdd, text: t("incoming-references-input.add-reference-item") }) : /* @__PURE__ */ jsx(CreateNewIncomingReference, { type: type.type, referenceToId: referenced.id, referenceToType: referenced.type, creationAllowed, onCreateNewReference: handleCreateNewReference, fieldName }), $[61] = creationAllowed, $[62] = fieldName, $[63] = onLinkDocument, $[64] = referenced.id, $[65] = referenced.type, $[66] = t, $[67] = type.type, $[68] = t16) : t16 = $[68];
500
+ let t17;
501
+ return $[69] !== t11 || $[70] !== t15 || $[71] !== t16 ? (t17 = /* @__PURE__ */ jsxs(Stack, { space: 2, marginBottom: 2, children: [
502
+ t11,
503
+ t15,
504
+ t16
505
+ ] }), $[69] = t11, $[70] = t15, $[71] = t16, $[72] = t17) : t17 = $[72], t17;
500
506
  }
501
507
  function _temp(p) {
502
508
  return !p;
@@ -1 +1 @@
1
- {"version":3,"file":"structure.js","sources":["../src/structure/components/incomingReferencesDecoration/CrossDatasetIncomingReference/CrossDatasetIncomingReferenceType.tsx","../src/structure/components/incomingReferencesDecoration/CreateNewIncomingReference.tsx","../src/structure/components/incomingReferencesDecoration/LinkToExistingPreview.tsx","../src/structure/components/incomingReferencesDecoration/AddIncomingReference.tsx","../src/structure/components/incomingReferencesDecoration/IncomingReferencesType.tsx","../src/structure/components/incomingReferencesDecoration/types.ts","../src/structure/components/incomingReferencesDecoration/IncomingReferencesList.tsx","../src/structure/components/incomingReferencesDecoration/IncomingReferencesDecoration.tsx","../src/structure/components/incomingReferencesDecoration/defineIncomingReferenceDecoration.tsx","../src/structure/components/incomingReferencesDecoration/isIncomingReferenceCreation.ts"],"sourcesContent":["import {Box, Card, Flex, Stack, Text} from '@sanity/ui'\nimport {useCallback, useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {\n CommandList,\n type CommandListRenderItemCallback,\n DEFAULT_STUDIO_CLIENT_OPTIONS,\n LoadingBlock,\n useClient,\n useDocumentPreviewStore,\n useSchema,\n useTranslation,\n} from 'sanity'\n\nimport {structureLocaleNamespace} from '../../../i18n'\nimport {INITIAL_STATE} from '../getIncomingReferences'\nimport {INCOMING_REFERENCES_ITEM_HEIGHT, IncomingReferencesListContainer} from '../shared'\nimport {type CrossDatasetIncomingReference} from '../types'\nimport {CrossDatasetIncomingReferenceDocumentPreview} from './CrossDatasetIncomingReferenceDocumentPreview'\nimport {\n type CrossDatasetIncomingReferenceDocument,\n getCrossDatasetIncomingReferences,\n} from './getCrossDatasetIncomingReferences'\n\nexport function CrossDatasetIncomingReferenceType({\n type,\n referenced,\n shouldRenderTitle,\n}: {\n shouldRenderTitle: boolean\n referenced: {id: string; type: string}\n type: CrossDatasetIncomingReference\n}) {\n const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n const documentPreviewStore = useDocumentPreviewStore()\n\n const references$ = useMemo(\n () =>\n getCrossDatasetIncomingReferences({\n documentId: referenced.id,\n client,\n type: type,\n documentPreviewStore,\n }),\n [client, type, referenced.id, documentPreviewStore],\n )\n\n const {documents, loading} = useObservable(references$, INITIAL_STATE)\n\n const schema = useSchema()\n const {t} = useTranslation(structureLocaleNamespace)\n const schemaType = schema.get(type.type)\n\n const renderItem = useCallback<\n CommandListRenderItemCallback<CrossDatasetIncomingReferenceDocument>\n >(\n (document) => <CrossDatasetIncomingReferenceDocumentPreview document={document} type={type} />,\n [type],\n )\n\n if (!schemaType) return null\n if (loading) {\n return <LoadingBlock showText title={t('incoming-references-input.types-loading')} />\n }\n return (\n <Stack space={2} marginBottom={2}>\n {shouldRenderTitle && (\n <Box paddingY={2} paddingX={0}>\n <Text size={1} weight=\"medium\">\n {type.title || schemaType?.title}\n </Text>\n </Box>\n )}\n <Card radius={2} padding={1} border tone=\"default\">\n {documents && documents.length > 0 ? (\n <IncomingReferencesListContainer $itemCount={documents.length}>\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={t('incoming-references-input.list-label', {\n type: type.title || schemaType?.title,\n })}\n canReceiveFocus\n fixedHeight\n getItemKey={(index) => documents[index].id}\n itemHeight={INCOMING_REFERENCES_ITEM_HEIGHT}\n items={documents}\n onlyShowSelectionWhenActive\n overscan={5}\n renderItem={renderItem}\n wrapAround={false}\n />\n </IncomingReferencesListContainer>\n ) : (\n <>\n <Flex align=\"center\" justify=\"center\" padding={2}>\n <Text size={1} muted>\n {t('incoming-references-input.no-items')}\n </Text>\n </Flex>\n </>\n )}\n </Card>\n </Stack>\n )\n}\n","import {uuid} from '@sanity/uuid'\nimport {useCallback, useMemo} from 'react'\nimport {\n CreateReferenceButton,\n type CreateReferenceOption,\n getPublishedId,\n isNonNullable,\n useReferenceInputOptions,\n} from 'sanity'\nimport {useRouter} from 'sanity/router'\n\nimport {usePaneRouter} from '../paneRouter'\nimport {type IncomingReferenceCreationParams} from './isIncomingReferenceCreation'\nimport {type IncomingReferencesOptions} from './types'\n\nexport function CreateNewIncomingReference({\n type,\n referenceToId,\n referenceToType,\n onCreateNewReference,\n fieldName,\n creationAllowed,\n}: {\n type: string\n referenceToId: string\n referenceToType: string\n onCreateNewReference: (id: string) => void\n fieldName: string\n creationAllowed: IncomingReferencesOptions['creationAllowed']\n}) {\n const {initialValueTemplateItems} = useReferenceInputOptions()\n\n const {navigate} = useRouter()\n const {routerPanesState, groupIndex} = usePaneRouter()\n\n const handleCreate = useCallback(\n (option: CreateReferenceOption) => {\n const id = uuid()\n navigate({\n panes: [\n ...routerPanesState.slice(0, groupIndex + 1),\n [\n {\n id: getPublishedId(id),\n params: {type, template: option.template.id},\n payload: {\n reference: {\n _type: 'reference',\n _ref: referenceToId,\n _weak: true,\n _strengthenOnPublish: {type: referenceToType},\n },\n from: {fieldName, type: referenceToType},\n // eslint-disable-next-line camelcase\n __internal_isIncomingReferenceCreation: true,\n } satisfies IncomingReferenceCreationParams,\n },\n ],\n ],\n })\n onCreateNewReference(id)\n },\n [\n type,\n navigate,\n routerPanesState,\n groupIndex,\n referenceToId,\n referenceToType,\n onCreateNewReference,\n fieldName,\n ],\n )\n\n const createOptions = useMemo(() => {\n if (!creationAllowed) return []\n return (initialValueTemplateItems || [])\n\n .filter((i) => {\n const typeMatch = type === i.template?.schemaType\n if (Array.isArray(creationAllowed)) {\n // Check if the template id is in the creationAllowed array\n return typeMatch && creationAllowed.includes(i.template.id)\n }\n return typeMatch\n })\n .map((item): CreateReferenceOption | undefined =>\n item.template?.schemaType\n ? {\n id: item.id,\n title: item.title || `${item.template.schemaType} from template ${item.template?.id}`,\n i18n: item.i18n,\n type: item.template.schemaType,\n icon: item.icon,\n template: {\n id: item.template?.id,\n params: item.parameters,\n },\n\n permission: {granted: item.granted, reason: item.reason},\n }\n : undefined,\n )\n .filter(isNonNullable)\n }, [creationAllowed, initialValueTemplateItems, type])\n\n if (!creationAllowed) {\n return null\n }\n return (\n <CreateReferenceButton\n id={`create-new-incoming-reference-${type}`}\n createOptions={createOptions}\n onCreate={handleCreate}\n />\n )\n}\n","import {type SchemaType} from '@sanity/types'\nimport {type BadgeTone, Text} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {\n type DocumentPreviewStore,\n getPreviewStateObservable,\n getPreviewValueWithFallback,\n getReleaseIdFromReleaseDocumentId,\n getReleaseTone,\n getVersionFromId,\n isDraftId,\n isPublishedId,\n isVersionId,\n PreviewCard,\n ReleaseTitle,\n SanityDefaultPreview,\n useActiveReleases,\n useTranslation,\n VersionInlineBadge,\n} from 'sanity'\n\nexport interface LinkToExistingPreviewProps {\n documentPreviewStore: DocumentPreviewStore\n schemaType: SchemaType\n value: {_id: string; _type: string}\n onLinkToDocument: () => void\n}\n\nconst getPerspective = (id: string) => {\n if (isDraftId(id)) return ['drafts']\n if (isVersionId(id)) return [getVersionFromId(id) as string]\n if (isPublishedId(id)) return ['published']\n return ['raw']\n}\n\nexport function LinkToExistingPreview(props: LinkToExistingPreviewProps) {\n const {schemaType, value, onLinkToDocument} = props\n const {data: releases} = useActiveReleases()\n const {t} = useTranslation()\n\n const previewStateObservable = useMemo(() => {\n return getPreviewStateObservable(\n props.documentPreviewStore,\n schemaType,\n value._id,\n getPerspective(value._id),\n )\n }, [props.documentPreviewStore, schemaType, value._id])\n\n const {snapshot, original, isLoading} = useObservable(previewStateObservable, {\n snapshot: null,\n isLoading: true,\n original: null,\n })\n\n const badgeProps = useMemo(():\n | {kind: 'static'; tone: BadgeTone; text: string}\n | {kind: 'release'; tone: BadgeTone; releaseTitle: string | undefined; releaseFallback: string}\n | null => {\n const id = value._id\n if (isDraftId(id)) {\n return {\n kind: 'static',\n tone: getReleaseTone('drafts'),\n text: t('release.chip.draft'),\n }\n }\n if (isPublishedId(id)) {\n return {\n kind: 'static',\n tone: getReleaseTone('published'),\n text: t('release.chip.published'),\n }\n }\n if (isVersionId(id)) {\n const releaseId = getVersionFromId(id)\n const release = releases.find((r) => getReleaseIdFromReleaseDocumentId(r._id) === releaseId)\n if (release) {\n return {\n kind: 'release',\n tone: getReleaseTone(release),\n releaseTitle: release.metadata.title,\n releaseFallback: release._id,\n }\n }\n }\n return null\n }, [releases, value._id, t])\n\n /**\n * If the document is not found, for example because it will be unpublished.\n * Then we don't want to render the preview of it. Because it shouldn't be possible\n * to link to a document that will be unpublished in this same release\n */\n if (!snapshot && !isLoading) return null\n return (\n <PreviewCard __unstable_focusRing onClick={onLinkToDocument} as=\"button\" radius={2}>\n <SanityDefaultPreview\n {...getPreviewValueWithFallback({snapshot, original, fallback: value})}\n isPlaceholder={isLoading}\n icon={schemaType.icon}\n layout=\"default\"\n status={\n badgeProps ? (\n <Text size={0}>\n {badgeProps.kind === 'release' ? (\n <ReleaseTitle title={badgeProps.releaseTitle} fallback={badgeProps.releaseFallback}>\n {({displayTitle}) => (\n <VersionInlineBadge $tone={badgeProps.tone}>{displayTitle}</VersionInlineBadge>\n )}\n </ReleaseTitle>\n ) : (\n <VersionInlineBadge $tone={badgeProps.tone}>{badgeProps.text}</VersionInlineBadge>\n )}\n </Text>\n ) : undefined\n }\n />\n </PreviewCard>\n )\n}\n","import {DEFAULT_MAX_FIELD_DEPTH} from '@sanity/schema/_internal'\nimport {type SanityDocumentLike} from '@sanity/types'\nimport {Box, Grid, Stack, Text, useToast} from '@sanity/ui'\nimport {useCallback, useMemo, useState} from 'react'\nimport {useObservableEvent} from 'react-rx'\nimport {catchError, concat, filter, map, type Observable, of, scan, switchMap, tap} from 'rxjs'\nimport {\n createSearch,\n DEFAULT_STUDIO_CLIENT_OPTIONS,\n getPublishedId,\n isDraftId,\n isNonNullable,\n isPublishedId,\n isVersionId,\n ReferenceAutocomplete,\n type SanityClient,\n type SchemaType,\n type SearchStrategy,\n useClient,\n useDocumentPreviewStore,\n useSchema,\n useSource,\n useTranslation,\n} from 'sanity'\n\nimport {structureLocaleNamespace} from '../../i18n'\nimport {CreateNewIncomingReference} from './CreateNewIncomingReference'\nimport {LinkToExistingPreview} from './LinkToExistingPreview'\nimport {type IncomingReferencesOptions} from './types'\n\ninterface ReferenceSearchState {\n hits: ReferenceSearchHit[]\n isLoading: boolean\n searchString?: string\n}\n\ninterface ReferenceOption {\n value: string\n hit: ReferenceSearchHit\n}\ninterface ReferenceSearchHit {\n _id: string\n _type: string\n}\n\nconst INITIAL_SEARCH_STATE: ReferenceSearchState = {\n hits: [],\n isLoading: false,\n}\nconst NO_FILTER = () => true\n\nconst incomingReferenceSearch = (\n client: SanityClient,\n schemaType: SchemaType,\n searchStrategy: SearchStrategy | undefined,\n): ((textTerm: string) => Observable<ReferenceSearchHit[]>) => {\n const search = createSearch([schemaType], client, {\n maxDepth: DEFAULT_MAX_FIELD_DEPTH,\n strategy: searchStrategy,\n tag: 'search.incoming-reference',\n })\n return (textTerm: string) =>\n search(textTerm, {perspective: 'raw'}).pipe(\n map(({hits}) => hits.map(({hit}) => hit)),\n map((docs) => {\n // We want to collate drafts and published documents into a single entry, but keep the versions as a separate entry\n const byId: Map<string, SanityDocumentLike> = new Map()\n\n docs.forEach((doc) => {\n if (isVersionId(doc._id)) {\n // We want to preserve version documents as a different entry.\n byId.set(doc._id, doc)\n return\n }\n const publishedId = getPublishedId(doc._id)\n const entry = byId.get(publishedId)\n if (!entry) {\n byId.set(publishedId, doc)\n // If the document is a draft and the entry is published, we want to keep the draft.\n } else if (isDraftId(doc._id) && isPublishedId(entry._id)) {\n byId.set(publishedId, doc)\n }\n })\n return Array.from(byId.values())\n }),\n map((collated) =>\n collated.map((entry) => ({\n _id: entry._id,\n _type: entry._type,\n })),\n ),\n map((docs) => docs.slice(0, 100)),\n )\n}\n\n/**\n * This component is responsible for two things:\n * 1) Search for the document type to add to the incoming references.\n * 2) Render the CreateNewIncomingReference button. Allowing users to add a new incoming reference.\n */\nexport function AddIncomingReference({\n type,\n referenced,\n onCreateNewReference,\n onLinkDocument,\n fieldName,\n creationAllowed,\n}: {\n type: string\n referenced: {id: string; type: string}\n onCreateNewReference: (id: string) => void\n onLinkDocument: (documentId: string) => void\n fieldName: string\n creationAllowed: IncomingReferencesOptions['creationAllowed']\n}) {\n const {t} = useTranslation(structureLocaleNamespace)\n const {push} = useToast()\n const schema = useSchema()\n const schemaType = schema.get(type)\n const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n const source = useSource()\n const {strategy: searchStrategy} = source.search\n const documentPreviewStore = useDocumentPreviewStore()\n const handleSearch = useMemo(\n () => incomingReferenceSearch(client, schemaType!, searchStrategy),\n [client, schemaType, searchStrategy],\n )\n\n const [searchState, setSearchState] = useState(INITIAL_SEARCH_STATE)\n const handleQueryChange = useObservableEvent((inputValue$: Observable<string | null>) => {\n return inputValue$.pipe(\n filter(isNonNullable),\n switchMap((searchString) =>\n concat(\n of({isLoading: true, hits: []}),\n handleSearch(searchString).pipe(\n map((hits) => ({hits, searchString, isLoading: false})),\n catchError((error) => {\n push({\n title: 'Reference search failed',\n description: error.message,\n status: 'error',\n id: `reference-search-fail-${type}`,\n })\n console.error(error)\n return of({hits: [], isLoading: false})\n }),\n ),\n ),\n ),\n\n scan(\n (prevState, nextState: ReferenceSearchState) => ({...prevState, ...nextState}),\n INITIAL_SEARCH_STATE,\n ),\n\n tap(setSearchState),\n )\n })\n\n const options: ReferenceOption[] = useMemo(() => {\n return searchState.hits.map((hit) => ({\n value: hit._id,\n hit: hit,\n }))\n }, [searchState.hits])\n\n const handleAutocompleteOpenButtonClick = useCallback(() => {\n handleQueryChange('')\n }, [handleQueryChange])\n\n const renderOption = useCallback(\n (option: ReferenceOption) => {\n return (\n <LinkToExistingPreview\n onLinkToDocument={() => onLinkDocument(option.value)}\n documentPreviewStore={documentPreviewStore}\n schemaType={schemaType!}\n value={option.hit}\n />\n )\n },\n [documentPreviewStore, schemaType, onLinkDocument],\n )\n\n return (\n <Stack space={2} padding={2}>\n <Box paddingY={2}>\n <Text size={1} weight=\"medium\">\n {t('incoming-references-input.reference-from', {type})}\n </Text>\n </Box>\n <Grid gap={creationAllowed ? 2 : 0} style={{gridTemplateColumns: '1fr min-content'}}>\n <ReferenceAutocomplete\n id={`${type}-autocomplete`}\n radius={2}\n autoFocus\n options={options}\n placeholder={t('incoming-references-input.type-to-search')}\n onQueryChange={handleQueryChange}\n filterOption={NO_FILTER}\n path={[]}\n // @ts-expect-error - Types are not derived correctly\n renderOption={renderOption}\n openButton={{onClick: handleAutocompleteOpenButtonClick}}\n referenceElement={null}\n loading={searchState.isLoading}\n />\n <CreateNewIncomingReference\n type={type}\n referenceToId={referenced.id}\n referenceToType={referenced.type}\n creationAllowed={creationAllowed}\n onCreateNewReference={onCreateNewReference}\n fieldName={fieldName}\n />\n </Grid>\n </Stack>\n )\n}\n","import {AddIcon} from '@sanity/icons'\nimport {type SanityDocument} from '@sanity/types'\nimport {Box, Card, Flex, Stack, Text, useToast} from '@sanity/ui'\nimport {useCallback, useEffect, useMemo, useState} from 'react'\nimport {useObservable} from 'react-rx'\nimport {\n CommandList,\n type CommandListRenderItemCallback,\n DEFAULT_STUDIO_CLIENT_OPTIONS,\n getDraftId,\n getPublishedId,\n isPublishedId,\n LoadingBlock,\n SanityDefaultPreview,\n useClient,\n useDocumentPreviewStore,\n useSchema,\n useSource,\n useTranslation,\n} from 'sanity'\n\nimport {Button} from '../../../ui-components/button/Button'\nimport {structureLocaleNamespace} from '../../i18n'\nimport {useDocumentPane} from '../../panes/document/useDocumentPane'\nimport {AddIncomingReference} from './AddIncomingReference'\nimport {CreateNewIncomingReference} from './CreateNewIncomingReference'\nimport {getIncomingReferences, INITIAL_STATE} from './getIncomingReferences'\nimport {IncomingReferenceDocument} from './IncomingReferenceDocument'\nimport {INCOMING_REFERENCES_ITEM_HEIGHT, IncomingReferencesListContainer} from './shared'\nimport {type IncomingReferencesOptions, type IncomingReferenceType} from './types'\n\nexport function IncomingReferencesType({\n type,\n referenced,\n onLinkDocument,\n actions,\n shouldRenderTitle,\n fieldName,\n creationAllowed,\n filter,\n filterParams,\n}: {\n shouldRenderTitle: boolean\n referenced: {id: string; type: string}\n fieldName: string\n type: IncomingReferenceType\n onLinkDocument: IncomingReferencesOptions['onLinkDocument']\n actions: IncomingReferencesOptions['actions']\n creationAllowed: IncomingReferencesOptions['creationAllowed']\n filter: IncomingReferencesOptions['filter']\n filterParams: IncomingReferencesOptions['filterParams']\n}) {\n const documentPreviewStore = useDocumentPreviewStore()\n const {displayed} = useDocumentPane()\n const {getClient} = useSource()\n const displayedId = displayed?._id as string\n const references$ = useMemo(\n () =>\n getIncomingReferences({\n documentId: displayedId,\n documentPreviewStore,\n type: type.type,\n filter,\n filterParams,\n getClient,\n }),\n [documentPreviewStore, type, filter, filterParams, displayedId, getClient],\n )\n\n const {documents, loading} = useObservable(references$, INITIAL_STATE)\n\n const schema = useSchema()\n const {t} = useTranslation(structureLocaleNamespace)\n const schemaType = schema.get(type.type)\n const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n const [isAdding, setIsAdding] = useState(false)\n const [newReferenceId, setNewReferenceId] = useState<string | null>(null)\n const {editState} = useDocumentPane()\n const toast = useToast()\n const handleAdd = useCallback(() => {\n setIsAdding((p) => !p)\n }, [])\n\n const publishedExists = Boolean(editState?.published)\n\n const handleCreateNewReference = useCallback(async (documentId: string) => {\n setIsAdding(false)\n setNewReferenceId(documentId)\n }, [])\n\n const handleLinkDocument = useCallback(\n async (documentId: string) => {\n setIsAdding(false)\n setNewReferenceId(documentId)\n const liveEdit = Boolean(schemaType?.liveEdit)\n const document = await client.fetch('*[_id == $id][0]', {id: documentId})\n\n const linkedDocument = onLinkDocument?.(document, {\n _type: 'reference',\n _ref: getPublishedId(referenced.id),\n ...(publishedExists ? {} : {_weak: true, _strengthenOnPublish: {type: referenced.type}}),\n })\n if (!linkedDocument) {\n setNewReferenceId(null)\n toast.push({\n title: 'Not possible to link to document',\n description: 'The document you are trying to link cannot be linked to',\n status: 'error',\n })\n return\n }\n\n // if the document is published and the schema is not live edit, we want to update the draft id, not the published id\n // If it's a version, we can update the version document.\n if (isPublishedId(documentId) && !liveEdit) {\n linkedDocument._id = getDraftId(documentId)\n }\n await client.createOrReplace(linkedDocument)\n },\n [client, onLinkDocument, referenced, publishedExists, toast, schemaType?.liveEdit],\n )\n\n useEffect(() => {\n if (documents.length > 0 && newReferenceId) {\n // new reference is now part of the documents, we need to remove it from the newReferenceId state\n const isAdded = documents.find(\n (document) => getPublishedId(document._id) === getPublishedId(newReferenceId),\n )\n if (isAdded) setNewReferenceId(null)\n }\n }, [documents, newReferenceId])\n\n const renderItem = useCallback<CommandListRenderItemCallback<SanityDocument>>(\n (document) => (\n <IncomingReferenceDocument\n document={document}\n referenceToId={referenced.id}\n actions={actions}\n />\n ),\n [referenced.id, actions],\n )\n\n if (!schemaType) return null\n if (loading) {\n return <LoadingBlock showText title={t('incoming-references-input.types-loading')} />\n }\n return (\n <Stack space={2} marginBottom={2}>\n {shouldRenderTitle && (\n <Box paddingY={2} paddingX={0}>\n <Text size={1} weight=\"medium\">\n {type.title || schemaType?.title}\n </Text>\n </Box>\n )}\n <Card radius={2} padding={1} border tone=\"default\">\n {documents.length > 0 ? (\n <IncomingReferencesListContainer $itemCount={documents.length}>\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={t('incoming-references-input.list-label', {\n type: type.title || schemaType?.title,\n })}\n canReceiveFocus\n fixedHeight\n getItemKey={(index) => documents[index]._id}\n itemHeight={INCOMING_REFERENCES_ITEM_HEIGHT}\n items={documents}\n onlyShowSelectionWhenActive\n overscan={5}\n renderItem={renderItem}\n wrapAround={false}\n />\n </IncomingReferencesListContainer>\n ) : (\n <>\n <Flex\n align=\"center\"\n justify=\"center\"\n padding={2}\n hidden={isAdding || Boolean(newReferenceId)}\n >\n <Text size={1} muted>\n {t('incoming-references-input.no-items')}\n </Text>\n </Flex>\n </>\n )}\n\n {newReferenceId && (\n <SanityDefaultPreview icon={schemaType.icon} layout={'default'} isPlaceholder />\n )}\n {isAdding && (\n <AddIncomingReference\n type={type.type}\n referenced={referenced}\n onCreateNewReference={handleCreateNewReference}\n onLinkDocument={handleLinkDocument}\n creationAllowed={creationAllowed}\n fieldName={fieldName}\n />\n )}\n </Card>\n {onLinkDocument ? (\n <Button\n size=\"large\"\n disabled={false}\n icon={AddIcon}\n mode=\"ghost\"\n onClick={handleAdd}\n text={t('incoming-references-input.add-reference-item')}\n />\n ) : (\n <CreateNewIncomingReference\n type={type.type}\n referenceToId={referenced.id}\n referenceToType={referenced.type}\n creationAllowed={creationAllowed}\n onCreateNewReference={handleCreateNewReference}\n fieldName={fieldName}\n />\n )}\n </Stack>\n )\n}\n","import {type SelectableTone} from '@sanity/ui'\nimport {\n type ActionComponent,\n type DocumentActionDialogProps,\n type PreviewConfig,\n type SanityClient,\n type SanityDocument,\n} from 'sanity'\n\nexport type IncomingReferenceActionsContext = {\n /**\n * The document that is linked to the reference.\n */\n document: SanityDocument\n getClient: (options: {apiVersion: string}) => SanityClient\n}\n\nexport type IncomingReferenceActionDescription = {\n label: string\n icon?: React.ElementType\n tone?: SelectableTone\n disabled?: boolean\n onHandle: (() => Promise<void>) | (() => void)\n dialog?: DocumentActionDialogProps | false | null\n}\n\n/**\n * Incoming reference action component definition.\n * Allows users to define actions that will be shown in the IncomingReferences component as part\n * of each reference\n * example:\n * ```ts\n * export const LogReferenceAction: IncomingReferenceAction = ({document, getClient}) => {\n * return {\n * label: 'Log reference',\n * icon: LogIcon,\n * onHandle: () => console.log(document._id)\n * }\n * }\n * ```\n *\n * @beta\n */\nexport type IncomingReferenceAction = ActionComponent<\n IncomingReferenceActionsContext,\n IncomingReferenceActionDescription\n>\n\nexport interface CrossDatasetIncomingReference {\n type: string\n title?: string\n dataset: string\n preview: PreviewConfig\n studioUrl?: (document: {id: string; type?: string}) => string | null\n}\n\nexport interface IncomingReferenceType {\n type: string\n dataset?: never\n title?: string\n}\n\nexport function isCrossDatasetIncomingReference(\n type: IncomingReferenceType | CrossDatasetIncomingReference,\n): type is CrossDatasetIncomingReference {\n return Boolean(type.dataset)\n}\n\nexport type IncomingReferencesFilterResolver = (context: {\n document: SanityDocument | undefined\n getClient: (options: {apiVersion: string}) => SanityClient\n}) =>\n | string\n | {filter: string; filterParams?: Record<string, string>}\n | Promise<{filter: string; filterParams?: Record<string, string>}>\n\nexport type IncomingReferencesOptions = {\n name: string\n title?: string\n description?: string\n /**\n * The type of the incoming references.\n */\n types: (IncomingReferenceType | CrossDatasetIncomingReference)[]\n\n /**\n * The filter query to apply to the incoming references in addition to the type filter.\n * For example: filter all books that are from an specific editorial brand: `editorialBrand == \"Random House\"`\n * The `_type` filter is applied automatically.\n */\n filter?: string | IncomingReferencesFilterResolver\n filterParams?: Record<string, string>\n\n /**\n * Callback to link a document to a reference.\n *\n * This function is called when a user wants to link an existing document to the current document.\n * It receives two parameters:\n * - The document that will be linked (the target document)\n * - The reference object with all properties needed to establish the link\n *\n * The developer must implement this function to define where and how the reference\n * should be placed within the document structure. The function should return the\n * modified document with the reference properly added.\n *\n * For example:\n * - We want to link a book to an author:\n * ```ts\n * onLinkDocument: (document, reference) => {\n * return {\n * ...document,\n * author: reference,\n * }\n * }\n * ```\n *\n *\n * @param document - The document to link to the reference.\n * @param reference - The reference to link to the document.\n * @returns The document to link to the reference. If false, the document will not be linked to the reference.\n */\n\n onLinkDocument?: (\n document: SanityDocument,\n reference: {\n _type: 'reference'\n _ref: string\n _weak?: boolean\n _strengthenOnPublish?: {\n type: string\n }\n },\n ) => SanityDocument | false\n /**\n * Callback to define the actions that will be shown for the incoming reference document.\n *\n * For example:\n * ```ts\n * actions: ({document, client}) => {\n * return [\n * {label: 'Unlink document',\n * icon: TrashIcon,\n * tone: 'critical',\n * onClick: async () => {\n * await client.createOrReplace({...document, _id: getDraftId(document._id), author: undefined})\n * }\n * }\n * ]\n * }\n * ```\n * @param context - The context of the linked document.\n * @returns The actions that will be shown for the linked document.\n\n */\n actions?: IncomingReferenceAction[]\n /**\n * Whether to allow creation of new references.\n * default: true\n *\n * If false, it will only be possible to link to existing documents, if the `onLinkDocument` callback is provided.\n * If true, it will be possible to create new references to any template of the type.\n * If an array is provided, it will only be possible to create new references that match the template id in the array provided.\n *\n * To define how a creation will be handled, you can use the `initialValue` option in the\n * document type that will be linked.\n *\n * For example:\n * I want to create a new book from an author:\n * In the author we will have the <IncomingReferenceInput /> with the creationAllowed set to true.\n *\n * Then in the book type, we will have the `initialValue` option to define the default values for the new book.\n * This initialValue callback will receive the `reference` object that needs to be linked to the book in the params.\n *\n * ```ts\n * // Book type\n * export default {\n * type: 'document',\n * name: 'book',\n * title: 'Book',\n * fields: [\n * {\n * name: 'author',\n * type: 'reference',\n * to: [{type: 'author'}],\n * },\n * ],\n * initialValue: (params) => {\n * return {\n * author: params?.reference,\n * }\n * }\n * ```\n */\n creationAllowed?: boolean | string[]\n}\n","import {Card, Flex, Stack, Text} from '@sanity/ui'\nimport {useTranslation} from 'sanity'\n\nimport {structureLocaleNamespace} from '../../i18n'\nimport {useDocumentPane} from '../../panes/document/useDocumentPane'\nimport {CrossDatasetIncomingReferenceType} from './CrossDatasetIncomingReference/CrossDatasetIncomingReferenceType'\nimport {IncomingReferencesType} from './IncomingReferencesType'\nimport {type IncomingReferencesOptions, isCrossDatasetIncomingReference} from './types'\n\nexport function IncomingReferencesList({\n types,\n onLinkDocument,\n actions,\n filter,\n filterParams,\n name,\n creationAllowed,\n}: IncomingReferencesOptions) {\n const {documentId, documentType} = useDocumentPane()\n const {t} = useTranslation(structureLocaleNamespace)\n\n if (!types || types?.length === 0) {\n return (\n <Card border radius={2} padding={3} tone=\"critical\">\n <Flex align=\"center\" justify=\"center\">\n <Text size={1} muted>\n {t('incoming-references-input.types-not-defined')}\n </Text>\n </Flex>\n </Card>\n )\n }\n\n return (\n <Stack space={3}>\n {types.map((type) => {\n if (isCrossDatasetIncomingReference(type)) {\n return (\n <CrossDatasetIncomingReferenceType\n key={`${type.type}-${type.dataset || ''}`}\n type={type}\n referenced={{id: documentId, type: documentType}}\n shouldRenderTitle={types.length > 1}\n />\n )\n }\n return (\n <IncomingReferencesType\n key={type.type}\n type={type}\n referenced={{id: documentId, type: documentType}}\n onLinkDocument={onLinkDocument}\n actions={actions}\n shouldRenderTitle={types.length > 1}\n fieldName={name}\n creationAllowed={creationAllowed}\n filter={filter}\n filterParams={filterParams}\n />\n )\n })}\n </Stack>\n )\n}\n","import {Box, Flex, Stack, Text} from '@sanity/ui'\nimport startCase from 'lodash-es/startCase.js'\n\nimport {IncomingReferencesList} from './IncomingReferencesList'\nimport {type IncomingReferencesOptions} from './types'\n\n/**\n * @beta\n */\nexport function IncomingReferencesDecoration(\n props: IncomingReferencesOptions & {\n name: string\n title?: string\n description?: string\n },\n) {\n const {\n onLinkDocument,\n actions,\n filter,\n filterParams,\n name,\n creationAllowed = true,\n types,\n title,\n description,\n } = props\n\n return (\n <Stack space={2}>\n <Box paddingY={2}>\n <Stack space={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text as=\"label\" weight=\"medium\" size={1}>\n {title || startCase(name)}\n </Text>\n </Flex>\n\n {description && (\n <Text muted size={1}>\n {description}\n </Text>\n )}\n </Stack>\n </Box>\n <IncomingReferencesList\n name={name}\n types={types}\n onLinkDocument={onLinkDocument}\n actions={actions}\n filter={filter}\n filterParams={filterParams}\n creationAllowed={creationAllowed}\n />\n </Stack>\n )\n}\n","import {type DecorationMember} from 'sanity'\n\nimport {IncomingReferencesDecoration} from './IncomingReferencesDecoration'\nimport {type IncomingReferencesOptions} from './types'\n\n/**\n * Helper function to define an incoming references decoration.\n *\n * example:\n * ```ts\n * defineType({\n * name: 'author',\n * type: 'document',\n * renderMembers: (members) => {\n * return [\n * ...members,\n * defineIncomingReferenceDecoration({\n * name: 'incomingReferences',\n * title: 'Incoming references',\n * types: [{type: 'author'}],\n * }),\n * ]\n * },\n * })\n * ```\n *\n * @beta\n */\nexport function defineIncomingReferenceDecoration(\n options: IncomingReferencesOptions,\n): DecorationMember {\n return {\n kind: 'decoration',\n key: options.name,\n component: <IncomingReferencesDecoration {...options} />,\n }\n}\n","import {type DocumentDefinition} from 'sanity'\n\nexport interface IncomingReferenceCreationParams {\n reference: {\n _type: 'reference'\n _ref: string\n _weak?: boolean\n _strengthenOnPublish?: {\n type: string\n }\n }\n from: {\n fieldName: string\n type: string\n }\n __internal_isIncomingReferenceCreation: true\n [key: string]: unknown\n}\n\n/**\n * Helper function to check if the document is being created from an incoming reference.\n * It will be used in the initialValue callback to determine if the document is being created from an incoming reference.\n *\n * example:\n * ```ts\n * defineType({\n * name: 'book',\n * type: 'document',\n * fields: [...],\n * initialValue: (params) => {\n * // If the document is being created from an incoming reference, return the reference\n * // Otherwise, return undefined\n * return {\n * author: isIncomingReferenceCreation(params) ? params.reference : undefined,\n * }\n * },\n * })\n * ```\n *\n * @beta\n */\nexport function isIncomingReferenceCreation(\n initialValue: DocumentDefinition['initialValue'],\n): initialValue is IncomingReferenceCreationParams {\n return (\n typeof initialValue === 'object' &&\n initialValue !== null &&\n '__internal_isIncomingReferenceCreation' in initialValue\n )\n}\n"],"names":["CrossDatasetIncomingReferenceType","t0","$","_c","type","referenced","shouldRenderTitle","client","useClient","DEFAULT_STUDIO_CLIENT_OPTIONS","documentPreviewStore","useDocumentPreviewStore","t1","id","getCrossDatasetIncomingReferences","documentId","references$","documents","loading","useObservable","INITIAL_STATE","schema","useSchema","t","useTranslation","structureLocaleNamespace","T0","T1","t10","t2","t3","t4","t5","t6","t7","t8","t9","Symbol","for","bb0","schemaType","get","t11","document","renderItem","t12","t13","Stack","title","Card","length","index","INCOMING_REFERENCES_ITEM_HEIGHT","CreateNewIncomingReference","referenceToId","referenceToType","onCreateNewReference","fieldName","creationAllowed","initialValueTemplateItems","useReferenceInputOptions","navigate","useRouter","routerPanesState","groupIndex","usePaneRouter","option","uuid","panes","slice","getPublishedId","params","template","payload","reference","_type","_ref","_weak","_strengthenOnPublish","from","__internal_isIncomingReferenceCreation","handleCreate","i","typeMatch","Array","isArray","includes","filter","map","_temp","isNonNullable","createOptions","item","i18n","icon","parameters","permission","granted","reason","undefined","getPerspective","isDraftId","isVersionId","getVersionFromId","isPublishedId","LinkToExistingPreview","props","value","onLinkToDocument","data","releases","useActiveReleases","_id","getPreviewStateObservable","previewStateObservable","snapshot","isLoading","original","getReleaseTone","kind","tone","text","releaseId","r","getReleaseIdFromReleaseDocumentId","release","find","releaseTitle","metadata","releaseFallback","badgeProps","getPreviewValueWithFallback","fallback","displayTitle","INITIAL_SEARCH_STATE","hits","NO_FILTER","incomingReferenceSearch","searchStrategy","search","createSearch","maxDepth","DEFAULT_MAX_FIELD_DEPTH","strategy","tag","textTerm","perspective","pipe","hit","docs","byId","Map","forEach","doc","set","publishedId","entry","values","collated","AddIncomingReference","onLinkDocument","push","useToast","source","useSource","handleSearch","searchState","setSearchState","useState","inputValue$","switchMap","searchString","concat","of","catchError","error","description","message","status","console","scan","tap","handleQueryChange","useObservableEvent","_temp2","options","handleAutocompleteOpenButtonClick","renderOption","gridTemplateColumns","t14","onClick","t15","t16","t17","t18","prevState","nextState","IncomingReferencesType","actions","filterParams","displayed","useDocumentPane","getClient","displayedId","getIncomingReferences","isAdding","setIsAdding","newReferenceId","setNewReferenceId","editState","toast","handleAdd","publishedExists","Boolean","published","handleCreateNewReference","liveEdit","documentId_0","fetch","linkedDocument","getDraftId","createOrReplace","handleLinkDocument","document_0","useEffect","document_1","AddIcon","p","isCrossDatasetIncomingReference","dataset","IncomingReferencesList","types","name","documentType","IncomingReferencesDecoration","startCase","defineIncomingReferenceDecoration","key","component","isIncomingReferenceCreation","initialValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBO,SAAAA,kCAAAC,IAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA,GAA2C;AAAA,IAAAC;AAAAA,IAAAC;AAAAA,IAAAC;AAAAA,EAAAA,IAAAL,IAShDM,SAAeC,UAAUC,6BAA6B,GACtDC,uBAA6BC,wBAAAA;AAAyB,MAAAC;AAAAV,IAAA,CAAA,MAAAK,UAAAL,SAAAQ,wBAAAR,EAAA,CAAA,MAAAG,WAAAQ,MAAAX,SAAAE,QAIlDQ,KAAAE,kCAAkC;AAAA,IAAAC,YACpBV,WAAUQ;AAAAA,IAAGN;AAAAA,IAAAH;AAAAA,IAAAM;AAAAA,EAAAA,CAI1B,GAACR,OAAAK,QAAAL,OAAAQ,sBAAAR,EAAA,CAAA,IAAAG,WAAAQ,IAAAX,OAAAE,MAAAF,OAAAU,MAAAA,KAAAV,EAAA,CAAA;AAPN,QAAAc,cAEIJ,IASJ;AAAA,IAAAK;AAAAA,IAAAC;AAAAA,EAAAA,IAA6BC,cAAcH,aAAaI,aAAa,GAErEC,SAAeC,aACf;AAAA,IAAAC;AAAAA,EAAAA,IAAYC,eAAeC,wBAAwB;AAAC,MAAAC,IAAAC,IAAAC,KAAAC,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC,IAAAC;AAAA,MAAAlC,SAAAe,aAAAf,EAAA,CAAA,MAAAgB,WAAAhB,EAAA,CAAA,MAAAmB,UAAAnB,EAAA,CAAA,MAAAI,qBAAAJ,SAAAqB,KAAArB,EAAA,EAAA,MAAAE,MAAA;AAU5BwB,UAAAS,uBAAIC,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/components/incomingReferencesDecoration/CrossDatasetIncomingReference/CrossDatasetIncomingReferenceType.tsx","../src/structure/components/incomingReferencesDecoration/CreateNewIncomingReference.tsx","../src/structure/components/incomingReferencesDecoration/LinkToExistingPreview.tsx","../src/structure/components/incomingReferencesDecoration/AddIncomingReference.tsx","../src/structure/components/incomingReferencesDecoration/IncomingReferencesType.tsx","../src/structure/components/incomingReferencesDecoration/types.ts","../src/structure/components/incomingReferencesDecoration/IncomingReferencesList.tsx","../src/structure/components/incomingReferencesDecoration/IncomingReferencesDecoration.tsx","../src/structure/components/incomingReferencesDecoration/defineIncomingReferenceDecoration.tsx","../src/structure/components/incomingReferencesDecoration/isIncomingReferenceCreation.ts"],"sourcesContent":["import {Box, Card, Flex, Stack, Text} from '@sanity/ui'\nimport {useCallback, useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {\n CommandList,\n type CommandListRenderItemCallback,\n DEFAULT_STUDIO_CLIENT_OPTIONS,\n LoadingBlock,\n useClient,\n useDocumentPreviewStore,\n useSchema,\n useTranslation,\n} from 'sanity'\n\nimport {structureLocaleNamespace} from '../../../i18n'\nimport {INITIAL_STATE} from '../getIncomingReferences'\nimport {INCOMING_REFERENCES_ITEM_HEIGHT, IncomingReferencesListContainer} from '../shared'\nimport {type CrossDatasetIncomingReference} from '../types'\nimport {CrossDatasetIncomingReferenceDocumentPreview} from './CrossDatasetIncomingReferenceDocumentPreview'\nimport {\n type CrossDatasetIncomingReferenceDocument,\n getCrossDatasetIncomingReferences,\n} from './getCrossDatasetIncomingReferences'\n\nexport function CrossDatasetIncomingReferenceType({\n type,\n referenced,\n shouldRenderTitle,\n}: {\n shouldRenderTitle: boolean\n referenced: {id: string; type: string}\n type: CrossDatasetIncomingReference\n}) {\n const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n const documentPreviewStore = useDocumentPreviewStore()\n\n const references$ = useMemo(\n () =>\n getCrossDatasetIncomingReferences({\n documentId: referenced.id,\n client,\n type: type,\n documentPreviewStore,\n }),\n [client, type, referenced.id, documentPreviewStore],\n )\n\n const {documents, loading} = useObservable(references$, INITIAL_STATE)\n\n const schema = useSchema()\n const {t} = useTranslation(structureLocaleNamespace)\n const schemaType = schema.get(type.type)\n\n const renderItem = useCallback<\n CommandListRenderItemCallback<CrossDatasetIncomingReferenceDocument>\n >(\n (document) => <CrossDatasetIncomingReferenceDocumentPreview document={document} type={type} />,\n [type],\n )\n\n if (!schemaType) return null\n if (loading) {\n return <LoadingBlock showText title={t('incoming-references-input.types-loading')} />\n }\n return (\n <Stack space={2} marginBottom={2}>\n {shouldRenderTitle && (\n <Box paddingY={2} paddingX={0}>\n <Text size={1} weight=\"medium\">\n {type.title || schemaType?.title}\n </Text>\n </Box>\n )}\n <Card radius={2} padding={1} border tone=\"default\">\n {documents && documents.length > 0 ? (\n <IncomingReferencesListContainer $itemCount={documents.length}>\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={t('incoming-references-input.list-label', {\n type: type.title || schemaType?.title,\n })}\n canReceiveFocus\n fixedHeight\n getItemKey={(index) => documents[index].id}\n itemHeight={INCOMING_REFERENCES_ITEM_HEIGHT}\n items={documents}\n onlyShowSelectionWhenActive\n overscan={5}\n renderItem={renderItem}\n wrapAround={false}\n />\n </IncomingReferencesListContainer>\n ) : (\n <>\n <Flex align=\"center\" justify=\"center\" padding={2}>\n <Text size={1} muted>\n {t('incoming-references-input.no-items')}\n </Text>\n </Flex>\n </>\n )}\n </Card>\n </Stack>\n )\n}\n","import {uuid} from '@sanity/uuid'\nimport {useCallback, useMemo} from 'react'\nimport {\n CreateReferenceButton,\n type CreateReferenceOption,\n getPublishedId,\n isNonNullable,\n useReferenceInputOptions,\n} from 'sanity'\nimport {useRouter} from 'sanity/router'\n\nimport {usePaneRouter} from '../paneRouter'\nimport {type IncomingReferenceCreationParams} from './isIncomingReferenceCreation'\nimport {type IncomingReferencesOptions} from './types'\n\nexport function CreateNewIncomingReference({\n type,\n referenceToId,\n referenceToType,\n onCreateNewReference,\n fieldName,\n creationAllowed,\n}: {\n type: string\n referenceToId: string\n referenceToType: string\n onCreateNewReference: (id: string) => void\n fieldName: string\n creationAllowed: IncomingReferencesOptions['creationAllowed']\n}) {\n const {initialValueTemplateItems} = useReferenceInputOptions()\n\n const {navigate} = useRouter()\n const {routerPanesState, groupIndex} = usePaneRouter()\n\n const handleCreate = useCallback(\n (option: CreateReferenceOption) => {\n const id = uuid()\n navigate({\n panes: [\n ...routerPanesState.slice(0, groupIndex + 1),\n [\n {\n id: getPublishedId(id),\n params: {type, template: option.template.id},\n payload: {\n reference: {\n _type: 'reference',\n _ref: referenceToId,\n _weak: true,\n _strengthenOnPublish: {type: referenceToType},\n },\n from: {fieldName, type: referenceToType},\n // eslint-disable-next-line camelcase\n __internal_isIncomingReferenceCreation: true,\n } satisfies IncomingReferenceCreationParams,\n },\n ],\n ],\n })\n onCreateNewReference(id)\n },\n [\n type,\n navigate,\n routerPanesState,\n groupIndex,\n referenceToId,\n referenceToType,\n onCreateNewReference,\n fieldName,\n ],\n )\n\n const createOptions = useMemo(() => {\n if (!creationAllowed) return []\n return (initialValueTemplateItems || [])\n\n .filter((i) => {\n const typeMatch = type === i.template?.schemaType\n if (Array.isArray(creationAllowed)) {\n // Check if the template id is in the creationAllowed array\n return typeMatch && creationAllowed.includes(i.template.id)\n }\n return typeMatch\n })\n .map((item): CreateReferenceOption | undefined =>\n item.template?.schemaType\n ? {\n id: item.id,\n title: item.title || `${item.template.schemaType} from template ${item.template?.id}`,\n i18n: item.i18n,\n type: item.template.schemaType,\n icon: item.icon,\n template: {\n id: item.template?.id,\n params: item.parameters,\n },\n\n permission: {granted: item.granted, reason: item.reason},\n }\n : undefined,\n )\n .filter(isNonNullable)\n }, [creationAllowed, initialValueTemplateItems, type])\n\n if (!creationAllowed) {\n return null\n }\n return (\n <CreateReferenceButton\n id={`create-new-incoming-reference-${type}`}\n createOptions={createOptions}\n onCreate={handleCreate}\n />\n )\n}\n","import {type SchemaType} from '@sanity/types'\nimport {type BadgeTone, Text} from '@sanity/ui'\nimport {useMemo} from 'react'\nimport {useObservable} from 'react-rx'\nimport {\n type DocumentPreviewStore,\n getPreviewStateObservable,\n getPreviewValueWithFallback,\n getReleaseIdFromReleaseDocumentId,\n getReleaseTone,\n getVersionFromId,\n isDraftId,\n isPublishedId,\n isVersionId,\n PreviewCard,\n ReleaseTitle,\n SanityDefaultPreview,\n useActiveReleases,\n useTranslation,\n VersionInlineBadge,\n} from 'sanity'\n\nexport interface LinkToExistingPreviewProps {\n documentPreviewStore: DocumentPreviewStore\n schemaType: SchemaType\n value: {_id: string; _type: string}\n onLinkToDocument: () => void\n}\n\nconst getPerspective = (id: string) => {\n if (isDraftId(id)) return ['drafts']\n if (isVersionId(id)) return [getVersionFromId(id) as string]\n if (isPublishedId(id)) return ['published']\n return ['raw']\n}\n\nexport function LinkToExistingPreview(props: LinkToExistingPreviewProps) {\n const {schemaType, value, onLinkToDocument} = props\n const {data: releases} = useActiveReleases()\n const {t} = useTranslation()\n\n const previewStateObservable = useMemo(() => {\n return getPreviewStateObservable(\n props.documentPreviewStore,\n schemaType,\n value._id,\n getPerspective(value._id),\n )\n }, [props.documentPreviewStore, schemaType, value._id])\n\n const {snapshot, original, isLoading} = useObservable(previewStateObservable, {\n snapshot: null,\n isLoading: true,\n original: null,\n })\n\n const badgeProps = useMemo(():\n | {kind: 'static'; tone: BadgeTone; text: string}\n | {kind: 'release'; tone: BadgeTone; releaseTitle: string | undefined; releaseFallback: string}\n | null => {\n const id = value._id\n if (isDraftId(id)) {\n return {\n kind: 'static',\n tone: getReleaseTone('drafts'),\n text: t('release.chip.draft'),\n }\n }\n if (isPublishedId(id)) {\n return {\n kind: 'static',\n tone: getReleaseTone('published'),\n text: t('release.chip.published'),\n }\n }\n if (isVersionId(id)) {\n const releaseId = getVersionFromId(id)\n const release = releases.find((r) => getReleaseIdFromReleaseDocumentId(r._id) === releaseId)\n if (release) {\n return {\n kind: 'release',\n tone: getReleaseTone(release),\n releaseTitle: release.metadata.title,\n releaseFallback: release._id,\n }\n }\n }\n return null\n }, [releases, value._id, t])\n\n /**\n * If the document is not found, for example because it will be unpublished.\n * Then we don't want to render the preview of it. Because it shouldn't be possible\n * to link to a document that will be unpublished in this same release\n */\n if (!snapshot && !isLoading) return null\n return (\n <PreviewCard __unstable_focusRing onClick={onLinkToDocument} as=\"button\" radius={2}>\n <SanityDefaultPreview\n {...getPreviewValueWithFallback({snapshot, original, fallback: value})}\n isPlaceholder={isLoading}\n icon={schemaType.icon}\n layout=\"default\"\n status={\n badgeProps ? (\n <Text size={0}>\n {badgeProps.kind === 'release' ? (\n <ReleaseTitle title={badgeProps.releaseTitle} fallback={badgeProps.releaseFallback}>\n {({displayTitle}) => (\n <VersionInlineBadge $tone={badgeProps.tone}>{displayTitle}</VersionInlineBadge>\n )}\n </ReleaseTitle>\n ) : (\n <VersionInlineBadge $tone={badgeProps.tone}>{badgeProps.text}</VersionInlineBadge>\n )}\n </Text>\n ) : undefined\n }\n />\n </PreviewCard>\n )\n}\n","import {DEFAULT_MAX_FIELD_DEPTH} from '@sanity/schema/_internal'\nimport {type SanityDocumentLike} from '@sanity/types'\nimport {Box, Grid, Stack, Text, useToast} from '@sanity/ui'\nimport {useCallback, useMemo, useState} from 'react'\nimport {useObservableEvent} from 'react-rx'\nimport {catchError, concat, filter, map, type Observable, of, scan, switchMap, tap} from 'rxjs'\nimport {\n createSearch,\n DEFAULT_STUDIO_CLIENT_OPTIONS,\n getPublishedId,\n isDraftId,\n isNonNullable,\n isPublishedId,\n isVersionId,\n ReferenceAutocomplete,\n type SanityClient,\n type SchemaType,\n type SearchStrategy,\n useClient,\n useDocumentPreviewStore,\n useSchema,\n useSource,\n useTranslation,\n} from 'sanity'\n\nimport {structureLocaleNamespace} from '../../i18n'\nimport {CreateNewIncomingReference} from './CreateNewIncomingReference'\nimport {LinkToExistingPreview} from './LinkToExistingPreview'\nimport {type IncomingReferencesOptions} from './types'\n\ninterface ReferenceSearchState {\n hits: ReferenceSearchHit[]\n isLoading: boolean\n searchString?: string\n}\n\ninterface ReferenceOption {\n value: string\n hit: ReferenceSearchHit\n}\ninterface ReferenceSearchHit {\n _id: string\n _type: string\n}\n\nconst INITIAL_SEARCH_STATE: ReferenceSearchState = {\n hits: [],\n isLoading: false,\n}\nconst NO_FILTER = () => true\n\nconst incomingReferenceSearch = (\n client: SanityClient,\n schemaType: SchemaType,\n searchStrategy: SearchStrategy | undefined,\n): ((textTerm: string) => Observable<ReferenceSearchHit[]>) => {\n const search = createSearch([schemaType], client, {\n maxDepth: DEFAULT_MAX_FIELD_DEPTH,\n strategy: searchStrategy,\n tag: 'search.incoming-reference',\n })\n return (textTerm: string) =>\n search(textTerm, {perspective: 'raw'}).pipe(\n map(({hits}) => hits.map(({hit}) => hit)),\n map((docs) => {\n // We want to collate drafts and published documents into a single entry, but keep the versions as a separate entry\n const byId: Map<string, SanityDocumentLike> = new Map()\n\n docs.forEach((doc) => {\n if (isVersionId(doc._id)) {\n // We want to preserve version documents as a different entry.\n byId.set(doc._id, doc)\n return\n }\n const publishedId = getPublishedId(doc._id)\n const entry = byId.get(publishedId)\n if (!entry) {\n byId.set(publishedId, doc)\n // If the document is a draft and the entry is published, we want to keep the draft.\n } else if (isDraftId(doc._id) && isPublishedId(entry._id)) {\n byId.set(publishedId, doc)\n }\n })\n return Array.from(byId.values())\n }),\n map((collated) =>\n collated.map((entry) => ({\n _id: entry._id,\n _type: entry._type,\n })),\n ),\n map((docs) => docs.slice(0, 100)),\n )\n}\n\n/**\n * This component is responsible for two things:\n * 1) Search for the document type to add to the incoming references.\n * 2) Render the CreateNewIncomingReference button. Allowing users to add a new incoming reference.\n */\nexport function AddIncomingReference({\n type,\n referenced,\n onCreateNewReference,\n onLinkDocument,\n fieldName,\n creationAllowed,\n}: {\n type: string\n referenced: {id: string; type: string}\n onCreateNewReference: (id: string) => void\n onLinkDocument: (documentId: string) => void\n fieldName: string\n creationAllowed: IncomingReferencesOptions['creationAllowed']\n}) {\n const {t} = useTranslation(structureLocaleNamespace)\n const {push} = useToast()\n const schema = useSchema()\n const schemaType = schema.get(type)\n const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n const source = useSource()\n const {strategy: searchStrategy} = source.search\n const documentPreviewStore = useDocumentPreviewStore()\n const handleSearch = useMemo(\n () => incomingReferenceSearch(client, schemaType!, searchStrategy),\n [client, schemaType, searchStrategy],\n )\n\n const [searchState, setSearchState] = useState(INITIAL_SEARCH_STATE)\n const handleQueryChange = useObservableEvent((inputValue$: Observable<string | null>) => {\n return inputValue$.pipe(\n filter(isNonNullable),\n switchMap((searchString) =>\n concat(\n of({isLoading: true, hits: []}),\n handleSearch(searchString).pipe(\n map((hits) => ({hits, searchString, isLoading: false})),\n catchError((error) => {\n push({\n title: 'Reference search failed',\n description: error.message,\n status: 'error',\n id: `reference-search-fail-${type}`,\n })\n console.error(error)\n return of({hits: [], isLoading: false})\n }),\n ),\n ),\n ),\n\n scan(\n (prevState, nextState: ReferenceSearchState) => ({...prevState, ...nextState}),\n INITIAL_SEARCH_STATE,\n ),\n\n tap(setSearchState),\n )\n })\n\n const options: ReferenceOption[] = useMemo(() => {\n return searchState.hits.map((hit) => ({\n value: hit._id,\n hit: hit,\n }))\n }, [searchState.hits])\n\n const handleAutocompleteOpenButtonClick = useCallback(() => {\n handleQueryChange('')\n }, [handleQueryChange])\n\n const renderOption = useCallback(\n (option: ReferenceOption) => {\n return (\n <LinkToExistingPreview\n onLinkToDocument={() => onLinkDocument(option.value)}\n documentPreviewStore={documentPreviewStore}\n schemaType={schemaType!}\n value={option.hit}\n />\n )\n },\n [documentPreviewStore, schemaType, onLinkDocument],\n )\n\n return (\n <Stack space={2} padding={2}>\n <Box paddingY={2}>\n <Text size={1} weight=\"medium\">\n {t('incoming-references-input.reference-from', {type})}\n </Text>\n </Box>\n <Grid gap={creationAllowed ? 2 : 0} style={{gridTemplateColumns: '1fr min-content'}}>\n <ReferenceAutocomplete\n id={`${type}-autocomplete`}\n radius={2}\n autoFocus\n options={options}\n placeholder={t('incoming-references-input.type-to-search')}\n onQueryChange={handleQueryChange}\n filterOption={NO_FILTER}\n path={[]}\n // @ts-expect-error - Types are not derived correctly\n renderOption={renderOption}\n openButton={{onClick: handleAutocompleteOpenButtonClick}}\n referenceElement={null}\n loading={searchState.isLoading}\n />\n <CreateNewIncomingReference\n type={type}\n referenceToId={referenced.id}\n referenceToType={referenced.type}\n creationAllowed={creationAllowed}\n onCreateNewReference={onCreateNewReference}\n fieldName={fieldName}\n />\n </Grid>\n </Stack>\n )\n}\n","import {AddIcon} from '@sanity/icons'\nimport {type SanityDocument} from '@sanity/types'\nimport {Box, Card, Flex, Stack, Text, useToast} from '@sanity/ui'\nimport {useCallback, useEffect, useMemo, useState} from 'react'\nimport {useObservable} from 'react-rx'\nimport {\n CommandList,\n type CommandListRenderItemCallback,\n DEFAULT_STUDIO_CLIENT_OPTIONS,\n getDraftId,\n getPublishedId,\n isPublishedId,\n LoadingBlock,\n SanityDefaultPreview,\n useClient,\n useDocumentPreviewStore,\n useSchema,\n useSource,\n useTranslation,\n} from 'sanity'\n\nimport {Button} from '../../../ui-components/button/Button'\nimport {structureLocaleNamespace} from '../../i18n'\nimport {useDocumentPane} from '../../panes/document/useDocumentPane'\nimport {AddIncomingReference} from './AddIncomingReference'\nimport {CreateNewIncomingReference} from './CreateNewIncomingReference'\nimport {getIncomingReferences, INITIAL_STATE} from './getIncomingReferences'\nimport {IncomingReferenceDocument} from './IncomingReferenceDocument'\nimport {INCOMING_REFERENCES_ITEM_HEIGHT, IncomingReferencesListContainer} from './shared'\nimport {type IncomingReferencesOptions, type IncomingReferenceType} from './types'\n\nexport function IncomingReferencesType({\n type,\n referenced,\n onLinkDocument,\n actions,\n shouldRenderTitle,\n fieldName,\n creationAllowed,\n filter,\n filterParams,\n}: {\n shouldRenderTitle: boolean\n referenced: {id: string; type: string}\n fieldName: string\n type: IncomingReferenceType\n onLinkDocument: IncomingReferencesOptions['onLinkDocument']\n actions: IncomingReferencesOptions['actions']\n creationAllowed: IncomingReferencesOptions['creationAllowed']\n filter: IncomingReferencesOptions['filter']\n filterParams: IncomingReferencesOptions['filterParams']\n}) {\n const documentPreviewStore = useDocumentPreviewStore()\n const {displayed} = useDocumentPane()\n const {getClient} = useSource()\n const displayedId = displayed?._id as string\n /**\n * `filter` is a function or a string, if it's a function it will get a new reference on every render\n * `filterParams` is an object, so it will also get a new reference on every render.\n *\n * If they are not memoized the `references$` observable will be recreated on every render,\n * causing the list to jump even when the resolved GROQ filter is unchanged.\n *\n * It is safe to capture the initial values here because both come from the schema, not\n * from React render state. Schema changes reload the studio, so pinning the first reference for this mount\n * does not stale meaningful configuration.\n */\n const [memoizedFilter] = useState(() => filter)\n const [memoizedFilterParams] = useState(() => filterParams)\n\n const references$ = useMemo(\n () =>\n getIncomingReferences({\n documentId: displayedId,\n documentPreviewStore,\n type: type.type,\n filter: memoizedFilter,\n filterParams: memoizedFilterParams,\n getClient,\n }),\n [documentPreviewStore, type.type, memoizedFilter, memoizedFilterParams, displayedId, getClient],\n )\n\n const {documents, loading} = useObservable(references$, INITIAL_STATE)\n\n const schema = useSchema()\n const {t} = useTranslation(structureLocaleNamespace)\n const schemaType = schema.get(type.type)\n const client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS)\n const [isAdding, setIsAdding] = useState(false)\n const [newReferenceId, setNewReferenceId] = useState<string | null>(null)\n const {editState} = useDocumentPane()\n const toast = useToast()\n const handleAdd = useCallback(() => {\n setIsAdding((p) => !p)\n }, [])\n\n const publishedExists = Boolean(editState?.published)\n\n const handleCreateNewReference = useCallback(async (documentId: string) => {\n setIsAdding(false)\n setNewReferenceId(documentId)\n }, [])\n\n const handleLinkDocument = useCallback(\n async (documentId: string) => {\n setIsAdding(false)\n setNewReferenceId(documentId)\n const liveEdit = Boolean(schemaType?.liveEdit)\n const document = await client.fetch('*[_id == $id][0]', {id: documentId})\n\n const linkedDocument = onLinkDocument?.(document, {\n _type: 'reference',\n _ref: getPublishedId(referenced.id),\n ...(publishedExists ? {} : {_weak: true, _strengthenOnPublish: {type: referenced.type}}),\n })\n if (!linkedDocument) {\n setNewReferenceId(null)\n toast.push({\n title: 'Not possible to link to document',\n description: 'The document you are trying to link cannot be linked to',\n status: 'error',\n })\n return\n }\n\n // if the document is published and the schema is not live edit, we want to update the draft id, not the published id\n // If it's a version, we can update the version document.\n if (isPublishedId(documentId) && !liveEdit) {\n linkedDocument._id = getDraftId(documentId)\n }\n await client.createOrReplace(linkedDocument)\n },\n [client, onLinkDocument, referenced, publishedExists, toast, schemaType?.liveEdit],\n )\n\n useEffect(() => {\n if (documents.length > 0 && newReferenceId) {\n // new reference is now part of the documents, we need to remove it from the newReferenceId state\n const isAdded = documents.find(\n (document) => getPublishedId(document._id) === getPublishedId(newReferenceId),\n )\n if (isAdded) setNewReferenceId(null)\n }\n }, [documents, newReferenceId])\n\n const renderItem = useCallback<CommandListRenderItemCallback<SanityDocument>>(\n (document) => (\n <IncomingReferenceDocument\n document={document}\n referenceToId={referenced.id}\n actions={actions}\n />\n ),\n [referenced.id, actions],\n )\n\n if (!schemaType) return null\n if (loading) {\n return <LoadingBlock showText title={t('incoming-references-input.types-loading')} />\n }\n return (\n <Stack space={2} marginBottom={2}>\n {shouldRenderTitle && (\n <Box paddingY={2} paddingX={0}>\n <Text size={1} weight=\"medium\">\n {type.title || schemaType?.title}\n </Text>\n </Box>\n )}\n <Card radius={2} padding={1} border tone=\"default\">\n {documents.length > 0 ? (\n <IncomingReferencesListContainer $itemCount={documents.length}>\n <CommandList\n activeItemDataAttr=\"data-hovered\"\n ariaLabel={t('incoming-references-input.list-label', {\n type: type.title || schemaType?.title,\n })}\n canReceiveFocus\n fixedHeight\n getItemKey={(index) => documents[index]._id}\n itemHeight={INCOMING_REFERENCES_ITEM_HEIGHT}\n items={documents}\n onlyShowSelectionWhenActive\n overscan={5}\n renderItem={renderItem}\n wrapAround={false}\n />\n </IncomingReferencesListContainer>\n ) : (\n <>\n <Flex\n align=\"center\"\n justify=\"center\"\n padding={2}\n hidden={isAdding || Boolean(newReferenceId)}\n >\n <Text size={1} muted>\n {t('incoming-references-input.no-items')}\n </Text>\n </Flex>\n </>\n )}\n\n {newReferenceId && (\n <SanityDefaultPreview icon={schemaType.icon} layout={'default'} isPlaceholder />\n )}\n {isAdding && (\n <AddIncomingReference\n type={type.type}\n referenced={referenced}\n onCreateNewReference={handleCreateNewReference}\n onLinkDocument={handleLinkDocument}\n creationAllowed={creationAllowed}\n fieldName={fieldName}\n />\n )}\n </Card>\n {onLinkDocument ? (\n <Button\n size=\"large\"\n disabled={false}\n icon={AddIcon}\n mode=\"ghost\"\n onClick={handleAdd}\n text={t('incoming-references-input.add-reference-item')}\n />\n ) : (\n <CreateNewIncomingReference\n type={type.type}\n referenceToId={referenced.id}\n referenceToType={referenced.type}\n creationAllowed={creationAllowed}\n onCreateNewReference={handleCreateNewReference}\n fieldName={fieldName}\n />\n )}\n </Stack>\n )\n}\n","import {type SelectableTone} from '@sanity/ui'\nimport {\n type ActionComponent,\n type DocumentActionDialogProps,\n type PreviewConfig,\n type SanityClient,\n type SanityDocument,\n} from 'sanity'\n\nexport type IncomingReferenceActionsContext = {\n /**\n * The document that is linked to the reference.\n */\n document: SanityDocument\n getClient: (options: {apiVersion: string}) => SanityClient\n}\n\nexport type IncomingReferenceActionDescription = {\n label: string\n icon?: React.ElementType\n tone?: SelectableTone\n disabled?: boolean\n onHandle: (() => Promise<void>) | (() => void)\n dialog?: DocumentActionDialogProps | false | null\n}\n\n/**\n * Incoming reference action component definition.\n * Allows users to define actions that will be shown in the IncomingReferences component as part\n * of each reference\n * example:\n * ```ts\n * export const LogReferenceAction: IncomingReferenceAction = ({document, getClient}) => {\n * return {\n * label: 'Log reference',\n * icon: LogIcon,\n * onHandle: () => console.log(document._id)\n * }\n * }\n * ```\n *\n * @beta\n */\nexport type IncomingReferenceAction = ActionComponent<\n IncomingReferenceActionsContext,\n IncomingReferenceActionDescription\n>\n\nexport interface CrossDatasetIncomingReference {\n type: string\n title?: string\n dataset: string\n preview: PreviewConfig\n studioUrl?: (document: {id: string; type?: string}) => string | null\n}\n\nexport interface IncomingReferenceType {\n type: string\n dataset?: never\n title?: string\n}\n\nexport function isCrossDatasetIncomingReference(\n type: IncomingReferenceType | CrossDatasetIncomingReference,\n): type is CrossDatasetIncomingReference {\n return Boolean(type.dataset)\n}\n\nexport type IncomingReferencesFilterResolver = (context: {\n document: SanityDocument | undefined\n getClient: (options: {apiVersion: string}) => SanityClient\n}) =>\n | string\n | {filter: string; filterParams?: Record<string, string>}\n | Promise<{filter: string; filterParams?: Record<string, string>}>\n\nexport type IncomingReferencesOptions = {\n name: string\n title?: string\n description?: string\n /**\n * The type of the incoming references.\n */\n types: (IncomingReferenceType | CrossDatasetIncomingReference)[]\n\n /**\n * The filter query to apply to the incoming references in addition to the type filter.\n * For example: filter all books that are from an specific editorial brand: `editorialBrand == \"Random House\"`\n * The `_type` filter is applied automatically.\n */\n filter?: string | IncomingReferencesFilterResolver\n filterParams?: Record<string, string>\n\n /**\n * Callback to link a document to a reference.\n *\n * This function is called when a user wants to link an existing document to the current document.\n * It receives two parameters:\n * - The document that will be linked (the target document)\n * - The reference object with all properties needed to establish the link\n *\n * The developer must implement this function to define where and how the reference\n * should be placed within the document structure. The function should return the\n * modified document with the reference properly added.\n *\n * For example:\n * - We want to link a book to an author:\n * ```ts\n * onLinkDocument: (document, reference) => {\n * return {\n * ...document,\n * author: reference,\n * }\n * }\n * ```\n *\n *\n * @param document - The document to link to the reference.\n * @param reference - The reference to link to the document.\n * @returns The document to link to the reference. If false, the document will not be linked to the reference.\n */\n\n onLinkDocument?: (\n document: SanityDocument,\n reference: {\n _type: 'reference'\n _ref: string\n _weak?: boolean\n _strengthenOnPublish?: {\n type: string\n }\n },\n ) => SanityDocument | false\n /**\n * Callback to define the actions that will be shown for the incoming reference document.\n *\n * For example:\n * ```ts\n * actions: ({document, client}) => {\n * return [\n * {label: 'Unlink document',\n * icon: TrashIcon,\n * tone: 'critical',\n * onClick: async () => {\n * await client.createOrReplace({...document, _id: getDraftId(document._id), author: undefined})\n * }\n * }\n * ]\n * }\n * ```\n * @param context - The context of the linked document.\n * @returns The actions that will be shown for the linked document.\n\n */\n actions?: IncomingReferenceAction[]\n /**\n * Whether to allow creation of new references.\n * default: true\n *\n * If false, it will only be possible to link to existing documents, if the `onLinkDocument` callback is provided.\n * If true, it will be possible to create new references to any template of the type.\n * If an array is provided, it will only be possible to create new references that match the template id in the array provided.\n *\n * To define how a creation will be handled, you can use the `initialValue` option in the\n * document type that will be linked.\n *\n * For example:\n * I want to create a new book from an author:\n * In the author we will have the <IncomingReferenceInput /> with the creationAllowed set to true.\n *\n * Then in the book type, we will have the `initialValue` option to define the default values for the new book.\n * This initialValue callback will receive the `reference` object that needs to be linked to the book in the params.\n *\n * ```ts\n * // Book type\n * export default {\n * type: 'document',\n * name: 'book',\n * title: 'Book',\n * fields: [\n * {\n * name: 'author',\n * type: 'reference',\n * to: [{type: 'author'}],\n * },\n * ],\n * initialValue: (params) => {\n * return {\n * author: params?.reference,\n * }\n * }\n * ```\n */\n creationAllowed?: boolean | string[]\n}\n","import {Card, Flex, Stack, Text} from '@sanity/ui'\nimport {useTranslation} from 'sanity'\n\nimport {structureLocaleNamespace} from '../../i18n'\nimport {useDocumentPane} from '../../panes/document/useDocumentPane'\nimport {CrossDatasetIncomingReferenceType} from './CrossDatasetIncomingReference/CrossDatasetIncomingReferenceType'\nimport {IncomingReferencesType} from './IncomingReferencesType'\nimport {type IncomingReferencesOptions, isCrossDatasetIncomingReference} from './types'\n\nexport function IncomingReferencesList({\n types,\n onLinkDocument,\n actions,\n filter,\n filterParams,\n name,\n creationAllowed,\n}: IncomingReferencesOptions) {\n const {documentId, documentType} = useDocumentPane()\n const {t} = useTranslation(structureLocaleNamespace)\n\n if (!types || types?.length === 0) {\n return (\n <Card border radius={2} padding={3} tone=\"critical\">\n <Flex align=\"center\" justify=\"center\">\n <Text size={1} muted>\n {t('incoming-references-input.types-not-defined')}\n </Text>\n </Flex>\n </Card>\n )\n }\n\n return (\n <Stack space={3}>\n {types.map((type) => {\n if (isCrossDatasetIncomingReference(type)) {\n return (\n <CrossDatasetIncomingReferenceType\n key={`${type.type}-${type.dataset || ''}`}\n type={type}\n referenced={{id: documentId, type: documentType}}\n shouldRenderTitle={types.length > 1}\n />\n )\n }\n return (\n <IncomingReferencesType\n key={type.type}\n type={type}\n referenced={{id: documentId, type: documentType}}\n onLinkDocument={onLinkDocument}\n actions={actions}\n shouldRenderTitle={types.length > 1}\n fieldName={name}\n creationAllowed={creationAllowed}\n filter={filter}\n filterParams={filterParams}\n />\n )\n })}\n </Stack>\n )\n}\n","import {Box, Flex, Stack, Text} from '@sanity/ui'\nimport startCase from 'lodash-es/startCase.js'\n\nimport {IncomingReferencesList} from './IncomingReferencesList'\nimport {type IncomingReferencesOptions} from './types'\n\n/**\n * @beta\n */\nexport function IncomingReferencesDecoration(\n props: IncomingReferencesOptions & {\n name: string\n title?: string\n description?: string\n },\n) {\n const {\n onLinkDocument,\n actions,\n filter,\n filterParams,\n name,\n creationAllowed = true,\n types,\n title,\n description,\n } = props\n\n return (\n <Stack space={2}>\n <Box paddingY={2}>\n <Stack space={3}>\n <Flex align=\"center\" paddingY={1}>\n <Text as=\"label\" weight=\"medium\" size={1}>\n {title || startCase(name)}\n </Text>\n </Flex>\n\n {description && (\n <Text muted size={1}>\n {description}\n </Text>\n )}\n </Stack>\n </Box>\n <IncomingReferencesList\n name={name}\n types={types}\n onLinkDocument={onLinkDocument}\n actions={actions}\n filter={filter}\n filterParams={filterParams}\n creationAllowed={creationAllowed}\n />\n </Stack>\n )\n}\n","import {type DecorationMember} from 'sanity'\n\nimport {IncomingReferencesDecoration} from './IncomingReferencesDecoration'\nimport {type IncomingReferencesOptions} from './types'\n\n/**\n * Helper function to define an incoming references decoration.\n *\n * example:\n * ```ts\n * defineType({\n * name: 'author',\n * type: 'document',\n * renderMembers: (members) => {\n * return [\n * ...members,\n * defineIncomingReferenceDecoration({\n * name: 'incomingReferences',\n * title: 'Incoming references',\n * types: [{type: 'author'}],\n * }),\n * ]\n * },\n * })\n * ```\n *\n * @beta\n */\nexport function defineIncomingReferenceDecoration(\n options: IncomingReferencesOptions,\n): DecorationMember {\n return {\n kind: 'decoration',\n key: options.name,\n component: <IncomingReferencesDecoration {...options} />,\n }\n}\n","import {type DocumentDefinition} from 'sanity'\n\nexport interface IncomingReferenceCreationParams {\n reference: {\n _type: 'reference'\n _ref: string\n _weak?: boolean\n _strengthenOnPublish?: {\n type: string\n }\n }\n from: {\n fieldName: string\n type: string\n }\n __internal_isIncomingReferenceCreation: true\n [key: string]: unknown\n}\n\n/**\n * Helper function to check if the document is being created from an incoming reference.\n * It will be used in the initialValue callback to determine if the document is being created from an incoming reference.\n *\n * example:\n * ```ts\n * defineType({\n * name: 'book',\n * type: 'document',\n * fields: [...],\n * initialValue: (params) => {\n * // If the document is being created from an incoming reference, return the reference\n * // Otherwise, return undefined\n * return {\n * author: isIncomingReferenceCreation(params) ? params.reference : undefined,\n * }\n * },\n * })\n * ```\n *\n * @beta\n */\nexport function isIncomingReferenceCreation(\n initialValue: DocumentDefinition['initialValue'],\n): initialValue is IncomingReferenceCreationParams {\n return (\n typeof initialValue === 'object' &&\n initialValue !== null &&\n '__internal_isIncomingReferenceCreation' in initialValue\n )\n}\n"],"names":["CrossDatasetIncomingReferenceType","t0","$","_c","type","referenced","shouldRenderTitle","client","useClient","DEFAULT_STUDIO_CLIENT_OPTIONS","documentPreviewStore","useDocumentPreviewStore","t1","id","getCrossDatasetIncomingReferences","documentId","references$","documents","loading","useObservable","INITIAL_STATE","schema","useSchema","t","useTranslation","structureLocaleNamespace","T0","T1","t10","t2","t3","t4","t5","t6","t7","t8","t9","Symbol","for","bb0","schemaType","get","t11","document","renderItem","t12","t13","Stack","title","Card","length","index","INCOMING_REFERENCES_ITEM_HEIGHT","CreateNewIncomingReference","referenceToId","referenceToType","onCreateNewReference","fieldName","creationAllowed","initialValueTemplateItems","useReferenceInputOptions","navigate","useRouter","routerPanesState","groupIndex","usePaneRouter","option","uuid","panes","slice","getPublishedId","params","template","payload","reference","_type","_ref","_weak","_strengthenOnPublish","from","__internal_isIncomingReferenceCreation","handleCreate","i","typeMatch","Array","isArray","includes","filter","map","_temp","isNonNullable","createOptions","item","i18n","icon","parameters","permission","granted","reason","undefined","getPerspective","isDraftId","isVersionId","getVersionFromId","isPublishedId","LinkToExistingPreview","props","value","onLinkToDocument","data","releases","useActiveReleases","_id","getPreviewStateObservable","previewStateObservable","snapshot","isLoading","original","getReleaseTone","kind","tone","text","releaseId","r","getReleaseIdFromReleaseDocumentId","release","find","releaseTitle","metadata","releaseFallback","badgeProps","getPreviewValueWithFallback","fallback","displayTitle","INITIAL_SEARCH_STATE","hits","NO_FILTER","incomingReferenceSearch","searchStrategy","search","createSearch","maxDepth","DEFAULT_MAX_FIELD_DEPTH","strategy","tag","textTerm","perspective","pipe","hit","docs","byId","Map","forEach","doc","set","publishedId","entry","values","collated","AddIncomingReference","onLinkDocument","push","useToast","source","useSource","handleSearch","searchState","setSearchState","useState","inputValue$","switchMap","searchString","concat","of","catchError","error","description","message","status","console","scan","tap","handleQueryChange","useObservableEvent","_temp2","options","handleAutocompleteOpenButtonClick","renderOption","gridTemplateColumns","t14","onClick","t15","t16","t17","t18","prevState","nextState","IncomingReferencesType","actions","filterParams","displayed","useDocumentPane","getClient","displayedId","memoizedFilter","memoizedFilterParams","getIncomingReferences","isAdding","setIsAdding","newReferenceId","setNewReferenceId","editState","toast","handleAdd","publishedExists","Boolean","published","handleCreateNewReference","liveEdit","documentId_0","fetch","linkedDocument","getDraftId","createOrReplace","handleLinkDocument","document_0","useEffect","document_1","AddIcon","p","isCrossDatasetIncomingReference","dataset","IncomingReferencesList","types","name","documentType","IncomingReferencesDecoration","startCase","defineIncomingReferenceDecoration","key","component","isIncomingReferenceCreation","initialValue"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBO,SAAAA,kCAAAC,IAA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B,QACjB,4CAA4CA;AAEhD;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity",
3
- "version": "5.29.0-next.13",
3
+ "version": "5.29.0-next.14",
4
4
  "description": "Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches",
5
5
  "keywords": [
6
6
  "cms",
@@ -179,11 +179,11 @@
179
179
  "uuid": "^11.1.0",
180
180
  "web-vitals": "^5.1.0",
181
181
  "xstate": "^5.25.1",
182
- "@sanity/mutator": "5.29.0-next.13+054950f5ec",
183
- "@sanity/schema": "5.29.0-next.13+054950f5ec",
184
- "@sanity/types": "5.29.0-next.13+054950f5ec",
185
- "@sanity/util": "5.29.0-next.13+054950f5ec",
186
- "@sanity/diff": "5.29.0-next.13+054950f5ec"
182
+ "@sanity/mutator": "5.29.0-next.14+30f89d5b82",
183
+ "@sanity/schema": "5.29.0-next.14+30f89d5b82",
184
+ "@sanity/types": "5.29.0-next.14+30f89d5b82",
185
+ "@sanity/util": "5.29.0-next.14+30f89d5b82",
186
+ "@sanity/diff": "5.29.0-next.14+30f89d5b82"
187
187
  },
188
188
  "devDependencies": {
189
189
  "@playwright/experimental-ct-react": "1.60.0",
@@ -230,11 +230,11 @@
230
230
  "vite": "^7.3.1",
231
231
  "vitest": "^4.1.4",
232
232
  "vitest-package-exports": "^1.1.2",
233
- "@repo/eslint-config": "5.29.0-next.13+054950f5ec",
234
- "@repo/package.bundle": "5.29.0-next.13+054950f5ec",
235
- "@repo/package.config": "5.29.0-next.13+054950f5ec",
236
- "@repo/test-config": "5.29.0-next.13+054950f5ec",
237
- "@repo/tsconfig": "5.29.0-next.13+054950f5ec"
233
+ "@repo/eslint-config": "5.29.0-next.14+30f89d5b82",
234
+ "@repo/package.config": "5.29.0-next.14+30f89d5b82",
235
+ "@repo/package.bundle": "5.29.0-next.14+30f89d5b82",
236
+ "@repo/test-config": "5.29.0-next.14+30f89d5b82",
237
+ "@repo/tsconfig": "5.29.0-next.14+30f89d5b82"
238
238
  },
239
239
  "peerDependencies": {
240
240
  "react": "^19.2.2",