sanity 6.3.0-next.30 → 6.3.0-next.32

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.
@@ -46958,8 +46958,11 @@ const MAX_DESCRIPTION_HEIGHT = 200, TitleTextArea = /* @__PURE__ */ styled.texta
46958
46958
  }
46959
46959
  `;
46960
46960
  }), getIsReleaseOpen = (release) => release.state !== "archived" && release.state !== "published";
46961
+ function resizeTextarea(element) {
46962
+ element.style.height = "auto", element.style.height = `${element.scrollHeight}px`;
46963
+ }
46961
46964
  function TitleDescriptionForm(t0) {
46962
- const $ = c(44), {
46965
+ const $ = c(45), {
46963
46966
  release,
46964
46967
  onChange,
46965
46968
  disabled
@@ -46981,18 +46984,20 @@ function TitleDescriptionForm(t0) {
46981
46984
  createFocusHandler,
46982
46985
  handleBlur
46983
46986
  } = useReleaseFormOptimisticUpdating(t2);
46984
- let t3, t4;
46987
+ let t3;
46985
46988
  $[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
46986
- descriptionRef.current && setScrollHeight(descriptionRef.current.scrollHeight), titleRef.current && (titleRef.current.style.height = "auto", titleRef.current.style.height = `${titleRef.current.scrollHeight}px`);
46987
- }, t4 = [], $[4] = t3, $[5] = t4) : (t3 = $[4], t4 = $[5]), useEffect(t3, t4);
46989
+ titleRef.current && resizeTextarea(titleRef.current);
46990
+ }, $[4] = t3) : t3 = $[4];
46991
+ let t4;
46992
+ $[5] !== release.metadata.title ? (t4 = [release.metadata.title], $[5] = release.metadata.title, $[6] = t4) : t4 = $[6], useEffect(t3, t4);
46988
46993
  let t5;
46989
- $[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
46990
- titleRef.current && (titleRef.current.style.height = "auto", titleRef.current.style.height = `${titleRef.current.scrollHeight}px`);
46991
- }, $[6] = t5) : t5 = $[6];
46994
+ $[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
46995
+ descriptionRef.current && (resizeTextarea(descriptionRef.current), setScrollHeight(descriptionRef.current.scrollHeight));
46996
+ }, $[7] = t5) : t5 = $[7];
46992
46997
  let t6;
46993
- $[7] !== release.metadata.title ? (t6 = [release.metadata.title], $[7] = release.metadata.title, $[8] = t6) : t6 = $[8], useEffect(t5, t6);
46998
+ $[8] !== release.metadata.description ? (t6 = [release.metadata.description], $[8] = release.metadata.description, $[9] = t6) : t6 = $[9], useEffect(t5, t6);
46994
46999
  let t7;
46995
- $[9] !== onChange || $[10] !== release || $[11] !== updateLocalData ? (t7 = (event) => {
47000
+ $[10] !== onChange || $[11] !== release || $[12] !== updateLocalData ? (t7 = (event) => {
46996
47001
  event.preventDefault();
46997
47002
  const title = event.target.value;
46998
47003
  updateLocalData({
@@ -47003,11 +47008,11 @@ function TitleDescriptionForm(t0) {
47003
47008
  ...release.metadata,
47004
47009
  title
47005
47010
  }
47006
- }), titleRef.current && (titleRef.current.style.height = "auto", titleRef.current.style.height = `${titleRef.current.scrollHeight}px`);
47007
- }, $[9] = onChange, $[10] = release, $[11] = updateLocalData, $[12] = t7) : t7 = $[12];
47011
+ }), titleRef.current && resizeTextarea(titleRef.current);
47012
+ }, $[10] = onChange, $[11] = release, $[12] = updateLocalData, $[13] = t7) : t7 = $[13];
47008
47013
  const handleTitleChange = t7;
47009
47014
  let t8;
47010
- $[13] !== isReleaseOpen || $[14] !== onChange || $[15] !== release || $[16] !== updateLocalData ? (t8 = (event_0) => {
47015
+ $[14] !== isReleaseOpen || $[15] !== onChange || $[16] !== release || $[17] !== updateLocalData ? (t8 = (event_0) => {
47011
47016
  if (event_0.preventDefault(), !isReleaseOpen)
47012
47017
  return;
47013
47018
  const description = event_0.target.value;
@@ -47019,27 +47024,28 @@ function TitleDescriptionForm(t0) {
47019
47024
  ...release.metadata,
47020
47025
  description
47021
47026
  }
47022
- }), descriptionRef.current && (descriptionRef.current.style.overflow = "hidden", descriptionRef.current.style.height = "auto", descriptionRef.current.style.height = `${descriptionRef.current.scrollHeight}px`, parseInt(descriptionRef.current.style.height, 10) > MAX_DESCRIPTION_HEIGHT && (descriptionRef.current.style.overflow = "auto")), setScrollHeight(event_0.currentTarget.scrollHeight);
47023
- }, $[13] = isReleaseOpen, $[14] = onChange, $[15] = release, $[16] = updateLocalData, $[17] = t8) : t8 = $[17];
47027
+ }), descriptionRef.current && resizeTextarea(descriptionRef.current), setScrollHeight(event_0.currentTarget.scrollHeight);
47028
+ }, $[14] = isReleaseOpen, $[15] = onChange, $[16] = release, $[17] = updateLocalData, $[18] = t8) : t8 = $[18];
47024
47029
  const handleDescriptionChange = t8, shouldShowDescription = isReleaseOpen || localData.description;
47025
47030
  let t9;
47026
- $[18] !== createFocusHandler ? (t9 = createFocusHandler("title"), $[18] = createFocusHandler, $[19] = t9) : t9 = $[19];
47031
+ $[19] !== createFocusHandler ? (t9 = createFocusHandler("title"), $[19] = createFocusHandler, $[20] = t9) : t9 = $[20];
47027
47032
  const t10 = localData.title;
47028
47033
  let t11;
47029
- $[20] !== t ? (t11 = t("release.placeholder-untitled-release"), $[20] = t, $[21] = t11) : t11 = $[21];
47034
+ $[21] !== t ? (t11 = t("release.placeholder-untitled-release"), $[21] = t, $[22] = t11) : t11 = $[22];
47030
47035
  const t12 = !isReleaseOpen;
47031
47036
  let t13;
47032
- $[22] !== disabled || $[23] !== handleBlur || $[24] !== handleTitleChange || $[25] !== localData.title || $[26] !== t11 || $[27] !== t12 || $[28] !== t9 ? (t13 = /* @__PURE__ */ jsx(TitleTextArea, { ref: titleRef, onChange: handleTitleChange, onFocus: t9, onBlur: handleBlur, value: t10, placeholder: t11, "data-testid": "release-form-title", readOnly: t12, disabled }), $[22] = disabled, $[23] = handleBlur, $[24] = handleTitleChange, $[25] = localData.title, $[26] = t11, $[27] = t12, $[28] = t9, $[29] = t13) : t13 = $[29];
47037
+ $[23] !== disabled || $[24] !== handleBlur || $[25] !== handleTitleChange || $[26] !== localData.title || $[27] !== t11 || $[28] !== t12 || $[29] !== t9 ? (t13 = /* @__PURE__ */ jsx(TitleTextArea, { ref: titleRef, onChange: handleTitleChange, onFocus: t9, onBlur: handleBlur, value: t10, placeholder: t11, "data-testid": "release-form-title", readOnly: t12, disabled }), $[23] = disabled, $[24] = handleBlur, $[25] = handleTitleChange, $[26] = localData.title, $[27] = t11, $[28] = t12, $[29] = t9, $[30] = t13) : t13 = $[30];
47033
47038
  let t14;
47034
- $[30] !== createFocusHandler || $[31] !== disabled || $[32] !== handleBlur || $[33] !== handleDescriptionChange || $[34] !== isReleaseOpen || $[35] !== localData.description || $[36] !== localData.title || $[37] !== scrollHeight || $[38] !== shouldShowDescription || $[39] !== t ? (t14 = shouldShowDescription && /* @__PURE__ */ jsx(DescriptionTextArea, { ref: descriptionRef, autoFocus: !localData.title, value: localData.description, placeholder: t("release.form.placeholder-describe-release"), onChange: handleDescriptionChange, onFocus: createFocusHandler("description"), onBlur: handleBlur, style: {
47039
+ $[31] !== createFocusHandler || $[32] !== disabled || $[33] !== handleBlur || $[34] !== handleDescriptionChange || $[35] !== isReleaseOpen || $[36] !== localData.description || $[37] !== localData.title || $[38] !== scrollHeight || $[39] !== shouldShowDescription || $[40] !== t ? (t14 = shouldShowDescription && /* @__PURE__ */ jsx(DescriptionTextArea, { ref: descriptionRef, autoFocus: !localData.title, value: localData.description, placeholder: t("release.form.placeholder-describe-release"), onChange: handleDescriptionChange, onFocus: createFocusHandler("description"), onBlur: handleBlur, style: {
47035
47040
  height: `${scrollHeight}px`,
47036
- maxHeight: MAX_DESCRIPTION_HEIGHT
47037
- }, "data-testid": "release-form-description", disabled, readOnly: !isReleaseOpen }), $[30] = createFocusHandler, $[31] = disabled, $[32] = handleBlur, $[33] = handleDescriptionChange, $[34] = isReleaseOpen, $[35] = localData.description, $[36] = localData.title, $[37] = scrollHeight, $[38] = shouldShowDescription, $[39] = t, $[40] = t14) : t14 = $[40];
47041
+ maxHeight: MAX_DESCRIPTION_HEIGHT,
47042
+ overflowY: scrollHeight > MAX_DESCRIPTION_HEIGHT ? "auto" : "hidden"
47043
+ }, "data-testid": "release-form-description", disabled, readOnly: !isReleaseOpen }), $[31] = createFocusHandler, $[32] = disabled, $[33] = handleBlur, $[34] = handleDescriptionChange, $[35] = isReleaseOpen, $[36] = localData.description, $[37] = localData.title, $[38] = scrollHeight, $[39] = shouldShowDescription, $[40] = t, $[41] = t14) : t14 = $[41];
47038
47044
  let t15;
47039
- return $[41] !== t13 || $[42] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
47045
+ return $[42] !== t13 || $[43] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
47040
47046
  t13,
47041
47047
  t14
47042
- ] }), $[41] = t13, $[42] = t14, $[43] = t15) : t15 = $[43], t15;
47048
+ ] }), $[42] = t13, $[43] = t14, $[44] = t15) : t15 = $[44], t15;
47043
47049
  }
47044
47050
  function _temp$1S(t0) {
47045
47051
  const {