Styled operator pages
This commit is contained in:
@@ -16,7 +16,8 @@
|
||||
"memfs": "^4.9.2",
|
||||
"next-i18next": "^15.1.1",
|
||||
"pdf-lib": "^1.17.1",
|
||||
"pdfjs-dist": "^4.2.67"
|
||||
"pdfjs-dist": "^4.2.67",
|
||||
"react-material-symbols": "^4.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/multer": "^1.4.11"
|
||||
|
||||
@@ -22,5 +22,6 @@ export default new OperatorSchema(
|
||||
.label(i18next.t("values.arrangementConfig.friendlyName", { ns: "arrangePages" })).description(i18next.t("values.arrangementConfig.description", { ns: "arrangePages" }))
|
||||
.example("REVERSE_ORDER").example("DUPLEX_SORT").example("BOOKLET_SORT").required()
|
||||
}),
|
||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description"))
|
||||
JoiPDFFileSchema.label(i18next.t("outputs.pdffile.name")).description(i18next.t("outputs.pdffile.description")),
|
||||
"list"
|
||||
);
|
||||
@@ -1,6 +1,8 @@
|
||||
import { PdfFile } from "../wrappers/PdfFile";
|
||||
import { Action } from "../../declarations/Action";
|
||||
import Joi from "@stirling-tools/joi";
|
||||
import Joi, { StringRegexOptions } from "@stirling-tools/joi";
|
||||
import { MaterialSymbolProps } from "react-material-symbols";
|
||||
|
||||
|
||||
export interface ValidationResult {
|
||||
valid: boolean,
|
||||
@@ -32,13 +34,15 @@ export class Operator {
|
||||
|
||||
export class OperatorSchema {
|
||||
schema: Joi.ObjectSchema<any>;
|
||||
materialSymbolName: MaterialSymbolProps["icon"] | undefined;
|
||||
|
||||
constructor(label: string, description: string, inputSchema: Joi.Schema, valueSchema: Joi.Schema, outputSchema: Joi.Schema) {
|
||||
constructor(label: string, description: string, inputSchema: Joi.Schema, valueSchema: Joi.Schema, outputSchema: Joi.Schema, materialSymbolName?: MaterialSymbolProps["icon"] | undefined) {
|
||||
this.schema = Joi.object({
|
||||
input: inputSchema,
|
||||
values: valueSchema.required(),
|
||||
output: outputSchema
|
||||
}).label(label).description(description);
|
||||
this.materialSymbolName = materialSymbolName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user