@soppiya/app-bridge 1.1.2 → 1.1.4
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/dist/components/articles-picker/ui/ArticlesPicker.js +13 -7
- package/dist/components/blogs-picker/ui/BlogsPicker.js +13 -7
- package/dist/components/collections-pciker/ui/CollectionPicker.js +16 -10
- package/dist/components/collections-pciker/ui/CollectionPicker.stories.d.ts +1 -4
- package/dist/components/collections-pciker/ui/CollectionPicker.stories.js +1 -4
- package/dist/components/link-list-picker/ui/LinkListPicker.js +15 -9
- package/dist/components/meta-data/index.d.ts +1 -1
- package/dist/components/meta-data/ui/MetaData.d.ts +7 -5
- package/dist/components/meta-data/ui/MetaData.js +11 -16
- package/dist/components/meta-data/ui/MetaData.stories.js +15 -7
- package/dist/components/metafield-entries/api/query.d.ts +8 -0
- package/dist/components/metafield-entries/api/query.js +18 -0
- package/dist/components/metafield-entries/index.d.ts +0 -0
- package/dist/components/metafield-entries/index.js +0 -0
- package/dist/components/metafield-entries/model/useMetaobjectEntries.d.ts +25 -0
- package/dist/components/metafield-entries/model/useMetaobjectEntries.js +46 -0
- package/dist/components/metafield-entries/ui/MetaobjectEntries.d.ts +10 -0
- package/dist/components/metafield-entries/ui/MetaobjectEntries.js +108 -0
- package/dist/components/metafield-entries/ui/MetaobjectEntries.stories.d.ts +15 -0
- package/dist/components/metafield-entries/ui/MetaobjectEntries.stories.js +10 -0
- package/dist/components/pages-picker/ui/PagesPicker.js +19 -11
- package/dist/components/products-picker/ui/ProductPicker.js +16 -10
- package/dist/components/variants-picker/ui/VariantsPicker.js +13 -7
- package/dist/shared/graphql/gql.d.ts +5 -0
- package/dist/shared/graphql/gql.js +2 -1
- package/dist/shared/graphql/graphql.d.ts +29 -0
- package/dist/shared/graphql/graphql.js +299 -1
- package/dist/styles.css +12 -4
- package/package.json +1 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InfinityScroll } from "../../infinity-scroll/index.js";
|
|
3
|
+
import { useFilterQuery } from "../../../shared/lib/index.js";
|
|
4
|
+
import { BlockStack, Box, Button, Checkbox, InlineStack, Input, Modal, Spinner, Text } from "@soppiya/elementus";
|
|
5
|
+
import classnames from "classnames";
|
|
6
|
+
import lodash from "lodash";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { useMetaobjectEntries } from "../model/useMetaobjectEntries.js";
|
|
9
|
+
const MetaobjectEntries_MetaobjectEntries = ({ title = "Metaobject entries", initialIds = [], limit = 1 / 0, metaobjects = [], onClose, onOk })=>{
|
|
10
|
+
const [selectedMetaobjectEntries, setSelectedMetaobjectEntries] = useState(initialIds);
|
|
11
|
+
const { query, debounceQuery, onChangeQuery } = useFilterQuery();
|
|
12
|
+
const { metaobjectEntries, isLoadingMetaobjectEntries, fetchMoreMetaobjectEntries, pageInfo } = useMetaobjectEntries({
|
|
13
|
+
first: 20,
|
|
14
|
+
query: debounceQuery,
|
|
15
|
+
filterKeys: {
|
|
16
|
+
metaobjects: metaobjects ?? []
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const isReached = limit !== 1 / 0 && selectedMetaobjectEntries.length >= limit;
|
|
20
|
+
const isDisabled = limit !== 1 / 0 && selectedMetaobjectEntries.length > limit;
|
|
21
|
+
const handleSelectedMetaobjectEntries = (metaobjectEntryId)=>{
|
|
22
|
+
if (selectedMetaobjectEntries?.includes(metaobjectEntryId)) return void setSelectedMetaobjectEntries((prev)=>prev?.filter((id)=>metaobjectEntryId !== id));
|
|
23
|
+
if (isReached) return;
|
|
24
|
+
setSelectedMetaobjectEntries((prev)=>[
|
|
25
|
+
...prev,
|
|
26
|
+
metaobjectEntryId
|
|
27
|
+
]);
|
|
28
|
+
};
|
|
29
|
+
const handleOk = ()=>{
|
|
30
|
+
if (lodash.isFunction(onOk)) onOk(selectedMetaobjectEntries);
|
|
31
|
+
};
|
|
32
|
+
const ButtonJSX = /*#__PURE__*/ jsx(InlineStack, {
|
|
33
|
+
justifyContent: "end",
|
|
34
|
+
children: /*#__PURE__*/ jsx(Button, {
|
|
35
|
+
disabled: lodash.isEmpty(selectedMetaobjectEntries) || isDisabled,
|
|
36
|
+
onClick: handleOk,
|
|
37
|
+
children: "Add"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
return /*#__PURE__*/ jsx(Modal, {
|
|
41
|
+
open: true,
|
|
42
|
+
title: title,
|
|
43
|
+
bodyPadding: 0,
|
|
44
|
+
buttons: ButtonJSX,
|
|
45
|
+
onClose: onClose,
|
|
46
|
+
children: /*#__PURE__*/ jsxs(BlockStack, {
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ jsx(Box, {
|
|
49
|
+
padding: 60,
|
|
50
|
+
children: /*#__PURE__*/ jsx(Input, {
|
|
51
|
+
size: "sm",
|
|
52
|
+
type: "search",
|
|
53
|
+
value: query ?? "",
|
|
54
|
+
onChange: (event)=>onChangeQuery(event.target.value)
|
|
55
|
+
})
|
|
56
|
+
}),
|
|
57
|
+
isLoadingMetaobjectEntries ? /*#__PURE__*/ jsx(InlineStack, {
|
|
58
|
+
justifyContent: "center",
|
|
59
|
+
padding: 80,
|
|
60
|
+
children: /*#__PURE__*/ jsx(Spinner, {
|
|
61
|
+
size: "md"
|
|
62
|
+
})
|
|
63
|
+
}) : /*#__PURE__*/ jsxs(BlockStack, {
|
|
64
|
+
children: [
|
|
65
|
+
metaobjectEntries?.map((metaobjectEntry)=>/*#__PURE__*/ jsxs(InlineStack, {
|
|
66
|
+
stack: "full",
|
|
67
|
+
className: classnames('lg:cursor-pointer border-t border-t-[#ebebeb]!', {
|
|
68
|
+
'bg-[#f1f1f1ab] cursor-default!': !selectedMetaobjectEntries.includes(metaobjectEntry._id) && isReached
|
|
69
|
+
}),
|
|
70
|
+
gapX: 60,
|
|
71
|
+
padding: 60,
|
|
72
|
+
onClick: ()=>handleSelectedMetaobjectEntries(String(metaobjectEntry._id)),
|
|
73
|
+
children: [
|
|
74
|
+
/*#__PURE__*/ jsx(InlineStack, {
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
gapX: 60,
|
|
77
|
+
children: /*#__PURE__*/ jsx(Box, {
|
|
78
|
+
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
79
|
+
variant: "primary",
|
|
80
|
+
disabled: !selectedMetaobjectEntries.includes(metaobjectEntry._id) && isReached,
|
|
81
|
+
checked: selectedMetaobjectEntries.includes(String(metaobjectEntry._id)),
|
|
82
|
+
onChange: ()=>{}
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
}),
|
|
86
|
+
/*#__PURE__*/ jsx(BlockStack, {
|
|
87
|
+
gapY: 30,
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
90
|
+
size: "sm",
|
|
91
|
+
color: "secondary",
|
|
92
|
+
truncate: "truncate-1",
|
|
93
|
+
children: metaobjectEntry.title
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
}, metaobjectEntry._id)),
|
|
98
|
+
pageInfo?.hasNextPage && /*#__PURE__*/ jsx(InfinityScroll, {
|
|
99
|
+
onFetch: fetchMoreMetaobjectEntries
|
|
100
|
+
})
|
|
101
|
+
]
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
const MetaobjectEntries = MetaobjectEntries_MetaobjectEntries;
|
|
108
|
+
export { MetaobjectEntries as default };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare const meta: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: ({ title, initialIds, limit, metaobjects, onClose, onOk }: {
|
|
4
|
+
title?: string;
|
|
5
|
+
initialIds?: string[];
|
|
6
|
+
limit?: number;
|
|
7
|
+
metaobjects?: string[];
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onOk?: (linklist: string[]) => void;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export declare const Default: {
|
|
14
|
+
args: {};
|
|
15
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import MetaobjectEntries from "./MetaobjectEntries.js";
|
|
2
|
+
const meta = {
|
|
3
|
+
title: "Example/MetaobjectEntries",
|
|
4
|
+
component: MetaobjectEntries
|
|
5
|
+
};
|
|
6
|
+
const MetaobjectEntries_stories = meta;
|
|
7
|
+
const Default = {
|
|
8
|
+
args: {}
|
|
9
|
+
};
|
|
10
|
+
export { Default, MetaobjectEntries_stories as default };
|
|
@@ -2,18 +2,23 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { InfinityScroll } from "../../infinity-scroll/index.js";
|
|
3
3
|
import { useFilterQuery } from "../../../shared/lib/index.js";
|
|
4
4
|
import { BlockStack, Box, Button, Checkbox, Image, InlineStack, Input, Modal, Spinner, Text } from "@soppiya/elementus";
|
|
5
|
+
import classnames from "classnames";
|
|
5
6
|
import lodash from "lodash";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
import { usePages } from "../model/usePages.js";
|
|
8
|
-
const PagesPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>{
|
|
9
|
+
const PagesPicker = ({ title = "Pages", initialIds = [], limit = 1 / 0, onClose, onOk })=>{
|
|
9
10
|
const [selectedPage, setSelectedPage] = useState(initialIds);
|
|
10
11
|
const { query, debounceQuery, onChangeQuery } = useFilterQuery();
|
|
11
12
|
const { pages, fetchMorePages, isLoadingPages, pageInfo } = usePages({
|
|
12
13
|
first: 20,
|
|
13
14
|
query: debounceQuery
|
|
14
15
|
});
|
|
16
|
+
const isReached = limit !== 1 / 0 && selectedPage.length >= limit;
|
|
17
|
+
const isDisabled = limit !== 1 / 0 && selectedPage.length > limit;
|
|
15
18
|
const handleSelectedPage = (pageId)=>{
|
|
16
|
-
selectedPage
|
|
19
|
+
if (selectedPage?.includes(pageId)) return void setSelectedPage((prev)=>prev?.filter((id)=>pageId !== id));
|
|
20
|
+
if (isReached) return;
|
|
21
|
+
setSelectedPage((prev)=>[
|
|
17
22
|
...prev,
|
|
18
23
|
pageId
|
|
19
24
|
]);
|
|
@@ -24,20 +29,20 @@ const PagesPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>
|
|
|
24
29
|
const ButtonJSX = /*#__PURE__*/ jsx(InlineStack, {
|
|
25
30
|
justifyContent: "end",
|
|
26
31
|
children: /*#__PURE__*/ jsx(Button, {
|
|
32
|
+
disabled: lodash.isEmpty(selectedPage) || isDisabled,
|
|
27
33
|
onClick: handleOk,
|
|
28
34
|
children: "Add"
|
|
29
35
|
})
|
|
30
36
|
});
|
|
31
37
|
return /*#__PURE__*/ jsx(Modal, {
|
|
32
38
|
open: true,
|
|
33
|
-
title: title
|
|
39
|
+
title: title,
|
|
34
40
|
buttons: ButtonJSX,
|
|
35
41
|
bodyPadding: 0,
|
|
36
42
|
onClose: onClose,
|
|
37
43
|
children: /*#__PURE__*/ jsxs(BlockStack, {
|
|
38
44
|
children: [
|
|
39
45
|
/*#__PURE__*/ jsx(Box, {
|
|
40
|
-
className: "border-b border-b-[#ebebeb]! h",
|
|
41
46
|
padding: 60,
|
|
42
47
|
children: /*#__PURE__*/ jsx(Input, {
|
|
43
48
|
size: "sm",
|
|
@@ -54,12 +59,14 @@ const PagesPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>
|
|
|
54
59
|
})
|
|
55
60
|
}) : /*#__PURE__*/ jsxs(BlockStack, {
|
|
56
61
|
children: [
|
|
57
|
-
pages?.map((
|
|
62
|
+
pages?.map((page)=>/*#__PURE__*/ jsxs(InlineStack, {
|
|
58
63
|
stack: "full",
|
|
59
|
-
className:
|
|
64
|
+
className: classnames('lg:cursor-pointer border-t border-t-[#ebebeb]!', {
|
|
65
|
+
'bg-[#f1f1f1ab] cursor-default!': !selectedPage.includes(page._id) && isReached
|
|
66
|
+
}),
|
|
60
67
|
gapX: 60,
|
|
61
68
|
padding: 60,
|
|
62
|
-
onClick: ()=>handleSelectedPage(String(
|
|
69
|
+
onClick: ()=>handleSelectedPage(String(page._id)),
|
|
63
70
|
children: [
|
|
64
71
|
/*#__PURE__*/ jsxs(InlineStack, {
|
|
65
72
|
alignItems: "center",
|
|
@@ -67,14 +74,15 @@ const PagesPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>
|
|
|
67
74
|
children: [
|
|
68
75
|
/*#__PURE__*/ jsx(Box, {
|
|
69
76
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
70
|
-
|
|
77
|
+
disabled: !selectedPage.includes(page._id) && isReached,
|
|
78
|
+
checked: selectedPage.includes(String(page._id)),
|
|
71
79
|
onChange: ()=>{}
|
|
72
80
|
})
|
|
73
81
|
}),
|
|
74
82
|
/*#__PURE__*/ jsx(Box, {
|
|
75
83
|
children: /*#__PURE__*/ jsx(Image, {
|
|
76
84
|
size: "xs",
|
|
77
|
-
url: String(
|
|
85
|
+
url: String(page.image?.url)
|
|
78
86
|
})
|
|
79
87
|
})
|
|
80
88
|
]
|
|
@@ -86,11 +94,11 @@ const PagesPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>
|
|
|
86
94
|
size: "sm",
|
|
87
95
|
color: "secondary",
|
|
88
96
|
truncate: "truncate-1",
|
|
89
|
-
children:
|
|
97
|
+
children: page.title
|
|
90
98
|
})
|
|
91
99
|
})
|
|
92
100
|
]
|
|
93
|
-
},
|
|
101
|
+
}, page._id)),
|
|
94
102
|
pageInfo?.hasNextPage && /*#__PURE__*/ jsx(InfinityScroll, {
|
|
95
103
|
onFetch: fetchMorePages
|
|
96
104
|
})
|
|
@@ -2,45 +2,48 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { InfinityScroll } from "../../infinity-scroll/index.js";
|
|
3
3
|
import { useFilterQuery } from "../../../shared/lib/index.js";
|
|
4
4
|
import { BlockStack, Box, Button, Checkbox, Image, InlineStack, Input, Modal, Spinner, Text } from "@soppiya/elementus";
|
|
5
|
+
import classnames from "classnames";
|
|
5
6
|
import lodash from "lodash";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
import { useProducts } from "../model/useProducts.js";
|
|
8
|
-
const ProductsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>{
|
|
9
|
-
const [
|
|
9
|
+
const ProductsPicker = ({ title = "Products", initialIds = [], limit = 1 / 0, onClose, onOk })=>{
|
|
10
|
+
const [selectedProduct, setSelectedProduct] = useState(initialIds);
|
|
10
11
|
const { query, debounceQuery, onChangeQuery } = useFilterQuery();
|
|
11
12
|
const { products, pageInfo, isLoadingProducts, fetchMoreProducts } = useProducts({
|
|
12
13
|
first: 20,
|
|
13
14
|
query: debounceQuery
|
|
14
15
|
});
|
|
15
|
-
const
|
|
16
|
+
const isReached = limit !== 1 / 0 && selectedProduct.length >= limit;
|
|
17
|
+
const isDisabled = limit !== 1 / 0 && selectedProduct.length > limit;
|
|
16
18
|
const handleSelectVariant = (productId)=>{
|
|
17
|
-
|
|
19
|
+
if (selectedProduct?.includes(productId)) return void setSelectedProduct((prev)=>prev?.filter((id)=>productId !== id));
|
|
20
|
+
if (isReached) return;
|
|
21
|
+
setSelectedProduct((prev)=>[
|
|
18
22
|
...prev,
|
|
19
23
|
productId
|
|
20
24
|
]);
|
|
21
25
|
};
|
|
22
26
|
const handleOk = ()=>{
|
|
23
|
-
if (lodash.isFunction(onOk)) onOk(
|
|
27
|
+
if (lodash.isFunction(onOk)) onOk(selectedProduct);
|
|
24
28
|
};
|
|
25
29
|
const buttonsJSX = /*#__PURE__*/ jsx(InlineStack, {
|
|
26
30
|
gap: 50,
|
|
27
31
|
justifyContent: "end",
|
|
28
32
|
children: /*#__PURE__*/ jsx(Button, {
|
|
29
|
-
disabled: lodash.isEmpty(
|
|
33
|
+
disabled: lodash.isEmpty(selectedProduct) || isDisabled,
|
|
30
34
|
onClick: handleOk,
|
|
31
35
|
children: "Add"
|
|
32
36
|
})
|
|
33
37
|
});
|
|
34
38
|
return /*#__PURE__*/ jsx(Modal, {
|
|
35
39
|
open: true,
|
|
36
|
-
title: title
|
|
40
|
+
title: title,
|
|
37
41
|
bodyPadding: 0,
|
|
38
42
|
buttons: buttonsJSX,
|
|
39
43
|
onClose: onClose,
|
|
40
44
|
children: /*#__PURE__*/ jsxs(BlockStack, {
|
|
41
45
|
children: [
|
|
42
46
|
/*#__PURE__*/ jsx(Box, {
|
|
43
|
-
className: "border-b border-b-[#ebebeb]! h",
|
|
44
47
|
padding: 60,
|
|
45
48
|
children: /*#__PURE__*/ jsx(Input, {
|
|
46
49
|
size: "sm",
|
|
@@ -59,7 +62,9 @@ const ProductsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk }
|
|
|
59
62
|
children: [
|
|
60
63
|
products?.map((product)=>/*#__PURE__*/ jsxs(InlineStack, {
|
|
61
64
|
stack: "full",
|
|
62
|
-
className:
|
|
65
|
+
className: classnames('lg:cursor-pointer border-t border-t-[#ebebeb]!', {
|
|
66
|
+
'bg-[#f1f1f1ab] cursor-default!': !selectedProduct.includes(product._id) && isReached
|
|
67
|
+
}),
|
|
63
68
|
gapX: 60,
|
|
64
69
|
padding: 60,
|
|
65
70
|
onClick: ()=>handleSelectVariant(String(product._id)),
|
|
@@ -70,7 +75,8 @@ const ProductsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk }
|
|
|
70
75
|
children: [
|
|
71
76
|
/*#__PURE__*/ jsx(Box, {
|
|
72
77
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
73
|
-
|
|
78
|
+
disabled: !selectedProduct.includes(product._id) && isReached,
|
|
79
|
+
checked: selectedProduct.includes(String(product._id)),
|
|
74
80
|
onChange: ()=>{}
|
|
75
81
|
})
|
|
76
82
|
}),
|
|
@@ -2,19 +2,23 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { InfinityScroll } from "../../infinity-scroll/index.js";
|
|
3
3
|
import { useFilterQuery } from "../../../shared/lib/index.js";
|
|
4
4
|
import { Badge, BlockStack, Box, Button, Checkbox, Image, InlineStack, Input, Modal, Spinner, Text } from "@soppiya/elementus";
|
|
5
|
+
import classnames from "classnames";
|
|
5
6
|
import lodash from "lodash";
|
|
6
7
|
import { useState } from "react";
|
|
7
8
|
import { useVariants } from "../model/useVariants.js";
|
|
8
|
-
const VariantsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk })=>{
|
|
9
|
+
const VariantsPicker = ({ title = "Variants", initialIds = [], limit = 1 / 0, onClose, onOk })=>{
|
|
9
10
|
const [selectedVariant, setSelectedVariant] = useState(initialIds);
|
|
10
11
|
const { query, debounceQuery, onChangeQuery } = useFilterQuery();
|
|
11
12
|
const { variants, pageInfo, isLoadingVariants, fetchMoreVariants } = useVariants({
|
|
12
13
|
first: 20,
|
|
13
14
|
query: debounceQuery
|
|
14
15
|
});
|
|
15
|
-
const
|
|
16
|
+
const isReached = limit !== 1 / 0 && selectedVariant.length >= limit;
|
|
17
|
+
const isDisabled = limit !== 1 / 0 && selectedVariant.length > limit;
|
|
16
18
|
const handleSelectVariant = (variantId)=>{
|
|
17
|
-
selectedVariant.includes(variantId)
|
|
19
|
+
if (selectedVariant.includes(variantId)) setSelectedVariant((prev)=>prev.filter((id)=>variantId !== id));
|
|
20
|
+
if (isReached) return;
|
|
21
|
+
setSelectedVariant((prev)=>[
|
|
18
22
|
...prev,
|
|
19
23
|
variantId
|
|
20
24
|
]);
|
|
@@ -26,21 +30,20 @@ const VariantsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk }
|
|
|
26
30
|
gap: 50,
|
|
27
31
|
justifyContent: "end",
|
|
28
32
|
children: /*#__PURE__*/ jsx(Button, {
|
|
29
|
-
disabled: lodash.isEmpty(selectedVariant) ||
|
|
33
|
+
disabled: lodash.isEmpty(selectedVariant) || isDisabled,
|
|
30
34
|
onClick: handleOk,
|
|
31
35
|
children: "Add"
|
|
32
36
|
})
|
|
33
37
|
});
|
|
34
38
|
return /*#__PURE__*/ jsx(Modal, {
|
|
35
39
|
open: true,
|
|
36
|
-
title: title
|
|
40
|
+
title: title,
|
|
37
41
|
bodyPadding: 0,
|
|
38
42
|
buttons: buttonsJSX,
|
|
39
43
|
onClose: onClose,
|
|
40
44
|
children: /*#__PURE__*/ jsxs(BlockStack, {
|
|
41
45
|
children: [
|
|
42
46
|
/*#__PURE__*/ jsx(Box, {
|
|
43
|
-
className: "border-b border-b-[#ebebeb]! h",
|
|
44
47
|
padding: 60,
|
|
45
48
|
children: /*#__PURE__*/ jsx(Input, {
|
|
46
49
|
size: "sm",
|
|
@@ -59,7 +62,9 @@ const VariantsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk }
|
|
|
59
62
|
children: [
|
|
60
63
|
variants.map((variant)=>/*#__PURE__*/ jsxs(InlineStack, {
|
|
61
64
|
stack: "full",
|
|
62
|
-
className:
|
|
65
|
+
className: classnames('lg:cursor-pointer border-t border-t-[#ebebeb]!', {
|
|
66
|
+
'bg-[#f1f1f1ab] cursor-default!': !selectedVariant.includes(variant._id) && isReached
|
|
67
|
+
}),
|
|
63
68
|
gapX: 60,
|
|
64
69
|
padding: 60,
|
|
65
70
|
onClick: ()=>handleSelectVariant(String(variant._id)),
|
|
@@ -70,6 +75,7 @@ const VariantsPicker = ({ title, initialIds = [], limit = 1 / 0, onClose, onOk }
|
|
|
70
75
|
children: [
|
|
71
76
|
/*#__PURE__*/ jsx(Box, {
|
|
72
77
|
children: /*#__PURE__*/ jsx(Checkbox, {
|
|
78
|
+
disabled: !selectedVariant.includes(variant._id) && isReached,
|
|
73
79
|
checked: selectedVariant.includes(String(variant._id)),
|
|
74
80
|
onChange: ()=>{}
|
|
75
81
|
})
|
|
@@ -22,6 +22,7 @@ type Documents = {
|
|
|
22
22
|
"\n mutation AddMedias($input: [Upload!]!) {\n addMedias(input: $input) {\n _id\n file_name\n url\n size\n }\n }\n": typeof types.AddMediasDocument;
|
|
23
23
|
"\n mutation DeleteMedias($cursors: [ID!]!) {\n deleteMedias(cursors: $cursors) {\n message\n }\n }\n": typeof types.DeleteMediasDocument;
|
|
24
24
|
"query Metafields($filterKeys: MetafieldFilterKeys, $first: Int) {\n metafields(filterKeys: $filterKeys, first: $first) {\n edges {\n node {\n _id\n entry\n name\n type\n }\n }\n }\n}": typeof types.MetafieldsDocument;
|
|
25
|
+
"query MetaobjectEntries($after: ID, $before: ID, $first: Int, $last: Int, $query: String, $filterKeys: MetaobjectEntryFilterKeys) {\n metaobjectEntries(after: $after, before: $before, first: $first, last: $last, query: $query, filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n }\n }\n }\n}": typeof types.MetaobjectEntriesDocument;
|
|
25
26
|
"query Pages($filterKeys: PageFilterKeys, $after: ID, $before: ID, $first: Int, $last: Int, $query: String) {\n pages(filterKeys: $filterKeys, after: $after, before: $before, first: $first, last: $last, query: $query) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n}": typeof types.PagesDocument;
|
|
26
27
|
"\n query Products($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: ProductFilterKeys) {\n products(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n }\n": typeof types.ProductsDocument;
|
|
27
28
|
"\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n": typeof types.VariantsDocument;
|
|
@@ -80,6 +81,10 @@ export declare function graphql(source: "\n mutation DeleteMedias($cursors: [ID
|
|
|
80
81
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
81
82
|
*/
|
|
82
83
|
export declare function graphql(source: "query Metafields($filterKeys: MetafieldFilterKeys, $first: Int) {\n metafields(filterKeys: $filterKeys, first: $first) {\n edges {\n node {\n _id\n entry\n name\n type\n }\n }\n }\n}"): (typeof documents)["query Metafields($filterKeys: MetafieldFilterKeys, $first: Int) {\n metafields(filterKeys: $filterKeys, first: $first) {\n edges {\n node {\n _id\n entry\n name\n type\n }\n }\n }\n}"];
|
|
84
|
+
/**
|
|
85
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
86
|
+
*/
|
|
87
|
+
export declare function graphql(source: "query MetaobjectEntries($after: ID, $before: ID, $first: Int, $last: Int, $query: String, $filterKeys: MetaobjectEntryFilterKeys) {\n metaobjectEntries(after: $after, before: $before, first: $first, last: $last, query: $query, filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n }\n }\n }\n}"): (typeof documents)["query MetaobjectEntries($after: ID, $before: ID, $first: Int, $last: Int, $query: String, $filterKeys: MetaobjectEntryFilterKeys) {\n metaobjectEntries(after: $after, before: $before, first: $first, last: $last, query: $query, filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n }\n }\n }\n}"];
|
|
83
88
|
/**
|
|
84
89
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
85
90
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddMediasDocument, ArticlesDocument, BlogsDocument, CollectionsDocument, DeleteMediasDocument, LinklistsDocument, MediaUsageDocument, MediasDocument, MetafieldsDocument, PagesDocument, ProductsDocument, StoragePlanDocument, VariantsDocument } from "./graphql.js";
|
|
1
|
+
import { AddMediasDocument, ArticlesDocument, BlogsDocument, CollectionsDocument, DeleteMediasDocument, LinklistsDocument, MediaUsageDocument, MediasDocument, MetafieldsDocument, MetaobjectEntriesDocument, PagesDocument, ProductsDocument, StoragePlanDocument, VariantsDocument } from "./graphql.js";
|
|
2
2
|
const documents = {
|
|
3
3
|
"query Articles($filterKeys: ArticleFilterKeys, $after: ID, $before: ID, $first: Int, $last: Int, $query: String) {\n articles(filterKeys: $filterKeys, after: $after, before: $before, first: $first, last: $last, query: $query) {\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n }\n}": ArticlesDocument,
|
|
4
4
|
"query Blogs($filterKeys: BlogFilterKeys, $after: ID, $before: ID, $first: Int, $last: Int, $query: String) {\n blogs(filterKeys: $filterKeys, after: $after, before: $before, first: $first, last: $last, query: $query) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n}": BlogsDocument,
|
|
@@ -10,6 +10,7 @@ const documents = {
|
|
|
10
10
|
"\n mutation AddMedias($input: [Upload!]!) {\n addMedias(input: $input) {\n _id\n file_name\n url\n size\n }\n }\n": AddMediasDocument,
|
|
11
11
|
"\n mutation DeleteMedias($cursors: [ID!]!) {\n deleteMedias(cursors: $cursors) {\n message\n }\n }\n": DeleteMediasDocument,
|
|
12
12
|
"query Metafields($filterKeys: MetafieldFilterKeys, $first: Int) {\n metafields(filterKeys: $filterKeys, first: $first) {\n edges {\n node {\n _id\n entry\n name\n type\n }\n }\n }\n}": MetafieldsDocument,
|
|
13
|
+
"query MetaobjectEntries($after: ID, $before: ID, $first: Int, $last: Int, $query: String, $filterKeys: MetaobjectEntryFilterKeys) {\n metaobjectEntries(after: $after, before: $before, first: $first, last: $last, query: $query, filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n }\n }\n }\n}": MetaobjectEntriesDocument,
|
|
13
14
|
"query Pages($filterKeys: PageFilterKeys, $after: ID, $before: ID, $first: Int, $last: Int, $query: String) {\n pages(filterKeys: $filterKeys, after: $after, before: $before, first: $first, last: $last, query: $query) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n}": PagesDocument,
|
|
14
15
|
"\n query Products($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: ProductFilterKeys) {\n products(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n title\n image {\n _id\n url\n }\n }\n }\n }\n }\n": ProductsDocument,
|
|
15
16
|
"\n query Variants($after: ID, $before: ID, $first: Int, $last: Int, $query: String,$filterKeys: VariantFilterKeys) {\n variants(after: $after, before: $before, first: $first, last: $last, query: $query,filterKeys: $filterKeys) {\n pageInfo {\n endCursor\n hasNextPage\n hasPreviousPage\n startCursor\n }\n edges {\n node {\n _id\n option1\n option2\n option3\n image {\n _id\n url\n }\n product {\n _id\n title\n }\n }\n }\n }\n }\n": VariantsDocument
|
|
@@ -6736,6 +6736,34 @@ export type MetafieldsQuery = {
|
|
|
6736
6736
|
} | null> | null;
|
|
6737
6737
|
} | null;
|
|
6738
6738
|
};
|
|
6739
|
+
export type MetaobjectEntriesQueryVariables = Exact<{
|
|
6740
|
+
after?: InputMaybe<Scalars['ID']['input']>;
|
|
6741
|
+
before?: InputMaybe<Scalars['ID']['input']>;
|
|
6742
|
+
first?: InputMaybe<Scalars['Int']['input']>;
|
|
6743
|
+
last?: InputMaybe<Scalars['Int']['input']>;
|
|
6744
|
+
query?: InputMaybe<Scalars['String']['input']>;
|
|
6745
|
+
filterKeys?: InputMaybe<MetaobjectEntryFilterKeys>;
|
|
6746
|
+
}>;
|
|
6747
|
+
export type MetaobjectEntriesQuery = {
|
|
6748
|
+
metaobjectEntries?: {
|
|
6749
|
+
__typename: 'MetaobjectEntryConnection';
|
|
6750
|
+
pageInfo?: {
|
|
6751
|
+
__typename: 'PageInfo';
|
|
6752
|
+
endCursor?: string | null;
|
|
6753
|
+
hasNextPage?: boolean | null;
|
|
6754
|
+
hasPreviousPage?: boolean | null;
|
|
6755
|
+
startCursor?: string | null;
|
|
6756
|
+
} | null;
|
|
6757
|
+
edges?: Array<{
|
|
6758
|
+
__typename: 'MetaobjectEntryEdge';
|
|
6759
|
+
node?: {
|
|
6760
|
+
__typename: 'MetaobjectEntry';
|
|
6761
|
+
_id?: string | null;
|
|
6762
|
+
title?: string | null;
|
|
6763
|
+
} | null;
|
|
6764
|
+
} | null> | null;
|
|
6765
|
+
} | null;
|
|
6766
|
+
};
|
|
6739
6767
|
export type PagesQueryVariables = Exact<{
|
|
6740
6768
|
filterKeys?: InputMaybe<PageFilterKeys>;
|
|
6741
6769
|
after?: InputMaybe<Scalars['ID']['input']>;
|
|
@@ -6852,6 +6880,7 @@ export declare const MediaUsageDocument: DocumentNode<MediaUsageQuery, MediaUsag
|
|
|
6852
6880
|
export declare const AddMediasDocument: DocumentNode<AddMediasMutation, AddMediasMutationVariables>;
|
|
6853
6881
|
export declare const DeleteMediasDocument: DocumentNode<DeleteMediasMutation, DeleteMediasMutationVariables>;
|
|
6854
6882
|
export declare const MetafieldsDocument: DocumentNode<MetafieldsQuery, MetafieldsQueryVariables>;
|
|
6883
|
+
export declare const MetaobjectEntriesDocument: DocumentNode<MetaobjectEntriesQuery, MetaobjectEntriesQueryVariables>;
|
|
6855
6884
|
export declare const PagesDocument: DocumentNode<PagesQuery, PagesQueryVariables>;
|
|
6856
6885
|
export declare const ProductsDocument: DocumentNode<ProductsQuery, ProductsQueryVariables>;
|
|
6857
6886
|
export declare const VariantsDocument: DocumentNode<VariantsQuery, VariantsQueryVariables>;
|