sanity 3.73.1-next.0 → 3.74.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-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 +13 -13
- package/src/structure/panes/document/DocumentEventsPane.tsx +27 -3
package/lib/_legacy/pane.esm.js
CHANGED
@@ -6614,72 +6614,82 @@ const DocumentPaneProvider = memo((props) => {
|
|
6614
6614
|
});
|
6615
6615
|
DocumentPaneProvider.displayName = "Memo(DocumentPaneProvider)";
|
6616
6616
|
const DocumentEventsPane = (props) => {
|
6617
|
-
const $ = c(
|
6617
|
+
const $ = c(37), {
|
6618
6618
|
params: t0
|
6619
|
-
} = usePaneRouter(), params = t0 === void 0 ? EMPTY_PARAMS$1 : t0, options = usePaneOptions(props.pane.options, params), {
|
6620
|
-
selectedPerspectiveName
|
6619
|
+
} = usePaneRouter(), params = t0 === void 0 ? EMPTY_PARAMS$1 : t0, options = usePaneOptions(props.pane.options, params), schema = useSchema(), documentType = options.type, liveEdit = !!schema.get(options.type)?.liveEdit, {
|
6620
|
+
selectedPerspectiveName,
|
6621
|
+
selectedReleaseId,
|
6622
|
+
selectedPerspective
|
6621
6623
|
} = usePerspective(), {
|
6622
6624
|
data: archivedReleases
|
6623
|
-
} = useArchivedReleases()
|
6625
|
+
} = useArchivedReleases();
|
6626
|
+
let t1;
|
6627
|
+
$[0] !== options.id ? (t1 = getPublishedId(options.id), $[0] = options.id, $[1] = t1) : t1 = $[1];
|
6628
|
+
const editState = useEditState(t1, documentType, "default", selectedReleaseId), showingPublishedOnDraft = liveEdit && selectedPerspective === "drafts" && !editState?.draft, {
|
6624
6629
|
rev,
|
6625
6630
|
since
|
6626
6631
|
} = params, historyVersion = params.historyVersion;
|
6627
|
-
let
|
6632
|
+
let t2;
|
6628
6633
|
bb0: {
|
6634
|
+
if (showingPublishedOnDraft) {
|
6635
|
+
let t32;
|
6636
|
+
$[2] !== options.id ? (t32 = getPublishedId(options.id), $[2] = options.id, $[3] = t32) : t32 = $[3], t2 = t32;
|
6637
|
+
break bb0;
|
6638
|
+
}
|
6629
6639
|
if (historyVersion && archivedReleases.some((release) => getReleaseIdFromReleaseDocumentId(release._id) === historyVersion)) {
|
6630
|
-
let
|
6631
|
-
$[
|
6640
|
+
let t32;
|
6641
|
+
$[4] !== historyVersion || $[5] !== options.id ? (t32 = getVersionId(options.id, historyVersion), $[4] = historyVersion, $[5] = options.id, $[6] = t32) : t32 = $[6], t2 = t32;
|
6632
6642
|
break bb0;
|
6633
6643
|
}
|
6634
6644
|
if (typeof selectedPerspectiveName > "u") {
|
6635
|
-
let
|
6636
|
-
$[
|
6645
|
+
let t32;
|
6646
|
+
$[7] !== options.id ? (t32 = getDraftId(options.id), $[7] = options.id, $[8] = t32) : t32 = $[8], t2 = t32;
|
6637
6647
|
break bb0;
|
6638
6648
|
}
|
6639
6649
|
if (selectedPerspectiveName === "published") {
|
6640
|
-
let
|
6641
|
-
$[
|
6650
|
+
let t32;
|
6651
|
+
$[9] !== options.id ? (t32 = getPublishedId(options.id), $[9] = options.id, $[10] = t32) : t32 = $[10], t2 = t32;
|
6642
6652
|
break bb0;
|
6643
6653
|
}
|
6644
|
-
if (
|
6645
|
-
let
|
6646
|
-
$[
|
6654
|
+
if (selectedReleaseId) {
|
6655
|
+
let t32;
|
6656
|
+
$[11] !== options.id || $[12] !== selectedPerspectiveName ? (t32 = getVersionId(options.id, selectedPerspectiveName), $[11] = options.id, $[12] = selectedPerspectiveName, $[13] = t32) : t32 = $[13], t2 = t32;
|
6647
6657
|
break bb0;
|
6648
6658
|
}
|
6649
|
-
|
6659
|
+
t2 = options.id;
|
6650
6660
|
}
|
6651
|
-
const documentId =
|
6652
|
-
let
|
6653
|
-
$[
|
6661
|
+
const documentId = t2;
|
6662
|
+
let t3;
|
6663
|
+
$[14] !== documentId || $[15] !== options.type || $[16] !== rev || $[17] !== since ? (t3 = {
|
6654
6664
|
documentId,
|
6655
6665
|
documentType: options.type,
|
6656
6666
|
rev,
|
6657
6667
|
since
|
6658
|
-
}, $[
|
6659
|
-
const eventsStore = useEventsStore(
|
6660
|
-
let
|
6661
|
-
const
|
6662
|
-
let t11;
|
6663
|
-
$[15] !== eventsStore.events ? (t11 = eventsStore.events.find(_temp$5)?.id || null, $[15] = eventsStore.events, $[16] = t11) : t11 = $[16];
|
6668
|
+
}, $[14] = documentId, $[15] = options.type, $[16] = rev, $[17] = since, $[18] = t3) : t3 = $[18];
|
6669
|
+
const eventsStore = useEventsStore(t3);
|
6670
|
+
let t4;
|
6671
|
+
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;
|
6664
6672
|
let t12;
|
6665
|
-
$[
|
6666
|
-
error: t4,
|
6667
|
-
revisionId: t5,
|
6668
|
-
onOlderRevision: t6,
|
6669
|
-
revisionDocument: t7,
|
6670
|
-
sinceDocument: t8,
|
6671
|
-
ready: t9,
|
6672
|
-
isPristine: t10,
|
6673
|
-
lastNonDeletedRevId: t11
|
6674
|
-
}, $[17] = eventsStore.error, $[18] = t10, $[19] = t11, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = t8, $[24] = t9, $[25] = t12) : t12 = $[25], t3 = t12;
|
6675
|
-
const historyStoreProps = t3;
|
6673
|
+
$[19] !== eventsStore.events ? (t12 = eventsStore.events.find(_temp$5)?.id || null, $[19] = eventsStore.events, $[20] = t12) : t12 = $[20];
|
6676
6674
|
let t13;
|
6677
|
-
t13 =
|
6678
|
-
|
6675
|
+
$[21] !== eventsStore.error || $[22] !== t10 || $[23] !== t11 || $[24] !== t12 || $[25] !== t6 || $[26] !== t7 || $[27] !== t8 || $[28] !== t9 ? (t13 = {
|
6676
|
+
error: t5,
|
6677
|
+
revisionId: t6,
|
6678
|
+
onOlderRevision: t7,
|
6679
|
+
revisionDocument: t8,
|
6680
|
+
sinceDocument: t9,
|
6681
|
+
ready: t10,
|
6682
|
+
isPristine: t11,
|
6683
|
+
lastNonDeletedRevId: t12
|
6684
|
+
}, $[21] = eventsStore.error, $[22] = t10, $[23] = t11, $[24] = t12, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = t13) : t13 = $[29], t4 = t13;
|
6685
|
+
const historyStoreProps = t4;
|
6679
6686
|
let t14;
|
6680
|
-
|
6687
|
+
t14 = eventsStore;
|
6688
|
+
const value = t14;
|
6681
6689
|
let t15;
|
6682
|
-
|
6690
|
+
$[30] !== historyStoreProps || $[31] !== historyVersion || $[32] !== props ? (t15 = historyVersion ? /* @__PURE__ */ jsx(PerspectiveProvider, { selectedPerspectiveName: historyVersion, excludedPerspectives: EMPTY_ARRAY$2, children: /* @__PURE__ */ jsx(DocumentPaneProvider, { ...props, historyStore: historyStoreProps }) }) : /* @__PURE__ */ jsx(DocumentPaneProvider, { ...props, historyStore: historyStoreProps }), $[30] = historyStoreProps, $[31] = historyVersion, $[32] = props, $[33] = t15) : t15 = $[33];
|
6691
|
+
let t16;
|
6692
|
+
return $[34] !== t15 || $[35] !== value ? (t16 = /* @__PURE__ */ jsx(EventsProvider, { value, children: t15 }), $[34] = t15, $[35] = value, $[36] = t16) : t16 = $[36], t16;
|
6683
6693
|
};
|
6684
6694
|
function _temp$5(e) {
|
6685
6695
|
return !isDeleteDocumentGroupEvent(e) && !isDeleteDocumentVersionEvent(e);
|