@timardex/cluemart-shared 1.3.35 → 1.3.37

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/index.d.mts CHANGED
@@ -955,6 +955,7 @@ type PostContentFormData = {
955
955
  };
956
956
  interface PostFormData {
957
957
  active: boolean;
958
+ caption: string;
958
959
  content: PostContentFormData[];
959
960
  postType: EnumPostType;
960
961
  tags?: string[] | null;
package/dist/index.d.ts CHANGED
@@ -955,6 +955,7 @@ type PostContentFormData = {
955
955
  };
956
956
  interface PostFormData {
957
957
  active: boolean;
958
+ caption: string;
958
959
  content: PostContentFormData[];
959
960
  postType: EnumPostType;
960
961
  tags?: string[] | null;
package/dist/index.mjs CHANGED
@@ -5107,6 +5107,7 @@ var POST_FIELDS_FRAGMENT = gql31`
5107
5107
  fragment PostFields on PostType {
5108
5108
  _id
5109
5109
  active
5110
+ caption
5110
5111
  content {
5111
5112
  ...PostContentFields
5112
5113
  }
@@ -5894,49 +5895,6 @@ var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
5894
5895
  })(EnumPostContentType || {});
5895
5896
 
5896
5897
  // src/yupSchema/post.ts
5897
- var textareaContentSchema = yup9.object({
5898
- textarea: yup9.object({
5899
- data: yup9.string().required("Textarea content is required"),
5900
- title: yup9.string().optional()
5901
- }).required()
5902
- });
5903
- var videoContentSchema = yup9.object({
5904
- video: yup9.object({
5905
- source: yup9.string().required("Video source is required"),
5906
- title: yup9.string().optional()
5907
- }).required()
5908
- });
5909
- var listContentSchema = yup9.object({
5910
- list: yup9.object({
5911
- items: yup9.array().of(
5912
- yup9.object({
5913
- text: yup9.string().required("List item text is required")
5914
- })
5915
- ).min(1, "List must contain at least one item").required(),
5916
- title: yup9.string().optional()
5917
- }).required()
5918
- });
5919
- var contentDataSchema = yup9.mixed().required("Content data is required").test(
5920
- "contentData-by-type",
5921
- "Invalid content data for content type",
5922
- function(value) {
5923
- const { contentType } = this.parent;
5924
- const schema = (() => {
5925
- switch (contentType) {
5926
- case "textarea" /* TEXTAREA */:
5927
- return textareaContentSchema;
5928
- case "video" /* VIDEO */:
5929
- return videoContentSchema;
5930
- case "list" /* LIST */:
5931
- return listContentSchema;
5932
- default:
5933
- return null;
5934
- }
5935
- })();
5936
- if (!schema) return false;
5937
- return schema.isValidSync(value);
5938
- }
5939
- );
5940
5898
  var postContentSchema = yup9.object().shape({
5941
5899
  contentData: yup9.mixed().optional().nullable(),
5942
5900
  contentOrder: yup9.number().nullable(),
@@ -5944,6 +5902,7 @@ var postContentSchema = yup9.object().shape({
5944
5902
  });
5945
5903
  var postSchema = yup9.object().shape({
5946
5904
  active: yup9.boolean().required(),
5905
+ caption: yup9.string().required(),
5947
5906
  content: yup9.array().of(postContentSchema).required(),
5948
5907
  postType: yup9.mixed().oneOf(Object.values(EnumPostType)).required(),
5949
5908
  tags: yup9.array().of(yup9.string().required()).nullable().optional(),
@@ -7006,6 +6965,7 @@ import React10 from "react";
7006
6965
  import { useForm as useForm15 } from "react-hook-form";
7007
6966
  var defaultValues10 = {
7008
6967
  active: true,
6968
+ caption: "",
7009
6969
  content: [],
7010
6970
  postType: "daily_meets" /* DAILY_MEETS */,
7011
6971
  tags: [],
@@ -7028,6 +6988,7 @@ function usePostForm(data) {
7028
6988
  if (data) {
7029
6989
  reset({
7030
6990
  active: data.active,
6991
+ caption: data.caption,
7031
6992
  content: data.content,
7032
6993
  postType: data.postType,
7033
6994
  tags: data.tags,
@@ -7037,11 +6998,12 @@ function usePostForm(data) {
7037
6998
  reset(defaultValues10);
7038
6999
  }
7039
7000
  }, [data]);
7040
- const { active, content, postType, tags, title } = getValues();
7001
+ const { active, caption, content, postType, tags, title } = getValues();
7041
7002
  return {
7042
7003
  control,
7043
7004
  fields: {
7044
7005
  active,
7006
+ caption,
7045
7007
  content,
7046
7008
  postType,
7047
7009
  tags,