sanity 6.3.0 → 6.3.1-next.13

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.
Files changed (36) hide show
  1. package/lib/_chunks-dts/ActiveWorkspaceMatcherContext.d.ts +116 -18
  2. package/lib/_chunks-dts/index.d.ts +8 -2
  3. package/lib/_chunks-es/MenuGroup.js +2 -2
  4. package/lib/_chunks-es/MenuGroup.js.map +1 -1
  5. package/lib/_chunks-es/PostMessagePreviewSnapshots.js.map +1 -1
  6. package/lib/_chunks-es/PostMessageSchema.js +1 -0
  7. package/lib/_chunks-es/PostMessageSchema.js.map +1 -1
  8. package/lib/_chunks-es/PresentationToolGrantsCheck.js +2 -0
  9. package/lib/_chunks-es/PresentationToolGrantsCheck.js.map +1 -1
  10. package/lib/_chunks-es/ReleasesTool.js +4 -4
  11. package/lib/_chunks-es/ReleasesTool.js.map +1 -1
  12. package/lib/_chunks-es/StructureToolProvider.js.map +1 -1
  13. package/lib/_chunks-es/Table.js.map +1 -1
  14. package/lib/_chunks-es/Tool.js +1 -1
  15. package/lib/_chunks-es/Tool.js.map +1 -1
  16. package/lib/_chunks-es/VariantsTool.js +182 -101
  17. package/lib/_chunks-es/VariantsTool.js.map +1 -1
  18. package/lib/_chunks-es/index.js +1 -1
  19. package/lib/_chunks-es/index.js.map +1 -1
  20. package/lib/_chunks-es/index2.js +1171 -931
  21. package/lib/_chunks-es/index2.js.map +1 -1
  22. package/lib/_chunks-es/index9.js +4 -1
  23. package/lib/_chunks-es/index9.js.map +1 -1
  24. package/lib/_chunks-es/presentation.js.map +1 -1
  25. package/lib/_chunks-es/resources.js +12 -0
  26. package/lib/_chunks-es/resources.js.map +1 -1
  27. package/lib/_chunks-es/resources8.js +4 -0
  28. package/lib/_chunks-es/resources8.js.map +1 -1
  29. package/lib/_chunks-es/structureTool.js +559 -347
  30. package/lib/_chunks-es/structureTool.js.map +1 -1
  31. package/lib/_chunks-es/version.js +2 -2
  32. package/lib/_singletons.d.ts +1 -1
  33. package/lib/index.d.ts +2 -2
  34. package/lib/index.js +10 -1
  35. package/lib/router.js.map +1 -1
  36. package/package.json +12 -12
@@ -1,15 +1,15 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import { c } from "react/compiler-runtime";
3
3
  import { useRouter, StateLink } from "sanity/router";
4
- import { Autocomplete, Stack, Flex, Box, Text, TextInput, TextArea, useToast, Card, Menu, Container, rem, Skeleton } from "@sanity/ui";
4
+ import { Autocomplete, Stack, Flex, Box, Text, TextInput, TextArea, useToast, Card, Menu, Badge, Container, rem, Skeleton } from "@sanity/ui";
5
5
  import { useId, useState, memo, forwardRef } from "react";
6
6
  import { Button, Dialog, MenuButton, MenuItem } from "./index.js";
7
- import { getVariantId, useClient, VARIANTS_STUDIO_CLIENT_OPTIONS, VARIANT_DOCUMENTS_PATH, useTranslation, variantsLocaleNamespace, useAllVariants, TextWithTone, ContextMenuButton, RelativeTime, useSchema, SanityDefaultPreview, decodeVariantIdFromRoute, LoadingBlock, getVariantDescription, getVariantConditionsText, getVariantTitle, filterVariantsForSearch } from "./index2.js";
7
+ import { getVariantId, variantsClient, useClient, VARIANTS_STUDIO_CLIENT_OPTIONS, VARIANT_DOCUMENTS_PATH, useTranslation, variantsLocaleNamespace, useAllVariants, TextWithTone, useBundleDocuments, ContextMenuButton, RelativeTime, useSchema, useReleasesStore, SanityDefaultPreview, getReleaseTitleDetails, getReleaseIdFromReleaseDocumentId, getReleaseTone, decodeVariantIdFromRoute, LoadingBlock, getVariantDescription, getVariantConditionsText, getVariantTitle, filterVariantsForSearch } from "./index2.js";
8
8
  import "history";
9
9
  import "sanity/_singletons";
10
10
  import "rxjs";
11
11
  import "rxjs/operators";
12
- import "react-rx";
12
+ import { useObservable } from "react-rx";
13
13
  import "@sanity/client/csm";
14
14
  import "quick-lru";
15
15
  import "lodash-es/throttle.js";
@@ -132,7 +132,7 @@ import { at, set } from "@sanity/mutate";
132
132
  import { applyPatches } from "@sanity/mutate/_unstable_apply";
133
133
  import { Table, Headers } from "./Table.js";
134
134
  function createVariantOperationsStore(options) {
135
- const client = options.client;
135
+ const client = variantsClient(options.client);
136
136
  return {
137
137
  createVariant: async (variant) => {
138
138
  const action = {
@@ -608,6 +608,20 @@ function EditVariantDialog(props) {
608
608
  let t5;
609
609
  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;
610
610
  }
611
+ function useVariantDocuments(variantId) {
612
+ const $ = c(5);
613
+ let t0;
614
+ $[0] !== variantId ? (t0 = {
615
+ variantId
616
+ }, $[0] = variantId, $[1] = t0) : t0 = $[1];
617
+ const params = t0, t1 = `variant-${variantId}`;
618
+ let t2;
619
+ return $[2] !== params || $[3] !== t1 ? (t2 = {
620
+ groqFilter: "_system.variant._ref == $variantId",
621
+ params,
622
+ cacheKey: t1
623
+ }, $[2] = params, $[3] = t1, $[4] = t2) : t2 = $[4], useBundleDocuments(t2);
624
+ }
611
625
  function VariantDetailMenuButton(t0) {
612
626
  const $ = c(21), {
613
627
  variant
@@ -683,6 +697,36 @@ function VariantDetailFooter(t0) {
683
697
  ] })
684
698
  ] }), $[11] = t5, $[12] = t6, $[13] = t7) : t7 = $[13], t7;
685
699
  }
700
+ function getVariantDocumentVersion({
701
+ document,
702
+ releasesById,
703
+ t
704
+ }) {
705
+ const system = document._system, releaseRef = system?.release?._ref;
706
+ if (releaseRef) {
707
+ const release = releasesById?.get(releaseRef);
708
+ if (release) {
709
+ const {
710
+ displayTitle
711
+ } = getReleaseTitleDetails(release.metadata?.title, getReleaseIdFromReleaseDocumentId(release._id));
712
+ return {
713
+ label: displayTitle,
714
+ tone: getReleaseTone(release)
715
+ };
716
+ }
717
+ return {
718
+ label: getReleaseIdFromReleaseDocumentId(releaseRef),
719
+ tone: "default"
720
+ };
721
+ }
722
+ return system?.bundleId === "drafts" ? {
723
+ label: t("detail.documents.table.version.drafts"),
724
+ tone: getReleaseTone("drafts")
725
+ } : {
726
+ label: t("detail.documents.table.version.published"),
727
+ tone: getReleaseTone("published")
728
+ };
729
+ }
686
730
  const TABLE_CARD_STYLE = {
687
731
  height: "100%",
688
732
  overflow: "auto"
@@ -701,8 +745,25 @@ const MemoDocumentType = memo(function(t0) {
701
745
  let t3;
702
746
  return $[3] !== t2 ? (t3 = /* @__PURE__ */ jsx(Text, { size: 1, children: t2 }), $[3] = t2, $[4] = t3) : t3 = $[4], t3;
703
747
  }, (prev, next) => prev.type === next.type);
748
+ function getVariantDocumentVersionSortRank(document) {
749
+ const system = document._system;
750
+ return system?.release?._ref ? 2 : system?.bundleId === "drafts" ? 1 : 0;
751
+ }
752
+ function getVariantDocumentGroupSortKey({
753
+ document,
754
+ version
755
+ }) {
756
+ const groupRef = document._system?.group._ref ?? document._id, versionRank = getVariantDocumentVersionSortRank(document);
757
+ return `${groupRef}\0${versionRank}\0${version.label}\0${document._id}`;
758
+ }
704
759
  function getVariantDocumentColumnDefs(t) {
705
760
  return [{
761
+ id: "documentGroup",
762
+ hidden: !0,
763
+ width: null,
764
+ sorting: !0,
765
+ sortTransform: getVariantDocumentGroupSortKey
766
+ }, {
706
767
  id: "version",
707
768
  width: null,
708
769
  style: {
@@ -711,8 +772,9 @@ function getVariantDocumentColumnDefs(t) {
711
772
  sorting: !1,
712
773
  header: (props) => /* @__PURE__ */ jsx(Flex, { ...props.headerProps, paddingY: 3, sizing: "border", children: /* @__PURE__ */ jsx(Headers.BasicHeader, { text: t("detail.documents.table.version") }) }),
713
774
  cell: ({
714
- cellProps
715
- }) => /* @__PURE__ */ jsx(Flex, { align: "center", ...cellProps, children: /* @__PURE__ */ jsx(Box, { paddingX: 2, children: /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: "-" }) }) })
775
+ cellProps,
776
+ datum
777
+ }) => /* @__PURE__ */ jsx(Flex, { align: "center", ...cellProps, children: /* @__PURE__ */ jsx(Box, { paddingX: 2, children: !datum.isLoading && datum.version && /* @__PURE__ */ jsx(Badge, { fontSize: 1, mode: "outline", radius: 2, tone: datum.version.tone, children: datum.version.label }) }) })
716
778
  }, {
717
779
  id: "document._type",
718
780
  width: null,
@@ -760,149 +822,168 @@ function filterDocuments(rows, searchTerm) {
760
822
  }) => [getDocumentPreviewTitle(document), document._id, document._type].some((value) => value.toLowerCase().includes(normalizedSearchTerm))) : rows;
761
823
  }
762
824
  function VariantDocumentsTable(t0) {
763
- const $ = c(12), {
764
- documents
765
- } = t0, {
825
+ const $ = c(18), {
826
+ documents,
827
+ loading: t1
828
+ } = t0, loading = t1 === void 0 ? !1 : t1, {
766
829
  t
767
- } = useTranslation(variantsLocaleNamespace), [scrollContainerRef, setScrollContainerRef] = useState(null);
768
- let t1;
769
- $[0] !== t ? (t1 = getVariantDocumentColumnDefs(t), $[0] = t, $[1] = t1) : t1 = $[1];
770
- const columnDefs = t1;
830
+ } = useTranslation(variantsLocaleNamespace), [scrollContainerRef, setScrollContainerRef] = useState(null), {
831
+ state$
832
+ } = useReleasesStore(), releasesById = useObservable(state$)?.releases;
771
833
  let t2;
772
- $[2] !== documents ? (t2 = documents.map(_temp$2), $[2] = documents, $[3] = t2) : t2 = $[3];
773
- const rows = t2;
834
+ $[0] !== t ? (t2 = getVariantDocumentColumnDefs(t), $[0] = t, $[1] = t2) : t2 = $[1];
835
+ const columnDefs = t2;
774
836
  let t3;
775
- $[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t3 = {
776
- column: "search",
777
- direction: "asc"
778
- }, $[4] = t3) : t3 = $[4];
837
+ if ($[2] !== documents || $[3] !== releasesById || $[4] !== t) {
838
+ let t42;
839
+ $[6] !== releasesById || $[7] !== t ? (t42 = (document) => ({
840
+ document,
841
+ version: getVariantDocumentVersion({
842
+ document,
843
+ releasesById,
844
+ t
845
+ })
846
+ }), $[6] = releasesById, $[7] = t, $[8] = t42) : t42 = $[8], t3 = documents.map(t42), $[2] = documents, $[3] = releasesById, $[4] = t, $[5] = t3;
847
+ } else
848
+ t3 = $[5];
849
+ const rows = t3;
779
850
  let t4;
780
- $[5] !== t ? (t4 = t("detail.documents.no-documents"), $[5] = t, $[6] = t4) : t4 = $[6];
851
+ $[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t4 = {
852
+ column: "documentGroup",
853
+ direction: "asc"
854
+ }, $[9] = t4) : t4 = $[9];
781
855
  let t5;
782
- return $[7] !== columnDefs || $[8] !== rows || $[9] !== scrollContainerRef || $[10] !== t4 ? (t5 = /* @__PURE__ */ jsx(Card, { flex: 1, ref: setScrollContainerRef, style: TABLE_CARD_STYLE, children: /* @__PURE__ */ jsx(Table, { columnDefs, data: rows, defaultSort: t3, emptyState: t4, rowId: "document._id", scrollContainerRef, searchFilter: filterDocuments }) }), $[7] = columnDefs, $[8] = rows, $[9] = scrollContainerRef, $[10] = t4, $[11] = t5) : t5 = $[11], t5;
783
- }
784
- function _temp$2(document) {
785
- return {
786
- document
787
- };
856
+ $[10] !== t ? (t5 = t("detail.documents.no-documents"), $[10] = t, $[11] = t5) : t5 = $[11];
857
+ let t6;
858
+ return $[12] !== columnDefs || $[13] !== loading || $[14] !== rows || $[15] !== scrollContainerRef || $[16] !== 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: "document._id", scrollContainerRef, searchFilter: filterDocuments }) }), $[12] = columnDefs, $[13] = loading, $[14] = rows, $[15] = scrollContainerRef, $[16] = t5, $[17] = t6) : t6 = $[17], t6;
788
859
  }
789
- const EMPTY_VARIANT_DOCUMENTS = [];
790
860
  function VariantDetail() {
791
- const $ = c(92), router = useRouter(), {
861
+ const $ = c(98), router = useRouter(), {
792
862
  t
793
863
  } = useTranslation(variantsLocaleNamespace), [editDialogOpen, setEditDialogOpen] = useState(!1), variantIdRaw = typeof router.state.variantId == "string" ? router.state.variantId : void 0, variantId = decodeVariantIdFromRoute(variantIdRaw), {
794
864
  byId,
795
865
  loading
796
- } = useAllVariants(), variant = variantId ? byId.get(variantId) : void 0;
866
+ } = useAllVariants(), variant = variantId ? byId.get(variantId) : void 0, {
867
+ results: variantDocuments,
868
+ loading: documentsLoading
869
+ } = useVariantDocuments(variantId ?? "");
870
+ let t0;
871
+ $[0] !== variantDocuments ? (t0 = variantDocuments.map(_temp$2), $[0] = variantDocuments, $[1] = t0) : t0 = $[1];
872
+ const documents = t0;
797
873
  if (loading) {
798
- let t02;
799
- $[0] !== t ? (t02 = t("detail.loading"), $[0] = t, $[1] = t02) : t02 = $[1];
800
874
  let t110;
801
- return $[2] !== t02 ? (t110 = /* @__PURE__ */ jsx(LoadingBlock, { fill: !0, title: t02 }), $[2] = t02, $[3] = t110) : t110 = $[3], t110;
875
+ $[2] !== t ? (t110 = t("detail.loading"), $[2] = t, $[3] = t110) : t110 = $[3];
876
+ let t210;
877
+ return $[4] !== t110 ? (t210 = /* @__PURE__ */ jsx(LoadingBlock, { fill: !0, title: t110 }), $[4] = t110, $[5] = t210) : t210 = $[5], t210;
802
878
  }
803
879
  if (!variant) {
804
- let t02;
805
- $[4] !== router ? (t02 = () => router.navigate({}), $[4] = router, $[5] = t02) : t02 = $[5];
806
880
  let t110;
807
- $[6] !== t ? (t110 = t("detail.back"), $[6] = t, $[7] = t110) : t110 = $[7];
881
+ $[6] !== router ? (t110 = () => router.navigate({}), $[6] = router, $[7] = t110) : t110 = $[7];
808
882
  let t210;
809
- $[8] !== t02 || $[9] !== t110 ? (t210 = /* @__PURE__ */ jsx(Card, { borderBottom: !0, flex: "none", padding: 3, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", onClick: t02, text: t110 }) }), $[8] = t02, $[9] = t110, $[10] = t210) : t210 = $[10];
883
+ $[8] !== t ? (t210 = t("detail.back"), $[8] = t, $[9] = t210) : t210 = $[9];
810
884
  let t310;
811
- $[11] !== t ? (t310 = t("detail.not-found.title"), $[11] = t, $[12] = t310) : t310 = $[12];
812
- let t46;
813
- $[13] !== t310 ? (t46 = /* @__PURE__ */ jsx(Text, { size: 2, weight: "semibold", children: t310 }), $[13] = t310, $[14] = t46) : t46 = $[14];
885
+ $[10] !== t110 || $[11] !== t210 ? (t310 = /* @__PURE__ */ jsx(Card, { borderBottom: !0, flex: "none", padding: 3, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", onClick: t110, text: t210 }) }), $[10] = t110, $[11] = t210, $[12] = t310) : t310 = $[12];
886
+ let t48;
887
+ $[13] !== t ? (t48 = t("detail.not-found.title"), $[13] = t, $[14] = t48) : t48 = $[14];
814
888
  let t52;
815
- $[15] !== t ? (t52 = t("detail.not-found.description"), $[15] = t, $[16] = t52) : t52 = $[16];
889
+ $[15] !== t48 ? (t52 = /* @__PURE__ */ jsx(Text, { size: 2, weight: "semibold", children: t48 }), $[15] = t48, $[16] = t52) : t52 = $[16];
816
890
  let t62;
817
- $[17] !== t52 ? (t62 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t52 }), $[17] = t52, $[18] = t62) : t62 = $[18];
891
+ $[17] !== t ? (t62 = t("detail.not-found.description"), $[17] = t, $[18] = t62) : t62 = $[18];
818
892
  let t72;
819
- $[19] !== t46 || $[20] !== t62 ? (t72 = /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Card, { border: !0, padding: 4, radius: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
820
- t46,
821
- t62
822
- ] }) }) }), $[19] = t46, $[20] = t62, $[21] = t72) : t72 = $[21];
893
+ $[19] !== t62 ? (t72 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t62 }), $[19] = t62, $[20] = t72) : t72 = $[20];
823
894
  let t82;
824
- return $[22] !== t210 || $[23] !== t72 ? (t82 = /* @__PURE__ */ jsxs(Flex, { direction: "column", flex: 1, height: "fill", children: [
825
- t210,
895
+ $[21] !== t52 || $[22] !== t72 ? (t82 = /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Card, { border: !0, padding: 4, radius: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
896
+ t52,
826
897
  t72
827
- ] }), $[22] = t210, $[23] = t72, $[24] = t82) : t82 = $[24], t82;
898
+ ] }) }) }), $[21] = t52, $[22] = t72, $[23] = t82) : t82 = $[23];
899
+ let t92;
900
+ return $[24] !== t310 || $[25] !== t82 ? (t92 = /* @__PURE__ */ jsxs(Flex, { direction: "column", flex: 1, height: "fill", children: [
901
+ t310,
902
+ t82
903
+ ] }), $[24] = t310, $[25] = t82, $[26] = t92) : t92 = $[26], t92;
828
904
  }
829
- const description = getVariantDescription(variant), conditionsText = getVariantConditionsText(variant.conditions), T0 = Flex, t0 = "column", t1 = 1, t2 = "fill", t3 = "hidden";
830
- let t4;
831
- $[25] !== router ? (t4 = () => router.navigate({}), $[25] = router, $[26] = t4) : t4 = $[26];
905
+ const description = getVariantDescription(variant), conditionsText = getVariantConditionsText(variant.conditions), T0 = Flex, t1 = "column", t2 = 1, t3 = "fill", t4 = "hidden";
832
906
  let t5;
833
- $[27] !== t ? (t5 = t("detail.back"), $[27] = t, $[28] = t5) : t5 = $[28];
907
+ $[27] !== router ? (t5 = () => router.navigate({}), $[27] = router, $[28] = t5) : t5 = $[28];
834
908
  let t6;
835
- $[29] !== t4 || $[30] !== t5 ? (t6 = /* @__PURE__ */ jsx(Card, { borderBottom: !0, flex: "none", padding: 3, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", onClick: t4, text: t5 }) }), $[29] = t4, $[30] = t5, $[31] = t6) : t6 = $[31];
836
- const T1 = Flex, t7 = "column", t8 = 1, t9 = "fill", t10 = "hidden";
837
- let t11;
838
- $[32] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t11 = {
909
+ $[29] !== t ? (t6 = t("detail.back"), $[29] = t, $[30] = t6) : t6 = $[30];
910
+ let t7;
911
+ $[31] !== t5 || $[32] !== t6 ? (t7 = /* @__PURE__ */ jsx(Card, { borderBottom: !0, flex: "none", padding: 3, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", onClick: t5, text: t6 }) }), $[31] = t5, $[32] = t6, $[33] = t7) : t7 = $[33];
912
+ const T1 = Flex, t8 = "column", t9 = 1, t10 = "fill", t11 = "hidden";
913
+ let t12;
914
+ $[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t12 = {
839
915
  minHeight: 0
840
- }, $[32] = t11) : t11 = $[32];
841
- const T2 = Container, t12 = "none", t13 = 3, T3 = Flex, t14 = "column", t15 = 3, T4 = Card, t16 = 5, T5 = Flex, t17 = "flex-start", t18 = 4, t19 = "space-between", T6 = Stack, t20 = 3, T7 = Text, t21 = "h1", t22 = 4, t23 = "bold", t24 = getVariantTitle(variant);
842
- let t25;
843
- $[33] !== T7 || $[34] !== t24 ? (t25 = /* @__PURE__ */ jsx(T7, { as: t21, size: t22, weight: t23, children: t24 }), $[33] = T7, $[34] = t24, $[35] = t25) : t25 = $[35];
916
+ }, $[34] = t12) : t12 = $[34];
917
+ const T2 = Container, t13 = "none", t14 = 3, T3 = Flex, t15 = "column", t16 = 3, T4 = Card, t17 = 5, T5 = Flex, t18 = "flex-start", t19 = 4, t20 = "space-between", T6 = Stack, t21 = 3, T7 = Text, t22 = "h1", t23 = 4, t24 = "bold", t25 = getVariantTitle(variant);
844
918
  let t26;
845
- $[36] !== description || $[37] !== t ? (t26 = description || t("detail.no-description"), $[36] = description, $[37] = t, $[38] = t26) : t26 = $[38];
919
+ $[35] !== T7 || $[36] !== t25 ? (t26 = /* @__PURE__ */ jsx(T7, { as: t22, size: t23, weight: t24, children: t25 }), $[35] = T7, $[36] = t25, $[37] = t26) : t26 = $[37];
846
920
  let t27;
847
- $[39] !== t26 ? (t27 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t26 }), $[39] = t26, $[40] = t27) : t27 = $[40];
921
+ $[38] !== description || $[39] !== t ? (t27 = description || t("detail.no-description"), $[38] = description, $[39] = t, $[40] = t27) : t27 = $[40];
848
922
  let t28;
849
- $[41] !== T6 || $[42] !== t25 || $[43] !== t27 ? (t28 = /* @__PURE__ */ jsxs(T6, { space: t20, children: [
850
- t25,
851
- t27
852
- ] }), $[41] = T6, $[42] = t25, $[43] = t27, $[44] = t28) : t28 = $[44];
923
+ $[41] !== t27 ? (t28 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t27 }), $[41] = t27, $[42] = t28) : t28 = $[42];
853
924
  let t29;
854
- $[45] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t29 = () => setEditDialogOpen(!0), $[45] = t29) : t29 = $[45];
925
+ $[43] !== T6 || $[44] !== t26 || $[45] !== t28 ? (t29 = /* @__PURE__ */ jsxs(T6, { space: t21, children: [
926
+ t26,
927
+ t28
928
+ ] }), $[43] = T6, $[44] = t26, $[45] = t28, $[46] = t29) : t29 = $[46];
855
929
  let t30;
856
- $[46] !== t ? (t30 = t("detail.action.edit-variant"), $[46] = t, $[47] = t30) : t30 = $[47];
930
+ $[47] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t30 = () => setEditDialogOpen(!0), $[47] = t30) : t30 = $[47];
857
931
  let t31;
858
- $[48] !== t30 ? (t31 = /* @__PURE__ */ jsx(Button, { onClick: t29, text: t30 }), $[48] = t30, $[49] = t31) : t31 = $[49];
932
+ $[48] !== t ? (t31 = t("detail.action.edit-variant"), $[48] = t, $[49] = t31) : t31 = $[49];
859
933
  let t32;
860
- $[50] !== T5 || $[51] !== t28 || $[52] !== t31 ? (t32 = /* @__PURE__ */ jsxs(T5, { align: t17, gap: t18, justify: t19, children: [
861
- t28,
862
- t31
863
- ] }), $[50] = T5, $[51] = t28, $[52] = t31, $[53] = t32) : t32 = $[53];
934
+ $[50] !== t31 ? (t32 = /* @__PURE__ */ jsx(Button, { onClick: t30, text: t31 }), $[50] = t31, $[51] = t32) : t32 = $[51];
864
935
  let t33;
865
- $[54] !== t ? (t33 = t("dialog.create.conditions.title"), $[54] = t, $[55] = t33) : t33 = $[55];
936
+ $[52] !== T5 || $[53] !== t29 || $[54] !== t32 ? (t33 = /* @__PURE__ */ jsxs(T5, { align: t18, gap: t19, justify: t20, children: [
937
+ t29,
938
+ t32
939
+ ] }), $[52] = T5, $[53] = t29, $[54] = t32, $[55] = t33) : t33 = $[55];
866
940
  let t34;
867
- $[56] !== t33 ? (t34 = /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: t33 }), $[56] = t33, $[57] = t34) : t34 = $[57];
941
+ $[56] !== t ? (t34 = t("dialog.create.conditions.title"), $[56] = t, $[57] = t34) : t34 = $[57];
868
942
  let t35;
869
- $[58] !== conditionsText || $[59] !== t ? (t35 = conditionsText || t("overview.table.no-conditions"), $[58] = conditionsText, $[59] = t, $[60] = t35) : t35 = $[60];
943
+ $[58] !== t34 ? (t35 = /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: t34 }), $[58] = t34, $[59] = t35) : t35 = $[59];
870
944
  let t36;
871
- $[61] !== t35 ? (t36 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t35 }), $[61] = t35, $[62] = t36) : t36 = $[62];
945
+ $[60] !== conditionsText || $[61] !== t ? (t36 = conditionsText || t("overview.table.no-conditions"), $[60] = conditionsText, $[61] = t, $[62] = t36) : t36 = $[62];
872
946
  let t37;
873
- $[63] !== t34 || $[64] !== t36 ? (t37 = /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Stack, { space: 2, children: [
874
- t34,
875
- t36
876
- ] }) }), $[63] = t34, $[64] = t36, $[65] = t37) : t37 = $[65];
947
+ $[63] !== t36 ? (t37 = /* @__PURE__ */ jsx(Text, { muted: !0, size: 1, children: t36 }), $[63] = t36, $[64] = t37) : t37 = $[64];
877
948
  let t38;
878
- $[66] !== T4 || $[67] !== t32 || $[68] !== t37 ? (t38 = /* @__PURE__ */ jsxs(T4, { paddingY: t16, children: [
879
- t32,
949
+ $[65] !== t35 || $[66] !== t37 ? (t38 = /* @__PURE__ */ jsx(Box, { paddingTop: 4, children: /* @__PURE__ */ jsxs(Stack, { space: 2, children: [
950
+ t35,
880
951
  t37
881
- ] }), $[66] = T4, $[67] = t32, $[68] = t37, $[69] = t38) : t38 = $[69];
952
+ ] }) }), $[65] = t35, $[66] = t37, $[67] = t38) : t38 = $[67];
882
953
  let t39;
883
- $[70] !== T3 || $[71] !== t38 ? (t39 = /* @__PURE__ */ jsx(T3, { direction: t14, paddingX: t15, children: t38 }), $[70] = T3, $[71] = t38, $[72] = t39) : t39 = $[72];
954
+ $[68] !== T4 || $[69] !== t33 || $[70] !== t38 ? (t39 = /* @__PURE__ */ jsxs(T4, { paddingY: t17, children: [
955
+ t33,
956
+ t38
957
+ ] }), $[68] = T4, $[69] = t33, $[70] = t38, $[71] = t39) : t39 = $[71];
884
958
  let t40;
885
- $[73] !== T2 || $[74] !== t39 ? (t40 = /* @__PURE__ */ jsx(T2, { flex: t12, width: t13, children: t39 }), $[73] = T2, $[74] = t39, $[75] = t40) : t40 = $[75];
959
+ $[72] !== T3 || $[73] !== t39 ? (t40 = /* @__PURE__ */ jsx(T3, { direction: t15, paddingX: t16, children: t39 }), $[72] = T3, $[73] = t39, $[74] = t40) : t40 = $[74];
886
960
  let t41;
887
- $[76] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t41 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, overflow: "hidden", style: {
888
- minHeight: 0
889
- }, children: /* @__PURE__ */ jsx(VariantDocumentsTable, { documents: EMPTY_VARIANT_DOCUMENTS }) }), $[76] = t41) : t41 = $[76];
961
+ $[75] !== T2 || $[76] !== t40 ? (t41 = /* @__PURE__ */ jsx(T2, { flex: t13, width: t14, children: t40 }), $[75] = T2, $[76] = t40, $[77] = t41) : t41 = $[77];
890
962
  let t42;
891
- $[77] !== T1 || $[78] !== t11 || $[79] !== t40 ? (t42 = /* @__PURE__ */ jsxs(T1, { direction: t7, flex: t8, height: t9, overflow: t10, style: t11, children: [
892
- t40,
893
- t41
894
- ] }), $[77] = T1, $[78] = t11, $[79] = t40, $[80] = t42) : t42 = $[80];
963
+ $[78] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (t42 = {
964
+ minHeight: 0
965
+ }, $[78] = t42) : t42 = $[78];
895
966
  let t43;
896
- $[81] !== variant ? (t43 = /* @__PURE__ */ jsx(VariantDetailFooter, { variant }), $[81] = variant, $[82] = t43) : t43 = $[82];
967
+ $[79] !== documents || $[80] !== documentsLoading ? (t43 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, overflow: "hidden", style: t42, children: /* @__PURE__ */ jsx(VariantDocumentsTable, { documents, loading: documentsLoading }) }), $[79] = documents, $[80] = documentsLoading, $[81] = t43) : t43 = $[81];
897
968
  let t44;
898
- $[83] !== editDialogOpen || $[84] !== variant ? (t44 = editDialogOpen && /* @__PURE__ */ jsx(EditVariantDialog, { onCancel: () => setEditDialogOpen(!1), onSubmit: () => setEditDialogOpen(!1), variant }), $[83] = editDialogOpen, $[84] = variant, $[85] = t44) : t44 = $[85];
969
+ $[82] !== T1 || $[83] !== t12 || $[84] !== t41 || $[85] !== t43 ? (t44 = /* @__PURE__ */ jsxs(T1, { direction: t8, flex: t9, height: t10, overflow: t11, style: t12, children: [
970
+ t41,
971
+ t43
972
+ ] }), $[82] = T1, $[83] = t12, $[84] = t41, $[85] = t43, $[86] = t44) : t44 = $[86];
899
973
  let t45;
900
- return $[86] !== T0 || $[87] !== t42 || $[88] !== t43 || $[89] !== t44 || $[90] !== t6 ? (t45 = /* @__PURE__ */ jsxs(T0, { direction: t0, flex: t1, height: t2, overflow: t3, children: [
901
- t6,
902
- t42,
903
- t43,
904
- t44
905
- ] }), $[86] = T0, $[87] = t42, $[88] = t43, $[89] = t44, $[90] = t6, $[91] = t45) : t45 = $[91], t45;
974
+ $[87] !== variant ? (t45 = /* @__PURE__ */ jsx(VariantDetailFooter, { variant }), $[87] = variant, $[88] = t45) : t45 = $[88];
975
+ let t46;
976
+ $[89] !== editDialogOpen || $[90] !== variant ? (t46 = editDialogOpen && /* @__PURE__ */ jsx(EditVariantDialog, { onCancel: () => setEditDialogOpen(!1), onSubmit: () => setEditDialogOpen(!1), variant }), $[89] = editDialogOpen, $[90] = variant, $[91] = t46) : t46 = $[91];
977
+ let t47;
978
+ return $[92] !== T0 || $[93] !== t44 || $[94] !== t45 || $[95] !== t46 || $[96] !== t7 ? (t47 = /* @__PURE__ */ jsxs(T0, { direction: t1, flex: t2, height: t3, overflow: t4, children: [
979
+ t7,
980
+ t44,
981
+ t45,
982
+ t46
983
+ ] }), $[92] = T0, $[93] = t44, $[94] = t45, $[95] = t46, $[96] = t7, $[97] = t47) : t47 = $[97], t47;
984
+ }
985
+ function _temp$2(result) {
986
+ return result.document;
906
987
  }
907
988
  function CreateVariantDialog(props) {
908
989
  const $ = c(16), {