@uuv/assistant
Version:
UUV Helper used to improve the life of testers and developers by generating cucumber phrases from the GUI.
84 lines (83 loc) • 2.98 kB
JavaScript
;
/**
* Software Name : UUV
*
* SPDX-License-Identifier: MIT
*
* This software is distributed under the MIT License,
* see the "LICENSE" file for more details
*
* Authors: NJAKO MOLOM Louis Fredice & SERVICAL Stanley
* Software description: Make test writing fast, understandable by any human
* understanding English or French.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.CssHelper = exports.MimeTypeEnum = void 0;
const antd_1 = require("antd");
var MimeTypeEnum;
(function (MimeTypeEnum) {
MimeTypeEnum["IMAGE_BMP"] = "image/bmp";
MimeTypeEnum["TEXT_CSS"] = "text/css";
MimeTypeEnum["TEXT_CSV"] = "text/csv";
MimeTypeEnum["IMAGE_GIF"] = "image/gif";
MimeTypeEnum["TEXT_HTML"] = "text/html";
MimeTypeEnum["IMAGE_X_ICON"] = "image/x-icon";
MimeTypeEnum["IMAGE_JPEG"] = "image/jpeg";
MimeTypeEnum["APPLICATION_JAVASCRIPT"] = "application/javascript";
MimeTypeEnum["APPLICATION_JSON"] = "application/json";
MimeTypeEnum["IMAGE_PNG"] = "image/png";
MimeTypeEnum["APPLICATION_PDF"] = "application/pdf";
MimeTypeEnum["APPLICATION_RTF"] = "application/rtf";
MimeTypeEnum["IMAGE_SVG_XML"] = "image/svg+xml";
MimeTypeEnum["APPLICATION_TYPESCRIPT"] = "application/typescript";
MimeTypeEnum["IMAGE_WEBP"] = "image/webp";
MimeTypeEnum["FONT_WOFF"] = "font/woff";
MimeTypeEnum["FONT_WOFF2"] = "font/woff2";
MimeTypeEnum["APPLICATION_XHTML_XML"] = "application/xhtml+xml";
MimeTypeEnum["APPLICATION_XML"] = "application/xml";
MimeTypeEnum["APPLICATION_ZIP"] = "application/zip";
})(MimeTypeEnum || (exports.MimeTypeEnum = MimeTypeEnum = {}));
class CssHelper {
/* eslint-disable @typescript-eslint/no-explicit-any */
static getBase64File(file) {
if (!Object.values(MimeTypeEnum).includes(file.mime)) {
antd_1.notification.error({
message: "Error",
description: `The mimetype '${file.mime}' of resource is not configured`
});
}
return `data:${file.mime};base64,${file.data}`;
}
}
exports.CssHelper = CssHelper;
CssHelper.buttonConfig = (isDark) => {
return isDark ? {
background: "#0b4c89",
color: "#FFF"
} : {
background: "#d6e4ff",
color: "#000"
};
};
CssHelper.expanderConfig = (isDark, isExtended) => {
return isDark ? {
background: "#0b4c89",
shadow: "rgba(250, 250, 250, 0.16) 0px 10px 36px 0px, rgba(250, 250, 250, 0.06) 0px 0px 0px 1px",
rotate: isExtended ? 180 : 0,
color: "white"
} : {
background: "#d6e4ff",
shadow: "rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px",
rotate: isExtended ? 180 : 0,
color: "black"
};
};
CssHelper.iconConfig = (isDark) => {
return isDark ? {
background: "rgb(31, 31, 31)",
color: "#FFF"
} : {
color: "#000",
background: "#FFF",
};
};