sanity 3.73.1-next.0 → 3.74.1
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-cjs/pane.js +49 -39
- package/lib/_chunks-cjs/pane.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/pane.mjs +49 -39
- package/lib/_chunks-es/pane.mjs.map +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/lib/_legacy/pane.esm.js +49 -39
- package/lib/_legacy/pane.esm.js.map +1 -1
- package/lib/_legacy/version.esm.js +1 -1
- package/package.json +14 -14
- package/src/structure/panes/document/DocumentEventsPane.tsx +27 -3
package/lib/_chunks-cjs/pane.js
CHANGED
@@ -6587,72 +6587,82 @@ const DocumentPaneProvider = React.memo((props) => {
|
|
6587
6587
|
});
|
6588
6588
|
DocumentPaneProvider.displayName = "Memo(DocumentPaneProvider)";
|
6589
6589
|
const DocumentEventsPane = (props) => {
|
6590
|
-
const $ = reactCompilerRuntime.c(
|
6590
|
+
const $ = reactCompilerRuntime.c(37), {
|
6591
6591
|
params: t0
|
6592
|
-
} = usePaneRouter(), params = t0 === void 0 ? EMPTY_PARAMS$1 : t0, options = usePaneOptions(props.pane.options, params), {
|
6593
|
-
selectedPerspectiveName
|
6592
|
+
} = usePaneRouter(), params = t0 === void 0 ? EMPTY_PARAMS$1 : t0, options = usePaneOptions(props.pane.options, params), schema = sanity.useSchema(), documentType = options.type, liveEdit = !!schema.get(options.type)?.liveEdit, {
|
6593
|
+
selectedPerspectiveName,
|
6594
|
+
selectedReleaseId,
|
6595
|
+
selectedPerspective
|
6594
6596
|
} = sanity.usePerspective(), {
|
6595
6597
|
data: archivedReleases
|
6596
|
-
} = sanity.useArchivedReleases()
|
6598
|
+
} = sanity.useArchivedReleases();
|
6599
|
+
let t1;
|
6600
|
+
$[0] !== options.id ? (t1 = sanity.getPublishedId(options.id), $[0] = options.id, $[1] = t1) : t1 = $[1];
|
6601
|
+
const editState = sanity.useEditState(t1, documentType, "default", selectedReleaseId), showingPublishedOnDraft = liveEdit && selectedPerspective === "drafts" && !editState?.draft, {
|
6597
6602
|
rev,
|
6598
6603
|
since
|
6599
6604
|
} = params, historyVersion = params.historyVersion;
|
6600
|
-
let
|
6605
|
+
let t2;
|
6601
6606
|
bb0: {
|
6607
|
+
if (showingPublishedOnDraft) {
|
6608
|
+
let t32;
|
6609
|
+
$[2] !== options.id ? (t32 = sanity.getPublishedId(options.id), $[2] = options.id, $[3] = t32) : t32 = $[3], t2 = t32;
|
6610
|
+
break bb0;
|
6611
|
+
}
|
6602
6612
|
if (historyVersion && archivedReleases.some((release) => sanity.getReleaseIdFromReleaseDocumentId(release._id) === historyVersion)) {
|
6603
|
-
let
|
6604
|
-
$[
|
6613
|
+
let t32;
|
6614
|
+
$[4] !== historyVersion || $[5] !== options.id ? (t32 = sanity.getVersionId(options.id, historyVersion), $[4] = historyVersion, $[5] = options.id, $[6] = t32) : t32 = $[6], t2 = t32;
|
6605
6615
|
break bb0;
|
6606
6616
|
}
|
6607
6617
|
if (typeof selectedPerspectiveName > "u") {
|
6608
|
-
let
|
6609
|
-
$[
|
6618
|
+
let t32;
|
6619
|
+
$[7] !== options.id ? (t32 = sanity.getDraftId(options.id), $[7] = options.id, $[8] = t32) : t32 = $[8], t2 = t32;
|
6610
6620
|
break bb0;
|
6611
6621
|
}
|
6612
6622
|
if (selectedPerspectiveName === "published") {
|
6613
|
-
let
|
6614
|
-
$[
|
6623
|
+
let t32;
|
6624
|
+
$[9] !== options.id ? (t32 = sanity.getPublishedId(options.id), $[9] = options.id, $[10] = t32) : t32 = $[10], t2 = t32;
|
6615
6625
|
break bb0;
|
6616
6626
|
}
|
6617
|
-
if (
|
6618
|
-
let
|
6619
|
-
$[
|
6627
|
+
if (selectedReleaseId) {
|
6628
|
+
let t32;
|
6629
|
+
$[11] !== options.id || $[12] !== selectedPerspectiveName ? (t32 = sanity.getVersionId(options.id, selectedPerspectiveName), $[11] = options.id, $[12] = selectedPerspectiveName, $[13] = t32) : t32 = $[13], t2 = t32;
|
6620
6630
|
break bb0;
|
6621
6631
|
}
|
6622
|
-
|
6632
|
+
t2 = options.id;
|
6623
6633
|
}
|
6624
|
-
const documentId =
|
6625
|
-
let
|
6626
|
-
$[
|
6634
|
+
const documentId = t2;
|
6635
|
+
let t3;
|
6636
|
+
$[14] !== documentId || $[15] !== options.type || $[16] !== rev || $[17] !== since ? (t3 = {
|
6627
6637
|
documentId,
|
6628
6638
|
documentType: options.type,
|
6629
6639
|
rev,
|
6630
6640
|
since
|
6631
|
-
}, $[
|
6632
|
-
const eventsStore = sanity.useEventsStore(
|
6633
|
-
let
|
6634
|
-
const
|
6635
|
-
let t11;
|
6636
|
-
$[15] !== eventsStore.events ? (t11 = eventsStore.events.find(_temp$5)?.id || null, $[15] = eventsStore.events, $[16] = t11) : t11 = $[16];
|
6641
|
+
}, $[14] = documentId, $[15] = options.type, $[16] = rev, $[17] = since, $[18] = t3) : t3 = $[18];
|
6642
|
+
const eventsStore = sanity.useEventsStore(t3);
|
6643
|
+
let t4;
|
6644
|
+
const t5 = eventsStore.error, t6 = eventsStore.revision?.revisionId || null, t7 = !!(eventsStore.revision?.document && eventsStore.revision?.revisionId), t8 = eventsStore.revision?.document || null, t9 = eventsStore.sinceRevision?.document || null, t10 = !eventsStore.loading, t11 = eventsStore.events.length === 0;
|
6637
6645
|
let t12;
|
6638
|
-
$[
|
6639
|
-
error: t4,
|
6640
|
-
revisionId: t5,
|
6641
|
-
onOlderRevision: t6,
|
6642
|
-
revisionDocument: t7,
|
6643
|
-
sinceDocument: t8,
|
6644
|
-
ready: t9,
|
6645
|
-
isPristine: t10,
|
6646
|
-
lastNonDeletedRevId: t11
|
6647
|
-
}, $[17] = eventsStore.error, $[18] = t10, $[19] = t11, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t12) : t12 = $[25], t3 = t12;
|
6648
|
-
const historyStoreProps = t3;
|
6646
|
+
$[19] !== eventsStore.events ? (t12 = eventsStore.events.find(_temp$5)?.id || null, $[19] = eventsStore.events, $[20] = t12) : t12 = $[20];
|
6649
6647
|
let t13;
|
6650
|
-
t13 =
|
6651
|
-
|
6648
|
+
$[21] !== eventsStore.error || $[22] !== t10 || $[23] !== t11 || $[24] !== t12 || $[25] !== t6 || $[26] !== t7 || $[27] !== t8 || $[28] !== t9 ? (t13 = {
|
6649
|
+
error: t5,
|
6650
|
+
revisionId: t6,
|
6651
|
+
onOlderRevision: t7,
|
6652
|
+
revisionDocument: t8,
|
6653
|
+
sinceDocument: t9,
|
6654
|
+
ready: t10,
|
6655
|
+
isPristine: t11,
|
6656
|
+
lastNonDeletedRevId: t12
|
6657
|
+
}, $[21] = eventsStore.error, $[22] = t10, $[23] = t11, $[24] = t12, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = t13) : t13 = $[29], t4 = t13;
|
6658
|
+
const historyStoreProps = t4;
|
6652
6659
|
let t14;
|
6653
|
-
|
6660
|
+
t14 = eventsStore;
|
6661
|
+
const value = t14;
|
6654
6662
|
let t15;
|
6655
|
-
|
6663
|
+
$[30] !== historyStoreProps || $[31] !== historyVersion || $[32] !== props ? (t15 = historyVersion ? /* @__PURE__ */ jsxRuntime.jsx(sanity.PerspectiveProvider, { selectedPerspectiveName: historyVersion, excludedPerspectives: sanity.EMPTY_ARRAY, children: /* @__PURE__ */ jsxRuntime.jsx(DocumentPaneProvider, { ...props, historyStore: historyStoreProps }) }) : /* @__PURE__ */ jsxRuntime.jsx(DocumentPaneProvider, { ...props, historyStore: historyStoreProps }), $[30] = historyStoreProps, $[31] = historyVersion, $[32] = props, $[33] = t15) : t15 = $[33];
|
6664
|
+
let t16;
|
6665
|
+
return $[34] !== t15 || $[35] !== value ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(sanity.EventsProvider, { value, children: t15 }), $[34] = t15, $[35] = value, $[36] = t16) : t16 = $[36], t16;
|
6656
6666
|
};
|
6657
6667
|
function _temp$5(e) {
|
6658
6668
|
return !sanity.isDeleteDocumentGroupEvent(e) && !sanity.isDeleteDocumentVersionEvent(e);
|