ported schema builder
This commit is contained in:
25
constants/ReservedFields.ts
Normal file
25
constants/ReservedFields.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { FieldTypes } from "@/components/schema/fieldtypes";
|
||||
|
||||
export const RESERVED_FIELDS: Record<string, FieldType> = {
|
||||
maximum: {
|
||||
isConstant: false,
|
||||
limit: 1,
|
||||
minimum: 1,
|
||||
type: FieldTypes.number,
|
||||
value: "",
|
||||
},
|
||||
minimum: {
|
||||
isConstant: false,
|
||||
limit: 1,
|
||||
minimum: 1,
|
||||
type: FieldTypes.number,
|
||||
value: "",
|
||||
},
|
||||
relative: {
|
||||
isConstant: true,
|
||||
limit: 1,
|
||||
minimum: 1,
|
||||
type: FieldTypes.text,
|
||||
value: "$",
|
||||
},
|
||||
};
|
95
constants/TemplateTypes.ts
Normal file
95
constants/TemplateTypes.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import { FieldTypes } from "@/components/schema/fieldtypes";
|
||||
|
||||
export const TEMPLATE_TYPES: Record<string, TypeType> = {
|
||||
section: {
|
||||
name: {
|
||||
isConstant: false,
|
||||
limit: 1,
|
||||
minimum: 1,
|
||||
type: FieldTypes.text,
|
||||
value: "",
|
||||
},
|
||||
body: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes["long text"],
|
||||
value: "",
|
||||
},
|
||||
},
|
||||
steps: {
|
||||
steps: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes.type,
|
||||
value: "section",
|
||||
},
|
||||
},
|
||||
image: {
|
||||
name: {
|
||||
isConstant: false,
|
||||
limit: 1,
|
||||
minimum: 1,
|
||||
type: FieldTypes.text,
|
||||
value: "",
|
||||
},
|
||||
link: {
|
||||
isConstant: false,
|
||||
limit: 1,
|
||||
minimum: 1,
|
||||
type: FieldTypes.text,
|
||||
value: "",
|
||||
},
|
||||
},
|
||||
list: {
|
||||
items: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes["long text"],
|
||||
value: "",
|
||||
},
|
||||
},
|
||||
table_column: {
|
||||
name: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes.any,
|
||||
value: "",
|
||||
},
|
||||
value: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes.any,
|
||||
value: "",
|
||||
},
|
||||
},
|
||||
table_row: {
|
||||
columns: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes.type,
|
||||
value: "tableColumn",
|
||||
},
|
||||
},
|
||||
table: {
|
||||
rows: {
|
||||
isConstant: false,
|
||||
limit: 0,
|
||||
minimum: 1,
|
||||
type: FieldTypes.type,
|
||||
value: "tableRow",
|
||||
},
|
||||
header: {
|
||||
isConstant: false,
|
||||
limit: 1,
|
||||
minimum: 0,
|
||||
type: FieldTypes.type,
|
||||
value: "tableRow",
|
||||
},
|
||||
},
|
||||
};
|
Reference in New Issue
Block a user