@vivlab/api-database
Advanced tools
Comparing version 1.1.15 to 1.1.16
@@ -78,2 +78,13 @@ import * as hashItem from "./items"; | ||
}; | ||
style: { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
layout: { | ||
grid: unknown; | ||
gap: unknown; | ||
justify: unknown; | ||
align: unknown; | ||
mode: unknown; | ||
} | undefined; | ||
template: { | ||
@@ -212,2 +223,13 @@ rounded: unknown; | ||
}; | ||
style: { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
layout: { | ||
grid: unknown; | ||
gap: unknown; | ||
justify: unknown; | ||
align: unknown; | ||
mode: unknown; | ||
} | undefined; | ||
template: { | ||
@@ -339,2 +361,13 @@ rounded: unknown; | ||
}; | ||
style: { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
layout: { | ||
grid: unknown; | ||
gap: unknown; | ||
justify: unknown; | ||
align: unknown; | ||
mode: unknown; | ||
} | undefined; | ||
template: { | ||
@@ -341,0 +374,0 @@ rounded: unknown; |
@@ -82,2 +82,13 @@ import type { Page } from "@vivlab/types"; | ||
}; | ||
style: { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
layout: { | ||
grid: unknown; | ||
gap: unknown; | ||
justify: unknown; | ||
align: unknown; | ||
mode: unknown; | ||
} | undefined; | ||
template: { | ||
@@ -178,2 +189,13 @@ rounded: unknown; | ||
}; | ||
style: { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
layout: { | ||
grid: unknown; | ||
gap: unknown; | ||
justify: unknown; | ||
align: unknown; | ||
mode: unknown; | ||
} | undefined; | ||
template: { | ||
@@ -180,0 +202,0 @@ rounded: unknown; |
@@ -45,3 +45,3 @@ "use strict"; | ||
products: { type: "array", maxItems: 12, items: { type: "string", maxLength: 30 } }, | ||
style_textAlign: { enum: ["left", "center", "right", "justify"] }, | ||
style_textAlign: { enum: [null, "left", "center", "right", "justify"] }, | ||
style_backgroundColor: { type: ["string", "null"], maxLength: 500 }, | ||
@@ -59,8 +59,10 @@ subtitle_text: { type: ["string", "null"], maxLength: 500 }, | ||
button_dark: { type: ["boolean", "null"] }, | ||
...(0, util_1.generateTemplateSchema)("item"), | ||
...(0, util_1.generateLayoutSchema)("item"), | ||
...(0, util_1.generateTemplateSchema)("item"), | ||
...(0, util_1.generateTemplateSchema)("inner"), | ||
...(0, util_1.generateLayoutSchema)("inner"), | ||
...(0, util_1.generateStyleSchema)("inner"), | ||
...(0, util_1.generateTemplateSchema)("button"), | ||
...(0, util_1.generateTemplateSchema)("text"), | ||
...(0, util_1.generateTemplateSchema)("media"), | ||
...(0, util_1.generateTemplateSchema)("inner") | ||
...(0, util_1.generateTemplateSchema)("media") | ||
} | ||
@@ -67,0 +69,0 @@ } |
@@ -94,2 +94,13 @@ import type { Page } from "@vivlab/types"; | ||
}; | ||
style: { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
layout: { | ||
grid: unknown; | ||
gap: unknown; | ||
justify: unknown; | ||
align: unknown; | ||
mode: unknown; | ||
} | undefined; | ||
template: { | ||
@@ -96,0 +107,0 @@ rounded: unknown; |
@@ -45,2 +45,4 @@ "use strict"; | ||
}, | ||
style: (0, util_1.styleRedisToData)("inner", data), | ||
layout: (0, util_1.layoutRedisToData)("inner", data), | ||
template: (0, util_1.templateRedisToData)("inner", data) | ||
@@ -78,2 +80,4 @@ }, | ||
...(0, util_1.templateDataToRedis)("inner", payload.inner?.template), | ||
...(0, util_1.layoutDataToRedis)("inner", payload.inner?.layout), | ||
...(0, util_1.styleDataToRedis)("inner", payload.inner?.style), | ||
...(0, util_1.templateDataToRedis)("button", payload.inner?.button?.template), | ||
@@ -80,0 +84,0 @@ ...(0, util_1.templateDataToRedis)("text", payload.inner?.text?.template) |
@@ -56,2 +56,13 @@ export declare const generateTemplateSchema: (key: string) => { | ||
}; | ||
export declare const generateStyleSchema: (key: string) => { | ||
[x: string]: { | ||
enum: (string | null)[]; | ||
type?: undefined; | ||
maxLength?: undefined; | ||
} | { | ||
type: string[]; | ||
maxLength: number; | ||
enum?: undefined; | ||
}; | ||
}; | ||
export declare const templateRedisToData: <T>(key: string, data: T & Record<string, unknown>) => { | ||
@@ -80,1 +91,8 @@ rounded: unknown; | ||
} | undefined; | ||
export declare const styleRedisToData: <T>(key: string, data: T & Record<string, unknown>) => { | ||
textAlign: unknown; | ||
backgroundColor: unknown; | ||
} | undefined; | ||
export declare const styleDataToRedis: <T>(key: string, data: T & Record<string, unknown>) => { | ||
[x: string]: unknown; | ||
} | undefined; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.layoutDataToRedis = exports.layoutRedisToData = exports.templateDataToRedis = exports.templateRedisToData = exports.generateLayoutSchema = exports.generateTemplateSchema = void 0; | ||
exports.styleDataToRedis = exports.styleRedisToData = exports.layoutDataToRedis = exports.layoutRedisToData = exports.templateDataToRedis = exports.templateRedisToData = exports.generateStyleSchema = exports.generateLayoutSchema = exports.generateTemplateSchema = void 0; | ||
const spacing = [ | ||
@@ -113,2 +113,7 @@ null, | ||
exports.generateLayoutSchema = generateLayoutSchema; | ||
const generateStyleSchema = (key) => ({ | ||
[`${key}_s_textAlign`]: { enum: [null, "left", "center", "right", "justify"] }, | ||
[`${key}_s_backgroundColor`]: { type: ["string", "null"], maxLength: 500 } | ||
}); | ||
exports.generateStyleSchema = generateStyleSchema; | ||
const templateRedisToData = (key, data) => { | ||
@@ -168,2 +173,20 @@ if (!data) | ||
exports.layoutDataToRedis = layoutDataToRedis; | ||
const styleRedisToData = (key, data) => { | ||
if (!data) | ||
return undefined; | ||
return { | ||
textAlign: data[`${key}_s_textAlign`], | ||
backgroundColor: data[`${key}_s_backgroundColor`] | ||
}; | ||
}; | ||
exports.styleRedisToData = styleRedisToData; | ||
const styleDataToRedis = (key, data) => { | ||
if (!data) | ||
return undefined; | ||
return { | ||
[`${key}_s_textAlign`]: data.style_textAlign, | ||
[`${key}_s_backgroundColor`]: data.style_backgroundColor | ||
}; | ||
}; | ||
exports.styleDataToRedis = styleDataToRedis; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@vivlab/api-database", | ||
"version": "1.1.15", | ||
"version": "1.1.16", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
430436
7250