sanity 6.6.0-next.34 → 6.6.0-next.35

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.
@@ -10741,6 +10741,7 @@ interface BundleDocument {
10741
10741
  isPending?: boolean;
10742
10742
  document: SanityDocument & {
10743
10743
  publishedDocumentExists: boolean;
10744
+ draftDocumentExists?: boolean;
10744
10745
  };
10745
10746
  validation: DocumentValidationStatus;
10746
10747
  }
@@ -1422,7 +1422,7 @@ function ReleaseDashboardDetails(t0) {
1422
1422
  ] }) }), $[56] = t13, $[57] = t14, $[58] = t15, $[59] = t16, $[60] = t17, $[61] = t18) : t18 = $[61], t18;
1423
1423
  }
1424
1424
  const ReleasePublishAllButton = (t0) => {
1425
- const $ = c(85), {
1425
+ const $ = c(99), {
1426
1426
  release,
1427
1427
  documents,
1428
1428
  disabled,
@@ -1430,7 +1430,8 @@ const ReleasePublishAllButton = (t0) => {
1430
1430
  onConfirmDialogOpen,
1431
1431
  onConfirmDialogClose
1432
1432
  } = t0, isMenuItem = t1 === void 0 ? !1 : t1, toast = useToast(), {
1433
- publishRelease
1433
+ publishRelease,
1434
+ discardDrafts
1434
1435
  } = useReleaseOperations(), {
1435
1436
  checkWithPermissionGuard
1436
1437
  } = useReleasePermissions(), {
@@ -1443,32 +1444,42 @@ const ReleasePublishAllButton = (t0) => {
1443
1444
  drafts: t2
1444
1445
  } = document2, {
1445
1446
  enabled: isDraftModelEnabled
1446
- } = t2, [publishBundleStatus, setPublishBundleStatus] = useState("idle"), [publishPermission, setPublishPermission] = useState(!1);
1447
+ } = t2, [publishBundleStatus, setPublishBundleStatus] = useState("idle"), [shouldUpdateDrafts, setShouldUpdateDrafts] = useState(!1), [publishPermission, setPublishPermission] = useState(!1);
1447
1448
  let t3;
1448
- $[0] !== documents ? (t3 = documents.some(_temp$g), $[0] = documents, $[1] = t3) : t3 = $[1];
1449
- const isValidatingDocuments = t3;
1449
+ $[0] !== documents ? (t3 = documents.filter(_temp$g).map(_temp2$7), $[0] = documents, $[1] = t3) : t3 = $[1];
1450
+ const draftDocumentIds = t3, draftDocumentsCount = draftDocumentIds.length, showUpdateDraftsOption = isDraftModelEnabled && draftDocumentsCount > 0;
1450
1451
  let t4;
1451
- $[2] !== documents ? (t4 = documents.some(_temp2$7), $[2] = documents, $[3] = t4) : t4 = $[3];
1452
- const hasDocumentValidationErrors = t4, isPublishButtonDisabled = disabled || isValidatingDocuments || hasDocumentValidationErrors || !publishPermission, isMounted = useRef(!1);
1452
+ $[2] !== documents ? (t4 = documents.some(_temp3$4), $[2] = documents, $[3] = t4) : t4 = $[3];
1453
+ const isValidatingDocuments = t4;
1453
1454
  let t5;
1454
- $[4] !== checkWithPermissionGuard || $[5] !== publishRelease || $[6] !== release._id ? (t5 = () => (isMounted.current = !0, checkWithPermissionGuard(publishRelease, release._id).then((hasPermission) => {
1455
+ $[4] !== documents ? (t5 = documents.some(_temp4$1), $[4] = documents, $[5] = t5) : t5 = $[5];
1456
+ const hasDocumentValidationErrors = t5, isPublishButtonDisabled = disabled || isValidatingDocuments || hasDocumentValidationErrors || !publishPermission, isMounted = useRef(!1);
1457
+ let t6;
1458
+ $[6] !== checkWithPermissionGuard || $[7] !== publishRelease || $[8] !== release._id ? (t6 = () => (isMounted.current = !0, checkWithPermissionGuard(publishRelease, release._id).then((hasPermission) => {
1455
1459
  isMounted.current && setPublishPermission(hasPermission);
1456
1460
  }), () => {
1457
1461
  isMounted.current = !1;
1458
- }), $[4] = checkWithPermissionGuard, $[5] = publishRelease, $[6] = release._id, $[7] = t5) : t5 = $[7];
1459
- let t6;
1460
- $[8] !== checkWithPermissionGuard || $[9] !== publishRelease || $[10] !== release._id || $[11] !== release.metadata.intendedPublishAt ? (t6 = [checkWithPermissionGuard, publishRelease, release._id, release.metadata.intendedPublishAt], $[8] = checkWithPermissionGuard, $[9] = publishRelease, $[10] = release._id, $[11] = release.metadata.intendedPublishAt, $[12] = t6) : t6 = $[12], useEffect(t5, t6);
1462
+ }), $[6] = checkWithPermissionGuard, $[7] = publishRelease, $[8] = release._id, $[9] = t6) : t6 = $[9];
1461
1463
  let t7;
1462
- $[13] !== isDraftModelEnabled || $[14] !== onConfirmDialogClose || $[15] !== perspective.selectedPerspective || $[16] !== publishRelease || $[17] !== release || $[18] !== setPerspective || $[19] !== t || $[20] !== tCore || $[21] !== telemetry || $[22] !== toast ? (t7 = async () => {
1464
+ $[10] !== checkWithPermissionGuard || $[11] !== publishRelease || $[12] !== release._id || $[13] !== release.metadata.intendedPublishAt ? (t7 = [checkWithPermissionGuard, publishRelease, release._id, release.metadata.intendedPublishAt], $[10] = checkWithPermissionGuard, $[11] = publishRelease, $[12] = release._id, $[13] = release.metadata.intendedPublishAt, $[14] = t7) : t7 = $[14], useEffect(t6, t7);
1465
+ let t8;
1466
+ $[15] !== discardDrafts || $[16] !== draftDocumentIds || $[17] !== isDraftModelEnabled || $[18] !== onConfirmDialogClose || $[19] !== perspective.selectedPerspective || $[20] !== publishRelease || $[21] !== release || $[22] !== setPerspective || $[23] !== shouldUpdateDrafts || $[24] !== showUpdateDraftsOption || $[25] !== t || $[26] !== tCore || $[27] !== telemetry || $[28] !== toast ? (t8 = async () => {
1463
1467
  if (!release)
1464
1468
  return;
1465
1469
  const run = async () => {
1466
- setPublishBundleStatus("publishing"), await publishRelease(release._id), telemetry.log(PublishedRelease), isReleaseDocument(perspective.selectedPerspective) && perspective.selectedPerspective?._id === release._id && setPerspective(isDraftModelEnabled ? "drafts" : "published");
1470
+ setPublishBundleStatus("publishing"), await publishRelease(release._id), telemetry.log(PublishedRelease), showUpdateDraftsOption && shouldUpdateDrafts && await discardDrafts(draftDocumentIds).catch((updateDraftsError) => {
1471
+ toast.push({
1472
+ status: "warning",
1473
+ title: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsx(Translate, { t, i18nKey: "toast.publish.update-drafts-error", values: {
1474
+ error: updateDraftsError.message
1475
+ } }) })
1476
+ }), console.error(updateDraftsError);
1477
+ }), isReleaseDocument(perspective.selectedPerspective) && perspective.selectedPerspective?._id === release._id && setPerspective(isDraftModelEnabled ? "drafts" : "published");
1467
1478
  };
1468
1479
  try {
1469
1480
  await run();
1470
- } catch (t82) {
1471
- const publishingError = t82;
1481
+ } catch (t92) {
1482
+ const publishingError = t92;
1472
1483
  toast.push({
1473
1484
  status: "error",
1474
1485
  title: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsx(Translate, { t, i18nKey: "toast.publish.error", values: {
@@ -1478,106 +1489,128 @@ const ReleasePublishAllButton = (t0) => {
1478
1489
  }), console.error(publishingError);
1479
1490
  }
1480
1491
  onConfirmDialogClose?.(), setPublishBundleStatus("idle");
1481
- }, $[13] = isDraftModelEnabled, $[14] = onConfirmDialogClose, $[15] = perspective.selectedPerspective, $[16] = publishRelease, $[17] = release, $[18] = setPerspective, $[19] = t, $[20] = tCore, $[21] = telemetry, $[22] = toast, $[23] = t7) : t7 = $[23];
1482
- const handleConfirmPublishAll = t7;
1483
- let t8;
1492
+ }, $[15] = discardDrafts, $[16] = draftDocumentIds, $[17] = isDraftModelEnabled, $[18] = onConfirmDialogClose, $[19] = perspective.selectedPerspective, $[20] = publishRelease, $[21] = release, $[22] = setPerspective, $[23] = shouldUpdateDrafts, $[24] = showUpdateDraftsOption, $[25] = t, $[26] = tCore, $[27] = telemetry, $[28] = toast, $[29] = t8) : t8 = $[29];
1493
+ const handleConfirmPublishAll = t8;
1494
+ let t9;
1484
1495
  bb0: {
1485
1496
  if (publishBundleStatus === "idle") {
1486
- t8 = null;
1497
+ t9 = null;
1487
1498
  break bb0;
1488
1499
  }
1489
- let t92;
1490
- $[24] !== t ? (t92 = t("publish-dialog.confirm-publish.title"), $[24] = t, $[25] = t92) : t92 = $[25];
1491
1500
  let t102;
1492
- $[26] !== onConfirmDialogClose ? (t102 = () => {
1493
- onConfirmDialogClose?.(), setPublishBundleStatus("idle");
1494
- }, $[26] = onConfirmDialogClose, $[27] = t102) : t102 = $[27];
1501
+ $[30] !== t ? (t102 = t("publish-dialog.confirm-publish.title"), $[30] = t, $[31] = t102) : t102 = $[31];
1495
1502
  let t112;
1496
- $[28] !== t ? (t112 = t("action.publish-all-documents"), $[28] = t, $[29] = t112) : t112 = $[29];
1497
- const t122 = publishBundleStatus === "publishing", t132 = publishBundleStatus === "publishing";
1498
- let t142;
1499
- $[30] !== handleConfirmPublishAll || $[31] !== t112 || $[32] !== t122 || $[33] !== t132 ? (t142 = {
1503
+ $[32] !== onConfirmDialogClose ? (t112 = () => {
1504
+ onConfirmDialogClose?.(), setPublishBundleStatus("idle");
1505
+ }, $[32] = onConfirmDialogClose, $[33] = t112) : t112 = $[33];
1506
+ let t122;
1507
+ $[34] !== t ? (t122 = t("action.publish-all-documents"), $[34] = t, $[35] = t122) : t122 = $[35];
1508
+ const t132 = publishBundleStatus === "publishing", t142 = publishBundleStatus === "publishing";
1509
+ let t152;
1510
+ $[36] !== handleConfirmPublishAll || $[37] !== t122 || $[38] !== t132 || $[39] !== t142 ? (t152 = {
1500
1511
  confirmButton: {
1501
- text: t112,
1512
+ text: t122,
1502
1513
  tone: "positive",
1503
1514
  onClick: handleConfirmPublishAll,
1504
- loading: t122,
1505
- disabled: t132
1515
+ loading: t132,
1516
+ disabled: t142
1506
1517
  }
1507
- }, $[30] = handleConfirmPublishAll, $[31] = t112, $[32] = t122, $[33] = t132, $[34] = t142) : t142 = $[34];
1508
- let t152;
1509
- $[35] !== release.metadata.title || $[36] !== tCore ? (t152 = release.metadata.title || tCore("release.placeholder-untitled-release"), $[35] = release.metadata.title, $[36] = tCore, $[37] = t152) : t152 = $[37];
1518
+ }, $[36] = handleConfirmPublishAll, $[37] = t122, $[38] = t132, $[39] = t142, $[40] = t152) : t152 = $[40];
1510
1519
  let t162;
1511
- $[38] !== documents.length || $[39] !== t152 ? (t162 = {
1512
- title: t152,
1520
+ $[41] !== release.metadata.title || $[42] !== tCore ? (t162 = release.metadata.title || tCore("release.placeholder-untitled-release"), $[41] = release.metadata.title, $[42] = tCore, $[43] = t162) : t162 = $[43];
1521
+ let t172;
1522
+ $[44] !== documents.length || $[45] !== t162 ? (t172 = {
1523
+ title: t162,
1513
1524
  releaseDocumentsLength: documents.length,
1514
1525
  count: documents.length
1515
- }, $[38] = documents.length, $[39] = t152, $[40] = t162) : t162 = $[40];
1516
- let t172;
1517
- $[41] !== t || $[42] !== t162 ? (t172 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsx(Translate, { t, i18nKey: "publish-dialog.confirm-publish-description", values: t162 }) }), $[41] = t, $[42] = t162, $[43] = t172) : t172 = $[43];
1526
+ }, $[44] = documents.length, $[45] = t162, $[46] = t172) : t172 = $[46];
1518
1527
  let t182;
1519
- $[44] !== t102 || $[45] !== t142 || $[46] !== t172 || $[47] !== t92 ? (t182 = /* @__PURE__ */ jsx(Dialog, { id: "confirm-publish-dialog", "data-testid": "confirm-publish-dialog", header: t92, onClose: t102, footer: t142, children: t172 }), $[44] = t102, $[45] = t142, $[46] = t172, $[47] = t92, $[48] = t182) : t182 = $[48], t8 = t182;
1528
+ $[47] !== t || $[48] !== t172 ? (t182 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsx(Translate, { t, i18nKey: "publish-dialog.confirm-publish-description", values: t172 }) }), $[47] = t, $[48] = t172, $[49] = t182) : t182 = $[49];
1529
+ let t192;
1530
+ $[50] !== draftDocumentsCount || $[51] !== shouldUpdateDrafts || $[52] !== showUpdateDraftsOption || $[53] !== t ? (t192 = showUpdateDraftsOption && /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
1531
+ /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 3, as: "label", children: [
1532
+ /* @__PURE__ */ jsx(Checkbox, { checked: shouldUpdateDrafts, onChange: (event) => setShouldUpdateDrafts(event.currentTarget.checked), "data-testid": "update-drafts-checkbox" }),
1533
+ /* @__PURE__ */ jsx(Text, { size: 1, children: t("publish-dialog.confirm-publish.update-drafts-checkbox") })
1534
+ ] }),
1535
+ /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t("publish-dialog.confirm-publish.update-drafts-description", {
1536
+ count: draftDocumentsCount,
1537
+ draftDocumentsLength: draftDocumentsCount
1538
+ }) })
1539
+ ] }), $[50] = draftDocumentsCount, $[51] = shouldUpdateDrafts, $[52] = showUpdateDraftsOption, $[53] = t, $[54] = t192) : t192 = $[54];
1540
+ let t20;
1541
+ $[55] !== t182 || $[56] !== t192 ? (t20 = /* @__PURE__ */ jsxs(Stack, { space: 4, children: [
1542
+ t182,
1543
+ t192
1544
+ ] }), $[55] = t182, $[56] = t192, $[57] = t20) : t20 = $[57];
1545
+ let t21;
1546
+ $[58] !== t102 || $[59] !== t112 || $[60] !== t152 || $[61] !== t20 ? (t21 = /* @__PURE__ */ jsx(Dialog, { id: "confirm-publish-dialog", "data-testid": "confirm-publish-dialog", header: t102, onClose: t112, footer: t152, children: t20 }), $[58] = t102, $[59] = t112, $[60] = t152, $[61] = t20, $[62] = t21) : t21 = $[62], t9 = t21;
1520
1547
  }
1521
- const confirmPublishDialog = t8;
1522
- let t9;
1548
+ const confirmPublishDialog = t9;
1549
+ let t10;
1523
1550
  bb1: {
1524
1551
  if (!hasDocumentValidationErrors && !isValidatingDocuments && publishPermission) {
1525
- t9 = null;
1552
+ t10 = null;
1526
1553
  break bb1;
1527
1554
  }
1528
- let t102;
1529
- $[49] !== documents.length || $[50] !== hasDocumentValidationErrors || $[51] !== isValidatingDocuments || $[52] !== publishPermission || $[53] !== t ? (t102 = () => documents.length === 0 ? t("publish-action.validation.no-documents") : publishPermission ? isValidatingDocuments ? t("publish-dialog.validation.loading") : hasDocumentValidationErrors ? t("publish-dialog.validation.error") : null : t("publish-dialog.validation.no-permission"), $[49] = documents.length, $[50] = hasDocumentValidationErrors, $[51] = isValidatingDocuments, $[52] = publishPermission, $[53] = t, $[54] = t102) : t102 = $[54];
1530
- const tooltipText = t102, t112 = isValidatingDocuments ? "default" : "critical";
1531
- let t122;
1532
- $[55] !== t112 ? (t122 = /* @__PURE__ */ jsx(ToneIcon, { icon: ErrorOutlineIcon, tone: t112 }), $[55] = t112, $[56] = t122) : t122 = $[56];
1555
+ let t112;
1556
+ $[63] !== documents.length || $[64] !== hasDocumentValidationErrors || $[65] !== isValidatingDocuments || $[66] !== publishPermission || $[67] !== t ? (t112 = () => documents.length === 0 ? t("publish-action.validation.no-documents") : publishPermission ? isValidatingDocuments ? t("publish-dialog.validation.loading") : hasDocumentValidationErrors ? t("publish-dialog.validation.error") : null : t("publish-dialog.validation.no-permission"), $[63] = documents.length, $[64] = hasDocumentValidationErrors, $[65] = isValidatingDocuments, $[66] = publishPermission, $[67] = t, $[68] = t112) : t112 = $[68];
1557
+ const tooltipText = t112, t122 = isValidatingDocuments ? "default" : "critical";
1533
1558
  let t132;
1534
- $[57] !== tooltipText ? (t132 = tooltipText(), $[57] = tooltipText, $[58] = t132) : t132 = $[58];
1559
+ $[69] !== t122 ? (t132 = /* @__PURE__ */ jsx(ToneIcon, { icon: ErrorOutlineIcon, tone: t122 }), $[69] = t122, $[70] = t132) : t132 = $[70];
1535
1560
  let t142;
1536
- $[59] !== t122 || $[60] !== t132 ? (t142 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 3, padding: 1, children: [
1537
- t122,
1538
- t132
1539
- ] }) }), $[59] = t122, $[60] = t132, $[61] = t142) : t142 = $[61], t9 = t142;
1561
+ $[71] !== tooltipText ? (t142 = tooltipText(), $[71] = tooltipText, $[72] = t142) : t142 = $[72];
1562
+ let t152;
1563
+ $[73] !== t132 || $[74] !== t142 ? (t152 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 3, padding: 1, children: [
1564
+ t132,
1565
+ t142
1566
+ ] }) }), $[73] = t132, $[74] = t142, $[75] = t152) : t152 = $[75], t10 = t152;
1540
1567
  }
1541
- const publishTooltipContent = t9;
1542
- let t10;
1543
- $[62] !== onConfirmDialogOpen ? (t10 = () => {
1544
- setPublishBundleStatus("confirm"), onConfirmDialogOpen?.();
1545
- }, $[62] = onConfirmDialogOpen, $[63] = t10) : t10 = $[63];
1546
- const handleInitialPublish = t10, t11 = isPublishButtonDisabled || publishBundleStatus === "publishing" || documents.length === 0;
1547
- let t12;
1548
- $[64] !== t ? (t12 = t("action.publish-all-documents"), $[64] = t, $[65] = t12) : t12 = $[65];
1549
- const t13 = !isPublishButtonDisabled;
1550
- let t14;
1551
- $[66] !== publishTooltipContent || $[67] !== t13 ? (t14 = {
1552
- disabled: t13,
1568
+ const publishTooltipContent = t10;
1569
+ let t11;
1570
+ $[76] !== onConfirmDialogOpen ? (t11 = () => {
1571
+ setShouldUpdateDrafts(!1), setPublishBundleStatus("confirm"), onConfirmDialogOpen?.();
1572
+ }, $[76] = onConfirmDialogOpen, $[77] = t11) : t11 = $[77];
1573
+ const handleInitialPublish = t11, t12 = isPublishButtonDisabled || publishBundleStatus === "publishing" || documents.length === 0;
1574
+ let t13;
1575
+ $[78] !== t ? (t13 = t("action.publish-all-documents"), $[78] = t, $[79] = t13) : t13 = $[79];
1576
+ const t14 = !isPublishButtonDisabled;
1577
+ let t15;
1578
+ $[80] !== publishTooltipContent || $[81] !== t14 ? (t15 = {
1579
+ disabled: t14,
1553
1580
  content: publishTooltipContent,
1554
1581
  placement: "bottom"
1555
- }, $[66] = publishTooltipContent, $[67] = t13, $[68] = t14) : t14 = $[68];
1556
- const t15 = t14;
1557
- let t16;
1558
- $[69] !== handleInitialPublish || $[70] !== t11 || $[71] !== t12 || $[72] !== t15 ? (t16 = {
1582
+ }, $[80] = publishTooltipContent, $[81] = t14, $[82] = t15) : t15 = $[82];
1583
+ const t16 = t15;
1584
+ let t17;
1585
+ $[83] !== handleInitialPublish || $[84] !== t12 || $[85] !== t13 || $[86] !== t16 ? (t17 = {
1559
1586
  icon: PublishIcon,
1560
- disabled: t11,
1561
- text: t12,
1587
+ disabled: t12,
1588
+ text: t13,
1562
1589
  handleOnClick: handleInitialPublish,
1563
- tooltipProps: t15
1564
- }, $[69] = handleInitialPublish, $[70] = t11, $[71] = t12, $[72] = t15, $[73] = t16) : t16 = $[73];
1565
- const sharedProps = t16;
1566
- let t17;
1567
- $[74] !== isMenuItem || $[75] !== publishBundleStatus || $[76] !== sharedProps.disabled || $[77] !== sharedProps.handleOnClick || $[78] !== sharedProps.icon || $[79] !== sharedProps.text || $[80] !== sharedProps.tooltipProps ? (t17 = isMenuItem ? /* @__PURE__ */ jsx(MenuItem, { tooltipProps: sharedProps.tooltipProps, icon: sharedProps.icon, disabled: sharedProps.disabled, text: sharedProps.text, onClick: sharedProps.handleOnClick, "data-testid": "publish-all-button-menu-item" }) : /* @__PURE__ */ jsx(Button, { tooltipProps: sharedProps.tooltipProps, icon: sharedProps.icon, disabled: sharedProps.disabled, text: sharedProps.text, onClick: sharedProps.handleOnClick, loading: publishBundleStatus === "publishing", "data-testid": "publish-all-button", tone: "positive" }), $[74] = isMenuItem, $[75] = publishBundleStatus, $[76] = sharedProps.disabled, $[77] = sharedProps.handleOnClick, $[78] = sharedProps.icon, $[79] = sharedProps.text, $[80] = sharedProps.tooltipProps, $[81] = t17) : t17 = $[81];
1590
+ tooltipProps: t16
1591
+ }, $[83] = handleInitialPublish, $[84] = t12, $[85] = t13, $[86] = t16, $[87] = t17) : t17 = $[87];
1592
+ const sharedProps = t17;
1568
1593
  let t18;
1569
- return $[82] !== confirmPublishDialog || $[83] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Fragment, { children: [
1570
- t17,
1594
+ $[88] !== isMenuItem || $[89] !== publishBundleStatus || $[90] !== sharedProps.disabled || $[91] !== sharedProps.handleOnClick || $[92] !== sharedProps.icon || $[93] !== sharedProps.text || $[94] !== sharedProps.tooltipProps ? (t18 = isMenuItem ? /* @__PURE__ */ jsx(MenuItem, { tooltipProps: sharedProps.tooltipProps, icon: sharedProps.icon, disabled: sharedProps.disabled, text: sharedProps.text, onClick: sharedProps.handleOnClick, "data-testid": "publish-all-button-menu-item" }) : /* @__PURE__ */ jsx(Button, { tooltipProps: sharedProps.tooltipProps, icon: sharedProps.icon, disabled: sharedProps.disabled, text: sharedProps.text, onClick: sharedProps.handleOnClick, loading: publishBundleStatus === "publishing", "data-testid": "publish-all-button", tone: "positive" }), $[88] = isMenuItem, $[89] = publishBundleStatus, $[90] = sharedProps.disabled, $[91] = sharedProps.handleOnClick, $[92] = sharedProps.icon, $[93] = sharedProps.text, $[94] = sharedProps.tooltipProps, $[95] = t18) : t18 = $[95];
1595
+ let t19;
1596
+ return $[96] !== confirmPublishDialog || $[97] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Fragment, { children: [
1597
+ t18,
1571
1598
  confirmPublishDialog
1572
- ] }), $[82] = confirmPublishDialog, $[83] = t17, $[84] = t18) : t18 = $[84], t18;
1599
+ ] }), $[96] = confirmPublishDialog, $[97] = t18, $[98] = t19) : t19 = $[98], t19;
1573
1600
  };
1574
- function _temp$g(t0) {
1601
+ function _temp$g(releaseDocument) {
1602
+ return releaseDocument.document.draftDocumentExists && !isGoingToUnpublish(releaseDocument.document);
1603
+ }
1604
+ function _temp2$7(releaseDocument_0) {
1605
+ return releaseDocument_0.document._id;
1606
+ }
1607
+ function _temp3$4(t0) {
1575
1608
  const {
1576
1609
  validation
1577
1610
  } = t0;
1578
1611
  return validation.isValidating;
1579
1612
  }
1580
- function _temp2$7(t0) {
1613
+ function _temp4$1(t0) {
1581
1614
  const {
1582
1615
  validation: validation_0
1583
1616
  } = t0;