diff --git a/postinstall.js b/postinstall.js
index 6325c0e091..571e1dcde4 100644
--- a/postinstall.js
+++ b/postinstall.js
@@ -1,9 +1,8 @@
// Script to copy tinymce to public folder. Read more: https://www.tiny.cloud/docs/tinymce/latest/react-pm-host/
const fse = require('fs-extra');
-const path = require('path');
+const path = require('node:path');
const topDir = __dirname;
-// const topDir = import.meta.dirname;
fse.emptyDirSync(path.join(topDir, 'public', 'tinymce'));
fse.copySync(path.join(topDir, 'node_modules', 'tinymce'), path.join(topDir, 'public', 'tinymce'), {
overwrite: true,
diff --git a/public/emailFormat.html b/public/emailFormat.html
index 3a7af10312..c176fbd69d 100644
--- a/public/emailFormat.html
+++ b/public/emailFormat.html
@@ -1,9 +1,9 @@
-
+
Hello, World
Hello, World
-
+
\ No newline at end of file
diff --git a/public/index.css b/public/index.css
index 3b776350f3..93d65327c5 100644
--- a/public/index.css
+++ b/public/index.css
@@ -7,24 +7,12 @@
/* THEME ROOT (BODY / ROOT) */
/* ========================= */
-body.dark-mode:not(.no-global-theme),
-body.bm-dashboard-dark:not(.no-global-theme) {
- background-color: #1b2a41 !important;
- color: #ffffff !important;
-}
-
body.dark-mode:not(.no-global-theme) #root,
body.bm-dashboard-dark:not(.no-global-theme) #root {
background-color: #1b2a41 !important;
color: #ffffff !important;
}
-/* SAFE BASE (dark mode) */
-body.dark-mode:not(.no-global-theme),
-body.bm-dashboard-dark:not(.no-global-theme) {
- color: #ffffff;
-}
-
/* ========================= */
/* TYPOGRAPHY (DARK MODE) */
/* ========================= */
diff --git a/refactor-css-classes.js b/refactor-css-classes.js
index 4a41662026..12a78646d5 100644
--- a/refactor-css-classes.js
+++ b/refactor-css-classes.js
@@ -1,14 +1,14 @@
// updated on june 11
/* eslint-disable import/no-extraneous-dependencies */
/* eslint-disable no-console */
-const fs = require('fs');
-const path = require('path');
+const fs = require('node:fs');
+const path = require('node:path');
const postcss = require('postcss');
const safeParser = require('postcss-safe-parser');
// Helper to convert kebab-case, snake_case, pascalcase to camelCase
const toCamelCase = str => {
- const formatted = str.replace(/[-_](\w)/g, (_, char) => char.toUpperCase());
+ const formatted = str.replaceAll(/[-_](\w)/gu, (_, char) => char.toUpperCase());
return formatted.charAt(0).toLowerCase() + formatted.slice(1);
};
@@ -21,7 +21,7 @@ const convertCSSFile = filePath => {
root.walkRules(rule => {
const updated = rule.selectors.map(selector => {
- return selector.replace(/\.(\w[\w-]*)/g, (_, className) => {
+ return selector.replaceAll(/\.(\w[\w-]*)/gu, (_, className) => {
const camel = toCamelCase(className);
classMap[className] = camel;
return `.${camel}`;
@@ -32,15 +32,12 @@ const convertCSSFile = filePath => {
});
fs.writeFileSync(filePath, root.toString());
- // eslint-disable-next-line no-console
console.log(`β
Updated CSS: ${filePath}`);
- // eslint-disable-next-line no-console
- // console.log('classMap after CSS processing:', classMap);
};
// Step 2: Replace import statement for CSS module in JSX
const replaceImportStatement = code => {
- const importRegex = /import\s+['"](.+\/)?([a-zA-Z0-9_-]+)\.css['"];/;
+ const importRegex = /import\s+['"](.+\/)?([a-zA-Z0-9_-]+)\.css['"];/u;
// eslint-disable-next-line default-param-last
return code.replace(importRegex, (_, pathPrefix = '', cssFileName) => {
return `import styles from '${pathPrefix}${cssFileName}.module.css';`;
@@ -64,8 +61,8 @@ const replaceInCodeFile = filePath => {
}
// Step 2: Replace className="text-light input-file-upload" β className={styles.textLight + " " + styles.inputFileUpload}
- code = code.replace(/className\s*=\s*["']([^"']+)["']/g, (_, classStr) => {
- const classList = classStr.trim().split(/\s+/);
+ code = code.replaceAll(/className\s*=\s*["']([^"']+)["']/gu, (_, classStr) => {
+ const classList = classStr.trim().split(/\s+/u);
// Skip transforming if no class in classList exists in classMap
if (classList.every(cls => !classMap[cls])) {
@@ -98,7 +95,7 @@ const walkDir = dir => {
if (stats.isDirectory()) {
walkDir(fullPath);
} else if (file.endsWith('.css')) {
- cssFiles.push(fullPath); // Add CSS file path to the array
+ cssFiles.push(fullPath);
} else if (
file.endsWith('.js') ||
file.endsWith('.jsx') ||
@@ -106,28 +103,23 @@ const walkDir = dir => {
file.endsWith('.tsx') ||
file.endsWith('.html')
) {
- codeFiles.push(fullPath); // Add JS/JSX file path to the array
+ codeFiles.push(fullPath);
}
});
// Now process CSS files first
cssFiles.forEach(cssFile => {
console.log('Processing CSS file:', cssFile);
- convertCSSFile(cssFile); // Process CSS files
+ convertCSSFile(cssFile);
});
// Then process code files (JS/JSX, etc.)
codeFiles.forEach(codeFile => {
console.log('Processing code file:', codeFile);
- replaceInCodeFile(codeFile); // Process JS/JSX files
+ replaceInCodeFile(codeFile);
});
};
// π Start here: Replace with your actual project folder path
const rootDir = 'src/components/HGNForm';
walkDir(rootDir);
-
-// const mapPath = path.join(__dirname, 'class-map.json');
-// fs.writeFileSync(mapPath, JSON.stringify(classMap, null, 2));
-// // eslint-disable-next-line no-console
-// console.log(`πΊοΈ Class map written to ${mapPath}`);