commit
62ef6bf1b9
1
common/Tests/colors-test/.gitignore
vendored
Normal file
1
common/Tests/colors-test/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.html
|
10
common/Tests/colors-test/package.json
Normal file
10
common/Tests/colors-test/package.json
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "colors-test",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"license": "MIT",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"start": "node src/index.js"
|
||||||
|
}
|
||||||
|
}
|
39
common/Tests/colors-test/src/exclude.js
Normal file
39
common/Tests/colors-test/src/exclude.js
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
// (c) Copyright Ascensio System SIA 2010-2024
|
||||||
|
//
|
||||||
|
// This program is a free software product.
|
||||||
|
// You can redistribute it and/or modify it under the terms
|
||||||
|
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||||
|
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||||
|
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||||
|
// any third-party rights.
|
||||||
|
//
|
||||||
|
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||||
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||||
|
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
//
|
||||||
|
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||||
|
//
|
||||||
|
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||||
|
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||||
|
//
|
||||||
|
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||||
|
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||||
|
// trademark law for use of our trademarks.
|
||||||
|
//
|
||||||
|
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||||
|
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||||
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
|
export const excludeFiles = ["../../../packages/shared/utils/encoder.ts"];
|
||||||
|
|
||||||
|
export const excludeDirs = [
|
||||||
|
"../../../packages/client/node_modules",
|
||||||
|
"../../../packages/shared/node_modules",
|
||||||
|
"../../../packages/login/node_modules",
|
||||||
|
"../../../packages/doceditor/node_modules",
|
||||||
|
"../../../packages/management/node_modules",
|
||||||
|
"../../../packages/doceditor/.next",
|
||||||
|
"../../../packages/login/.next",
|
||||||
|
"../../../packages/login/dist",
|
||||||
|
"../../../packages/shared/themes",
|
||||||
|
];
|
42
common/Tests/colors-test/src/index.js
Normal file
42
common/Tests/colors-test/src/index.js
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
// (c) Copyright Ascensio System SIA 2010-2024
|
||||||
|
//
|
||||||
|
// This program is a free software product.
|
||||||
|
// You can redistribute it and/or modify it under the terms
|
||||||
|
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||||
|
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||||
|
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||||
|
// any third-party rights.
|
||||||
|
//
|
||||||
|
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||||
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||||
|
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
//
|
||||||
|
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||||
|
//
|
||||||
|
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||||
|
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||||
|
//
|
||||||
|
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||||
|
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||||
|
// trademark law for use of our trademarks.
|
||||||
|
//
|
||||||
|
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||||
|
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||||
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
|
import fs from "fs";
|
||||||
|
import { searchDirectoryForHexColors } from "./utils.js";
|
||||||
|
import { excludeDirs, excludeFiles } from "./exclude.js";
|
||||||
|
import { generateReport } from "./report.js";
|
||||||
|
|
||||||
|
const directoryPath = "../../../packages";
|
||||||
|
const reportName = `colors_report_${new Date().toJSON()}.html`;
|
||||||
|
|
||||||
|
const hexColorsFound = searchDirectoryForHexColors(
|
||||||
|
directoryPath,
|
||||||
|
excludeFiles,
|
||||||
|
excludeDirs
|
||||||
|
);
|
||||||
|
|
||||||
|
const htmlReport = generateReport(hexColorsFound);
|
||||||
|
fs.writeFileSync(reportName, htmlReport, "utf-8");
|
67
common/Tests/colors-test/src/report.js
Normal file
67
common/Tests/colors-test/src/report.js
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
// (c) Copyright Ascensio System SIA 2010-2024
|
||||||
|
//
|
||||||
|
// This program is a free software product.
|
||||||
|
// You can redistribute it and/or modify it under the terms
|
||||||
|
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||||
|
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||||
|
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||||
|
// any third-party rights.
|
||||||
|
//
|
||||||
|
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||||
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||||
|
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
//
|
||||||
|
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||||
|
//
|
||||||
|
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||||
|
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||||
|
//
|
||||||
|
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||||
|
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||||
|
// trademark law for use of our trademarks.
|
||||||
|
//
|
||||||
|
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||||
|
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||||
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
|
export function generateReport(hexColorsFound) {
|
||||||
|
let htmlReport = `
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Colors report</title>
|
||||||
|
<style>
|
||||||
|
body { font-family: Arial, sans-serif; margin: 20px; }
|
||||||
|
h1 { color: #333; }
|
||||||
|
h3 { margin-top: 8px; }
|
||||||
|
ul { list-style-type: none; padding: 0; }
|
||||||
|
li { margin-bottom: 4px; }
|
||||||
|
.color-box { display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: middle; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Colors Report</h1>
|
||||||
|
<p>Found colors in the following files:</p>
|
||||||
|
`;
|
||||||
|
|
||||||
|
Object.keys(hexColorsFound).forEach((file) => {
|
||||||
|
htmlReport += `<h3>File: ${file}</h3><ul>`;
|
||||||
|
hexColorsFound[file].forEach((color) => {
|
||||||
|
htmlReport += `
|
||||||
|
<li>
|
||||||
|
<div class="color-box" style="background-color: ${color};"></div>
|
||||||
|
${color}
|
||||||
|
</li>`;
|
||||||
|
});
|
||||||
|
htmlReport += "</ul>";
|
||||||
|
});
|
||||||
|
|
||||||
|
htmlReport += `
|
||||||
|
<p>Total files with colors: ${Object.keys(hexColorsFound).length}</p>
|
||||||
|
</body>
|
||||||
|
</html>`;
|
||||||
|
|
||||||
|
return htmlReport;
|
||||||
|
}
|
72
common/Tests/colors-test/src/utils.js
Normal file
72
common/Tests/colors-test/src/utils.js
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
// (c) Copyright Ascensio System SIA 2010-2024
|
||||||
|
//
|
||||||
|
// This program is a free software product.
|
||||||
|
// You can redistribute it and/or modify it under the terms
|
||||||
|
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||||
|
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||||
|
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||||
|
// any third-party rights.
|
||||||
|
//
|
||||||
|
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||||
|
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||||
|
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||||
|
//
|
||||||
|
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||||
|
//
|
||||||
|
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||||
|
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||||
|
//
|
||||||
|
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||||
|
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||||
|
// trademark law for use of our trademarks.
|
||||||
|
//
|
||||||
|
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||||
|
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||||
|
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||||
|
|
||||||
|
import path from "path";
|
||||||
|
import fs from "fs";
|
||||||
|
|
||||||
|
const hexColorPattern = /#(?:[0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})\b/g;
|
||||||
|
|
||||||
|
export function findHexColorsInFile(filePath) {
|
||||||
|
const content = fs.readFileSync(filePath, "utf-8");
|
||||||
|
const matches = content.match(hexColorPattern);
|
||||||
|
return matches || [];
|
||||||
|
}
|
||||||
|
|
||||||
|
export function searchDirectoryForHexColors(
|
||||||
|
directory,
|
||||||
|
excludeFiles = [],
|
||||||
|
excludeDirs = []
|
||||||
|
) {
|
||||||
|
let hexColors = {};
|
||||||
|
|
||||||
|
function walkDirectory(currentPath) {
|
||||||
|
const items = fs.readdirSync(currentPath);
|
||||||
|
|
||||||
|
items.forEach((item) => {
|
||||||
|
const fullPath = path.join(currentPath, item);
|
||||||
|
const isDirectory = fs.statSync(fullPath).isDirectory();
|
||||||
|
|
||||||
|
if (isDirectory) {
|
||||||
|
if (!excludeDirs.includes(fullPath)) {
|
||||||
|
walkDirectory(fullPath);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (
|
||||||
|
!excludeFiles.includes(fullPath) &&
|
||||||
|
/\.(js|ts|jsx|tsx)$/.test(item)
|
||||||
|
) {
|
||||||
|
const matches = findHexColorsInFile(fullPath);
|
||||||
|
if (matches.length > 0) {
|
||||||
|
hexColors[fullPath] = matches;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
walkDirectory(directory);
|
||||||
|
return hexColors;
|
||||||
|
}
|
12
common/Tests/colors-test/yarn.lock
Normal file
12
common/Tests/colors-test/yarn.lock
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# This file is generated by running "yarn install" inside your project.
|
||||||
|
# Manual changes might be lost - proceed with caution!
|
||||||
|
|
||||||
|
__metadata:
|
||||||
|
version: 8
|
||||||
|
cacheKey: 10
|
||||||
|
|
||||||
|
"colors-test@workspace:.":
|
||||||
|
version: 0.0.0-use.local
|
||||||
|
resolution: "colors-test@workspace:."
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
@ -49,20 +49,16 @@ const {
|
|||||||
darkBlack,
|
darkBlack,
|
||||||
|
|
||||||
lightGrayBlackout,
|
lightGrayBlackout,
|
||||||
darkGrayBlackout,
|
|
||||||
grayLight,
|
grayLight,
|
||||||
darkGrayLight,
|
darkGrayLight,
|
||||||
lightGrayHover,
|
lightGrayHover,
|
||||||
lightDarkGrayHover,
|
|
||||||
grayLightMid,
|
grayLightMid,
|
||||||
grayDarkMid,
|
grayDarkMid,
|
||||||
lightGraySelected,
|
lightGraySelected,
|
||||||
grayStrong,
|
grayStrong,
|
||||||
grayDarkStrong,
|
|
||||||
gray,
|
gray,
|
||||||
grayDark,
|
grayDark,
|
||||||
lightGrayDark,
|
lightGrayDark,
|
||||||
darkGrayDark,
|
|
||||||
grayText,
|
grayText,
|
||||||
grayDarkText,
|
grayDarkText,
|
||||||
lightBlueMain,
|
lightBlueMain,
|
||||||
@ -76,32 +72,21 @@ const {
|
|||||||
mainGreen,
|
mainGreen,
|
||||||
|
|
||||||
lightErrorStatus,
|
lightErrorStatus,
|
||||||
darkErrorStatus,
|
|
||||||
favoritesStatus,
|
favoritesStatus,
|
||||||
lightStatusWarning,
|
lightStatusWarning,
|
||||||
darkStatusWarning,
|
|
||||||
lightStatusPositive,
|
lightStatusPositive,
|
||||||
darkStatusPositive,
|
|
||||||
|
|
||||||
lightIcons,
|
lightIcons,
|
||||||
darkIcon,
|
|
||||||
link,
|
link,
|
||||||
darkLink,
|
|
||||||
blueLightMid,
|
blueLightMid,
|
||||||
|
|
||||||
lightToastDone,
|
lightToastDone,
|
||||||
darkToastDone,
|
|
||||||
lightToastInfo,
|
lightToastInfo,
|
||||||
darkToastInfo,
|
|
||||||
lightToastAlert,
|
lightToastAlert,
|
||||||
darkToastAlert,
|
|
||||||
lightToastWarning,
|
lightToastWarning,
|
||||||
darkToastWarning,
|
|
||||||
|
|
||||||
dndColor,
|
dndColor,
|
||||||
dndDarkColor,
|
|
||||||
dndHoverColor,
|
dndHoverColor,
|
||||||
dndDarkHover,
|
|
||||||
|
|
||||||
onWhiteColor,
|
onWhiteColor,
|
||||||
boxShadowColor,
|
boxShadowColor,
|
||||||
|
@ -37,7 +37,6 @@ const {
|
|||||||
black,
|
black,
|
||||||
darkBlack,
|
darkBlack,
|
||||||
|
|
||||||
lightGrayBlackout,
|
|
||||||
darkGrayBlackout,
|
darkGrayBlackout,
|
||||||
grayLight,
|
grayLight,
|
||||||
darkGrayLight,
|
darkGrayLight,
|
||||||
@ -64,28 +63,21 @@ const {
|
|||||||
|
|
||||||
mainOrange,
|
mainOrange,
|
||||||
|
|
||||||
lightErrorStatus,
|
|
||||||
darkErrorStatus,
|
darkErrorStatus,
|
||||||
favoritesStatus,
|
favoritesStatus,
|
||||||
lightStatusWarning,
|
lightStatusWarning,
|
||||||
darkStatusWarning,
|
darkStatusWarning,
|
||||||
lightStatusPositive,
|
|
||||||
darkStatusPositive,
|
darkStatusPositive,
|
||||||
|
|
||||||
lightIcons,
|
|
||||||
darkIcon,
|
darkIcon,
|
||||||
link,
|
link,
|
||||||
darkLink,
|
darkLink,
|
||||||
blueLightMid,
|
blueLightMid,
|
||||||
bigGrayDarkMid,
|
bigGrayDarkMid,
|
||||||
|
|
||||||
lightToastDone,
|
|
||||||
darkToastDone,
|
darkToastDone,
|
||||||
lightToastInfo,
|
|
||||||
darkToastInfo,
|
darkToastInfo,
|
||||||
lightToastAlert,
|
|
||||||
darkToastAlert,
|
darkToastAlert,
|
||||||
lightToastWarning,
|
|
||||||
darkToastWarning,
|
darkToastWarning,
|
||||||
|
|
||||||
dndColor,
|
dndColor,
|
||||||
@ -665,7 +657,7 @@ const Dark: TTheme = {
|
|||||||
color: white,
|
color: white,
|
||||||
disableColor: grayDarkText,
|
disableColor: grayDarkText,
|
||||||
|
|
||||||
backgroundColor: black,
|
backgroundColor: darkGrayLight,
|
||||||
disableBackgroundColor: grayDarkStrong,
|
disableBackgroundColor: grayDarkStrong,
|
||||||
|
|
||||||
width: {
|
width: {
|
||||||
|
Loading…
Reference in New Issue
Block a user