sanity 5.29.0-next.9 → 5.29.0
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/structureTool.js +25 -18
- package/lib/_chunks-es/structureTool.js.map +1 -1
- package/lib/_chunks-es/version.js +2 -2
- package/lib/cli.d.ts +1 -1
- package/lib/index.js +36 -22
- package/lib/index.js.map +1 -1
- package/lib/structure.js +54 -48
- package/lib/structure.js.map +1 -1
- package/package.json +12 -12
|
@@ -3779,7 +3779,7 @@ const TitleContainer = styled(Stack).withConfig({
|
|
|
3779
3779
|
t4
|
|
3780
3780
|
] }), $[11] = t1, $[12] = t4, $[13] = t5) : t5 = $[13], t5;
|
|
3781
3781
|
}, preventDefault = (ev) => ev.preventDefault(), FormView = forwardRef(function(props, ref) {
|
|
3782
|
-
const $ = c(
|
|
3782
|
+
const $ = c(82), {
|
|
3783
3783
|
hidden,
|
|
3784
3784
|
margins
|
|
3785
3785
|
} = props, {
|
|
@@ -3804,7 +3804,8 @@ const TitleContainer = styled(Stack).withConfig({
|
|
|
3804
3804
|
openPath,
|
|
3805
3805
|
inspectOpen,
|
|
3806
3806
|
compareValue,
|
|
3807
|
-
hasUpstreamVersion
|
|
3807
|
+
hasUpstreamVersion,
|
|
3808
|
+
focusPath
|
|
3808
3809
|
} = useDocumentPane(), {
|
|
3809
3810
|
selectedReleaseId,
|
|
3810
3811
|
selectedPerspective
|
|
@@ -3853,33 +3854,39 @@ const TitleContainer = styled(Stack).withConfig({
|
|
|
3853
3854
|
}, $[23] = handleInitialValue, $[24] = hasRev, $[25] = t6) : t6 = $[25];
|
|
3854
3855
|
let t7;
|
|
3855
3856
|
$[26] !== hasRev ? (t7 = [hasRev], $[26] = hasRev, $[27] = t7) : t7 = $[27], useEffect(t6, t7);
|
|
3856
|
-
const [formRef, setFormRef] = useState(null), [
|
|
3857
|
+
const [formRef, setFormRef] = useState(null), [hasFocusedAnyPath, setHasFocusedAnyPath] = useState(!1);
|
|
3857
3858
|
let t8;
|
|
3858
|
-
$[28] !==
|
|
3859
|
-
!
|
|
3860
|
-
}, $[28] =
|
|
3859
|
+
$[28] !== formRef || $[29] !== formState?.focusPath.length || $[30] !== hasFocusedAnyPath || $[31] !== ready ? (t8 = () => {
|
|
3860
|
+
!hasFocusedAnyPath && ready && !formState?.focusPath.length && formRef && focusFirstDescendant(formRef);
|
|
3861
|
+
}, $[28] = formRef, $[29] = formState?.focusPath.length, $[30] = hasFocusedAnyPath, $[31] = ready, $[32] = t8) : t8 = $[32];
|
|
3861
3862
|
const t9 = formState?.focusPath.length;
|
|
3862
3863
|
let t10;
|
|
3863
|
-
$[33] !==
|
|
3864
|
+
$[33] !== formRef || $[34] !== hasFocusedAnyPath || $[35] !== ready || $[36] !== t9 ? (t10 = [hasFocusedAnyPath, formRef, t9, ready], $[33] = formRef, $[34] = hasFocusedAnyPath, $[35] = ready, $[36] = t9, $[37] = t10) : t10 = $[37], useEffect(t8, t10);
|
|
3864
3865
|
let t11;
|
|
3865
|
-
$[38] !==
|
|
3866
|
-
|
|
3867
|
-
}, $[38] =
|
|
3868
|
-
|
|
3866
|
+
$[38] !== focusPath.length ? (t11 = () => {
|
|
3867
|
+
focusPath.length !== 0 && setHasFocusedAnyPath(!0);
|
|
3868
|
+
}, $[38] = focusPath.length, $[39] = t11) : t11 = $[39];
|
|
3869
|
+
let t12;
|
|
3870
|
+
$[40] !== focusPath ? (t12 = [focusPath], $[40] = focusPath, $[41] = t12) : t12 = $[41], useEffect(t11, t12);
|
|
3869
3871
|
let t13;
|
|
3870
|
-
$[
|
|
3872
|
+
$[42] !== ref ? (t13 = (node) => {
|
|
3873
|
+
setFormRef(node), typeof ref == "function" ? ref(node) : ref && (ref.current = node);
|
|
3874
|
+
}, $[42] = ref, $[43] = t13) : t13 = $[43];
|
|
3875
|
+
const setRef = t13, isReadOnly = connectionState === "reconnecting" || formState?.readOnly || !editState?.ready, t14 = isReadOnly ? "true" : void 0;
|
|
3876
|
+
let t15;
|
|
3877
|
+
$[44] !== collapsedFieldSets || $[45] !== collapsedPaths || $[46] !== compareValue || $[47] !== connectionState || $[48] !== documentId || $[49] !== editState?.draft || $[50] !== editState?.published || $[51] !== fieldActions || $[52] !== formState || $[53] !== hasUpstreamVersion || $[54] !== hidden || $[55] !== inspectOpen || $[56] !== isReadOnly || $[57] !== onBlur || $[58] !== onChange || $[59] !== onFocus || $[60] !== onPathOpen || $[61] !== onSetActiveFieldGroup || $[62] !== onSetCollapsedFieldSet || $[63] !== onSetCollapsedPath || $[64] !== openPath || $[65] !== patchChannel || $[66] !== presence || $[67] !== selectedPerspective || $[68] !== t || $[69] !== title || $[70] !== validation ? (t15 = connectionState === "connecting" && !editState?.draft && !editState?.published ? /* @__PURE__ */ jsx(Delay, { ms: 300, children: /* @__PURE__ */ jsxs(Flex, { align: "center", direction: "column", height: "fill", justify: "center", children: [
|
|
3871
3878
|
/* @__PURE__ */ jsx(Spinner, { muted: !0 }),
|
|
3872
3879
|
/* @__PURE__ */ jsx(Box, { marginTop: 3, children: /* @__PURE__ */ jsx(Text, { align: "center", muted: !0, size: 1, children: t("document-view.form-view.loading") }) })
|
|
3873
3880
|
] }) }) : formState === null || hidden ? /* @__PURE__ */ jsx(Box, { padding: 2, children: /* @__PURE__ */ jsx(Text, { children: t("document-view.form-view.form-hidden") }) }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3874
3881
|
/* @__PURE__ */ jsx(FormRow, { children: /* @__PURE__ */ jsx(FormHeader, { documentId, schemaType: formState.schemaType, title }) }),
|
|
3875
3882
|
/* @__PURE__ */ jsx(FormBuilder, { __internal_fieldActions: fieldActions, __internal_inspectOpen: inspectOpen, __internal_patchChannel: patchChannel, changed: formState.changed, collapsedFieldSets, collapsedPaths, compareValue: compareValue ?? void 0, focused: formState.focused, focusPath: formState.focusPath, groups: formState.groups, id: "root", members: formState.members, onChange, onFieldGroupSelect: onSetActiveFieldGroup, onPathBlur: onBlur, onPathFocus: onFocus, onPathOpen, onSetFieldSetCollapsed: onSetCollapsedFieldSet, onSetPathCollapsed: onSetCollapsedPath, openPath, perspective: selectedPerspective, hasUpstreamVersion, presence, readOnly: isReadOnly, schemaType: formState.schemaType, validation, value: formState.value })
|
|
3876
|
-
] }), $[
|
|
3877
|
-
let t14;
|
|
3878
|
-
$[68] !== setRef || $[69] !== t12 || $[70] !== t13 ? (t14 = /* @__PURE__ */ jsx(Box, { as: "form", onSubmit: preventDefault, ref: setRef, "data-testid": "form-view", "data-read-only": t12, children: t13 }), $[68] = setRef, $[69] = t12, $[70] = t13, $[71] = t14) : t14 = $[71];
|
|
3879
|
-
let t15;
|
|
3880
|
-
$[72] !== margins || $[73] !== t14 ? (t15 = /* @__PURE__ */ jsx(PresenceOverlay, { margins, children: t14 }), $[72] = margins, $[73] = t14, $[74] = t15) : t15 = $[74];
|
|
3883
|
+
] }), $[44] = collapsedFieldSets, $[45] = collapsedPaths, $[46] = compareValue, $[47] = connectionState, $[48] = documentId, $[49] = editState?.draft, $[50] = editState?.published, $[51] = fieldActions, $[52] = formState, $[53] = hasUpstreamVersion, $[54] = hidden, $[55] = inspectOpen, $[56] = isReadOnly, $[57] = onBlur, $[58] = onChange, $[59] = onFocus, $[60] = onPathOpen, $[61] = onSetActiveFieldGroup, $[62] = onSetCollapsedFieldSet, $[63] = onSetCollapsedPath, $[64] = openPath, $[65] = patchChannel, $[66] = presence, $[67] = selectedPerspective, $[68] = t, $[69] = title, $[70] = validation, $[71] = t15) : t15 = $[71];
|
|
3881
3884
|
let t16;
|
|
3882
|
-
|
|
3885
|
+
$[72] !== setRef || $[73] !== t14 || $[74] !== t15 ? (t16 = /* @__PURE__ */ jsx(Box, { as: "form", onSubmit: preventDefault, ref: setRef, "data-testid": "form-view", "data-read-only": t14, children: t15 }), $[72] = setRef, $[73] = t14, $[74] = t15, $[75] = t16) : t16 = $[75];
|
|
3886
|
+
let t17;
|
|
3887
|
+
$[76] !== margins || $[77] !== t16 ? (t17 = /* @__PURE__ */ jsx(PresenceOverlay, { margins, children: t16 }), $[76] = margins, $[77] = t16, $[78] = t17) : t17 = $[78];
|
|
3888
|
+
let t18;
|
|
3889
|
+
return $[79] !== hidden || $[80] !== t17 ? (t18 = /* @__PURE__ */ jsx(FormContainer, { hidden, children: t17 }), $[79] = hidden, $[80] = t17, $[81] = t18) : t18 = $[81], t18;
|
|
3883
3890
|
});
|
|
3884
3891
|
function prepareMutationEvent(event) {
|
|
3885
3892
|
const patches = event.mutations.map((mut) => mut.patch).filter(Boolean);
|