sanity 5.26.0-next.15 → 5.26.0-next.16

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.26.0-next.15";
1
+ var version = "5.26.0-next.16";
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.26.0-next.15";
10
+ "5.26.0-next.16";
11
11
  } catch {
12
12
  }
13
13
  const SANITY_VERSION = buildVersion || `${version}-dev`;
package/lib/index.js CHANGED
@@ -38960,7 +38960,7 @@ function UploadDropDownMenuComponent(props2, forwardedRef) {
38960
38960
  }
38961
38961
  const UploadDropDownMenu = memo(forwardRef(UploadDropDownMenuComponent));
38962
38962
  function UploadPlaceholderComponent(props2) {
38963
- const $ = c(47), {
38963
+ const $ = c(49), {
38964
38964
  assetSources,
38965
38965
  browse,
38966
38966
  directUploads,
@@ -38972,7 +38972,7 @@ function UploadPlaceholderComponent(props2) {
38972
38972
  type
38973
38973
  } = props2, [rootElement, setRootElement] = useState(null), rect = useElementSize(rootElement), collapsed = rect?.border && rect.border.width < 440, {
38974
38974
  t
38975
- } = useTranslation(), client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS), source = useSource();
38975
+ } = useTranslation(), client = useClient(DEFAULT_STUDIO_CLIENT_OPTIONS), source = useSource(), disableNew = schemaType.options?.disableNew === !0;
38976
38976
  let result;
38977
38977
  if ($[0] !== assetSources || $[1] !== client || $[2] !== source || $[3] !== type) {
38978
38978
  if (result = getAssetSourcesWithUpload(assetSources), result.length === 0) {
@@ -38995,50 +38995,60 @@ function UploadPlaceholderComponent(props2) {
38995
38995
  $[7] !== schemaType || $[8] !== t1 ? (t2 = get(schemaType, "options.accept", t1), $[7] = schemaType, $[8] = t1, $[9] = t2) : t2 = $[9];
38996
38996
  const accept = t2;
38997
38997
  let t3;
38998
- bb0: switch (assetSourcesWithUpload.length) {
38999
- case 0: {
38998
+ bb0: {
38999
+ if (disableNew) {
39000
39000
  t3 = null;
39001
39001
  break bb0;
39002
39002
  }
39003
- case 1: {
39004
- const singleSource = assetSourcesWithUpload[0];
39005
- if (isComponentModeAssetSource(singleSource)) {
39006
- const t43 = `file-input-upload-button-${singleSource.name}`, t52 = readOnly || directUploads === !1;
39007
- let t62;
39008
- $[10] !== onOpenSourceForUpload || $[11] !== singleSource ? (t62 = () => {
39009
- onOpenSourceForUpload && onOpenSourceForUpload(singleSource);
39010
- }, $[10] = onOpenSourceForUpload, $[11] = singleSource, $[12] = t62) : t62 = $[12];
39011
- let t72;
39012
- $[13] !== t ? (t72 = t("input.files.common.upload-placeholder.file-input-button.text"), $[13] = t, $[14] = t72) : t72 = $[14];
39013
- let t82;
39014
- $[15] !== t43 || $[16] !== t52 || $[17] !== t62 || $[18] !== t72 ? (t82 = /* @__PURE__ */ jsx(Button, { "data-testid": t43, disabled: t52, icon: UploadIcon, mode: "bleed", onClick: t62, text: t72 }), $[15] = t43, $[16] = t52, $[17] = t62, $[18] = t72, $[19] = t82) : t82 = $[19], t3 = t82;
39003
+ switch (assetSourcesWithUpload.length) {
39004
+ case 0: {
39005
+ t3 = null;
39015
39006
  break bb0;
39016
39007
  }
39017
- const t42 = `file-input-upload-button-${singleSource.name}`, t5 = readOnly || directUploads === !1;
39018
- let t6;
39019
- $[20] !== onUpload || $[21] !== singleSource ? (t6 = (files_0) => {
39020
- onUpload && onUpload(singleSource, files_0);
39021
- }, $[20] = onUpload, $[21] = singleSource, $[22] = t6) : t6 = $[22];
39022
- let t7;
39023
- $[23] !== t ? (t7 = t("input.files.common.upload-placeholder.file-input-button.text"), $[23] = t, $[24] = t7) : t7 = $[24];
39024
- let t8;
39025
- $[25] !== accept || $[26] !== t42 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 ? (t8 = /* @__PURE__ */ jsx(FileInputButton, { accept, "data-testid": t42, disabled: t5, icon: UploadIcon, mode: "bleed", onSelect: t6, text: t7 }), $[25] = accept, $[26] = t42, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t8) : t8 = $[30], t3 = t8;
39026
- break bb0;
39027
- }
39028
- default: {
39029
- let t42;
39030
- $[31] !== accept || $[32] !== assetSourcesWithUpload || $[33] !== directUploads || $[34] !== handleSelectFiles || $[35] !== onOpenSourceForUpload || $[36] !== readOnly ? (t42 = /* @__PURE__ */ jsx(UploadDropDownMenu, { accept, assetSources: assetSourcesWithUpload, directUploads, onSelectFiles: handleSelectFiles, onOpenSourceForUpload, readOnly }), $[31] = accept, $[32] = assetSourcesWithUpload, $[33] = directUploads, $[34] = handleSelectFiles, $[35] = onOpenSourceForUpload, $[36] = readOnly, $[37] = t42) : t42 = $[37], t3 = t42;
39008
+ case 1: {
39009
+ const singleSource = assetSourcesWithUpload[0];
39010
+ if (isComponentModeAssetSource(singleSource)) {
39011
+ const t43 = `file-input-upload-button-${singleSource.name}`, t52 = readOnly || directUploads === !1;
39012
+ let t62;
39013
+ $[10] !== onOpenSourceForUpload || $[11] !== singleSource ? (t62 = () => {
39014
+ onOpenSourceForUpload && onOpenSourceForUpload(singleSource);
39015
+ }, $[10] = onOpenSourceForUpload, $[11] = singleSource, $[12] = t62) : t62 = $[12];
39016
+ let t72;
39017
+ $[13] !== t ? (t72 = t("input.files.common.upload-placeholder.file-input-button.text"), $[13] = t, $[14] = t72) : t72 = $[14];
39018
+ let t82;
39019
+ $[15] !== t43 || $[16] !== t52 || $[17] !== t62 || $[18] !== t72 ? (t82 = /* @__PURE__ */ jsx(Button, { "data-testid": t43, disabled: t52, icon: UploadIcon, mode: "bleed", onClick: t62, text: t72 }), $[15] = t43, $[16] = t52, $[17] = t62, $[18] = t72, $[19] = t82) : t82 = $[19], t3 = t82;
39020
+ break bb0;
39021
+ }
39022
+ const t42 = `file-input-upload-button-${singleSource.name}`, t5 = readOnly || directUploads === !1;
39023
+ let t6;
39024
+ $[20] !== onUpload || $[21] !== singleSource ? (t6 = (files_0) => {
39025
+ onUpload && onUpload(singleSource, files_0);
39026
+ }, $[20] = onUpload, $[21] = singleSource, $[22] = t6) : t6 = $[22];
39027
+ let t7;
39028
+ $[23] !== t ? (t7 = t("input.files.common.upload-placeholder.file-input-button.text"), $[23] = t, $[24] = t7) : t7 = $[24];
39029
+ let t8;
39030
+ $[25] !== accept || $[26] !== t42 || $[27] !== t5 || $[28] !== t6 || $[29] !== t7 ? (t8 = /* @__PURE__ */ jsx(FileInputButton, { accept, "data-testid": t42, disabled: t5, icon: UploadIcon, mode: "bleed", onSelect: t6, text: t7 }), $[25] = accept, $[26] = t42, $[27] = t5, $[28] = t6, $[29] = t7, $[30] = t8) : t8 = $[30], t3 = t8;
39031
+ break bb0;
39032
+ }
39033
+ default: {
39034
+ let t42;
39035
+ $[31] !== accept || $[32] !== assetSourcesWithUpload || $[33] !== directUploads || $[34] !== handleSelectFiles || $[35] !== onOpenSourceForUpload || $[36] !== readOnly ? (t42 = /* @__PURE__ */ jsx(UploadDropDownMenu, { accept, assetSources: assetSourcesWithUpload, directUploads, onSelectFiles: handleSelectFiles, onOpenSourceForUpload, readOnly }), $[31] = accept, $[32] = assetSourcesWithUpload, $[33] = directUploads, $[34] = handleSelectFiles, $[35] = onOpenSourceForUpload, $[36] = readOnly, $[37] = t42) : t42 = $[37], t3 = t42;
39036
+ }
39031
39037
  }
39032
39038
  }
39033
39039
  const uploadButton = t3;
39040
+ if (disableNew) {
39041
+ let t42;
39042
+ return $[38] !== browse ? (t42 = browse ? /* @__PURE__ */ jsx(Flex, { align: "center", justify: "flex-end", ref: setRootElement, children: browse }) : null, $[38] = browse, $[39] = t42) : t42 = $[39], t42;
39043
+ }
39034
39044
  let t4;
39035
- return $[38] !== assetSourcesWithUpload.length || $[39] !== browse || $[40] !== collapsed || $[41] !== directUploads || $[42] !== hoveringFiles || $[43] !== readOnly || $[44] !== type || $[45] !== uploadButton ? (t4 = assetSourcesWithUpload.length === 0 ? null : /* @__PURE__ */ jsxs(Flex, { align: collapsed ? void 0 : "center", direction: collapsed ? "column" : "row", gap: 4, justify: "space-between", paddingY: collapsed ? 1 : void 0, ref: setRootElement, children: [
39045
+ return $[40] !== assetSourcesWithUpload.length || $[41] !== browse || $[42] !== collapsed || $[43] !== directUploads || $[44] !== hoveringFiles || $[45] !== readOnly || $[46] !== type || $[47] !== uploadButton ? (t4 = assetSourcesWithUpload.length === 0 ? null : /* @__PURE__ */ jsxs(Flex, { align: collapsed ? void 0 : "center", direction: collapsed ? "column" : "row", gap: 4, justify: "space-between", paddingY: collapsed ? 1 : void 0, ref: setRootElement, children: [
39036
39046
  /* @__PURE__ */ jsx(Flex, { flex: 1, children: /* @__PURE__ */ jsx(PlaceholderText, { directUploads, hoveringFiles, readOnly, type }) }),
39037
39047
  /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 1, justify: "center", wrap: "wrap", children: [
39038
39048
  uploadButton,
39039
39049
  browse
39040
39050
  ] })
39041
- ] }), $[38] = assetSourcesWithUpload.length, $[39] = browse, $[40] = collapsed, $[41] = directUploads, $[42] = hoveringFiles, $[43] = readOnly, $[44] = type, $[45] = uploadButton, $[46] = t4) : t4 = $[46], t4;
39051
+ ] }), $[40] = assetSourcesWithUpload.length, $[41] = browse, $[42] = collapsed, $[43] = directUploads, $[44] = hoveringFiles, $[45] = readOnly, $[46] = type, $[47] = uploadButton, $[48] = t4) : t4 = $[48], t4;
39042
39052
  }
39043
39053
  const UploadPlaceholder = memo(UploadPlaceholderComponent), STALE_UPLOAD_MS = 12e4, RatioBox$2 = styled(Card).withConfig({
39044
39054
  displayName: "RatioBox",
@@ -39242,6 +39252,7 @@ function useUploadMenuItem(options) {
39242
39252
  accept,
39243
39253
  assetSourcesWithUpload,
39244
39254
  directUploads,
39255
+ disableNew,
39245
39256
  readOnly,
39246
39257
  onSelectFiles,
39247
39258
  onOpenSourceForUpload,
@@ -39255,34 +39266,40 @@ function useUploadMenuItem(options) {
39255
39266
  t
39256
39267
  } = useTranslation();
39257
39268
  let t0;
39258
- bb0: switch (assetSourcesWithUpload.length) {
39259
- case 0: {
39269
+ bb0: {
39270
+ if (disableNew) {
39260
39271
  t0 = null;
39261
39272
  break bb0;
39262
39273
  }
39263
- case 1: {
39264
- const singleSource = assetSourcesWithUpload[0];
39265
- let t1;
39266
- $[0] !== getSingleButtonTestId || $[1] !== singleSource.name ? (t1 = getSingleButtonTestId?.(singleSource.name), $[0] = getSingleButtonTestId, $[1] = singleSource.name, $[2] = t1) : t1 = $[2];
39267
- const singleButtonTestId = t1, disabled = readOnly || directUploads === !1;
39268
- if (isComponentModeAssetSource(singleSource)) {
39269
- const t22 = singleSource.name;
39270
- let t32;
39271
- $[3] !== t ? (t32 = t("inputs.files.common.actions-menu.upload.label"), $[3] = t, $[4] = t32) : t32 = $[4];
39272
- let t42;
39273
- $[5] !== disabled || $[6] !== onOpenSourceForUploadSingle || $[7] !== singleButtonTestId || $[8] !== singleSource.name || $[9] !== t32 ? (t42 = /* @__PURE__ */ jsx(MenuItem, { icon: UploadIcon, onClick: onOpenSourceForUploadSingle, "data-asset-source-name": t22, text: t32, "data-testid": singleButtonTestId, disabled }), $[5] = disabled, $[6] = onOpenSourceForUploadSingle, $[7] = singleButtonTestId, $[8] = singleSource.name, $[9] = t32, $[10] = t42) : t42 = $[10], t0 = t42;
39274
+ switch (assetSourcesWithUpload.length) {
39275
+ case 0: {
39276
+ t0 = null;
39274
39277
  break bb0;
39275
39278
  }
39276
- const t2 = singleSource.name;
39277
- let t3;
39278
- $[11] !== t ? (t3 = t("inputs.files.common.actions-menu.upload.label"), $[11] = t, $[12] = t3) : t3 = $[12];
39279
- let t4;
39280
- $[13] !== accept || $[14] !== disabled || $[15] !== onFilePickerCancel || $[16] !== onSelectFilesSingle || $[17] !== singleButtonTestId || $[18] !== singleSource.name || $[19] !== t3 ? (t4 = /* @__PURE__ */ jsx(FileInputMenuItem, { icon: UploadIcon, onSelect: onSelectFilesSingle, onFilePickerCancel, accept, "data-asset-source-name": t2, text: t3, "data-testid": singleButtonTestId, disabled }), $[13] = accept, $[14] = disabled, $[15] = onFilePickerCancel, $[16] = onSelectFilesSingle, $[17] = singleButtonTestId, $[18] = singleSource.name, $[19] = t3, $[20] = t4) : t4 = $[20], t0 = t4;
39281
- break bb0;
39282
- }
39283
- default: {
39284
- let t1;
39285
- $[21] !== accept || $[22] !== assetSourcesWithUpload || $[23] !== directUploads || $[24] !== dropdownMenuTestId || $[25] !== onCloseParentMenu || $[26] !== onFilePickerCancel || $[27] !== onOpenSourceForUpload || $[28] !== onSelectFiles || $[29] !== readOnly ? (t1 = /* @__PURE__ */ jsx(UploadDropDownMenu, { accept, assetSources: assetSourcesWithUpload, directUploads, onSelectFiles, onOpenSourceForUpload, onCloseParentMenu, onFilePickerCancel, readOnly, "data-testid": dropdownMenuTestId, renderAsMenuGroup: !0 }), $[21] = accept, $[22] = assetSourcesWithUpload, $[23] = directUploads, $[24] = dropdownMenuTestId, $[25] = onCloseParentMenu, $[26] = onFilePickerCancel, $[27] = onOpenSourceForUpload, $[28] = onSelectFiles, $[29] = readOnly, $[30] = t1) : t1 = $[30], t0 = t1;
39279
+ case 1: {
39280
+ const singleSource = assetSourcesWithUpload[0];
39281
+ let t1;
39282
+ $[0] !== getSingleButtonTestId || $[1] !== singleSource.name ? (t1 = getSingleButtonTestId?.(singleSource.name), $[0] = getSingleButtonTestId, $[1] = singleSource.name, $[2] = t1) : t1 = $[2];
39283
+ const singleButtonTestId = t1, disabled = readOnly || directUploads === !1;
39284
+ if (isComponentModeAssetSource(singleSource)) {
39285
+ const t22 = singleSource.name;
39286
+ let t32;
39287
+ $[3] !== t ? (t32 = t("inputs.files.common.actions-menu.upload.label"), $[3] = t, $[4] = t32) : t32 = $[4];
39288
+ let t42;
39289
+ $[5] !== disabled || $[6] !== onOpenSourceForUploadSingle || $[7] !== singleButtonTestId || $[8] !== singleSource.name || $[9] !== t32 ? (t42 = /* @__PURE__ */ jsx(MenuItem, { icon: UploadIcon, onClick: onOpenSourceForUploadSingle, "data-asset-source-name": t22, text: t32, "data-testid": singleButtonTestId, disabled }), $[5] = disabled, $[6] = onOpenSourceForUploadSingle, $[7] = singleButtonTestId, $[8] = singleSource.name, $[9] = t32, $[10] = t42) : t42 = $[10], t0 = t42;
39290
+ break bb0;
39291
+ }
39292
+ const t2 = singleSource.name;
39293
+ let t3;
39294
+ $[11] !== t ? (t3 = t("inputs.files.common.actions-menu.upload.label"), $[11] = t, $[12] = t3) : t3 = $[12];
39295
+ let t4;
39296
+ $[13] !== accept || $[14] !== disabled || $[15] !== onFilePickerCancel || $[16] !== onSelectFilesSingle || $[17] !== singleButtonTestId || $[18] !== singleSource.name || $[19] !== t3 ? (t4 = /* @__PURE__ */ jsx(FileInputMenuItem, { icon: UploadIcon, onSelect: onSelectFilesSingle, onFilePickerCancel, accept, "data-asset-source-name": t2, text: t3, "data-testid": singleButtonTestId, disabled }), $[13] = accept, $[14] = disabled, $[15] = onFilePickerCancel, $[16] = onSelectFilesSingle, $[17] = singleButtonTestId, $[18] = singleSource.name, $[19] = t3, $[20] = t4) : t4 = $[20], t0 = t4;
39297
+ break bb0;
39298
+ }
39299
+ default: {
39300
+ let t1;
39301
+ $[21] !== accept || $[22] !== assetSourcesWithUpload || $[23] !== directUploads || $[24] !== dropdownMenuTestId || $[25] !== onCloseParentMenu || $[26] !== onFilePickerCancel || $[27] !== onOpenSourceForUpload || $[28] !== onSelectFiles || $[29] !== readOnly ? (t1 = /* @__PURE__ */ jsx(UploadDropDownMenu, { accept, assetSources: assetSourcesWithUpload, directUploads, onSelectFiles, onOpenSourceForUpload, onCloseParentMenu, onFilePickerCancel, readOnly, "data-testid": dropdownMenuTestId, renderAsMenuGroup: !0 }), $[21] = accept, $[22] = assetSourcesWithUpload, $[23] = directUploads, $[24] = dropdownMenuTestId, $[25] = onCloseParentMenu, $[26] = onFilePickerCancel, $[27] = onOpenSourceForUpload, $[28] = onSelectFiles, $[29] = readOnly, $[30] = t1) : t1 = $[30], t0 = t1;
39302
+ }
39286
39303
  }
39287
39304
  }
39288
39305
  return t0;
@@ -39426,7 +39443,7 @@ function FileSkeleton$1() {
39426
39443
  ] }), $[2] = t2) : t2 = $[2], t2;
39427
39444
  }
39428
39445
  function FilePreview$1(props2) {
39429
- const $ = c(67), {
39446
+ const $ = c(68), {
39430
39447
  accessPolicy,
39431
39448
  assetSources,
39432
39449
  clearField,
@@ -39507,16 +39524,17 @@ function FilePreview$1(props2) {
39507
39524
  t92 = $[32];
39508
39525
  t7 = t92;
39509
39526
  }
39510
- const browseMenuItem = t7;
39527
+ const browseMenuItem = t7, disableNew = schemaType.options?.disableNew === !0;
39511
39528
  let t8;
39512
39529
  $[38] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t8 = () => setIsMenuOpen(!1), $[38] = t8) : t8 = $[38];
39513
39530
  let t9;
39514
39531
  $[39] !== menuButtonRef ? (t9 = () => menuButtonRef.current?.focus(), $[39] = menuButtonRef, $[40] = t9) : t9 = $[40];
39515
39532
  let t10;
39516
- $[41] !== accept || $[42] !== assetSourcesWithUpload || $[43] !== directUploads || $[44] !== handleOpenSourceForUpload || $[45] !== handleOpenSourceForUploadSingle || $[46] !== handleSelectFilesFromAssetSource || $[47] !== handleSelectFilesFromAssetSourceSingle || $[48] !== readOnly || $[49] !== t9 ? (t10 = {
39533
+ $[41] !== accept || $[42] !== assetSourcesWithUpload || $[43] !== directUploads || $[44] !== disableNew || $[45] !== handleOpenSourceForUpload || $[46] !== handleOpenSourceForUploadSingle || $[47] !== handleSelectFilesFromAssetSource || $[48] !== handleSelectFilesFromAssetSourceSingle || $[49] !== readOnly || $[50] !== t9 ? (t10 = {
39517
39534
  accept,
39518
39535
  assetSourcesWithUpload,
39519
39536
  directUploads,
39537
+ disableNew,
39520
39538
  readOnly,
39521
39539
  onSelectFiles: handleSelectFilesFromAssetSource,
39522
39540
  onOpenSourceForUpload: handleOpenSourceForUpload,
@@ -39526,16 +39544,16 @@ function FilePreview$1(props2) {
39526
39544
  dropdownMenuTestId: "file-input-upload-drop-down-menu-button",
39527
39545
  onCloseParentMenu: t8,
39528
39546
  onFilePickerCancel: t9
39529
- }, $[41] = accept, $[42] = assetSourcesWithUpload, $[43] = directUploads, $[44] = handleOpenSourceForUpload, $[45] = handleOpenSourceForUploadSingle, $[46] = handleSelectFilesFromAssetSource, $[47] = handleSelectFilesFromAssetSourceSingle, $[48] = readOnly, $[49] = t9, $[50] = t10) : t10 = $[50];
39547
+ }, $[41] = accept, $[42] = assetSourcesWithUpload, $[43] = directUploads, $[44] = disableNew, $[45] = handleOpenSourceForUpload, $[46] = handleOpenSourceForUploadSingle, $[47] = handleSelectFilesFromAssetSource, $[48] = handleSelectFilesFromAssetSourceSingle, $[49] = readOnly, $[50] = t9, $[51] = t10) : t10 = $[51];
39530
39548
  const uploadMenuItem = useUploadMenuItem(t10);
39531
39549
  if (!asset)
39532
39550
  return null;
39533
39551
  let t11;
39534
- $[51] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx(FileSkeleton$1, {}), $[51] = t11) : t11 = $[51];
39552
+ $[52] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx(FileSkeleton$1, {}), $[52] = t11) : t11 = $[52];
39535
39553
  let t12;
39536
- $[52] !== accessPolicy || $[53] !== assetSources || $[54] !== browseMenuItem || $[55] !== clearField || $[56] !== isMenuOpen || $[57] !== menuButtonRef || $[58] !== onOpenInSource || $[59] !== readOnly || $[60] !== uploadMenuItem || $[61] !== value ? (t12 = (fileAsset) => /* @__PURE__ */ jsx(FilePreviewContent, { accessPolicy, assetSources, browseMenuItem, clearField, fileAsset, isMenuOpen, onOpenInSource, readOnly, setIsMenuOpen, menuButtonRef, uploadMenuItem, value }), $[52] = accessPolicy, $[53] = assetSources, $[54] = browseMenuItem, $[55] = clearField, $[56] = isMenuOpen, $[57] = menuButtonRef, $[58] = onOpenInSource, $[59] = readOnly, $[60] = uploadMenuItem, $[61] = value, $[62] = t12) : t12 = $[62];
39554
+ $[53] !== accessPolicy || $[54] !== assetSources || $[55] !== browseMenuItem || $[56] !== clearField || $[57] !== isMenuOpen || $[58] !== menuButtonRef || $[59] !== onOpenInSource || $[60] !== readOnly || $[61] !== uploadMenuItem || $[62] !== value ? (t12 = (fileAsset) => /* @__PURE__ */ jsx(FilePreviewContent, { accessPolicy, assetSources, browseMenuItem, clearField, fileAsset, isMenuOpen, onOpenInSource, readOnly, setIsMenuOpen, menuButtonRef, uploadMenuItem, value }), $[53] = accessPolicy, $[54] = assetSources, $[55] = browseMenuItem, $[56] = clearField, $[57] = isMenuOpen, $[58] = menuButtonRef, $[59] = onOpenInSource, $[60] = readOnly, $[61] = uploadMenuItem, $[62] = value, $[63] = t12) : t12 = $[63];
39537
39555
  let t13;
39538
- return $[63] !== asset || $[64] !== observeAsset || $[65] !== t12 ? (t13 = /* @__PURE__ */ jsx(WithReferencedAsset, { reference: asset, observeAsset, waitPlaceholder: t11, children: t12 }), $[63] = asset, $[64] = observeAsset, $[65] = t12, $[66] = t13) : t13 = $[66], t13;
39556
+ return $[64] !== asset || $[65] !== observeAsset || $[66] !== t12 ? (t13 = /* @__PURE__ */ jsx(WithReferencedAsset, { reference: asset, observeAsset, waitPlaceholder: t11, children: t12 }), $[64] = asset, $[65] = observeAsset, $[66] = t12, $[67] = t13) : t13 = $[67], t13;
39539
39557
  }
39540
39558
  function _temp$2C(sourceName2) {
39541
39559
  return `file-input-upload-button-${sourceName2}`;
@@ -40005,7 +40023,7 @@ function ImageInputAssetMenuComponent(props2) {
40005
40023
  }
40006
40024
  const ImageInputAssetMenu = memo(ImageInputAssetMenuComponent);
40007
40025
  function ImageInputAssetMenuWithReferenceAssetComponent(props2) {
40008
- const $ = c(69), {
40026
+ const $ = c(70), {
40009
40027
  accept,
40010
40028
  accessPolicy,
40011
40029
  assetSources,
@@ -40021,6 +40039,7 @@ function ImageInputAssetMenuWithReferenceAssetComponent(props2) {
40021
40039
  observeAsset,
40022
40040
  readOnly,
40023
40041
  reference,
40042
+ schemaType,
40024
40043
  setHotspotButtonElement,
40025
40044
  menuButtonRef,
40026
40045
  setMenuOpen,
@@ -40069,16 +40088,17 @@ function ImageInputAssetMenuWithReferenceAssetComponent(props2) {
40069
40088
  } = openInSourceResult;
40070
40089
  result.type === "url" ? window.open(result.url, result.target || "_blank") : result.type === "component" && onOpenInSource?.(source, asset);
40071
40090
  }, $[21] = asset, $[22] = onOpenInSource, $[23] = openInSourceResult, $[24] = setMenuOpen, $[25] = t7) : t7 = $[25];
40072
- const handleOpenInSource = t7;
40091
+ const handleOpenInSource = t7, disableNew = schemaType.options?.disableNew === !0;
40073
40092
  let t8;
40074
40093
  $[26] !== setMenuOpen ? (t8 = () => setMenuOpen(!1), $[26] = setMenuOpen, $[27] = t8) : t8 = $[27];
40075
40094
  let t9;
40076
40095
  $[28] !== menuButtonRef ? (t9 = () => menuButtonRef.current?.focus(), $[28] = menuButtonRef, $[29] = t9) : t9 = $[29];
40077
40096
  let t10;
40078
- $[30] !== accept || $[31] !== assetSourcesWithUpload || $[32] !== directUploads || $[33] !== handleOpenSourceForUpload || $[34] !== handleOpenSourceForUploadSingle || $[35] !== handleSelectFilesFromAssetSource || $[36] !== handleSelectFilesFromAssetSourceSingle || $[37] !== readOnly || $[38] !== t8 || $[39] !== t9 ? (t10 = {
40097
+ $[30] !== accept || $[31] !== assetSourcesWithUpload || $[32] !== directUploads || $[33] !== disableNew || $[34] !== handleOpenSourceForUpload || $[35] !== handleOpenSourceForUploadSingle || $[36] !== handleSelectFilesFromAssetSource || $[37] !== handleSelectFilesFromAssetSourceSingle || $[38] !== readOnly || $[39] !== t8 || $[40] !== t9 ? (t10 = {
40079
40098
  accept,
40080
40099
  assetSourcesWithUpload,
40081
40100
  directUploads,
40101
+ disableNew,
40082
40102
  readOnly,
40083
40103
  onSelectFiles: handleSelectFilesFromAssetSource,
40084
40104
  onOpenSourceForUpload: handleOpenSourceForUpload,
@@ -40087,11 +40107,11 @@ function ImageInputAssetMenuWithReferenceAssetComponent(props2) {
40087
40107
  getSingleButtonTestId: _temp$2B,
40088
40108
  onCloseParentMenu: t8,
40089
40109
  onFilePickerCancel: t9
40090
- }, $[30] = accept, $[31] = assetSourcesWithUpload, $[32] = directUploads, $[33] = handleOpenSourceForUpload, $[34] = handleOpenSourceForUploadSingle, $[35] = handleSelectFilesFromAssetSource, $[36] = handleSelectFilesFromAssetSourceSingle, $[37] = readOnly, $[38] = t8, $[39] = t9, $[40] = t10) : t10 = $[40];
40110
+ }, $[30] = accept, $[31] = assetSourcesWithUpload, $[32] = directUploads, $[33] = disableNew, $[34] = handleOpenSourceForUpload, $[35] = handleOpenSourceForUploadSingle, $[36] = handleSelectFilesFromAssetSource, $[37] = handleSelectFilesFromAssetSourceSingle, $[38] = readOnly, $[39] = t8, $[40] = t9, $[41] = t10) : t10 = $[41];
40091
40111
  const uploadMenuItem = useUploadMenuItem(t10);
40092
40112
  if (!documentId || !asset) {
40093
40113
  let t112;
40094
- return $[41] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t112 = /* @__PURE__ */ jsx(ImageActionsMenuWaitPlaceholder, {}), $[41] = t112) : t112 = $[41], t112;
40114
+ return $[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t112 = /* @__PURE__ */ jsx(ImageActionsMenuWaitPlaceholder, {}), $[42] = t112) : t112 = $[42], t112;
40095
40115
  }
40096
40116
  const {
40097
40117
  _id,
@@ -40102,17 +40122,17 @@ function ImageInputAssetMenuWithReferenceAssetComponent(props2) {
40102
40122
  if (isImageSource(value) && accessPolicy !== "private") {
40103
40123
  const filename = originalFilename || `download.${extension}`;
40104
40124
  let t112;
40105
- $[42] !== _id || $[43] !== filename || $[44] !== imageUrlBuilder ? (t112 = imageUrlBuilder.image(_id).forceDownload(filename).url(), $[42] = _id, $[43] = filename, $[44] = imageUrlBuilder, $[45] = t112) : t112 = $[45], downloadUrl = t112;
40125
+ $[43] !== _id || $[44] !== filename || $[45] !== imageUrlBuilder ? (t112 = imageUrlBuilder.image(_id).forceDownload(filename).url(), $[43] = _id, $[44] = filename, $[45] = imageUrlBuilder, $[46] = t112) : t112 = $[46], downloadUrl = t112;
40106
40126
  let t122;
40107
- $[46] !== _id || $[47] !== imageUrlBuilder ? (t122 = imageUrlBuilder.image(_id).url(), $[46] = _id, $[47] = imageUrlBuilder, $[48] = t122) : t122 = $[48], copyUrl = t122;
40127
+ $[47] !== _id || $[48] !== imageUrlBuilder ? (t122 = imageUrlBuilder.image(_id).url(), $[47] = _id, $[48] = imageUrlBuilder, $[49] = t122) : t122 = $[49], copyUrl = t122;
40108
40128
  }
40109
40129
  const t11 = !!showAdvancedEditButton, t12 = downloadUrl, t13 = openInSourceResult ? handleOpenInSource : void 0;
40110
40130
  let t14;
40111
- $[49] !== openInSourceResult || $[50] !== t ? (t14 = getOpenInSourceName(openInSourceResult, t), $[49] = openInSourceResult, $[50] = t, $[51] = t14) : t14 = $[51];
40131
+ $[50] !== openInSourceResult || $[51] !== t ? (t14 = getOpenInSourceName(openInSourceResult, t), $[50] = openInSourceResult, $[51] = t, $[52] = t14) : t14 = $[52];
40112
40132
  let t15;
40113
- $[52] !== browseMenuItem || $[53] !== copyUrl || $[54] !== downloadUrl || $[55] !== handleRemoveButtonClick || $[56] !== readOnly || $[57] !== t13 || $[58] !== t14 || $[59] !== uploadMenuItem ? (t15 = /* @__PURE__ */ jsx(ActionsMenu, { upload: uploadMenuItem, browse: browseMenuItem, onReset: handleRemoveButtonClick, downloadUrl: t12, openInSource: t13, openInSourceName: t14, copyUrl, readOnly }), $[52] = browseMenuItem, $[53] = copyUrl, $[54] = downloadUrl, $[55] = handleRemoveButtonClick, $[56] = readOnly, $[57] = t13, $[58] = t14, $[59] = uploadMenuItem, $[60] = t15) : t15 = $[60];
40133
+ $[53] !== browseMenuItem || $[54] !== copyUrl || $[55] !== downloadUrl || $[56] !== handleRemoveButtonClick || $[57] !== readOnly || $[58] !== t13 || $[59] !== t14 || $[60] !== uploadMenuItem ? (t15 = /* @__PURE__ */ jsx(ActionsMenu, { upload: uploadMenuItem, browse: browseMenuItem, onReset: handleRemoveButtonClick, downloadUrl: t12, openInSource: t13, openInSourceName: t14, copyUrl, readOnly }), $[53] = browseMenuItem, $[54] = copyUrl, $[55] = downloadUrl, $[56] = handleRemoveButtonClick, $[57] = readOnly, $[58] = t13, $[59] = t14, $[60] = uploadMenuItem, $[61] = t15) : t15 = $[61];
40114
40134
  let t16;
40115
- return $[61] !== handleOpenDialog || $[62] !== isMenuOpen || $[63] !== menuButtonRef || $[64] !== setHotspotButtonElement || $[65] !== setMenuOpen || $[66] !== t11 || $[67] !== t15 ? (t16 = /* @__PURE__ */ jsx(ImageActionsMenu, { isMenuOpen, onEdit: handleOpenDialog, onMenuOpen: setMenuOpen, setHotspotButtonElement, menuButtonRef, showEdit: t11, children: t15 }), $[61] = handleOpenDialog, $[62] = isMenuOpen, $[63] = menuButtonRef, $[64] = setHotspotButtonElement, $[65] = setMenuOpen, $[66] = t11, $[67] = t15, $[68] = t16) : t16 = $[68], t16;
40135
+ return $[62] !== handleOpenDialog || $[63] !== isMenuOpen || $[64] !== menuButtonRef || $[65] !== setHotspotButtonElement || $[66] !== setMenuOpen || $[67] !== t11 || $[68] !== t15 ? (t16 = /* @__PURE__ */ jsx(ImageActionsMenu, { isMenuOpen, onEdit: handleOpenDialog, onMenuOpen: setMenuOpen, setHotspotButtonElement, menuButtonRef, showEdit: t11, children: t15 }), $[62] = handleOpenDialog, $[63] = isMenuOpen, $[64] = menuButtonRef, $[65] = setHotspotButtonElement, $[66] = setMenuOpen, $[67] = t11, $[68] = t15, $[69] = t16) : t16 = $[69], t16;
40116
40136
  }
40117
40137
  function _temp$2B() {
40118
40138
  return "file-input-upload-button";
@@ -67202,7 +67222,7 @@ function createMinimalAssetForOpenInSource(mediaRef) {
67202
67222
  } : null;
67203
67223
  }
67204
67224
  function VideoPreview(props2) {
67205
- const $ = c(96), {
67225
+ const $ = c(97), {
67206
67226
  assetSources,
67207
67227
  clearField,
67208
67228
  directUploads,
@@ -67354,16 +67374,17 @@ function VideoPreview(props2) {
67354
67374
  }), onClick: () => handleSelectAssetSourceForBrowse(assetSource_2), icon: assetSource_2.icon || ImageIcon, disabled: readOnly, "data-testid": `${dataTestIdPrefix}-browse-button-${assetSource_2.name}` }, assetSource_2.name)), $[54] = assetSources, $[55] = dataTestIdPrefix, $[56] = handleSelectAssetSourceForBrowse, $[57] = readOnly, $[58] = sourcesFromSchema?.length, $[59] = t, $[60] = t19) : t19 = $[60];
67355
67375
  let t20;
67356
67376
  $[61] !== t19 ? (t20 = t19(), $[61] = t19, $[62] = t20) : t20 = $[62];
67357
- const browseMenuItem = t20;
67377
+ const browseMenuItem = t20, disableNew = schemaType.options?.disableNew === !0;
67358
67378
  let t21;
67359
67379
  $[63] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t21 = () => setIsMenuOpen(!1), $[63] = t21) : t21 = $[63];
67360
67380
  let t22;
67361
67381
  $[64] !== menuButtonRef ? (t22 = () => menuButtonRef.current?.focus(), $[64] = menuButtonRef, $[65] = t22) : t22 = $[65];
67362
67382
  let t23;
67363
- $[66] !== accept || $[67] !== assetSourcesWithUpload || $[68] !== directUploads || $[69] !== handleOpenSourceForUpload || $[70] !== handleOpenSourceForUploadSingle || $[71] !== handleSelectVideosFromAssetSource || $[72] !== handleSelectVideosFromAssetSourceSingle || $[73] !== readOnly || $[74] !== t22 ? (t23 = {
67383
+ $[66] !== accept || $[67] !== assetSourcesWithUpload || $[68] !== directUploads || $[69] !== disableNew || $[70] !== handleOpenSourceForUpload || $[71] !== handleOpenSourceForUploadSingle || $[72] !== handleSelectVideosFromAssetSource || $[73] !== handleSelectVideosFromAssetSourceSingle || $[74] !== readOnly || $[75] !== t22 ? (t23 = {
67364
67384
  accept,
67365
67385
  assetSourcesWithUpload,
67366
67386
  directUploads,
67387
+ disableNew,
67367
67388
  readOnly,
67368
67389
  onSelectFiles: handleSelectVideosFromAssetSource,
67369
67390
  onOpenSourceForUpload: handleOpenSourceForUpload,
@@ -67373,33 +67394,33 @@ function VideoPreview(props2) {
67373
67394
  dropdownMenuTestId: "video-input-upload-drop-down-menu-button",
67374
67395
  onCloseParentMenu: t21,
67375
67396
  onFilePickerCancel: t22
67376
- }, $[66] = accept, $[67] = assetSourcesWithUpload, $[68] = directUploads, $[69] = handleOpenSourceForUpload, $[70] = handleOpenSourceForUploadSingle, $[71] = handleSelectVideosFromAssetSource, $[72] = handleSelectVideosFromAssetSourceSingle, $[73] = readOnly, $[74] = t22, $[75] = t23) : t23 = $[75];
67397
+ }, $[66] = accept, $[67] = assetSourcesWithUpload, $[68] = directUploads, $[69] = disableNew, $[70] = handleOpenSourceForUpload, $[71] = handleOpenSourceForUploadSingle, $[72] = handleSelectVideosFromAssetSource, $[73] = handleSelectVideosFromAssetSourceSingle, $[74] = readOnly, $[75] = t22, $[76] = t23) : t23 = $[76];
67377
67398
  const uploadMenuItem = useUploadMenuItem(t23);
67378
67399
  if (!asset)
67379
67400
  return null;
67380
67401
  if (parseError) {
67381
67402
  let t242;
67382
- return $[76] !== parseError ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, { error: parseError }), $[76] = parseError, $[77] = t242) : t242 = $[77], t242;
67403
+ return $[77] !== parseError ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, { error: parseError }), $[77] = parseError, $[78] = t242) : t242 = $[78], t242;
67383
67404
  }
67384
67405
  if (playbackInfoState.isLoading) {
67385
67406
  let t242;
67386
- return $[78] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, {}), $[78] = t242) : t242 = $[78], t242;
67407
+ return $[79] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, {}), $[79] = t242) : t242 = $[79], t242;
67387
67408
  }
67388
67409
  if (playbackInfoState.error) {
67389
67410
  let t242;
67390
- return $[79] !== playbackInfoState.error || $[80] !== playbackInfoState.retry ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, { error: playbackInfoState.error, retry: playbackInfoState.retry }), $[79] = playbackInfoState.error, $[80] = playbackInfoState.retry, $[81] = t242) : t242 = $[81], t242;
67411
+ return $[80] !== playbackInfoState.error || $[81] !== playbackInfoState.retry ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, { error: playbackInfoState.error, retry: playbackInfoState.retry }), $[80] = playbackInfoState.error, $[81] = playbackInfoState.retry, $[82] = t242) : t242 = $[82], t242;
67391
67412
  }
67392
67413
  if (!playbackInfoState.result) {
67393
67414
  let t242;
67394
- return $[82] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, {}), $[82] = t242) : t242 = $[82], t242;
67415
+ return $[83] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t242 = /* @__PURE__ */ jsx(VideoSkeleton, {}), $[83] = t242) : t242 = $[83], t242;
67395
67416
  }
67396
67417
  const t24 = openInSourceResult ? handleOpenInSource : void 0;
67397
67418
  let t25;
67398
- $[83] !== openInSourceResult || $[84] !== t ? (t25 = getOpenInSourceName(openInSourceResult, t), $[83] = openInSourceResult, $[84] = t, $[85] = t25) : t25 = $[85];
67419
+ $[84] !== openInSourceResult || $[85] !== t ? (t25 = getOpenInSourceName(openInSourceResult, t), $[84] = openInSourceResult, $[85] = t, $[86] = t25) : t25 = $[86];
67399
67420
  let t26;
67400
- $[86] !== browseMenuItem || $[87] !== clearField || $[88] !== readOnly || $[89] !== t24 || $[90] !== t25 || $[91] !== uploadMenuItem ? (t26 = /* @__PURE__ */ jsx(ActionsMenu, { browse: browseMenuItem, upload: uploadMenuItem, onReset: clearField, openInSource: t24, openInSourceName: t25, readOnly }), $[86] = browseMenuItem, $[87] = clearField, $[88] = readOnly, $[89] = t24, $[90] = t25, $[91] = uploadMenuItem, $[92] = t26) : t26 = $[92];
67421
+ $[87] !== browseMenuItem || $[88] !== clearField || $[89] !== readOnly || $[90] !== t24 || $[91] !== t25 || $[92] !== uploadMenuItem ? (t26 = /* @__PURE__ */ jsx(ActionsMenu, { browse: browseMenuItem, upload: uploadMenuItem, onReset: clearField, openInSource: t24, openInSourceName: t25, readOnly }), $[87] = browseMenuItem, $[88] = clearField, $[89] = readOnly, $[90] = t24, $[91] = t25, $[92] = uploadMenuItem, $[93] = t26) : t26 = $[93];
67401
67422
  let t27;
67402
- return $[93] !== t26 || $[94] !== videoActionsMenuProps ? (t27 = /* @__PURE__ */ jsx(VideoActionsMenu, { ...videoActionsMenuProps, children: t26 }), $[93] = t26, $[94] = videoActionsMenuProps, $[95] = t27) : t27 = $[95], t27;
67423
+ return $[94] !== t26 || $[95] !== videoActionsMenuProps ? (t27 = /* @__PURE__ */ jsx(VideoActionsMenu, { ...videoActionsMenuProps, children: t26 }), $[94] = t26, $[95] = videoActionsMenuProps, $[96] = t27) : t27 = $[96], t27;
67403
67424
  }
67404
67425
  function _temp$1g(sourceName2) {
67405
67426
  return `video-input-upload-button-${sourceName2}`;