@timardex/cluemart-shared 1.0.73 → 1.0.75
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/formFields/index.cjs +21 -14
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.d.mts +2 -2
- package/dist/formFields/index.d.ts +2 -2
- package/dist/formFields/index.mjs +21 -14
- package/dist/formFields/index.mjs.map +1 -1
- package/dist/{global-Dqtku_n8.d.mts → global-2TLPFthS.d.mts} +2 -1
- package/dist/{global-Cpfu9Dud.d.ts → global-Drk9CYfv.d.ts} +2 -1
- package/dist/graphql/index.cjs +8 -9
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +1 -1
- package/dist/graphql/index.d.ts +1 -1
- package/dist/graphql/index.mjs +8 -9
- package/dist/graphql/index.mjs.map +1 -1
- package/dist/hooks/index.cjs +23 -22
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +23 -22
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +52 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +52 -45
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -384,7 +384,8 @@ interface Subcategory {
|
|
|
384
384
|
items?: SubcategoryItems[] | null;
|
|
385
385
|
}
|
|
386
386
|
interface Category {
|
|
387
|
-
|
|
387
|
+
color?: string | null;
|
|
388
|
+
description?: string | null;
|
|
388
389
|
id: string;
|
|
389
390
|
name: string;
|
|
390
391
|
subcategories: Subcategory[];
|
|
@@ -632,8 +633,8 @@ declare const validateVerificationTokenFields: FormField[];
|
|
|
632
633
|
|
|
633
634
|
declare const profileFields: FormField[];
|
|
634
635
|
|
|
635
|
-
declare const availableCategories: Category[];
|
|
636
636
|
declare const categoryColors: Record<string, string>;
|
|
637
|
+
declare const availableCategories: Category[];
|
|
637
638
|
|
|
638
639
|
declare const socialMediaFields: FormField[];
|
|
639
640
|
|
package/dist/index.d.ts
CHANGED
|
@@ -384,7 +384,8 @@ interface Subcategory {
|
|
|
384
384
|
items?: SubcategoryItems[] | null;
|
|
385
385
|
}
|
|
386
386
|
interface Category {
|
|
387
|
-
|
|
387
|
+
color?: string | null;
|
|
388
|
+
description?: string | null;
|
|
388
389
|
id: string;
|
|
389
390
|
name: string;
|
|
390
391
|
subcategories: Subcategory[];
|
|
@@ -632,8 +633,8 @@ declare const validateVerificationTokenFields: FormField[];
|
|
|
632
633
|
|
|
633
634
|
declare const profileFields: FormField[];
|
|
634
635
|
|
|
635
|
-
declare const availableCategories: Category[];
|
|
636
636
|
declare const categoryColors: Record<string, string>;
|
|
637
|
+
declare const availableCategories: Category[];
|
|
637
638
|
|
|
638
639
|
declare const socialMediaFields: FormField[];
|
|
639
640
|
|
package/dist/index.mjs
CHANGED
|
@@ -824,6 +824,25 @@ var profileFields = [
|
|
|
824
824
|
];
|
|
825
825
|
|
|
826
826
|
// src/formFields/categories.ts
|
|
827
|
+
var categoryColors = {
|
|
828
|
+
"antiques-collectibles": "#8D6748",
|
|
829
|
+
"clothing-fashion": "#9D4EDD",
|
|
830
|
+
"electronics-technology": "#3AF3FF",
|
|
831
|
+
"food-beverages": "#FF0D1F",
|
|
832
|
+
"handmade-local-products": "#EE7E54",
|
|
833
|
+
"health-wellness": "#E23794",
|
|
834
|
+
"home-garden-household-goods": "#067325",
|
|
835
|
+
"pet-products-animal-goods": "#68E788",
|
|
836
|
+
"services-experiences": "#2E16A5",
|
|
837
|
+
"toys-childrens-items": "#FFF966"
|
|
838
|
+
};
|
|
839
|
+
var assignColorToCategories = (categories) => {
|
|
840
|
+
const result = categories.map((category) => ({
|
|
841
|
+
...category,
|
|
842
|
+
color: categoryColors[category.id]
|
|
843
|
+
}));
|
|
844
|
+
return result;
|
|
845
|
+
};
|
|
827
846
|
var foodAndBeverages = [
|
|
828
847
|
{
|
|
829
848
|
id: "food-beverages",
|
|
@@ -1673,7 +1692,7 @@ var serviceAndExperience = [
|
|
|
1673
1692
|
]
|
|
1674
1693
|
}
|
|
1675
1694
|
];
|
|
1676
|
-
var availableCategories = [
|
|
1695
|
+
var availableCategories = assignColorToCategories([
|
|
1677
1696
|
...foodAndBeverages,
|
|
1678
1697
|
...handmadeAndLocalProducts,
|
|
1679
1698
|
...clothingAndFashion,
|
|
@@ -1684,19 +1703,7 @@ var availableCategories = [
|
|
|
1684
1703
|
...antiquesAndCollectibles,
|
|
1685
1704
|
...petProductsAndAnimalGoods,
|
|
1686
1705
|
...serviceAndExperience
|
|
1687
|
-
];
|
|
1688
|
-
var categoryColors = {
|
|
1689
|
-
"antiques-collectibles": "#8D6748",
|
|
1690
|
-
"clothing-fashion": "#9D4EDD",
|
|
1691
|
-
"electronics-technology": "#3AF3FF",
|
|
1692
|
-
"food-beverages": "#FF0D1F",
|
|
1693
|
-
"handmade-local-products": "#EE7E54",
|
|
1694
|
-
"health-wellness": "#E23794",
|
|
1695
|
-
"home-garden-household-goods": "#067325",
|
|
1696
|
-
"pet-products-animal-goods": "#68E788",
|
|
1697
|
-
"services-experiences": "#2E16A5",
|
|
1698
|
-
"toys-childrens-items": "#FFF966"
|
|
1699
|
-
};
|
|
1706
|
+
]);
|
|
1700
1707
|
|
|
1701
1708
|
// src/formFields/socialMedia.ts
|
|
1702
1709
|
var socialMedia = [
|
|
@@ -2600,7 +2607,7 @@ var useCreateMarket = () => {
|
|
|
2600
2607
|
CREATE_MARKET_MUTATION,
|
|
2601
2608
|
{
|
|
2602
2609
|
awaitRefetchQueries: true,
|
|
2603
|
-
refetchQueries: [{
|
|
2610
|
+
refetchQueries: [{ fetchPolicy: "no-cache", query: GET_USER_MARKETS }]
|
|
2604
2611
|
}
|
|
2605
2612
|
);
|
|
2606
2613
|
return { createMarket, error, loading };
|
|
@@ -2610,7 +2617,7 @@ var useUpdateMarket = () => {
|
|
|
2610
2617
|
UPDATE_MARKET_MUTATION,
|
|
2611
2618
|
{
|
|
2612
2619
|
awaitRefetchQueries: true,
|
|
2613
|
-
refetchQueries: [{
|
|
2620
|
+
refetchQueries: [{ fetchPolicy: "no-cache", query: GET_USER_MARKETS }]
|
|
2614
2621
|
}
|
|
2615
2622
|
);
|
|
2616
2623
|
return { error, loading, updateMarket };
|
|
@@ -2620,7 +2627,7 @@ var useDeleteMarket = () => {
|
|
|
2620
2627
|
DELETE_MARKET_MUTATION,
|
|
2621
2628
|
{
|
|
2622
2629
|
awaitRefetchQueries: true,
|
|
2623
|
-
refetchQueries: [{
|
|
2630
|
+
refetchQueries: [{ fetchPolicy: "no-cache", query: GET_USER_MARKETS }]
|
|
2624
2631
|
}
|
|
2625
2632
|
);
|
|
2626
2633
|
return { deleteMarket, error, loading };
|
|
@@ -2640,6 +2647,7 @@ var useCreateMarketInfo = () => {
|
|
|
2640
2647
|
// Pass the marketId for refetching
|
|
2641
2648
|
},
|
|
2642
2649
|
{
|
|
2650
|
+
fetchPolicy: "no-cache",
|
|
2643
2651
|
query: GET_MARKET,
|
|
2644
2652
|
variables: { _id: marketId }
|
|
2645
2653
|
// Pass the marketId for refetching
|
|
@@ -3212,8 +3220,7 @@ var useCreateStallholder = () => {
|
|
|
3212
3220
|
{
|
|
3213
3221
|
awaitRefetchQueries: true,
|
|
3214
3222
|
refetchQueries: [
|
|
3215
|
-
{ query:
|
|
3216
|
-
{ query: GET_USER_STALLHOLDER }
|
|
3223
|
+
{ fetchPolicy: "no-cache", query: GET_USER_STALLHOLDER }
|
|
3217
3224
|
]
|
|
3218
3225
|
}
|
|
3219
3226
|
);
|
|
@@ -3225,8 +3232,7 @@ var useUpdateStallholder = () => {
|
|
|
3225
3232
|
{
|
|
3226
3233
|
awaitRefetchQueries: true,
|
|
3227
3234
|
refetchQueries: [
|
|
3228
|
-
{ query:
|
|
3229
|
-
{ query: GET_USER_STALLHOLDER }
|
|
3235
|
+
{ fetchPolicy: "no-cache", query: GET_USER_STALLHOLDER }
|
|
3230
3236
|
]
|
|
3231
3237
|
}
|
|
3232
3238
|
);
|
|
@@ -3238,8 +3244,7 @@ var useDeleteStallholder = () => {
|
|
|
3238
3244
|
{
|
|
3239
3245
|
awaitRefetchQueries: true,
|
|
3240
3246
|
refetchQueries: [
|
|
3241
|
-
{ query:
|
|
3242
|
-
{ query: GET_USER_STALLHOLDER }
|
|
3247
|
+
{ fetchPolicy: "no-cache", query: GET_USER_STALLHOLDER }
|
|
3243
3248
|
]
|
|
3244
3249
|
}
|
|
3245
3250
|
);
|
|
@@ -3260,6 +3265,7 @@ var useCreateStallholderInfo = () => {
|
|
|
3260
3265
|
// Pass the stallholderId for refetching
|
|
3261
3266
|
},
|
|
3262
3267
|
{
|
|
3268
|
+
fetchPolicy: "no-cache",
|
|
3263
3269
|
query: GET_USER_STALLHOLDER
|
|
3264
3270
|
}
|
|
3265
3271
|
];
|
|
@@ -3886,6 +3892,24 @@ var globalResourceSchema = yup.object().shape({
|
|
|
3886
3892
|
region: yup.string().label("Region").required("Region is required"),
|
|
3887
3893
|
socialMedia: yup.array().of(socialMediaSchema).nullable().optional()
|
|
3888
3894
|
});
|
|
3895
|
+
var categorySchema = yup.array().of(
|
|
3896
|
+
yup.object().shape({
|
|
3897
|
+
id: yup.string().required("Category id is required"),
|
|
3898
|
+
name: yup.string().required("Category name is required"),
|
|
3899
|
+
subcategories: yup.array().of(
|
|
3900
|
+
yup.object().shape({
|
|
3901
|
+
id: yup.string().defined(),
|
|
3902
|
+
items: yup.array().of(
|
|
3903
|
+
yup.object().shape({
|
|
3904
|
+
id: yup.string().defined(),
|
|
3905
|
+
name: yup.string().defined()
|
|
3906
|
+
})
|
|
3907
|
+
).nullable(),
|
|
3908
|
+
name: yup.string().defined()
|
|
3909
|
+
})
|
|
3910
|
+
).min(1, "At least one subcategory is required").required("Subcategories are required")
|
|
3911
|
+
})
|
|
3912
|
+
).min(1, "Category list must contain at least one item").required("Categories are required");
|
|
3889
3913
|
|
|
3890
3914
|
// src/yupSchema/market.ts
|
|
3891
3915
|
import * as yup2 from "yup";
|
|
@@ -3945,24 +3969,7 @@ var marketInfoSchema = yup2.object().shape({
|
|
|
3945
3969
|
// src/yupSchema/stallholder.ts
|
|
3946
3970
|
import * as yup3 from "yup";
|
|
3947
3971
|
var stallHolderSchema = globalResourceSchema.shape({
|
|
3948
|
-
categories:
|
|
3949
|
-
yup3.object().shape({
|
|
3950
|
-
id: yup3.string().required("Category id is required"),
|
|
3951
|
-
name: yup3.string().required("Category name is required"),
|
|
3952
|
-
subcategories: yup3.array().of(
|
|
3953
|
-
yup3.object().shape({
|
|
3954
|
-
id: yup3.string().defined(),
|
|
3955
|
-
items: yup3.array().of(
|
|
3956
|
-
yup3.object().shape({
|
|
3957
|
-
id: yup3.string().defined(),
|
|
3958
|
-
name: yup3.string().defined()
|
|
3959
|
-
})
|
|
3960
|
-
).nullable(),
|
|
3961
|
-
name: yup3.string().defined()
|
|
3962
|
-
})
|
|
3963
|
-
).min(1, "At least one subcategory is required").required("Subcategories are required")
|
|
3964
|
-
})
|
|
3965
|
-
).min(1, "Category list must contain at least one item").required("Categories are required"),
|
|
3972
|
+
categories: categorySchema,
|
|
3966
3973
|
multiLocation: yup3.boolean().required("Multi location is required"),
|
|
3967
3974
|
products: yup3.array().of(yup3.string().defined()).min(1, "Product list must contain at least one item").required("Products are required")
|
|
3968
3975
|
});
|
|
@@ -4087,15 +4094,15 @@ var defaultMarketFormValues = {
|
|
|
4087
4094
|
...globalDefaultValues,
|
|
4088
4095
|
dateTime: [
|
|
4089
4096
|
{
|
|
4090
|
-
endDate: "04-
|
|
4097
|
+
endDate: "04-09-2025",
|
|
4091
4098
|
endTime: "15:00",
|
|
4092
|
-
startDate: "04-
|
|
4099
|
+
startDate: "04-09-2025",
|
|
4093
4100
|
startTime: "09:00"
|
|
4094
4101
|
},
|
|
4095
4102
|
{
|
|
4096
|
-
endDate: "05-
|
|
4103
|
+
endDate: "05-09-2025",
|
|
4097
4104
|
endTime: "15:00",
|
|
4098
|
-
startDate: "05-
|
|
4105
|
+
startDate: "05-09-2025",
|
|
4099
4106
|
startTime: "09:00"
|
|
4100
4107
|
}
|
|
4101
4108
|
],
|