sanity 5.1.0-next.18 → 5.1.0-next.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/_chunks-es/package.js +1 -1
- package/lib/_chunks-es/version.js +1 -1
- package/lib/index.js +32 -32
- package/lib/index.js.map +1 -1
- package/package.json +14 -14
|
@@ -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.1.0-next.
|
|
10
|
+
"5.1.0-next.19+df4d72cb45";
|
|
11
11
|
} catch {
|
|
12
12
|
}
|
|
13
13
|
const SANITY_VERSION = buildVersion || `${version}-dev`;
|
package/lib/index.js
CHANGED
|
@@ -58109,7 +58109,7 @@ function useComlinkViewHistory(t0) {
|
|
|
58109
58109
|
$[13] !== displayed || $[14] !== editState2.ready || $[15] !== recordEvent || $[16] !== t7 ? (t8 = [t7, displayed, editState2.ready, recordEvent], $[13] = displayed, $[14] = editState2.ready, $[15] = recordEvent, $[16] = t7, $[17] = t8) : t8 = $[17], useEffect(t6, t8);
|
|
58110
58110
|
}
|
|
58111
58111
|
function useDocumentForm(options) {
|
|
58112
|
-
const $ = c(
|
|
58112
|
+
const $ = c(165), {
|
|
58113
58113
|
documentType,
|
|
58114
58114
|
getFormDocumentValue,
|
|
58115
58115
|
documentId,
|
|
@@ -58182,7 +58182,7 @@ function useDocumentForm(options) {
|
|
|
58182
58182
|
_type: documentType
|
|
58183
58183
|
}, $[15] = documentId, $[16] = documentType, $[17] = initialValue?.value, $[18] = t82) : t82 = $[18];
|
|
58184
58184
|
const baseValue = t82;
|
|
58185
|
-
if (
|
|
58185
|
+
if (releaseId) {
|
|
58186
58186
|
if (editState2.version && isGoingToUnpublish(editState2.version)) {
|
|
58187
58187
|
t7 = editState2.published || baseValue;
|
|
58188
58188
|
break bb1;
|
|
@@ -58198,7 +58198,7 @@ function useDocumentForm(options) {
|
|
|
58198
58198
|
}), $[19] = baseValue, $[20] = documentId, $[21] = documentType, $[22] = editState2.published, $[23] = liveEdit, $[24] = t92) : t92 = $[24], t7 = t92;
|
|
58199
58199
|
break bb1;
|
|
58200
58200
|
}
|
|
58201
|
-
if (
|
|
58201
|
+
if (selectedPerspectiveName || onlyHasVersions) {
|
|
58202
58202
|
t7 = editState2.version || editState2.draft || editState2.published || baseValue;
|
|
58203
58203
|
break bb1;
|
|
58204
58204
|
}
|
|
@@ -58282,41 +58282,41 @@ function useDocumentForm(options) {
|
|
|
58282
58282
|
isLockedByCanvas
|
|
58283
58283
|
} = useCanvasCompanionDoc(value._id);
|
|
58284
58284
|
let t23;
|
|
58285
|
-
$[58] !== connectionState || $[59] !== editState2 || $[60] !== isCreateLinked || $[61] !== isLockedByCanvas || $[62] !== isNonExistent || $[63] !== isPermissionsLoading || $[64] !== isReleaseLocked || $[65] !== liveEdit || $[66] !== onlyHasVersions || $[67] !== permissions?.granted || $[68] !== readOnlyProp || $[69] !== ready || $[70] !==
|
|
58285
|
+
$[58] !== connectionState || $[59] !== editState2 || $[60] !== isCreateLinked || $[61] !== isLockedByCanvas || $[62] !== isNonExistent || $[63] !== isPermissionsLoading || $[64] !== isReleaseLocked || $[65] !== liveEdit || $[66] !== onlyHasVersions || $[67] !== permissions?.granted || $[68] !== readOnlyProp || $[69] !== ready || $[70] !== releaseId || $[71] !== schemaType || $[72] !== selectedPerspectiveName || $[73] !== value ? (t23 = () => {
|
|
58286
58286
|
const hasNoPermission = !isPermissionsLoading && !permissions?.granted, updateActionDisabled = !isActionEnabled(schemaType, "update"), createActionDisabled = isNonExistent && !isActionEnabled(schemaType, "create"), reconnecting = connectionState === "reconnecting", isLocked = editState2.transactionSyncLock?.enabled, willBeUnpublished = value ? isGoingToUnpublish(value) : !1;
|
|
58287
|
-
return editState2.version && !editState2.draft && !editState2.published && onlyHasVersions && selectedPerspectiveName !== getVersionFromId(editState2.version._id) && isNewDocument(editState2) === !1 || liveEdit && editState2.draft?._id || !liveEdit && selectedPerspectiveName === "published" ||
|
|
58288
|
-
}, $[58] = connectionState, $[59] = editState2, $[60] = isCreateLinked, $[61] = isLockedByCanvas, $[62] = isNonExistent, $[63] = isPermissionsLoading, $[64] = isReleaseLocked, $[65] = liveEdit, $[66] = onlyHasVersions, $[67] = permissions?.granted, $[68] = readOnlyProp, $[69] = ready, $[70] =
|
|
58287
|
+
return editState2.version && !editState2.draft && !editState2.published && onlyHasVersions && selectedPerspectiveName !== getVersionFromId(editState2.version._id) && isNewDocument(editState2) === !1 || liveEdit && editState2.draft?._id || !liveEdit && selectedPerspectiveName === "published" || releaseId && getVersionFromId(value._id) !== releaseId && isNewDocument(editState2) === !1 || !ready || isLockedByCanvas || hasNoPermission || updateActionDisabled || createActionDisabled || reconnecting || isLocked || isCreateLinked || willBeUnpublished || isReleaseLocked ? !0 : typeof readOnlyProp == "function" ? readOnlyProp(editState2) : !!readOnlyProp;
|
|
58288
|
+
}, $[58] = connectionState, $[59] = editState2, $[60] = isCreateLinked, $[61] = isLockedByCanvas, $[62] = isNonExistent, $[63] = isPermissionsLoading, $[64] = isReleaseLocked, $[65] = liveEdit, $[66] = onlyHasVersions, $[67] = permissions?.granted, $[68] = readOnlyProp, $[69] = ready, $[70] = releaseId, $[71] = schemaType, $[72] = selectedPerspectiveName, $[73] = value, $[74] = t23) : t23 = $[74];
|
|
58289
58289
|
let t24;
|
|
58290
|
-
$[
|
|
58290
|
+
$[75] !== t23 ? (t24 = t23(), $[75] = t23, $[76] = t24) : t24 = $[76];
|
|
58291
58291
|
const readOnly = t24, {
|
|
58292
58292
|
patch: patch2
|
|
58293
58293
|
} = useDocumentOperation(documentId, documentType, activeDocumentReleaseId), patchRef = useRef(_temp$1s);
|
|
58294
58294
|
let t25;
|
|
58295
|
-
$[
|
|
58295
|
+
$[77] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t25 = (event) => patchRef.current(event), $[77] = t25) : t25 = $[77];
|
|
58296
58296
|
const handleChange = t25;
|
|
58297
58297
|
let t26;
|
|
58298
|
-
$[
|
|
58298
|
+
$[78] !== editState2.draft || $[79] !== editState2.published || $[80] !== initialValue?.value || $[81] !== isCreateLinked || $[82] !== patch2 || $[83] !== readOnly || $[84] !== telemetry ? (t26 = () => {
|
|
58299
58299
|
readOnly && !isCreateLinked ? patchRef.current = _temp2$B : patchRef.current = (event_0) => {
|
|
58300
58300
|
!editState2.draft && !editState2.published && telemetry.log(CreatedDraft), patch2.execute(toMutationPatches(event_0.patches), initialValue?.value);
|
|
58301
58301
|
};
|
|
58302
|
-
}, $[
|
|
58302
|
+
}, $[78] = editState2.draft, $[79] = editState2.published, $[80] = initialValue?.value, $[81] = isCreateLinked, $[82] = patch2, $[83] = readOnly, $[84] = telemetry, $[85] = t26) : t26 = $[85];
|
|
58303
58303
|
let t27;
|
|
58304
|
-
$[
|
|
58304
|
+
$[86] !== editState2.draft || $[87] !== editState2.published || $[88] !== initialValue || $[89] !== isCreateLinked || $[90] !== patch2 || $[91] !== readOnly || $[92] !== telemetry ? (t27 = [editState2.draft, editState2.published, initialValue, patch2, telemetry, readOnly, isCreateLinked], $[86] = editState2.draft, $[87] = editState2.published, $[88] = initialValue, $[89] = isCreateLinked, $[90] = patch2, $[91] = readOnly, $[92] = telemetry, $[93] = t27) : t27 = $[93], useInsertionEffect(t26, t27);
|
|
58305
58305
|
let t28;
|
|
58306
58306
|
bb3: {
|
|
58307
58307
|
if (getFormDocumentValue) {
|
|
58308
58308
|
let t292;
|
|
58309
|
-
$[
|
|
58309
|
+
$[94] !== getFormDocumentValue || $[95] !== value ? (t292 = getFormDocumentValue(value), $[94] = getFormDocumentValue, $[95] = value, $[96] = t292) : t292 = $[96], t28 = t292;
|
|
58310
58310
|
break bb3;
|
|
58311
58311
|
}
|
|
58312
58312
|
t28 = value;
|
|
58313
58313
|
}
|
|
58314
58314
|
const formDocumentValue = t28;
|
|
58315
58315
|
let t29;
|
|
58316
|
-
$[
|
|
58316
|
+
$[97] !== upstreamEditState ? (t29 = selectUpstreamVersion(upstreamEditState), $[97] = upstreamEditState, $[98] = t29) : t29 = $[98];
|
|
58317
58317
|
const hasUpstreamVersion = t29 !== null, t30 = comparisonValue || value;
|
|
58318
58318
|
let t31;
|
|
58319
|
-
$[
|
|
58319
|
+
$[99] !== changesOpen || $[100] !== collapsedFieldSets || $[101] !== collapsedPaths || $[102] !== displayInlineChanges || $[103] !== fieldGroupState || $[104] !== focusPath || $[105] !== formDocumentValue || $[106] !== hasUpstreamVersion || $[107] !== openPath || $[108] !== presence || $[109] !== readOnly || $[110] !== schemaType || $[111] !== selectedPerspective || $[112] !== t30 || $[113] !== validation2 ? (t31 = {
|
|
58320
58320
|
schemaType,
|
|
58321
58321
|
documentValue: formDocumentValue,
|
|
58322
58322
|
readOnly,
|
|
@@ -58332,25 +58332,25 @@ function useDocumentForm(options) {
|
|
|
58332
58332
|
changesOpen,
|
|
58333
58333
|
hasUpstreamVersion,
|
|
58334
58334
|
displayInlineChanges
|
|
58335
|
-
}, $[
|
|
58335
|
+
}, $[99] = changesOpen, $[100] = collapsedFieldSets, $[101] = collapsedPaths, $[102] = displayInlineChanges, $[103] = fieldGroupState, $[104] = focusPath, $[105] = formDocumentValue, $[106] = hasUpstreamVersion, $[107] = openPath, $[108] = presence, $[109] = readOnly, $[110] = schemaType, $[111] = selectedPerspective, $[112] = t30, $[113] = validation2, $[114] = t31) : t31 = $[114];
|
|
58336
58336
|
const formState = useFormState(t31), formStateRef = useRef(formState);
|
|
58337
58337
|
let t32, t33;
|
|
58338
|
-
$[
|
|
58338
|
+
$[115] !== formState ? (t32 = () => {
|
|
58339
58339
|
formStateRef.current = formState;
|
|
58340
|
-
}, t33 = [formState], $[
|
|
58340
|
+
}, t33 = [formState], $[115] = formState, $[116] = t32, $[117] = t33) : (t32 = $[116], t33 = $[117]), useEffect(t32, t33);
|
|
58341
58341
|
let t34;
|
|
58342
|
-
$[
|
|
58342
|
+
$[118] !== editState2 ? (t34 = {
|
|
58343
58343
|
editState: editState2
|
|
58344
|
-
}, $[
|
|
58344
|
+
}, $[118] = editState2, $[119] = t34) : t34 = $[119], useComlinkViewHistory(t34);
|
|
58345
58345
|
let t35;
|
|
58346
|
-
$[
|
|
58346
|
+
$[120] !== onSetCollapsedFieldSets || $[121] !== onSetCollapsedPath || $[122] !== onSetFieldGroupState || $[123] !== onSetOpenPath ? (t35 = (path_2) => {
|
|
58347
58347
|
getExpandOperations(formStateRef.current, path_2).forEach((op) => {
|
|
58348
58348
|
op.type === "expandPath" && onSetCollapsedPath((prevState_2) => setAtPath(prevState_2, op.path, !1)), op.type === "expandFieldSet" && onSetCollapsedFieldSets((prevState_3) => setAtPath(prevState_3, op.path, !1)), op.type === "setSelectedGroup" && onSetFieldGroupState((prevState_4) => setAtPath(prevState_4, op.path, op.groupName));
|
|
58349
58349
|
}), onSetOpenPath(path_2);
|
|
58350
|
-
}, $[
|
|
58350
|
+
}, $[120] = onSetCollapsedFieldSets, $[121] = onSetCollapsedPath, $[122] = onSetFieldGroupState, $[123] = onSetOpenPath, $[124] = t35) : t35 = $[124];
|
|
58351
58351
|
const handleSetOpenPath = t35;
|
|
58352
58352
|
let t36;
|
|
58353
|
-
$[
|
|
58353
|
+
$[125] !== presenceStore || $[126] !== value._id ? (t36 = throttle((nextFocusPath, payload) => {
|
|
58354
58354
|
presenceStore.setLocation([{
|
|
58355
58355
|
type: "document",
|
|
58356
58356
|
documentId: value._id,
|
|
@@ -58361,13 +58361,13 @@ function useDocumentForm(options) {
|
|
|
58361
58361
|
}, 1e3, {
|
|
58362
58362
|
leading: !0,
|
|
58363
58363
|
trailing: !0
|
|
58364
|
-
}), $[
|
|
58364
|
+
}), $[125] = presenceStore, $[126] = value._id, $[127] = t36) : t36 = $[127];
|
|
58365
58365
|
const updatePresenceThrottled = t36;
|
|
58366
58366
|
let t37;
|
|
58367
|
-
$[
|
|
58367
|
+
$[128] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t37 = [], $[128] = t37) : t37 = $[128];
|
|
58368
58368
|
const focusPathRef = useRef(t37);
|
|
58369
58369
|
let t38;
|
|
58370
|
-
$[
|
|
58370
|
+
$[129] !== enhancedObjectDialogEnabled || $[130] !== handleSetOpenPath || $[131] !== onFocusPath || $[132] !== setFocusPath || $[133] !== updatePresenceThrottled ? (t38 = (_nextFocusPath, payload_0) => {
|
|
58371
58371
|
const nextFocusPath_0 = pathFor(_nextFocusPath);
|
|
58372
58372
|
if (nextFocusPath_0 !== focusPathRef.current) {
|
|
58373
58373
|
if (setFocusPath(pathFor(nextFocusPath_0)), enhancedObjectDialogEnabled) {
|
|
@@ -58381,20 +58381,20 @@ function useDocumentForm(options) {
|
|
|
58381
58381
|
focusPathRef.current = nextFocusPath_0, onFocusPath?.(nextFocusPath_0);
|
|
58382
58382
|
}
|
|
58383
58383
|
updatePresenceThrottled(nextFocusPath_0, payload_0);
|
|
58384
|
-
}, $[
|
|
58384
|
+
}, $[129] = enhancedObjectDialogEnabled, $[130] = handleSetOpenPath, $[131] = onFocusPath, $[132] = setFocusPath, $[133] = updatePresenceThrottled, $[134] = t38) : t38 = $[134];
|
|
58385
58385
|
const handleFocus = t38;
|
|
58386
58386
|
let t39;
|
|
58387
|
-
$[
|
|
58387
|
+
$[135] !== onFocusPath || $[136] !== setFocusPath ? (t39 = (_blurredPath) => {
|
|
58388
58388
|
setFocusPath(EMPTY_ARRAY$B), focusPathRef.current !== EMPTY_ARRAY$B && (focusPathRef.current = EMPTY_ARRAY$B, onFocusPath?.(EMPTY_ARRAY$B));
|
|
58389
|
-
}, $[
|
|
58389
|
+
}, $[135] = onFocusPath, $[136] = setFocusPath, $[137] = t39) : t39 = $[137];
|
|
58390
58390
|
const handleBlur = t39;
|
|
58391
58391
|
let t40;
|
|
58392
|
-
$[
|
|
58392
|
+
$[138] !== handleSetOpenPath || $[139] !== onFocusPath || $[140] !== setFocusPath ? (t40 = (nextPath) => {
|
|
58393
58393
|
deepEquals(focusPathRef.current, nextPath) || (setFocusPath(nextPath), handleSetOpenPath(nextPath), onFocusPath?.(nextPath), focusPathRef.current = nextPath);
|
|
58394
|
-
}, $[
|
|
58394
|
+
}, $[138] = handleSetOpenPath, $[139] = onFocusPath, $[140] = setFocusPath, $[141] = t40) : t40 = $[141];
|
|
58395
58395
|
const handleProgrammaticFocus = t40;
|
|
58396
58396
|
let t41;
|
|
58397
|
-
return $[
|
|
58397
|
+
return $[142] !== collapsedFieldSets || $[143] !== collapsedPaths || $[144] !== connectionState || $[145] !== editState2 || $[146] !== focusPath || $[147] !== formState || $[148] !== handleBlur || $[149] !== handleFocus || $[150] !== handleOnSetCollapsedFieldSet || $[151] !== handleOnSetCollapsedPath || $[152] !== handleProgrammaticFocus || $[153] !== handleSetActiveFieldGroup || $[154] !== handleSetOpenPath || $[155] !== hasUpstreamVersion || $[156] !== isPermissionsLoading || $[157] !== openPath || $[158] !== permissions || $[159] !== ready || $[160] !== schemaType || $[161] !== upstreamEditState || $[162] !== validation2 || $[163] !== value ? (t41 = {
|
|
58398
58398
|
editState: editState2,
|
|
58399
58399
|
upstreamEditState,
|
|
58400
58400
|
connectionState,
|
|
@@ -58419,7 +58419,7 @@ function useDocumentForm(options) {
|
|
|
58419
58419
|
onSetActiveFieldGroup: handleSetActiveFieldGroup,
|
|
58420
58420
|
onSetCollapsedPath: handleOnSetCollapsedPath,
|
|
58421
58421
|
onSetCollapsedFieldSet: handleOnSetCollapsedFieldSet
|
|
58422
|
-
}, $[
|
|
58422
|
+
}, $[142] = collapsedFieldSets, $[143] = collapsedPaths, $[144] = connectionState, $[145] = editState2, $[146] = focusPath, $[147] = formState, $[148] = handleBlur, $[149] = handleFocus, $[150] = handleOnSetCollapsedFieldSet, $[151] = handleOnSetCollapsedPath, $[152] = handleProgrammaticFocus, $[153] = handleSetActiveFieldGroup, $[154] = handleSetOpenPath, $[155] = hasUpstreamVersion, $[156] = isPermissionsLoading, $[157] = openPath, $[158] = permissions, $[159] = ready, $[160] = schemaType, $[161] = upstreamEditState, $[162] = validation2, $[163] = value, $[164] = t41) : t41 = $[164], t41;
|
|
58423
58423
|
}
|
|
58424
58424
|
function _temp3$j(seg) {
|
|
58425
58425
|
return isKeySegment(seg);
|