sanity 6.4.0 → 6.4.1-next.2
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-dts/ActiveWorkspaceMatcherContext.d.ts +3 -0
- package/lib/_chunks-es/ReleasesTool.js +1 -24
- package/lib/_chunks-es/ReleasesTool.js.map +1 -1
- package/lib/_chunks-es/VariantsTool.js +415 -251
- package/lib/_chunks-es/VariantsTool.js.map +1 -1
- package/lib/_chunks-es/index2.js +21 -8
- package/lib/_chunks-es/index2.js.map +1 -1
- package/lib/_chunks-es/resources8.js +9 -7
- package/lib/_chunks-es/resources8.js.map +1 -1
- package/lib/_chunks-es/{Table.js → searchDocumentRelease.js} +26 -2
- package/lib/_chunks-es/searchDocumentRelease.js.map +1 -0
- package/lib/_chunks-es/version.js +2 -2
- package/package.json +11 -11
- package/lib/_chunks-es/Table.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
|
-
import { useRouter, StateLink } from "sanity/router";
|
|
3
|
+
import { useRouter, IntentLink, StateLink } from "sanity/router";
|
|
4
4
|
import { Autocomplete, Stack, Flex, Box, Text, TextInput, TextArea, useToast, Card, Menu, Badge, Container, rem, Skeleton } from "@sanity/ui";
|
|
5
|
-
import { useId, useState,
|
|
6
|
-
import { Button, Dialog, MenuButton, MenuItem } from "./index.js";
|
|
7
|
-
import { getVariantId, variantsClient, useClient, VARIANTS_STUDIO_CLIENT_OPTIONS, VARIANT_DOCUMENTS_PATH, useTranslation, variantsLocaleNamespace, useAllVariants, TextWithTone, useBundleDocuments, ContextMenuButton, RelativeTime,
|
|
5
|
+
import { useId, useState, forwardRef, memo } from "react";
|
|
6
|
+
import { Button, Dialog, MenuButton, MenuItem, Tooltip } from "./index.js";
|
|
7
|
+
import { getVariantId, variantsClient, useClient, VARIANTS_STUDIO_CLIENT_OPTIONS, VARIANT_DOCUMENTS_PATH, useTranslation, variantsLocaleNamespace, useAllVariants, TextWithTone, DOCUMENT_SYSTEM_FIELD, useBundleDocuments, isPublishedBundleId, ContextMenuButton, RelativeTime, isReleaseBundle, getReleaseDocumentIdFromReleaseId, getReleaseIdFromReleaseDocumentId, ReleaseTitle, RELEASES_INTENT, useDocumentPresence, DocumentPreviewPresence, useDocumentPreviewValues, SanityDefaultPreview, useSchema, ToneIcon, useActiveReleases, decodeVariantIdFromRoute, LoadingBlock, getVariantDescription, getVariantConditionsText, getVariantTitle, filterVariantsForSearch } from "./index2.js";
|
|
8
8
|
import "history";
|
|
9
9
|
import "sanity/_singletons";
|
|
10
10
|
import "@sanity/icons/ArrowLeft";
|
|
@@ -12,9 +12,9 @@ import "@sanity/icons/Launch";
|
|
|
12
12
|
import "styled-components";
|
|
13
13
|
import "react-i18next";
|
|
14
14
|
import "rxjs/operators";
|
|
15
|
-
import
|
|
15
|
+
import "react-rx";
|
|
16
16
|
import "rxjs";
|
|
17
|
-
import "@sanity/client/csm";
|
|
17
|
+
import { getPublishedId } from "@sanity/client/csm";
|
|
18
18
|
import "quick-lru";
|
|
19
19
|
import "lodash-es/throttle.js";
|
|
20
20
|
import "lodash-es/isEqual.js";
|
|
@@ -59,7 +59,7 @@ import "@sanity/icons/ArrowDown";
|
|
|
59
59
|
import "@sanity/icons/ArrowRight";
|
|
60
60
|
import "@sanity/util/legacyDateFormat";
|
|
61
61
|
import "@sanity/diff-patch";
|
|
62
|
-
import "@sanity/icons/ErrorOutline";
|
|
62
|
+
import { ErrorOutlineIcon } from "@sanity/icons/ErrorOutline";
|
|
63
63
|
import "@sanity/diff";
|
|
64
64
|
import "mendoza";
|
|
65
65
|
import "@sanity/icons/InfoOutline";
|
|
@@ -207,7 +207,7 @@ import { isPortableTextBlock, toPlainText } from "@portabletext/toolkit";
|
|
|
207
207
|
import { at, set } from "@sanity/mutate";
|
|
208
208
|
import { applyPatches } from "@sanity/mutate/_unstable_apply";
|
|
209
209
|
import { DiamondIcon } from "@sanity/icons/Diamond";
|
|
210
|
-
import { Table,
|
|
210
|
+
import { Headers, Table, searchDocumentRelease } from "./searchDocumentRelease.js";
|
|
211
211
|
function createVariantOperationsStore(options) {
|
|
212
212
|
const client = variantsClient(options.client);
|
|
213
213
|
return {
|
|
@@ -685,22 +685,93 @@ function EditVariantDialog(props) {
|
|
|
685
685
|
let t5;
|
|
686
686
|
return $[11] !== handleSubmit || $[12] !== initialValue || $[13] !== onCancel || $[14] !== t2 || $[15] !== t3 || $[16] !== t4 ? (t5 = /* @__PURE__ */ jsx(VariantDialog, { confirmDataTestId: "save-variant-button", confirmText: t2, errorTitle: t3, header: t4, id: "edit-variant-dialog", initialValue, onCancel, onSubmit: handleSubmit, renderCancelButton: !0 }), $[11] = handleSubmit, $[12] = initialValue, $[13] = onCancel, $[14] = t2, $[15] = t3, $[16] = t4, $[17] = t5) : t5 = $[17], t5;
|
|
687
687
|
}
|
|
688
|
-
function
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
688
|
+
function toVariantDocumentVersion(document) {
|
|
689
|
+
const system = document[DOCUMENT_SYSTEM_FIELD];
|
|
690
|
+
return system?.group?._ref ? {
|
|
691
|
+
documentId: document._id,
|
|
692
|
+
bundleId: system.bundleId ?? void 0,
|
|
693
|
+
releaseRef: system.release?._ref ?? null,
|
|
694
|
+
updatedAt: document._updatedAt ?? ""
|
|
695
|
+
} : null;
|
|
696
|
+
}
|
|
697
|
+
function useVariantDocuments(variantId) {
|
|
698
|
+
const $ = c(13), enabled = !!variantId, t0 = variantId ?? "";
|
|
693
699
|
let t1;
|
|
694
|
-
$[
|
|
695
|
-
variantId
|
|
696
|
-
}, $[
|
|
697
|
-
const params = t1, t2 = `variant-${variantId}
|
|
700
|
+
$[0] !== t0 ? (t1 = {
|
|
701
|
+
variantId: t0
|
|
702
|
+
}, $[0] = t0, $[1] = t1) : t1 = $[1];
|
|
703
|
+
const params = t1, t2 = enabled ? `variant-${variantId}` : "variant-disabled";
|
|
698
704
|
let t3;
|
|
699
|
-
|
|
705
|
+
$[2] !== enabled || $[3] !== params || $[4] !== t2 ? (t3 = {
|
|
700
706
|
groqFilter: "sanity::partOfVariant($variantId)",
|
|
701
707
|
params,
|
|
702
|
-
cacheKey: t2
|
|
703
|
-
|
|
708
|
+
cacheKey: t2,
|
|
709
|
+
enabled
|
|
710
|
+
}, $[2] = enabled, $[3] = params, $[4] = t2, $[5] = t3) : t3 = $[5];
|
|
711
|
+
const {
|
|
712
|
+
loading,
|
|
713
|
+
results,
|
|
714
|
+
error
|
|
715
|
+
} = useBundleDocuments(t3);
|
|
716
|
+
let t4;
|
|
717
|
+
$[6] !== enabled || $[7] !== results ? (t4 = enabled ? toDocumentInVariants(results) : [], $[6] = enabled, $[7] = results, $[8] = t4) : t4 = $[8];
|
|
718
|
+
const variantResults = t4, t5 = enabled && loading, t6 = enabled ? error : null;
|
|
719
|
+
let t7;
|
|
720
|
+
return $[9] !== t5 || $[10] !== t6 || $[11] !== variantResults ? (t7 = {
|
|
721
|
+
loading: t5,
|
|
722
|
+
results: variantResults,
|
|
723
|
+
error: t6
|
|
724
|
+
}, $[9] = t5, $[10] = t6, $[11] = variantResults, $[12] = t7) : t7 = $[12], t7;
|
|
725
|
+
}
|
|
726
|
+
function toDocumentInVariants(results) {
|
|
727
|
+
return results.flatMap((result) => {
|
|
728
|
+
const version = toVariantDocumentVersion(result.document);
|
|
729
|
+
return version ? [{
|
|
730
|
+
...result,
|
|
731
|
+
version
|
|
732
|
+
}] : [];
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
function getBundleSortOrder(bundleId) {
|
|
736
|
+
return isPublishedBundleId(bundleId) ? 0 : bundleId === "drafts" ? 1 : 2;
|
|
737
|
+
}
|
|
738
|
+
function compareVariantDocumentVersions(left, right) {
|
|
739
|
+
const leftOrder = getBundleSortOrder(left.bundleId), rightOrder = getBundleSortOrder(right.bundleId);
|
|
740
|
+
return leftOrder !== rightOrder ? leftOrder - rightOrder : left.documentId.localeCompare(right.documentId);
|
|
741
|
+
}
|
|
742
|
+
function pickRepresentativeDocument(documents) {
|
|
743
|
+
return documents.reduce((latest, current) => {
|
|
744
|
+
const latestUpdatedAt = latest.document._updatedAt ?? "";
|
|
745
|
+
return (current.document._updatedAt ?? "") > latestUpdatedAt ? current : latest;
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
function aggregateValidation(documents) {
|
|
749
|
+
const representative = pickRepresentativeDocument(documents);
|
|
750
|
+
return {
|
|
751
|
+
isValidating: documents.some((document) => document.validation.isValidating),
|
|
752
|
+
validation: documents.flatMap((document) => document.validation.validation),
|
|
753
|
+
revision: representative.validation.revision,
|
|
754
|
+
hasError: documents.some((document) => document.validation.hasError)
|
|
755
|
+
};
|
|
756
|
+
}
|
|
757
|
+
function groupVariantDocumentsByGroup(documents) {
|
|
758
|
+
const groups = /* @__PURE__ */ new Map();
|
|
759
|
+
for (const document of documents) {
|
|
760
|
+
const groupId = document.document._system?.group?._ref;
|
|
761
|
+
if (!groupId)
|
|
762
|
+
continue;
|
|
763
|
+
const existingGroup = groups.get(groupId);
|
|
764
|
+
existingGroup ? existingGroup.push(document) : groups.set(groupId, [document]);
|
|
765
|
+
}
|
|
766
|
+
return Array.from(groups.entries()).map(([groupId, groupDocuments]) => {
|
|
767
|
+
const representative = pickRepresentativeDocument(groupDocuments), versions = groupDocuments.map((item) => item.version).toSorted(compareVariantDocumentVersions);
|
|
768
|
+
return {
|
|
769
|
+
...representative,
|
|
770
|
+
groupId,
|
|
771
|
+
versions,
|
|
772
|
+
validation: aggregateValidation(groupDocuments)
|
|
773
|
+
};
|
|
774
|
+
});
|
|
704
775
|
}
|
|
705
776
|
function VariantDetailMenuButton(t0) {
|
|
706
777
|
const $ = c(21), {
|
|
@@ -777,45 +848,156 @@ function VariantDetailFooter(t0) {
|
|
|
777
848
|
] })
|
|
778
849
|
] }), $[11] = t5, $[12] = t6, $[13] = t7) : t7 = $[13], t7;
|
|
779
850
|
}
|
|
780
|
-
function
|
|
781
|
-
document
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
displayTitle
|
|
791
|
-
} = getReleaseTitleDetails(release.metadata?.title, getReleaseIdFromReleaseDocumentId(release._id));
|
|
792
|
-
return {
|
|
793
|
-
label: displayTitle,
|
|
794
|
-
tone: getReleaseTone(release)
|
|
795
|
-
};
|
|
796
|
-
}
|
|
797
|
-
return {
|
|
798
|
-
label: getReleaseIdFromReleaseDocumentId(releaseRef),
|
|
799
|
-
tone: "default"
|
|
800
|
-
};
|
|
851
|
+
function getDocumentPreviewTitle(document) {
|
|
852
|
+
const title = document.title || document.name;
|
|
853
|
+
return typeof title == "string" && title.trim() ? title : document._id;
|
|
854
|
+
}
|
|
855
|
+
function getReleaseDocumentForVersion(version, releasesById) {
|
|
856
|
+
if (version.releaseRef)
|
|
857
|
+
return releasesById.get(version.releaseRef);
|
|
858
|
+
if (isReleaseBundle(version.bundleId)) {
|
|
859
|
+
const releaseDocumentId = getReleaseDocumentIdFromReleaseId(version.bundleId);
|
|
860
|
+
return releasesById.get(releaseDocumentId);
|
|
801
861
|
}
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
862
|
+
}
|
|
863
|
+
function ReleaseBundleChip(t0) {
|
|
864
|
+
const $ = c(10), {
|
|
865
|
+
release
|
|
866
|
+
} = t0, {
|
|
867
|
+
t
|
|
868
|
+
} = useTranslation();
|
|
869
|
+
let t1;
|
|
870
|
+
$[0] !== release._id ? (t1 = getReleaseIdFromReleaseDocumentId(release._id), $[0] = release._id, $[1] = t1) : t1 = $[1];
|
|
871
|
+
const releaseId = t1, t2 = release.metadata?.title;
|
|
872
|
+
let t3;
|
|
873
|
+
$[2] !== t ? (t3 = t("release.placeholder-untitled-release"), $[2] = t, $[3] = t3) : t3 = $[3];
|
|
874
|
+
let t4;
|
|
875
|
+
$[4] !== releaseId ? (t4 = (t52) => {
|
|
876
|
+
const {
|
|
877
|
+
displayTitle
|
|
878
|
+
} = t52;
|
|
879
|
+
return /* @__PURE__ */ jsx(IntentLink, { intent: RELEASES_INTENT, params: {
|
|
880
|
+
id: releaseId
|
|
881
|
+
}, children: /* @__PURE__ */ jsx(Badge, { radius: 2, tone: "primary", children: displayTitle }) });
|
|
882
|
+
}, $[4] = releaseId, $[5] = t4) : t4 = $[5];
|
|
883
|
+
let t5;
|
|
884
|
+
return $[6] !== t2 || $[7] !== t3 || $[8] !== t4 ? (t5 = /* @__PURE__ */ jsx(ReleaseTitle, { title: t2, fallback: t3, children: t4 }), $[6] = t2, $[7] = t3, $[8] = t4, $[9] = t5) : t5 = $[9], t5;
|
|
885
|
+
}
|
|
886
|
+
function StaticBundleChip(t0) {
|
|
887
|
+
const $ = c(3), {
|
|
888
|
+
label,
|
|
889
|
+
tone
|
|
890
|
+
} = t0;
|
|
891
|
+
let t1;
|
|
892
|
+
return $[0] !== label || $[1] !== tone ? (t1 = /* @__PURE__ */ jsx(Badge, { radius: 2, tone, children: label }), $[0] = label, $[1] = tone, $[2] = t1) : t1 = $[2], t1;
|
|
893
|
+
}
|
|
894
|
+
function VariantDocumentBundleChips(t0) {
|
|
895
|
+
const $ = c(11), {
|
|
896
|
+
versions,
|
|
897
|
+
releasesById
|
|
898
|
+
} = t0, {
|
|
899
|
+
t
|
|
900
|
+
} = useTranslation();
|
|
901
|
+
let t1;
|
|
902
|
+
$[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t1 = {
|
|
903
|
+
minWidth: 0,
|
|
904
|
+
width: "100%",
|
|
905
|
+
overflowX: "auto",
|
|
906
|
+
overflowY: "hidden"
|
|
907
|
+
}, $[0] = t1) : t1 = $[0];
|
|
908
|
+
let t2;
|
|
909
|
+
$[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t2 = {
|
|
910
|
+
width: "max-content"
|
|
911
|
+
}, $[1] = t2) : t2 = $[1];
|
|
912
|
+
let t3;
|
|
913
|
+
if ($[2] !== releasesById || $[3] !== t || $[4] !== versions) {
|
|
914
|
+
let t42;
|
|
915
|
+
$[6] !== releasesById || $[7] !== t ? (t42 = (version) => {
|
|
916
|
+
if (isPublishedBundleId(version.bundleId))
|
|
917
|
+
return /* @__PURE__ */ jsx(StaticBundleChip, { label: t("release.chip.published"), tone: "positive" }, version.documentId);
|
|
918
|
+
if (version.bundleId === "drafts")
|
|
919
|
+
return /* @__PURE__ */ jsx(StaticBundleChip, { label: t("release.chip.draft"), tone: "default" }, version.documentId);
|
|
920
|
+
const release = getReleaseDocumentForVersion(version, releasesById);
|
|
921
|
+
return release ? /* @__PURE__ */ jsx(ReleaseBundleChip, { release }, version.documentId) : /* @__PURE__ */ jsx(StaticBundleChip, { label: t("release.placeholder-untitled-release"), tone: "default" }, version.documentId);
|
|
922
|
+
}, $[6] = releasesById, $[7] = t, $[8] = t42) : t42 = $[8], t3 = versions.map(t42), $[2] = releasesById, $[3] = t, $[4] = versions, $[5] = t3;
|
|
923
|
+
} else
|
|
924
|
+
t3 = $[5];
|
|
925
|
+
let t4;
|
|
926
|
+
return $[9] !== t3 ? (t4 = /* @__PURE__ */ jsx(Box, { style: t1, children: /* @__PURE__ */ jsx(Flex, { align: "center", gap: 1, wrap: "nowrap", style: t2, children: t3 }) }), $[9] = t3, $[10] = t4) : t4 = $[10], t4;
|
|
927
|
+
}
|
|
928
|
+
const VariantDocumentPreviewLink = forwardRef(function(t0, ref) {
|
|
929
|
+
const $ = c(13);
|
|
930
|
+
let documentType, linkProps, publishedId, searchParams;
|
|
931
|
+
$[0] !== t0 ? ({
|
|
932
|
+
publishedId,
|
|
933
|
+
documentType,
|
|
934
|
+
searchParams,
|
|
935
|
+
...linkProps
|
|
936
|
+
} = t0, $[0] = t0, $[1] = documentType, $[2] = linkProps, $[3] = publishedId, $[4] = searchParams) : (documentType = $[1], linkProps = $[2], publishedId = $[3], searchParams = $[4]);
|
|
937
|
+
let t1;
|
|
938
|
+
$[5] !== documentType || $[6] !== publishedId ? (t1 = {
|
|
939
|
+
id: publishedId,
|
|
940
|
+
type: documentType
|
|
941
|
+
}, $[5] = documentType, $[6] = publishedId, $[7] = t1) : t1 = $[7];
|
|
942
|
+
let t2;
|
|
943
|
+
return $[8] !== linkProps || $[9] !== ref || $[10] !== searchParams || $[11] !== t1 ? (t2 = /* @__PURE__ */ jsx(IntentLink, { ...linkProps, intent: "edit", params: t1, searchParams, ref }), $[8] = linkProps, $[9] = ref, $[10] = searchParams, $[11] = t1, $[12] = t2) : t2 = $[12], t2;
|
|
944
|
+
});
|
|
945
|
+
function getVersionPerspectiveNavigation(bundleId, variantId) {
|
|
946
|
+
const searchParams = variantId ? [["variant", variantId]] : [];
|
|
947
|
+
return isPublishedBundleId(bundleId) ? {
|
|
948
|
+
perspectiveStack: ["published"],
|
|
949
|
+
searchParams: [...searchParams, ["perspective", "published"]]
|
|
950
|
+
} : bundleId === "drafts" ? {
|
|
951
|
+
perspectiveStack: ["drafts"],
|
|
952
|
+
searchParams: searchParams.length > 0 ? searchParams : void 0
|
|
805
953
|
} : {
|
|
806
|
-
|
|
807
|
-
|
|
954
|
+
perspectiveStack: [bundleId ?? "", "drafts"],
|
|
955
|
+
searchParams: [...searchParams, ["perspective", bundleId ?? ""]]
|
|
808
956
|
};
|
|
809
957
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
958
|
+
function VariantDocumentPreview(t0) {
|
|
959
|
+
const $ = c(23), {
|
|
960
|
+
row,
|
|
961
|
+
layout,
|
|
962
|
+
variantId
|
|
963
|
+
} = t0;
|
|
964
|
+
let t1;
|
|
965
|
+
$[0] !== row.groupId ? (t1 = getPublishedId(row.groupId), $[0] = row.groupId, $[1] = t1) : t1 = $[1];
|
|
966
|
+
const publishedId = t1, documentPresence = useDocumentPresence(row.document._id);
|
|
967
|
+
let t2;
|
|
968
|
+
$[2] !== row.version.bundleId || $[3] !== variantId ? (t2 = getVersionPerspectiveNavigation(row.version.bundleId, variantId), $[2] = row.version.bundleId, $[3] = variantId, $[4] = t2) : t2 = $[4];
|
|
969
|
+
const {
|
|
970
|
+
perspectiveStack,
|
|
971
|
+
searchParams
|
|
972
|
+
} = t2;
|
|
973
|
+
let t3;
|
|
974
|
+
$[5] !== documentPresence ? (t3 = documentPresence?.length > 0 && /* @__PURE__ */ jsx(DocumentPreviewPresence, { presence: documentPresence }), $[5] = documentPresence, $[6] = t3) : t3 = $[6];
|
|
975
|
+
const previewPresence = t3;
|
|
976
|
+
let t4;
|
|
977
|
+
$[7] !== perspectiveStack || $[8] !== row.document._id || $[9] !== row.document._type ? (t4 = {
|
|
978
|
+
documentId: row.document._id,
|
|
979
|
+
documentType: row.document._type,
|
|
980
|
+
perspectiveStack
|
|
981
|
+
}, $[7] = perspectiveStack, $[8] = row.document._id, $[9] = row.document._type, $[10] = t4) : t4 = $[10];
|
|
982
|
+
const {
|
|
983
|
+
isLoading: previewLoading,
|
|
984
|
+
value: resolvedPreview
|
|
985
|
+
} = useDocumentPreviewValues(t4);
|
|
986
|
+
let t5;
|
|
987
|
+
$[11] !== resolvedPreview ? (t5 = resolvedPreview || {}, $[11] = resolvedPreview, $[12] = t5) : t5 = $[12];
|
|
988
|
+
let t6;
|
|
989
|
+
$[13] !== layout || $[14] !== previewLoading || $[15] !== previewPresence || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsx(SanityDefaultPreview, { ...t5, status: previewPresence, isPlaceholder: previewLoading, layout }), $[13] = layout, $[14] = previewLoading, $[15] = previewPresence, $[16] = t5, $[17] = t6) : t6 = $[17];
|
|
990
|
+
let t7;
|
|
991
|
+
return $[18] !== publishedId || $[19] !== row.document._type || $[20] !== searchParams || $[21] !== t6 ? (t7 = /* @__PURE__ */ jsx(Card, { tone: "inherit", as: VariantDocumentPreviewLink, publishedId, documentType: row.document._type, searchParams, radius: 2, "data-as": "a", children: t6 }), $[18] = publishedId, $[19] = row.document._type, $[20] = searchParams, $[21] = t6, $[22] = t7) : t7 = $[22], t7;
|
|
817
992
|
}
|
|
818
|
-
const
|
|
993
|
+
const MemoVariantDocumentPreview = memo(function(t0) {
|
|
994
|
+
const $ = c(3), {
|
|
995
|
+
row,
|
|
996
|
+
variantId
|
|
997
|
+
} = t0;
|
|
998
|
+
let t1;
|
|
999
|
+
return $[0] !== row || $[1] !== variantId ? (t1 = /* @__PURE__ */ jsx(VariantDocumentPreview, { row, variantId }), $[0] = row, $[1] = variantId, $[2] = t1) : t1 = $[2], t1;
|
|
1000
|
+
}, (prev, next) => prev.row.memoKey === next.row.memoKey && prev.variantId === next.variantId), MemoDocumentType = memo(function(t0) {
|
|
819
1001
|
const $ = c(5), {
|
|
820
1002
|
type
|
|
821
1003
|
} = t0, schema = useSchema();
|
|
@@ -824,149 +1006,160 @@ const MemoDocumentType = memo(function(t0) {
|
|
|
824
1006
|
const t2 = t1?.title || type;
|
|
825
1007
|
let t3;
|
|
826
1008
|
return $[3] !== t2 ? (t3 = /* @__PURE__ */ jsx(Text, { size: 1, children: t2 }), $[3] = t2, $[4] = t3) : t3 = $[4], t3;
|
|
827
|
-
}, (prev, next) => prev.type === next.type)
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
1009
|
+
}, (prev, next) => prev.type === next.type), getVariantDocumentTableColumnDefs = (t, variantId, releasesById) => [{
|
|
1010
|
+
id: "documentGroup",
|
|
1011
|
+
hidden: !0,
|
|
1012
|
+
width: null,
|
|
1013
|
+
sorting: !0,
|
|
1014
|
+
sortTransform: (row) => row.groupId
|
|
1015
|
+
}, {
|
|
1016
|
+
id: "bundle",
|
|
1017
|
+
width: 140,
|
|
1018
|
+
style: {
|
|
1019
|
+
minWidth: 100,
|
|
1020
|
+
maxWidth: 140
|
|
1021
|
+
},
|
|
1022
|
+
sorting: !1,
|
|
1023
|
+
header: (props) => /* @__PURE__ */ jsx(Flex, { ...props.headerProps, paddingY: 3, sizing: "border", children: /* @__PURE__ */ jsx(Headers.BasicHeader, { text: t("detail.documents.table.bundle") }) }),
|
|
1024
|
+
cell: ({
|
|
1025
|
+
cellProps,
|
|
1026
|
+
datum
|
|
1027
|
+
}) => /* @__PURE__ */ jsx(Flex, { align: "center", ...cellProps, style: {
|
|
1028
|
+
...cellProps.style,
|
|
1029
|
+
flex: "0 1 auto",
|
|
1030
|
+
minWidth: 0,
|
|
1031
|
+
overflow: "hidden"
|
|
1032
|
+
}, children: /* @__PURE__ */ jsx(Box, { flex: 1, paddingX: 2, style: {
|
|
1033
|
+
minWidth: 0,
|
|
1034
|
+
overflow: "hidden"
|
|
1035
|
+
}, children: !datum.isLoading && /* @__PURE__ */ jsx(VariantDocumentBundleChips, { versions: datum.versions, releasesById }) }) })
|
|
1036
|
+
}, {
|
|
1037
|
+
id: "document._type",
|
|
1038
|
+
width: null,
|
|
1039
|
+
style: {
|
|
1040
|
+
minWidth: 100
|
|
1041
|
+
},
|
|
1042
|
+
sorting: !0,
|
|
1043
|
+
header: (props) => /* @__PURE__ */ jsx(Flex, { ...props.headerProps, paddingY: 3, sizing: "border", children: /* @__PURE__ */ jsx(Headers.SortHeaderButton, { text: t("detail.documents.table.type"), ...props }) }),
|
|
1044
|
+
cell: ({
|
|
1045
|
+
cellProps,
|
|
1046
|
+
datum
|
|
1047
|
+
}) => /* @__PURE__ */ jsx(Flex, { align: "center", ...cellProps, children: /* @__PURE__ */ jsx(Box, { paddingX: 2, children: !datum.isLoading && /* @__PURE__ */ jsx(MemoDocumentType, { type: datum.document._type }) }) })
|
|
1048
|
+
}, {
|
|
1049
|
+
id: "search",
|
|
1050
|
+
width: null,
|
|
1051
|
+
style: {
|
|
1052
|
+
minWidth: "min(50%, calc(100vw - 80px))",
|
|
1053
|
+
maxWidth: "min(50%, calc(100vw - 80px))"
|
|
1054
|
+
},
|
|
1055
|
+
sortTransform: ({
|
|
1056
|
+
document
|
|
1057
|
+
}) => getDocumentPreviewTitle(document).toLowerCase(),
|
|
1058
|
+
header: (props) => /* @__PURE__ */ jsx(Headers.TableHeaderSearch, { ...props, placeholder: t("detail.documents.table.search-placeholder") }),
|
|
1059
|
+
cell: ({
|
|
1060
|
+
cellProps,
|
|
1061
|
+
datum
|
|
1062
|
+
}) => /* @__PURE__ */ jsx(Box, { ...cellProps, flex: 1, padding: 1, paddingRight: 2, sizing: "border", children: datum.isLoading ? /* @__PURE__ */ jsx(SanityDefaultPreview, { isPlaceholder: !0 }) : /* @__PURE__ */ jsx(MemoVariantDocumentPreview, { row: datum, variantId }) })
|
|
1063
|
+
}, {
|
|
1064
|
+
id: "document._updatedAt",
|
|
1065
|
+
sorting: !0,
|
|
1066
|
+
width: 130,
|
|
1067
|
+
header: (props) => /* @__PURE__ */ jsx(Flex, { ...props.headerProps, paddingY: 3, sizing: "border", children: /* @__PURE__ */ jsx(Headers.SortHeaderButton, { text: t("detail.documents.table.edited"), ...props }) }),
|
|
1068
|
+
cell: ({
|
|
1069
|
+
cellProps,
|
|
1070
|
+
datum
|
|
1071
|
+
}) => /* @__PURE__ */ jsx(Flex, { ...cellProps, align: "center", paddingX: 2, paddingY: 3, style: {
|
|
1072
|
+
minWidth: 130
|
|
1073
|
+
}, children: !datum.isLoading && datum.document._updatedAt && /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsx(RelativeTime, { time: datum.document._updatedAt, useTemporalPhrase: !0, minimal: !0 }) }) })
|
|
1074
|
+
}, {
|
|
1075
|
+
id: "validation",
|
|
1076
|
+
sorting: !1,
|
|
1077
|
+
width: 50,
|
|
1078
|
+
header: ({
|
|
1079
|
+
headerProps
|
|
1080
|
+
}) => /* @__PURE__ */ jsx(Flex, { ...headerProps, paddingY: 3, sizing: "border", children: /* @__PURE__ */ jsx(Headers.BasicHeader, { text: "" }) }),
|
|
1081
|
+
cell: ({
|
|
1082
|
+
cellProps,
|
|
1083
|
+
datum
|
|
1084
|
+
}) => {
|
|
1085
|
+
if (datum.isLoading) return null;
|
|
1086
|
+
const validationErrorCount = datum.validation.validation.filter((validation) => validation.level === "error").length;
|
|
1087
|
+
return /* @__PURE__ */ jsx(Flex, { ...cellProps, flex: 1, padding: 1, justify: "center", align: "center", sizing: "border", children: datum.validation.hasError && /* @__PURE__ */ jsx(Tooltip, { portal: !0, placement: "bottom-end", content: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 3, padding: 1, children: [
|
|
1088
|
+
/* @__PURE__ */ jsx(ToneIcon, { icon: ErrorOutlineIcon, tone: "critical" }),
|
|
1089
|
+
t(validationErrorCount === 1 ? "detail.documents.table.validation.error_one" : "detail.documents.table.validation.error_other", {
|
|
1090
|
+
count: validationErrorCount
|
|
1091
|
+
})
|
|
1092
|
+
] }) }), children: /* @__PURE__ */ jsx(Text, { size: 1, children: /* @__PURE__ */ jsx(ToneIcon, { icon: ErrorOutlineIcon, tone: "critical" }) }) }) });
|
|
1093
|
+
}
|
|
1094
|
+
}], TABLE_CARD_STYLE = {
|
|
1095
|
+
height: "100%",
|
|
1096
|
+
overflow: "auto"
|
|
1097
|
+
};
|
|
898
1098
|
function filterDocuments(rows, searchTerm) {
|
|
899
|
-
|
|
900
|
-
return normalizedSearchTerm ? rows.filter(({
|
|
1099
|
+
return searchTerm.trim() ? rows.filter(({
|
|
901
1100
|
document
|
|
902
|
-
}) =>
|
|
1101
|
+
}) => searchDocumentRelease(document, searchTerm)) : rows;
|
|
903
1102
|
}
|
|
904
1103
|
function VariantDocumentsTable(t0) {
|
|
905
|
-
const $ = c(
|
|
906
|
-
|
|
907
|
-
loading: t1
|
|
1104
|
+
const $ = c(15), {
|
|
1105
|
+
rows,
|
|
1106
|
+
loading: t1,
|
|
1107
|
+
variantId
|
|
908
1108
|
} = t0, loading = t1 === void 0 ? !1 : t1, {
|
|
909
1109
|
t
|
|
910
1110
|
} = useTranslation(variantsLocaleNamespace), [scrollContainerRef, setScrollContainerRef] = useState(null), {
|
|
911
|
-
|
|
912
|
-
} =
|
|
1111
|
+
data: releases
|
|
1112
|
+
} = useActiveReleases();
|
|
913
1113
|
let t2;
|
|
914
|
-
$[0] !==
|
|
915
|
-
const
|
|
1114
|
+
$[0] !== releases ? (t2 = new Map(releases.map(_temp$2)), $[0] = releases, $[1] = t2) : t2 = $[1];
|
|
1115
|
+
const releasesById = t2;
|
|
916
1116
|
let t3;
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
$[6] !== releasesById || $[7] !== t ? (t42 = (document) => ({
|
|
920
|
-
document,
|
|
921
|
-
version: getVariantDocumentVersion({
|
|
922
|
-
document,
|
|
923
|
-
releasesById,
|
|
924
|
-
t
|
|
925
|
-
})
|
|
926
|
-
}), $[6] = releasesById, $[7] = t, $[8] = t42) : t42 = $[8], t3 = documents.map(t42), $[2] = documents, $[3] = releasesById, $[4] = t, $[5] = t3;
|
|
927
|
-
} else
|
|
928
|
-
t3 = $[5];
|
|
929
|
-
const rows = t3;
|
|
1117
|
+
$[2] !== releasesById || $[3] !== t || $[4] !== variantId ? (t3 = getVariantDocumentTableColumnDefs(t, variantId, releasesById), $[2] = releasesById, $[3] = t, $[4] = variantId, $[5] = t3) : t3 = $[5];
|
|
1118
|
+
const columnDefs = t3;
|
|
930
1119
|
let t4;
|
|
931
|
-
$[
|
|
1120
|
+
$[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = {
|
|
932
1121
|
column: "documentGroup",
|
|
933
1122
|
direction: "asc"
|
|
934
|
-
}, $[
|
|
1123
|
+
}, $[6] = t4) : t4 = $[6];
|
|
935
1124
|
let t5;
|
|
936
|
-
$[
|
|
1125
|
+
$[7] !== t ? (t5 = t("detail.documents.no-documents"), $[7] = t, $[8] = t5) : t5 = $[8];
|
|
937
1126
|
let t6;
|
|
938
|
-
return $[
|
|
1127
|
+
return $[9] !== columnDefs || $[10] !== loading || $[11] !== rows || $[12] !== scrollContainerRef || $[13] !== t5 ? (t6 = /* @__PURE__ */ jsx(Card, { flex: 1, ref: setScrollContainerRef, style: TABLE_CARD_STYLE, children: /* @__PURE__ */ jsx(Table, { columnDefs, data: rows, defaultSort: t4, emptyState: t5, loading, rowId: "groupId", scrollContainerRef, searchFilter: filterDocuments }) }), $[9] = columnDefs, $[10] = loading, $[11] = rows, $[12] = scrollContainerRef, $[13] = t5, $[14] = t6) : t6 = $[14], t6;
|
|
1128
|
+
}
|
|
1129
|
+
function _temp$2(release) {
|
|
1130
|
+
return [release._id, release];
|
|
939
1131
|
}
|
|
940
1132
|
function VariantDetail() {
|
|
941
|
-
const $ = c(
|
|
1133
|
+
const $ = c(54), router = useRouter(), {
|
|
942
1134
|
t
|
|
943
1135
|
} = useTranslation(variantsLocaleNamespace), [editDialogOpen, setEditDialogOpen] = useState(!1), variantIdRaw = typeof router.state.variantId == "string" ? router.state.variantId : void 0, variantId = decodeVariantIdFromRoute(variantIdRaw), {
|
|
944
1136
|
byId,
|
|
945
1137
|
loading
|
|
946
1138
|
} = useAllVariants(), variant = variantId ? byId.get(variantId) : void 0, {
|
|
1139
|
+
loading: documentsLoading,
|
|
947
1140
|
results: variantDocuments,
|
|
948
|
-
|
|
949
|
-
} = useVariantDocuments(
|
|
1141
|
+
error: variantDocumentsError
|
|
1142
|
+
} = useVariantDocuments(variant?._id);
|
|
950
1143
|
let t0;
|
|
951
|
-
$[0] !== variantDocuments ? (t0 = variantDocuments
|
|
952
|
-
const
|
|
1144
|
+
$[0] !== variantDocuments ? (t0 = groupVariantDocumentsByGroup(variantDocuments), $[0] = variantDocuments, $[1] = t0) : t0 = $[1];
|
|
1145
|
+
const tableRows = t0;
|
|
953
1146
|
if (loading) {
|
|
954
|
-
let
|
|
955
|
-
$[2] !== t ? (
|
|
956
|
-
let
|
|
957
|
-
return $[4] !==
|
|
1147
|
+
let t18;
|
|
1148
|
+
$[2] !== t ? (t18 = t("detail.loading"), $[2] = t, $[3] = t18) : t18 = $[3];
|
|
1149
|
+
let t22;
|
|
1150
|
+
return $[4] !== t18 ? (t22 = /* @__PURE__ */ jsx(LoadingBlock, { fill: !0, title: t18 }), $[4] = t18, $[5] = t22) : t22 = $[5], t22;
|
|
958
1151
|
}
|
|
959
1152
|
if (!variant) {
|
|
960
|
-
let
|
|
961
|
-
$[6] !== router ? (
|
|
962
|
-
let
|
|
963
|
-
$[8] !== t ? (
|
|
964
|
-
let
|
|
965
|
-
$[10] !==
|
|
966
|
-
let
|
|
967
|
-
$[13] !== t ? (
|
|
1153
|
+
let t18;
|
|
1154
|
+
$[6] !== router ? (t18 = () => router.navigate({}), $[6] = router, $[7] = t18) : t18 = $[7];
|
|
1155
|
+
let t22;
|
|
1156
|
+
$[8] !== t ? (t22 = t("detail.back"), $[8] = t, $[9] = t22) : t22 = $[9];
|
|
1157
|
+
let t32;
|
|
1158
|
+
$[10] !== t18 || $[11] !== t22 ? (t32 = /* @__PURE__ */ jsx(Card, { borderBottom: !0, flex: "none", padding: 3, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", onClick: t18, text: t22 }) }), $[10] = t18, $[11] = t22, $[12] = t32) : t32 = $[12];
|
|
1159
|
+
let t42;
|
|
1160
|
+
$[13] !== t ? (t42 = t("detail.not-found.title"), $[13] = t, $[14] = t42) : t42 = $[14];
|
|
968
1161
|
let t52;
|
|
969
|
-
$[15] !==
|
|
1162
|
+
$[15] !== t42 ? (t52 = /* @__PURE__ */ jsx(Text, { size: 2, weight: "semibold", children: t42 }), $[15] = t42, $[16] = t52) : t52 = $[16];
|
|
970
1163
|
let t62;
|
|
971
1164
|
$[17] !== t ? (t62 = t("detail.not-found.description"), $[17] = t, $[18] = t62) : t62 = $[18];
|
|
972
1165
|
let t72;
|
|
@@ -977,93 +1170,64 @@ function VariantDetail() {
|
|
|
977
1170
|
t72
|
|
978
1171
|
] }) }) }), $[21] = t52, $[22] = t72, $[23] = t82) : t82 = $[23];
|
|
979
1172
|
let t92;
|
|
980
|
-
return $[24] !==
|
|
981
|
-
|
|
1173
|
+
return $[24] !== t32 || $[25] !== t82 ? (t92 = /* @__PURE__ */ jsxs(Flex, { direction: "column", flex: 1, height: "fill", children: [
|
|
1174
|
+
t32,
|
|
982
1175
|
t82
|
|
983
|
-
] }), $[24] =
|
|
1176
|
+
] }), $[24] = t32, $[25] = t82, $[26] = t92) : t92 = $[26], t92;
|
|
984
1177
|
}
|
|
985
|
-
const description = getVariantDescription(variant), conditionsText = getVariantConditionsText(variant.conditions)
|
|
1178
|
+
const description = getVariantDescription(variant), conditionsText = getVariantConditionsText(variant.conditions);
|
|
1179
|
+
let t1;
|
|
1180
|
+
$[27] !== router ? (t1 = () => router.navigate({}), $[27] = router, $[28] = t1) : t1 = $[28];
|
|
1181
|
+
let t2;
|
|
1182
|
+
$[29] !== t ? (t2 = t("detail.back"), $[29] = t, $[30] = t2) : t2 = $[30];
|
|
1183
|
+
let t3;
|
|
1184
|
+
$[31] !== t1 || $[32] !== t2 ? (t3 = /* @__PURE__ */ jsx(Card, { borderBottom: !0, flex: "none", padding: 3, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", onClick: t1, text: t2 }) }), $[31] = t1, $[32] = t2, $[33] = t3) : t3 = $[33];
|
|
1185
|
+
let t4;
|
|
1186
|
+
$[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = {
|
|
1187
|
+
minHeight: 0
|
|
1188
|
+
}, $[34] = t4) : t4 = $[34];
|
|
986
1189
|
let t5;
|
|
987
|
-
$[
|
|
1190
|
+
$[35] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t5 = () => setEditDialogOpen(!0), $[35] = t5) : t5 = $[35];
|
|
988
1191
|
let t6;
|
|
989
|
-
$[
|
|
1192
|
+
$[36] !== t ? (t6 = t("detail.action.edit-variant"), $[36] = t, $[37] = t6) : t6 = $[37];
|
|
990
1193
|
let t7;
|
|
991
|
-
$[
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
$[35] !== T7 || $[36] !== t25 ? (t26 = /* @__PURE__ */ jsx(T7, { as: t22, size: t23, weight: t24, children: t25 }), $[35] = T7, $[36] = t25, $[37] = t26) : t26 = $[37];
|
|
1000
|
-
let t27;
|
|
1001
|
-
$[38] !== description || $[39] !== t ? (t27 = description || t("detail.no-description"), $[38] = description, $[39] = t, $[40] = t27) : t27 = $[40];
|
|
1002
|
-
let t28;
|
|
1003
|
-
$[41] !== t27 ? (t28 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t27 }), $[41] = t27, $[42] = t28) : t28 = $[42];
|
|
1004
|
-
let t29;
|
|
1005
|
-
$[43] !== T6 || $[44] !== t26 || $[45] !== t28 ? (t29 = /* @__PURE__ */ jsxs(T6, { space: t21, children: [
|
|
1006
|
-
t26,
|
|
1007
|
-
t28
|
|
1008
|
-
] }), $[43] = T6, $[44] = t26, $[45] = t28, $[46] = t29) : t29 = $[46];
|
|
1009
|
-
let t30;
|
|
1010
|
-
$[47] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t30 = () => setEditDialogOpen(!0), $[47] = t30) : t30 = $[47];
|
|
1011
|
-
let t31;
|
|
1012
|
-
$[48] !== t ? (t31 = t("detail.action.edit-variant"), $[48] = t, $[49] = t31) : t31 = $[49];
|
|
1013
|
-
let t32;
|
|
1014
|
-
$[50] !== t31 ? (t32 = /* @__PURE__ */ jsx(Button, { onClick: t30, text: t31 }), $[50] = t31, $[51] = t32) : t32 = $[51];
|
|
1015
|
-
let t33;
|
|
1016
|
-
$[52] !== T5 || $[53] !== t29 || $[54] !== t32 ? (t33 = /* @__PURE__ */ jsxs(T5, { align: t18, gap: t19, justify: t20, children: [
|
|
1017
|
-
t29,
|
|
1018
|
-
t32
|
|
1019
|
-
] }), $[52] = T5, $[53] = t29, $[54] = t32, $[55] = t33) : t33 = $[55];
|
|
1020
|
-
let t34;
|
|
1021
|
-
$[56] !== t ? (t34 = t("dialog.create.conditions.title"), $[56] = t, $[57] = t34) : t34 = $[57];
|
|
1022
|
-
let t35;
|
|
1023
|
-
$[58] !== t34 ? (t35 = /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: t34 }), $[58] = t34, $[59] = t35) : t35 = $[59];
|
|
1024
|
-
let t36;
|
|
1025
|
-
$[60] !== conditionsText || $[61] !== t ? (t36 = conditionsText || t("overview.table.no-conditions"), $[60] = conditionsText, $[61] = t, $[62] = t36) : t36 = $[62];
|
|
1026
|
-
let t37;
|
|
1027
|
-
$[63] !== t36 ? (t37 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t36 }), $[63] = t36, $[64] = t37) : t37 = $[64];
|
|
1028
|
-
let t38;
|
|
1029
|
-
$[65] !== t35 || $[66] !== t37 ? (t38 = /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Stack, { space: 2, children: [
|
|
1030
|
-
t35,
|
|
1031
|
-
t37
|
|
1032
|
-
] }) }), $[65] = t35, $[66] = t37, $[67] = t38) : t38 = $[67];
|
|
1033
|
-
let t39;
|
|
1034
|
-
$[68] !== T4 || $[69] !== t33 || $[70] !== t38 ? (t39 = /* @__PURE__ */ jsxs(T4, { paddingY: t17, children: [
|
|
1035
|
-
t33,
|
|
1036
|
-
t38
|
|
1037
|
-
] }), $[68] = T4, $[69] = t33, $[70] = t38, $[71] = t39) : t39 = $[71];
|
|
1038
|
-
let t40;
|
|
1039
|
-
$[72] !== T3 || $[73] !== t39 ? (t40 = /* @__PURE__ */ jsx(T3, { direction: t15, paddingX: t16, children: t39 }), $[72] = T3, $[73] = t39, $[74] = t40) : t40 = $[74];
|
|
1040
|
-
let t41;
|
|
1041
|
-
$[75] !== T2 || $[76] !== t40 ? (t41 = /* @__PURE__ */ jsx(T2, { flex: t13, width: t14, children: t40 }), $[75] = T2, $[76] = t40, $[77] = t41) : t41 = $[77];
|
|
1042
|
-
let t42;
|
|
1043
|
-
$[78] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t42 = {
|
|
1194
|
+
$[38] !== t6 ? (t7 = /* @__PURE__ */ jsx(Button, { onClick: t5, text: t6 }), $[38] = t6, $[39] = t7) : t7 = $[39];
|
|
1195
|
+
let t8;
|
|
1196
|
+
$[40] !== t ? (t8 = t("dialog.create.conditions.title"), $[40] = t, $[41] = t8) : t8 = $[41];
|
|
1197
|
+
let t9;
|
|
1198
|
+
$[42] !== t8 ? (t9 = /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: t8 }), $[42] = t8, $[43] = t9) : t9 = $[43];
|
|
1199
|
+
const T0 = Flex, t10 = "column", t11 = 1, t12 = "hidden";
|
|
1200
|
+
let t13;
|
|
1201
|
+
$[44] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t13 = {
|
|
1044
1202
|
minHeight: 0
|
|
1045
|
-
}, $[
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1203
|
+
}, $[44] = t13) : t13 = $[44];
|
|
1204
|
+
const t14 = variantDocumentsError ? /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t("detail.documents.error") }) }) : /* @__PURE__ */ jsx(VariantDocumentsTable, { loading: documentsLoading, rows: tableRows, variantId: getVariantId(variant._id) });
|
|
1205
|
+
let t15;
|
|
1206
|
+
$[45] !== T0 || $[46] !== t13 || $[47] !== t14 ? (t15 = /* @__PURE__ */ jsx(T0, { direction: t10, flex: t11, overflow: t12, style: t13, children: t14 }), $[45] = T0, $[46] = t13, $[47] = t14, $[48] = t15) : t15 = $[48];
|
|
1207
|
+
let t16;
|
|
1208
|
+
$[49] !== variant ? (t16 = /* @__PURE__ */ jsx(VariantDetailFooter, { variant }), $[49] = variant, $[50] = t16) : t16 = $[50];
|
|
1209
|
+
let t17;
|
|
1210
|
+
return $[51] !== editDialogOpen || $[52] !== variant ? (t17 = editDialogOpen && /* @__PURE__ */ jsx(EditVariantDialog, { onCancel: () => setEditDialogOpen(!1), onSubmit: () => setEditDialogOpen(!1), variant }), $[51] = editDialogOpen, $[52] = variant, $[53] = t17) : t17 = $[53], /* @__PURE__ */ jsxs(Flex, { direction: "column", flex: 1, height: "fill", overflow: "hidden", children: [
|
|
1211
|
+
t3,
|
|
1212
|
+
/* @__PURE__ */ jsxs(Flex, { direction: "column", flex: 1, height: "fill", overflow: "hidden", style: t4, children: [
|
|
1213
|
+
/* @__PURE__ */ jsx(Container, { flex: "none", width: 3, children: /* @__PURE__ */ jsx(Flex, { direction: "column", paddingX: 3, children: /* @__PURE__ */ jsxs(Card, { paddingY: 5, children: [
|
|
1214
|
+
/* @__PURE__ */ jsxs(Flex, { align: "flex-start", gap: 4, justify: "space-between", children: [
|
|
1215
|
+
/* @__PURE__ */ jsxs(Stack, { space: 3, children: [
|
|
1216
|
+
/* @__PURE__ */ jsx(Text, { as: "h1", size: 4, weight: "bold", children: getVariantTitle(variant) }),
|
|
1217
|
+
/* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: description || t("detail.no-description") })
|
|
1218
|
+
] }),
|
|
1219
|
+
t7
|
|
1220
|
+
] }),
|
|
1221
|
+
/* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Stack, { space: 2, children: [
|
|
1222
|
+
t9,
|
|
1223
|
+
/* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: conditionsText || t("overview.table.no-conditions") })
|
|
1224
|
+
] }) })
|
|
1225
|
+
] }) }) }),
|
|
1226
|
+
t15
|
|
1227
|
+
] }),
|
|
1228
|
+
t16,
|
|
1229
|
+
t17
|
|
1230
|
+
] });
|
|
1067
1231
|
}
|
|
1068
1232
|
function CreateVariantDialog(props) {
|
|
1069
1233
|
const $ = c(16), {
|