@timardex/cluemart-shared 1.3.12 → 1.3.13
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/hooks/index.cjs +24 -16
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.mjs +24 -16
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.cjs +24 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -16
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -5889,23 +5889,31 @@ var listContentSchema = yup9.object({
|
|
|
5889
5889
|
title: yup9.string().optional()
|
|
5890
5890
|
}).required()
|
|
5891
5891
|
});
|
|
5892
|
-
var contentDataSchema = yup9.
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
5899
|
-
|
|
5900
|
-
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5892
|
+
var contentDataSchema = yup9.mixed().required("Content data is required").test(
|
|
5893
|
+
"contentData-by-type",
|
|
5894
|
+
"Invalid content data for content type",
|
|
5895
|
+
function(value) {
|
|
5896
|
+
const { contentType } = this.parent;
|
|
5897
|
+
const schema = (() => {
|
|
5898
|
+
switch (contentType) {
|
|
5899
|
+
case "cover" /* COVER */:
|
|
5900
|
+
return coverContentSchema;
|
|
5901
|
+
case "textarea" /* TEXTAREA */:
|
|
5902
|
+
return textareaContentSchema;
|
|
5903
|
+
case "image" /* IMAGE */:
|
|
5904
|
+
return imagesContentSchema;
|
|
5905
|
+
case "video" /* VIDEO */:
|
|
5906
|
+
return videoContentSchema;
|
|
5907
|
+
case "list" /* LIST */:
|
|
5908
|
+
return listContentSchema;
|
|
5909
|
+
default:
|
|
5910
|
+
return null;
|
|
5911
|
+
}
|
|
5912
|
+
})();
|
|
5913
|
+
if (!schema) return false;
|
|
5914
|
+
return schema.isValidSync(value);
|
|
5907
5915
|
}
|
|
5908
|
-
|
|
5916
|
+
);
|
|
5909
5917
|
var postContentSchema = yup9.object().shape({
|
|
5910
5918
|
contentData: contentDataSchema,
|
|
5911
5919
|
contentOrder: yup9.number().min(0).required(),
|