@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.cjs
CHANGED
|
@@ -6151,23 +6151,31 @@ var listContentSchema = yup9.object({
|
|
|
6151
6151
|
title: yup9.string().optional()
|
|
6152
6152
|
}).required()
|
|
6153
6153
|
});
|
|
6154
|
-
var contentDataSchema = yup9.
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6163
|
-
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6154
|
+
var contentDataSchema = yup9.mixed().required("Content data is required").test(
|
|
6155
|
+
"contentData-by-type",
|
|
6156
|
+
"Invalid content data for content type",
|
|
6157
|
+
function(value) {
|
|
6158
|
+
const { contentType } = this.parent;
|
|
6159
|
+
const schema = (() => {
|
|
6160
|
+
switch (contentType) {
|
|
6161
|
+
case "cover" /* COVER */:
|
|
6162
|
+
return coverContentSchema;
|
|
6163
|
+
case "textarea" /* TEXTAREA */:
|
|
6164
|
+
return textareaContentSchema;
|
|
6165
|
+
case "image" /* IMAGE */:
|
|
6166
|
+
return imagesContentSchema;
|
|
6167
|
+
case "video" /* VIDEO */:
|
|
6168
|
+
return videoContentSchema;
|
|
6169
|
+
case "list" /* LIST */:
|
|
6170
|
+
return listContentSchema;
|
|
6171
|
+
default:
|
|
6172
|
+
return null;
|
|
6173
|
+
}
|
|
6174
|
+
})();
|
|
6175
|
+
if (!schema) return false;
|
|
6176
|
+
return schema.isValidSync(value);
|
|
6169
6177
|
}
|
|
6170
|
-
|
|
6178
|
+
);
|
|
6171
6179
|
var postContentSchema = yup9.object().shape({
|
|
6172
6180
|
contentData: contentDataSchema,
|
|
6173
6181
|
contentOrder: yup9.number().min(0).required(),
|