@timardex/cluemart-shared 1.3.0 → 1.3.11

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 (38) hide show
  1. package/dist/{auth-DlXdCHFm.d.mts → auth-DpfaLmTU.d.mts} +1 -1
  2. package/dist/{auth-B1G5QrD2.d.ts → auth-xXqB6t_8.d.ts} +1 -1
  3. package/dist/{chunk-3ZDDQGW4.mjs → chunk-Y3MIKYGQ.mjs} +20 -2
  4. package/dist/chunk-Y3MIKYGQ.mjs.map +1 -0
  5. package/dist/formFields/index.d.mts +1 -1
  6. package/dist/formFields/index.d.ts +1 -1
  7. package/dist/{global-DabCYr5t.d.ts → global-DSwmP6sp.d.ts} +1 -3
  8. package/dist/{global-B3lGLGxH.d.mts → global-O7RsWypG.d.mts} +1 -3
  9. package/dist/graphql/index.cjs +143 -0
  10. package/dist/graphql/index.cjs.map +1 -1
  11. package/dist/graphql/index.d.mts +36 -3
  12. package/dist/graphql/index.d.ts +36 -3
  13. package/dist/graphql/index.mjs +138 -0
  14. package/dist/graphql/index.mjs.map +1 -1
  15. package/dist/hooks/index.cjs +140 -5
  16. package/dist/hooks/index.cjs.map +1 -1
  17. package/dist/hooks/index.d.mts +6 -4
  18. package/dist/hooks/index.d.ts +6 -4
  19. package/dist/hooks/index.mjs +124 -6
  20. package/dist/hooks/index.mjs.map +1 -1
  21. package/dist/index.cjs +287 -5
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.d.mts +100 -4
  24. package/dist/index.d.ts +100 -4
  25. package/dist/index.mjs +279 -5
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{ad-j0VWBCVE.d.ts → post-Df5kAhEE.d.ts} +65 -2
  28. package/dist/{ad-Cld9z55n.d.mts → post-tVcpbEDX.d.mts} +65 -2
  29. package/dist/types/index.cjs +20 -0
  30. package/dist/types/index.cjs.map +1 -1
  31. package/dist/types/index.d.mts +3 -3
  32. package/dist/types/index.d.ts +3 -3
  33. package/dist/types/index.mjs +5 -1
  34. package/dist/types/index.mjs.map +1 -1
  35. package/dist/utils/index.d.mts +1 -1
  36. package/dist/utils/index.d.ts +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-3ZDDQGW4.mjs.map +0 -1
@@ -44,6 +44,7 @@ __export(hooks_exports, {
44
44
  useLocationSearch: () => useLocationSearch,
45
45
  useLoginForm: () => useLoginForm,
46
46
  usePartnerForm: () => usePartnerForm,
47
+ usePostform: () => usePostform,
47
48
  useRegisterForm: () => useRegisterForm,
48
49
  useRequestPasswordResetForm: () => useRequestPasswordResetForm,
49
50
  useResetPasswordForm: () => useResetPasswordForm,
@@ -859,6 +860,87 @@ var partnerSchema = globalResourceSchema.shape({
859
860
  partnerType: yup8.mixed().oneOf(Object.values(EnumPartnerType)).required("Please select a Partner type")
860
861
  });
861
862
 
863
+ // src/yupSchema/post.ts
864
+ var yup9 = __toESM(require("yup"));
865
+
866
+ // src/types/post.ts
867
+ var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
868
+ EnumPostType2["DAILY_MEETS"] = "daily_meets";
869
+ EnumPostType2["DAILY_TIPS"] = "daily_tips";
870
+ EnumPostType2["DAILY_POLL"] = "daily_poll";
871
+ return EnumPostType2;
872
+ })(EnumPostType || {});
873
+ var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
874
+ EnumPostContentType2["COVER"] = "cover";
875
+ EnumPostContentType2["IMAGE"] = "image";
876
+ EnumPostContentType2["LIST"] = "list";
877
+ EnumPostContentType2["TEXTAREA"] = "textarea";
878
+ EnumPostContentType2["VIDEO"] = "video";
879
+ return EnumPostContentType2;
880
+ })(EnumPostContentType || {});
881
+
882
+ // src/yupSchema/post.ts
883
+ var coverContentSchema = yup9.object({
884
+ cover: yup9.object({
885
+ source: yup9.string().required("Cover source is required"),
886
+ title: yup9.string().required("Cover title is required")
887
+ }).required()
888
+ });
889
+ var textareaContentSchema = yup9.object({
890
+ textarea: yup9.object({
891
+ data: yup9.string().required("Textarea content is required"),
892
+ title: yup9.string().optional()
893
+ }).required()
894
+ });
895
+ var imagesContentSchema = yup9.object({
896
+ images: yup9.array().of(
897
+ yup9.object({
898
+ source: yup9.string().required("Image source is required"),
899
+ title: yup9.string().required("Image title is required")
900
+ })
901
+ ).nullable()
902
+ });
903
+ var videoContentSchema = yup9.object({
904
+ video: yup9.object({
905
+ source: yup9.string().required("Video source is required"),
906
+ title: yup9.string().optional()
907
+ }).required()
908
+ });
909
+ var listContentSchema = yup9.object({
910
+ list: yup9.object({
911
+ items: yup9.array().of(yup9.string().required()).min(1, "List must contain at least one item").required(),
912
+ title: yup9.string().optional()
913
+ }).required()
914
+ });
915
+ var contentDataSchema = yup9.lazy((_, options) => {
916
+ const contentType = options.parent?.contentType;
917
+ switch (contentType) {
918
+ case "cover" /* COVER */:
919
+ return coverContentSchema;
920
+ case "textarea" /* TEXTAREA */:
921
+ return textareaContentSchema;
922
+ case "image" /* IMAGE */:
923
+ return imagesContentSchema;
924
+ case "video" /* VIDEO */:
925
+ return videoContentSchema;
926
+ case "list" /* LIST */:
927
+ return listContentSchema;
928
+ default:
929
+ return yup9.mixed().required();
930
+ }
931
+ });
932
+ var postContentSchema = yup9.object().shape({
933
+ contentData: contentDataSchema.required(),
934
+ contentOrder: yup9.number().min(0).required(),
935
+ contentType: yup9.mixed().oneOf(Object.values(EnumPostContentType)).required()
936
+ });
937
+ var postSchema = yup9.object().shape({
938
+ content: yup9.array().of(postContentSchema).required(),
939
+ postType: yup9.mixed().oneOf(Object.values(EnumPostType)).required(),
940
+ tags: yup9.array().of(yup9.string()).nullable().optional(),
941
+ title: yup9.string().required()
942
+ });
943
+
862
944
  // src/hooks/utils.ts
863
945
  var defaultLocation = {
864
946
  city: "",
@@ -1656,12 +1738,12 @@ var import_react2 = __toESM(require("react"));
1656
1738
  var import_react_hook_form12 = require("react-hook-form");
1657
1739
 
1658
1740
  // src/yupSchema/contactUs.ts
1659
- var yup9 = __toESM(require("yup"));
1660
- var contactUsSchema = yup9.object().shape({
1741
+ var yup10 = __toESM(require("yup"));
1742
+ var contactUsSchema = yup10.object().shape({
1661
1743
  email: emailRequiredSchema,
1662
- firstName: yup9.string().label("First Name").required("First name is required"),
1663
- lastName: yup9.string().label("Last Name").required("Last name is required"),
1664
- message: yup9.string().label("Message").required("Message is required")
1744
+ firstName: yup10.string().label("First Name").required("First name is required"),
1745
+ lastName: yup10.string().label("Last Name").required("Last name is required"),
1746
+ message: yup10.string().label("Message").required("Message is required")
1665
1747
  });
1666
1748
 
1667
1749
  // src/hooks/useContactUsForm.ts
@@ -1908,6 +1990,58 @@ function usePartnerForm(data) {
1908
1990
  watch
1909
1991
  };
1910
1992
  }
1993
+
1994
+ // src/hooks/usePostForm.ts
1995
+ var import_yup15 = require("@hookform/resolvers/yup");
1996
+ var import_react4 = __toESM(require("react"));
1997
+ var import_react_hook_form15 = require("react-hook-form");
1998
+ var defaultValues10 = {
1999
+ content: [],
2000
+ postType: "daily_meets" /* DAILY_MEETS */,
2001
+ tags: [],
2002
+ title: ""
2003
+ };
2004
+ function usePostform(data) {
2005
+ const {
2006
+ control,
2007
+ formState: { errors },
2008
+ getValues,
2009
+ handleSubmit,
2010
+ reset,
2011
+ setValue,
2012
+ watch
2013
+ } = (0, import_react_hook_form15.useForm)({
2014
+ defaultValues: defaultValues10,
2015
+ resolver: (0, import_yup15.yupResolver)(postSchema)
2016
+ });
2017
+ import_react4.default.useEffect(() => {
2018
+ if (data) {
2019
+ reset({
2020
+ content: data.content,
2021
+ postType: data.postType,
2022
+ tags: data.tags,
2023
+ title: data.title
2024
+ });
2025
+ } else {
2026
+ reset(defaultValues10);
2027
+ }
2028
+ }, [data]);
2029
+ const { content, postType, tags, title } = getValues();
2030
+ return {
2031
+ control,
2032
+ fields: {
2033
+ content,
2034
+ postType,
2035
+ tags,
2036
+ title
2037
+ },
2038
+ formState: { errors },
2039
+ handleSubmit,
2040
+ reset,
2041
+ setValue,
2042
+ watch
2043
+ };
2044
+ }
1911
2045
  // Annotate the CommonJS export names for ESM import in node:
1912
2046
  0 && (module.exports = {
1913
2047
  defaultEventFormValues,
@@ -1924,6 +2058,7 @@ function usePartnerForm(data) {
1924
2058
  useLocationSearch,
1925
2059
  useLoginForm,
1926
2060
  usePartnerForm,
2061
+ usePostform,
1927
2062
  useRegisterForm,
1928
2063
  useRequestPasswordResetForm,
1929
2064
  useResetPasswordForm,