@sanity/cross-dataset-duplicator 1.2.3 → 1.3.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/LICENSE +1 -1
- package/dist/index.d.ts +1 -476
- package/dist/index.esm.js +221 -216
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +220 -215
- package/dist/index.js.map +1 -1
- package/package.json +9 -7
- package/src/components/Duplicator.tsx +126 -116
- package/src/components/DuplicatorQuery.tsx +61 -59
- package/src/components/SelectButtons.tsx +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import React, { useState, useEffect, useCallback, createContext, useContext } from 'react';
|
|
4
4
|
import { ArrowRightIcon, SearchIcon, LaunchIcon } from '@sanity/icons';
|
|
5
5
|
import { useSecrets, SettingsView } from '@sanity/studio-secrets';
|
|
6
|
-
import { Card, Flex, Button, Badge, Tooltip, Box, Text, useTheme, Container, Stack, Label, Select, Checkbox, Grid, TextInput
|
|
6
|
+
import { Card, Flex, Button, Badge, Tooltip, Box, Text, useTheme, Container, Stack, Label, Select, Checkbox, Spinner, Grid, TextInput } from '@sanity/ui';
|
|
7
7
|
import mapLimit from 'async/mapLimit';
|
|
8
8
|
import asyncify from 'async/asyncify';
|
|
9
9
|
import { extractWithPath } from '@sanity/mutator';
|
|
@@ -120,6 +120,7 @@ function SelectButtons(props) {
|
|
|
120
120
|
shadow: 1,
|
|
121
121
|
children: /* @__PURE__ */jsx(Flex, {
|
|
122
122
|
gap: 2,
|
|
123
|
+
wrap: "wrap",
|
|
123
124
|
children: buttons.map((action, actionIndex) => action ? /* @__PURE__ */jsx(Button, {
|
|
124
125
|
fontSize: 1,
|
|
125
126
|
mode: "bleed",
|
|
@@ -385,7 +386,7 @@ function Duplicator(props) {
|
|
|
385
386
|
setProgress([currentProgress, assetsCount]);
|
|
386
387
|
setMessage({
|
|
387
388
|
text: "Duplicating...",
|
|
388
|
-
tone: "
|
|
389
|
+
tone: "transparent"
|
|
389
390
|
});
|
|
390
391
|
const destinationClient = originClient.withConfig({
|
|
391
392
|
...clientConfig,
|
|
@@ -416,6 +417,8 @@ function Duplicator(props) {
|
|
|
416
417
|
});
|
|
417
418
|
}
|
|
418
419
|
transactionDocs.push(assetDoc);
|
|
420
|
+
doc.url = assetDoc.url;
|
|
421
|
+
doc.path = assetDoc.path;
|
|
419
422
|
});
|
|
420
423
|
currentProgress += 1;
|
|
421
424
|
setMessage({
|
|
@@ -535,89 +538,89 @@ function Duplicator(props) {
|
|
|
535
538
|
width: 1,
|
|
536
539
|
children: /* @__PURE__ */jsx(Card, {
|
|
537
540
|
border: true,
|
|
538
|
-
children: /* @__PURE__ */
|
|
539
|
-
children: /* @__PURE__ */
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
children: /* @__PURE__ */jsxs(
|
|
545
|
-
|
|
546
|
-
children: [/* @__PURE__ */jsxs(
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
children: [(_a2 = space.title) != null ? _a2 : space.name, hasMultipleProjectIds ? " (".concat(space.projectId, ")") : ""]
|
|
564
|
-
}, space.name);
|
|
565
|
-
})
|
|
566
|
-
})]
|
|
567
|
-
}), /* @__PURE__ */jsx(Box, {
|
|
568
|
-
padding: 4,
|
|
569
|
-
paddingTop: 5,
|
|
570
|
-
paddingBottom: 0,
|
|
571
|
-
children: /* @__PURE__ */jsx(Text, {
|
|
572
|
-
size: 3,
|
|
573
|
-
children: /* @__PURE__ */jsx(ArrowRightIcon, {})
|
|
541
|
+
children: /* @__PURE__ */jsxs(Stack, {
|
|
542
|
+
children: [/* @__PURE__ */jsx(Card, {
|
|
543
|
+
padding: 4,
|
|
544
|
+
style: stickyStyles(isDarkMode),
|
|
545
|
+
children: /* @__PURE__ */jsxs(Stack, {
|
|
546
|
+
space: 4,
|
|
547
|
+
children: [/* @__PURE__ */jsxs(Flex, {
|
|
548
|
+
gap: 3,
|
|
549
|
+
children: [/* @__PURE__ */jsxs(Stack, {
|
|
550
|
+
style: {
|
|
551
|
+
flex: 1
|
|
552
|
+
},
|
|
553
|
+
space: 3,
|
|
554
|
+
children: [/* @__PURE__ */jsx(Label, {
|
|
555
|
+
children: "Duplicate from"
|
|
556
|
+
}), /* @__PURE__ */jsx(Select, {
|
|
557
|
+
readOnly: true,
|
|
558
|
+
value: (_c = workspacesOptions.find(space => space.disabled)) == null ? void 0 : _c.name,
|
|
559
|
+
children: workspacesOptions.filter(space => space.disabled).map(space => {
|
|
560
|
+
var _a2;
|
|
561
|
+
return /* @__PURE__ */jsxs("option", {
|
|
562
|
+
value: space.name,
|
|
563
|
+
disabled: space.disabled,
|
|
564
|
+
children: [(_a2 = space.title) != null ? _a2 : space.name, hasMultipleProjectIds ? " (".concat(space.projectId, ")") : ""]
|
|
565
|
+
}, space.name);
|
|
574
566
|
})
|
|
575
|
-
}), /* @__PURE__ */jsxs(Stack, {
|
|
576
|
-
style: {
|
|
577
|
-
flex: 1
|
|
578
|
-
},
|
|
579
|
-
space: 3,
|
|
580
|
-
children: [/* @__PURE__ */jsx(Label, {
|
|
581
|
-
children: "To Destination"
|
|
582
|
-
}), /* @__PURE__ */jsx(Select, {
|
|
583
|
-
onChange: handleChange,
|
|
584
|
-
children: workspacesOptions.map(space => {
|
|
585
|
-
var _a2;
|
|
586
|
-
return /* @__PURE__ */jsxs("option", {
|
|
587
|
-
value: space.name,
|
|
588
|
-
disabled: space.disabled,
|
|
589
|
-
children: [(_a2 = space.title) != null ? _a2 : space.name, hasMultipleProjectIds ? " (".concat(space.projectId, ")") : "", space.disabled ? " (Current)" : ""]
|
|
590
|
-
}, space.name);
|
|
591
|
-
})
|
|
592
|
-
})]
|
|
593
567
|
})]
|
|
594
|
-
}),
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
transformOrigin: "left",
|
|
602
|
-
transition: "transform .2s ease",
|
|
603
|
-
boxSizing: "border-box"
|
|
604
|
-
},
|
|
605
|
-
padding: 1,
|
|
606
|
-
tone: "positive"
|
|
568
|
+
}), /* @__PURE__ */jsx(Box, {
|
|
569
|
+
padding: 4,
|
|
570
|
+
paddingTop: 5,
|
|
571
|
+
paddingBottom: 0,
|
|
572
|
+
children: /* @__PURE__ */jsx(Text, {
|
|
573
|
+
size: 3,
|
|
574
|
+
children: /* @__PURE__ */jsx(ArrowRightIcon, {})
|
|
607
575
|
})
|
|
608
|
-
}),
|
|
576
|
+
}), /* @__PURE__ */jsxs(Stack, {
|
|
577
|
+
style: {
|
|
578
|
+
flex: 1
|
|
579
|
+
},
|
|
580
|
+
space: 3,
|
|
609
581
|
children: [/* @__PURE__ */jsx(Label, {
|
|
610
|
-
children:
|
|
611
|
-
}), /* @__PURE__ */jsx(
|
|
612
|
-
|
|
613
|
-
|
|
582
|
+
children: "To Destination"
|
|
583
|
+
}), /* @__PURE__ */jsx(Select, {
|
|
584
|
+
onChange: handleChange,
|
|
585
|
+
children: workspacesOptions.map(space => {
|
|
586
|
+
var _a2;
|
|
587
|
+
return /* @__PURE__ */jsxs("option", {
|
|
588
|
+
value: space.name,
|
|
589
|
+
disabled: space.disabled,
|
|
590
|
+
children: [(_a2 = space.title) != null ? _a2 : space.name, hasMultipleProjectIds ? " (".concat(space.projectId, ")") : "", space.disabled ? " (Current)" : ""]
|
|
591
|
+
}, space.name);
|
|
592
|
+
})
|
|
614
593
|
})]
|
|
615
594
|
})]
|
|
616
|
-
})
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
595
|
+
}), isDuplicating && /* @__PURE__ */jsx(Card, {
|
|
596
|
+
border: true,
|
|
597
|
+
radius: 2,
|
|
598
|
+
children: /* @__PURE__ */jsx(Card, {
|
|
599
|
+
style: {
|
|
600
|
+
width: "100%",
|
|
601
|
+
transform: "scaleX(".concat(progress[0] / progress[1], ")"),
|
|
602
|
+
transformOrigin: "left",
|
|
603
|
+
transition: "transform .2s ease",
|
|
604
|
+
boxSizing: "border-box"
|
|
605
|
+
},
|
|
606
|
+
padding: 1,
|
|
607
|
+
tone: "positive"
|
|
608
|
+
})
|
|
609
|
+
}), payload.length > 0 && /* @__PURE__ */jsxs(Fragment, {
|
|
610
|
+
children: [/* @__PURE__ */jsx(Label, {
|
|
611
|
+
children: headingText
|
|
612
|
+
}), /* @__PURE__ */jsx(SelectButtons, {
|
|
613
|
+
payload,
|
|
614
|
+
setPayload
|
|
615
|
+
})]
|
|
616
|
+
})]
|
|
617
|
+
})
|
|
618
|
+
}), /* @__PURE__ */jsx(Card, {
|
|
619
|
+
borderTop: true,
|
|
620
|
+
padding: 4,
|
|
621
|
+
children: /* @__PURE__ */jsxs(Stack, {
|
|
622
|
+
space: 3,
|
|
623
|
+
children: [message && /* @__PURE__ */jsx(Card, {
|
|
621
624
|
padding: 3,
|
|
622
625
|
radius: 2,
|
|
623
626
|
shadow: 1,
|
|
@@ -626,89 +629,90 @@ function Duplicator(props) {
|
|
|
626
629
|
size: 1,
|
|
627
630
|
children: message.text
|
|
628
631
|
})
|
|
629
|
-
})
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const schemaType = schema.get(doc._type);
|
|
641
|
-
return /* @__PURE__ */jsxs(React.Fragment, {
|
|
642
|
-
children: [/* @__PURE__ */jsxs(Flex, {
|
|
643
|
-
align: "center",
|
|
644
|
-
children: [/* @__PURE__ */jsx(Checkbox, {
|
|
645
|
-
checked: include,
|
|
646
|
-
onChange: () => handleCheckbox(doc._id)
|
|
647
|
-
}), /* @__PURE__ */jsx(Box, {
|
|
648
|
-
flex: 1,
|
|
649
|
-
paddingX: 3,
|
|
650
|
-
children: schemaType ? /* @__PURE__ */jsx(Preview, {
|
|
651
|
-
value: doc,
|
|
652
|
-
schemaType
|
|
653
|
-
}) : /* @__PURE__ */jsx(Card, {
|
|
654
|
-
tone: "caution",
|
|
655
|
-
children: "Invalid schema type"
|
|
656
|
-
})
|
|
657
|
-
}), /* @__PURE__ */jsxs(Flex, {
|
|
632
|
+
}), payload.length > 0 ? /* @__PURE__ */jsx(Stack, {
|
|
633
|
+
children: payload.map((_ref5, index) => {
|
|
634
|
+
let {
|
|
635
|
+
doc,
|
|
636
|
+
include,
|
|
637
|
+
status,
|
|
638
|
+
hasDraft
|
|
639
|
+
} = _ref5;
|
|
640
|
+
const schemaType = schema.get(doc._type);
|
|
641
|
+
return /* @__PURE__ */jsxs(React.Fragment, {
|
|
642
|
+
children: [/* @__PURE__ */jsxs(Flex, {
|
|
658
643
|
align: "center",
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
644
|
+
children: [/* @__PURE__ */jsx(Checkbox, {
|
|
645
|
+
checked: include,
|
|
646
|
+
onChange: () => handleCheckbox(doc._id)
|
|
647
|
+
}), /* @__PURE__ */jsx(Box, {
|
|
648
|
+
flex: 1,
|
|
649
|
+
paddingX: 3,
|
|
650
|
+
children: schemaType ? /* @__PURE__ */jsx(Preview, {
|
|
651
|
+
value: doc,
|
|
652
|
+
schemaType
|
|
653
|
+
}) : /* @__PURE__ */jsx(Card, {
|
|
654
|
+
tone: "caution",
|
|
655
|
+
children: "Invalid schema type"
|
|
656
|
+
})
|
|
657
|
+
}), /* @__PURE__ */jsxs(Flex, {
|
|
658
|
+
align: "center",
|
|
659
|
+
gap: 2,
|
|
660
|
+
children: [hasDraft ? /* @__PURE__ */jsx(StatusBadge, {
|
|
661
|
+
status: "UNPUBLISHED",
|
|
662
|
+
isAsset: false
|
|
663
|
+
}) : null, /* @__PURE__ */jsx(StatusBadge, {
|
|
664
|
+
status,
|
|
665
|
+
isAsset: isAssetId(doc._id)
|
|
666
|
+
})]
|
|
666
667
|
})]
|
|
668
|
+
}), (doc == null ? void 0 : doc.extension) === "svg" && index === firstSvgIndex && /* @__PURE__ */jsx(Card, {
|
|
669
|
+
padding: 3,
|
|
670
|
+
radius: 2,
|
|
671
|
+
shadow: 1,
|
|
672
|
+
tone: "caution",
|
|
673
|
+
children: /* @__PURE__ */jsxs(Text, {
|
|
674
|
+
size: 1,
|
|
675
|
+
children: ["Due to how SVGs are sanitized after first uploaded, duplicated SVG assets may have new ", /* @__PURE__ */jsx("code", {
|
|
676
|
+
children: "_id"
|
|
677
|
+
}), "'s at the destination. The newly generated ", /* @__PURE__ */jsx("code", {
|
|
678
|
+
children: "_id"
|
|
679
|
+
}), " will be the same in each duplication, but it will never be the same ", /* @__PURE__ */jsx("code", {
|
|
680
|
+
children: "_id"
|
|
681
|
+
}), " as the first time this Asset was uploaded. References to the asset will be updated to use the new ", /* @__PURE__ */jsx("code", {
|
|
682
|
+
children: "_id"
|
|
683
|
+
}), "."]
|
|
684
|
+
})
|
|
667
685
|
})]
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
shadow: 1,
|
|
672
|
-
tone: "caution",
|
|
673
|
-
children: /* @__PURE__ */jsxs(Text, {
|
|
674
|
-
size: 1,
|
|
675
|
-
children: ["Due to how SVGs are sanitized after first uploaded, duplicated SVG assets may have new ", /* @__PURE__ */jsx("code", {
|
|
676
|
-
children: "_id"
|
|
677
|
-
}), "'s at the destination. The newly generated ", /* @__PURE__ */jsx("code", {
|
|
678
|
-
children: "_id"
|
|
679
|
-
}), " will be the same in each duplication, but it will never be the same ", /* @__PURE__ */jsx("code", {
|
|
680
|
-
children: "_id"
|
|
681
|
-
}), " as the first time this Asset was uploaded. References to the asset will be updated to use the new", " ", /* @__PURE__ */jsx("code", {
|
|
682
|
-
children: "_id"
|
|
683
|
-
}), "."]
|
|
684
|
-
})
|
|
685
|
-
})]
|
|
686
|
-
}, doc._id);
|
|
687
|
-
})
|
|
688
|
-
}), /* @__PURE__ */jsxs(Stack, {
|
|
689
|
-
space: 2,
|
|
690
|
-
padding: 4,
|
|
691
|
-
paddingTop: 0,
|
|
692
|
-
children: [hasReferences && /* @__PURE__ */jsx(Button, {
|
|
693
|
-
fontSize: 2,
|
|
694
|
-
padding: 4,
|
|
695
|
-
tone: "positive",
|
|
696
|
-
mode: "ghost",
|
|
697
|
-
icon: SearchIcon,
|
|
698
|
-
onClick: handleReferences,
|
|
699
|
-
text: "Gather References",
|
|
700
|
-
disabled: isDuplicating || !selectedTotal || isGathering
|
|
701
|
-
}), /* @__PURE__ */jsx(Button, {
|
|
702
|
-
fontSize: 2,
|
|
686
|
+
}, doc._id);
|
|
687
|
+
})
|
|
688
|
+
}) : /* @__PURE__ */jsx(Flex, {
|
|
703
689
|
padding: 4,
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
690
|
+
align: "center",
|
|
691
|
+
justify: "center",
|
|
692
|
+
children: /* @__PURE__ */jsx(Spinner, {})
|
|
693
|
+
}), /* @__PURE__ */jsxs(Stack, {
|
|
694
|
+
space: 2,
|
|
695
|
+
children: [hasReferences && /* @__PURE__ */jsx(Button, {
|
|
696
|
+
fontSize: 2,
|
|
697
|
+
padding: 4,
|
|
698
|
+
tone: "positive",
|
|
699
|
+
mode: "ghost",
|
|
700
|
+
icon: SearchIcon,
|
|
701
|
+
onClick: handleReferences,
|
|
702
|
+
text: "Gather References",
|
|
703
|
+
disabled: isDuplicating || !selectedTotal || isGathering
|
|
704
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
705
|
+
fontSize: 2,
|
|
706
|
+
padding: 4,
|
|
707
|
+
tone: "positive",
|
|
708
|
+
icon: LaunchIcon,
|
|
709
|
+
onClick: handleDuplicate,
|
|
710
|
+
text: buttonText,
|
|
711
|
+
disabled: isDuplicating || !selectedTotal || isGathering
|
|
712
|
+
})]
|
|
709
713
|
})]
|
|
710
|
-
})
|
|
711
|
-
})
|
|
714
|
+
})
|
|
715
|
+
})]
|
|
712
716
|
})
|
|
713
717
|
})
|
|
714
718
|
});
|
|
@@ -744,67 +748,68 @@ function DuplicatorQuery(props) {
|
|
|
744
748
|
handleSubmit();
|
|
745
749
|
}
|
|
746
750
|
}, []);
|
|
747
|
-
return /* @__PURE__ */jsx(
|
|
748
|
-
width: [1, 1, 1, 3],
|
|
751
|
+
return /* @__PURE__ */jsx(Card, {
|
|
749
752
|
padding: [0, 0, 0, 5],
|
|
750
|
-
children: /* @__PURE__ */
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
children: /* @__PURE__ */jsx(
|
|
763
|
-
children:
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
children:
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
children:
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
753
|
+
children: /* @__PURE__ */jsx(Container, {
|
|
754
|
+
children: /* @__PURE__ */jsxs(Grid, {
|
|
755
|
+
columns: [1, 1, 1, 2],
|
|
756
|
+
gap: [1, 1, 1, 4],
|
|
757
|
+
children: [/* @__PURE__ */jsx(Box, {
|
|
758
|
+
padding: [2, 2, 2, 0],
|
|
759
|
+
children: /* @__PURE__ */jsx(Card, {
|
|
760
|
+
padding: 4,
|
|
761
|
+
radius: 3,
|
|
762
|
+
border: true,
|
|
763
|
+
children: /* @__PURE__ */jsxs(Stack, {
|
|
764
|
+
space: 4,
|
|
765
|
+
children: [/* @__PURE__ */jsx(Box, {
|
|
766
|
+
children: /* @__PURE__ */jsx(Label, {
|
|
767
|
+
children: "Initial Documents Query"
|
|
768
|
+
})
|
|
769
|
+
}), /* @__PURE__ */jsx(Box, {
|
|
770
|
+
children: /* @__PURE__ */jsx(Text, {
|
|
771
|
+
children: "Start with a valid GROQ query to load initial documents. The query will need to return an Array of Objects. Drafts will be removed from the results."
|
|
772
|
+
})
|
|
773
|
+
}), /* @__PURE__ */jsx("form", {
|
|
774
|
+
onSubmit: handleSubmit,
|
|
775
|
+
children: /* @__PURE__ */jsxs(Flex, {
|
|
776
|
+
children: [/* @__PURE__ */jsx(Box, {
|
|
777
|
+
flex: 1,
|
|
778
|
+
paddingRight: 2,
|
|
779
|
+
children: /* @__PURE__ */jsx(TextInput, {
|
|
780
|
+
style: {
|
|
781
|
+
fontFamily: "monospace"
|
|
782
|
+
},
|
|
783
|
+
fontSize: 2,
|
|
784
|
+
onChange: event => setValue(event.currentTarget.value),
|
|
785
|
+
padding: 4,
|
|
786
|
+
placeholder: "*[_type == \"article\"]",
|
|
787
|
+
value: value != null ? value : ""
|
|
788
|
+
})
|
|
789
|
+
}), /* @__PURE__ */jsx(Button, {
|
|
790
|
+
padding: 2,
|
|
791
|
+
paddingX: 4,
|
|
792
|
+
tone: "primary",
|
|
793
|
+
onClick: handleSubmit,
|
|
794
|
+
text: "Query",
|
|
795
|
+
disabled: !value
|
|
796
|
+
})]
|
|
797
|
+
})
|
|
798
|
+
})]
|
|
799
|
+
})
|
|
795
800
|
})
|
|
796
|
-
})
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
})
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
})
|
|
801
|
+
}), !((_a = initialData.docs) == null ? void 0 : _a.length) || initialData.docs.length < 1 && /* @__PURE__ */jsx(Container, {
|
|
802
|
+
width: 1,
|
|
803
|
+
children: /* @__PURE__ */jsx(Card, {
|
|
804
|
+
padding: 5,
|
|
805
|
+
children: value ? "No Documents registered to the Schema match this query" : "Start with a valid GROQ query"
|
|
806
|
+
})
|
|
807
|
+
}), ((_b = initialData.docs) == null ? void 0 : _b.length) > 0 && /* @__PURE__ */jsx(Duplicator, {
|
|
808
|
+
docs: initialData.docs,
|
|
809
|
+
token,
|
|
810
|
+
pluginConfig
|
|
811
|
+
})]
|
|
812
|
+
})
|
|
808
813
|
})
|
|
809
814
|
});
|
|
810
815
|
}
|