colx 1.0.0 ā 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/analyzer/color-parser.js +0 -1
- package/dist/analyzer/consolidator.js +0 -1
- package/dist/analyzer/similarity.js +0 -1
- package/dist/index.js +18 -2
- package/dist/scanner/color-extractor.js +0 -1
- package/dist/scanner/file-walker.js +0 -1
- package/dist/scanner/watcher.js +85 -0
- package/dist/server/api.js +16 -4
- package/dist/server/server.js +17 -5
- package/package.json +7 -5
- package/src/ui/app.jsx +200 -21
- package/src/ui/index.html +113 -3
- package/dist/analyzer/color-parser.d.ts +0 -18
- package/dist/analyzer/color-parser.d.ts.map +0 -1
- package/dist/analyzer/color-parser.js.map +0 -1
- package/dist/analyzer/consolidator.d.ts +0 -13
- package/dist/analyzer/consolidator.d.ts.map +0 -1
- package/dist/analyzer/consolidator.js.map +0 -1
- package/dist/analyzer/similarity.d.ts +0 -10
- package/dist/analyzer/similarity.d.ts.map +0 -1
- package/dist/analyzer/similarity.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/scanner/color-extractor.d.ts +0 -10
- package/dist/scanner/color-extractor.d.ts.map +0 -1
- package/dist/scanner/color-extractor.js.map +0 -1
- package/dist/scanner/file-walker.d.ts +0 -2
- package/dist/scanner/file-walker.d.ts.map +0 -1
- package/dist/scanner/file-walker.js.map +0 -1
- package/dist/server/api.d.ts +0 -33
- package/dist/server/api.d.ts.map +0 -1
- package/dist/server/api.js.map +0 -1
- package/dist/server/server.d.ts +0 -4
- package/dist/server/server.d.ts.map +0 -1
- package/dist/server/server.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const similarity_1 = require("./analyzer/similarity");
|
|
|
11
11
|
const consolidator_1 = require("./analyzer/consolidator");
|
|
12
12
|
const server_1 = require("./server/server");
|
|
13
13
|
const api_1 = require("./server/api");
|
|
14
|
+
const watcher_1 = require("./scanner/watcher");
|
|
14
15
|
function findUiDirectory() {
|
|
15
16
|
// Try multiple possible paths
|
|
16
17
|
const possiblePaths = [
|
|
@@ -31,21 +32,26 @@ function findUiDirectory() {
|
|
|
31
32
|
}
|
|
32
33
|
const program = new commander_1.Command();
|
|
33
34
|
program
|
|
34
|
-
.name('
|
|
35
|
+
.name('colx')
|
|
35
36
|
.description('Scan and visualize Tailwind arbitrary color values')
|
|
36
37
|
.version('1.0.0')
|
|
37
38
|
.argument('[directory]', 'Directory to scan (default: current directory)', process.cwd())
|
|
38
39
|
.option('-p, --port <number>', 'Server port', '6969')
|
|
39
40
|
.option('--no-open', 'Do not open browser automatically')
|
|
40
41
|
.option('-t, --threshold <number>', 'Color similarity threshold (Delta E)', '5')
|
|
42
|
+
.option('-w, --watch', 'Watch for file changes and auto-rescan', false)
|
|
41
43
|
.action(async (directory, options) => {
|
|
42
44
|
const targetDir = (0, path_1.resolve)(directory);
|
|
43
45
|
const port = parseInt(options.port, 10);
|
|
44
46
|
const threshold = parseFloat(options.threshold);
|
|
45
47
|
const shouldOpen = options.open !== false;
|
|
48
|
+
const watchMode = options.watch === true;
|
|
46
49
|
console.log('š Scanning for Tailwind arbitrary color values...\n');
|
|
47
50
|
console.log(`š Directory: ${targetDir}`);
|
|
48
51
|
console.log(`šØ Similarity threshold: ${threshold}`);
|
|
52
|
+
if (watchMode) {
|
|
53
|
+
console.log(`š Watch mode: ENABLED`);
|
|
54
|
+
}
|
|
49
55
|
console.log('');
|
|
50
56
|
try {
|
|
51
57
|
// Phase 1: Find and scan files
|
|
@@ -82,13 +88,24 @@ program
|
|
|
82
88
|
console.log(` Generated ${cssVariables.length} CSS variable suggestion${cssVariables.length !== 1 ? 's' : ''}`);
|
|
83
89
|
// Phase 6: Setup API data
|
|
84
90
|
(0, api_1.setColorData)(occurrences, parsedColors, similarGroups, cssVariables);
|
|
91
|
+
(0, api_1.setWatchMode)(watchMode);
|
|
85
92
|
// Phase 7: Start server
|
|
86
93
|
console.log('\nš Starting web server...');
|
|
87
94
|
const uiDir = findUiDirectory();
|
|
88
95
|
await (0, server_1.startServer)(port, uiDir, shouldOpen);
|
|
96
|
+
// Phase 8: Start file watcher if watch mode is enabled
|
|
97
|
+
let watcher = null;
|
|
98
|
+
if (watchMode) {
|
|
99
|
+
console.log('\nš Watching for file changes...');
|
|
100
|
+
watcher = await (0, watcher_1.watchAndRescan)(targetDir, threshold);
|
|
101
|
+
console.log(' Watch mode active. Files will be rescanned automatically.\n');
|
|
102
|
+
}
|
|
89
103
|
// Keep the process alive
|
|
90
104
|
process.on('SIGINT', () => {
|
|
91
105
|
console.log('\n\nš Shutting down...');
|
|
106
|
+
if (watcher) {
|
|
107
|
+
watcher.close();
|
|
108
|
+
}
|
|
92
109
|
process.exit(0);
|
|
93
110
|
});
|
|
94
111
|
}
|
|
@@ -101,4 +118,3 @@ program
|
|
|
101
118
|
}
|
|
102
119
|
});
|
|
103
120
|
program.parse();
|
|
104
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.watchAndRescan = watchAndRescan;
|
|
7
|
+
const chokidar_1 = __importDefault(require("chokidar"));
|
|
8
|
+
const file_walker_1 = require("./file-walker");
|
|
9
|
+
const color_extractor_1 = require("./color-extractor");
|
|
10
|
+
const color_parser_1 = require("../analyzer/color-parser");
|
|
11
|
+
const similarity_1 = require("../analyzer/similarity");
|
|
12
|
+
const consolidator_1 = require("../analyzer/consolidator");
|
|
13
|
+
const api_1 = require("../server/api");
|
|
14
|
+
let rescanTimeout = null;
|
|
15
|
+
const DEBOUNCE_DELAY = 500; // Wait 500ms after last change before rescanning
|
|
16
|
+
async function watchAndRescan(targetDir, threshold) {
|
|
17
|
+
const watcher = chokidar_1.default.watch(targetDir, {
|
|
18
|
+
ignored: [
|
|
19
|
+
/(^|[\/\\])\../, // ignore dotfiles
|
|
20
|
+
'**/node_modules/**',
|
|
21
|
+
'**/.git/**',
|
|
22
|
+
'**/dist/**',
|
|
23
|
+
'**/build/**',
|
|
24
|
+
'**/.next/**',
|
|
25
|
+
'**/.turbo/**'
|
|
26
|
+
],
|
|
27
|
+
persistent: true,
|
|
28
|
+
ignoreInitial: true,
|
|
29
|
+
awaitWriteFinish: {
|
|
30
|
+
stabilityThreshold: 200,
|
|
31
|
+
pollInterval: 100
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const rescan = async () => {
|
|
35
|
+
// Clear existing timeout
|
|
36
|
+
if (rescanTimeout) {
|
|
37
|
+
clearTimeout(rescanTimeout);
|
|
38
|
+
}
|
|
39
|
+
// Debounce: wait for file changes to settle
|
|
40
|
+
rescanTimeout = setTimeout(async () => {
|
|
41
|
+
console.log('\nš Files changed, rescanning...');
|
|
42
|
+
try {
|
|
43
|
+
const files = await (0, file_walker_1.findTsxJsxFiles)(targetDir);
|
|
44
|
+
if (files.length === 0) {
|
|
45
|
+
console.log(' No .tsx or .jsx files found.');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const occurrences = await (0, color_extractor_1.extractColorsFromFiles)(files);
|
|
49
|
+
if (occurrences.length === 0) {
|
|
50
|
+
console.log(' No Tailwind arbitrary color values found.');
|
|
51
|
+
(0, api_1.setColorData)([], new Map(), [], []);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
const parsedColors = (0, color_parser_1.parseColors)(occurrences.map(occ => ({
|
|
55
|
+
originalValue: occ.originalValue,
|
|
56
|
+
format: occ.format
|
|
57
|
+
})));
|
|
58
|
+
const uniqueHexColors = Array.from(parsedColors.keys());
|
|
59
|
+
const similarGroups = (0, similarity_1.findSimilarColors)(uniqueHexColors, threshold);
|
|
60
|
+
const cssVariables = (0, consolidator_1.consolidateToCSSVariables)(occurrences);
|
|
61
|
+
(0, api_1.setColorData)(occurrences, parsedColors, similarGroups, cssVariables);
|
|
62
|
+
console.log(`ā
Updated: ${occurrences.length} color occurrence${occurrences.length !== 1 ? 's' : ''}, ${parsedColors.size} unique color${parsedColors.size !== 1 ? 's' : ''}`);
|
|
63
|
+
}
|
|
64
|
+
catch (error) {
|
|
65
|
+
console.error('ā Error rescanning:', error instanceof Error ? error.message : String(error));
|
|
66
|
+
}
|
|
67
|
+
}, DEBOUNCE_DELAY);
|
|
68
|
+
};
|
|
69
|
+
watcher.on('change', (path) => {
|
|
70
|
+
if (path.endsWith('.tsx') || path.endsWith('.jsx')) {
|
|
71
|
+
rescan();
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
watcher.on('add', (path) => {
|
|
75
|
+
if (path.endsWith('.tsx') || path.endsWith('.jsx')) {
|
|
76
|
+
rescan();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
watcher.on('unlink', (path) => {
|
|
80
|
+
if (path.endsWith('.tsx') || path.endsWith('.jsx')) {
|
|
81
|
+
rescan();
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
return watcher;
|
|
85
|
+
}
|
package/dist/server/api.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.setColorData = setColorData;
|
|
4
|
+
exports.setWatchMode = setWatchMode;
|
|
4
5
|
exports.setupApiRoutes = setupApiRoutes;
|
|
5
6
|
const color_parser_1 = require("../analyzer/color-parser");
|
|
7
|
+
// Helper function for JSON responses
|
|
8
|
+
function sendJson(res, data, statusCode = 200) {
|
|
9
|
+
res.writeHead(statusCode, { 'Content-Type': 'application/json' });
|
|
10
|
+
res.end(JSON.stringify(data));
|
|
11
|
+
}
|
|
6
12
|
let colorDataCache = [];
|
|
7
13
|
let suggestionsCache = null;
|
|
8
14
|
let statsCache = null;
|
|
15
|
+
let watchModeEnabled = false;
|
|
9
16
|
function setColorData(occurrences, parsedColors, similarGroups, cssVariables) {
|
|
10
17
|
// Group occurrences by hex color
|
|
11
18
|
const colorMap = new Map();
|
|
@@ -53,20 +60,25 @@ function setColorData(occurrences, parsedColors, similarGroups, cssVariables) {
|
|
|
53
60
|
formats: formatCounts
|
|
54
61
|
};
|
|
55
62
|
}
|
|
63
|
+
function setWatchMode(enabled) {
|
|
64
|
+
watchModeEnabled = enabled;
|
|
65
|
+
}
|
|
56
66
|
function setupApiRoutes(app) {
|
|
57
67
|
app.get('/api/colors', (_req, res) => {
|
|
58
|
-
res
|
|
68
|
+
sendJson(res, colorDataCache);
|
|
59
69
|
});
|
|
60
70
|
app.get('/api/suggestions', (_req, res) => {
|
|
61
|
-
res
|
|
71
|
+
sendJson(res, suggestionsCache || { cssVariables: [], merges: [] });
|
|
62
72
|
});
|
|
63
73
|
app.get('/api/stats', (_req, res) => {
|
|
64
|
-
res
|
|
74
|
+
sendJson(res, statsCache || {
|
|
65
75
|
totalOccurrences: 0,
|
|
66
76
|
uniqueColors: 0,
|
|
67
77
|
filesScanned: 0,
|
|
68
78
|
formats: {}
|
|
69
79
|
});
|
|
70
80
|
});
|
|
81
|
+
app.get('/api/watch-mode', (_req, res) => {
|
|
82
|
+
sendJson(res, { enabled: watchModeEnabled });
|
|
83
|
+
});
|
|
71
84
|
}
|
|
72
|
-
//# sourceMappingURL=api.js.map
|
package/dist/server/server.js
CHANGED
|
@@ -5,19 +5,32 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createServer = createServer;
|
|
7
7
|
exports.startServer = startServer;
|
|
8
|
-
const
|
|
8
|
+
const polka_1 = __importDefault(require("polka"));
|
|
9
|
+
const sirv_1 = __importDefault(require("sirv"));
|
|
9
10
|
const path_1 = require("path");
|
|
11
|
+
const fs_1 = require("fs");
|
|
10
12
|
const api_1 = require("./api");
|
|
11
13
|
const open_1 = __importDefault(require("open"));
|
|
12
14
|
function createServer(port = 6969, uiDir) {
|
|
13
|
-
const app = (0,
|
|
15
|
+
const app = (0, polka_1.default)();
|
|
14
16
|
// Serve static files from UI directory
|
|
15
|
-
app.use(
|
|
17
|
+
app.use((0, sirv_1.default)(uiDir, {
|
|
18
|
+
dev: false,
|
|
19
|
+
single: false
|
|
20
|
+
}));
|
|
16
21
|
// Setup API routes
|
|
17
22
|
(0, api_1.setupApiRoutes)(app);
|
|
18
23
|
// Fallback to index.html for SPA routing
|
|
19
24
|
app.get('*', (_req, res) => {
|
|
20
|
-
|
|
25
|
+
try {
|
|
26
|
+
const html = (0, fs_1.readFileSync)((0, path_1.join)(uiDir, 'index.html'), 'utf-8');
|
|
27
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
28
|
+
res.end(html);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
res.writeHead(404, { 'Content-Type': 'text/plain' });
|
|
32
|
+
res.end('Not Found');
|
|
33
|
+
}
|
|
21
34
|
});
|
|
22
35
|
return app;
|
|
23
36
|
}
|
|
@@ -38,4 +51,3 @@ async function startServer(port = 6969, uiDir, shouldOpen = true) {
|
|
|
38
51
|
});
|
|
39
52
|
});
|
|
40
53
|
}
|
|
41
|
-
//# sourceMappingURL=server.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Scan and visualize Tailwind arbitrary color values with CSS variable consolidation suggestions",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -33,15 +33,17 @@
|
|
|
33
33
|
"node": ">=16"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"express": "^4.18.2",
|
|
36
|
+
"chokidar": "^3.5.3",
|
|
38
37
|
"chroma-js": "^2.4.2",
|
|
39
|
-
"
|
|
38
|
+
"commander": "^11.1.0",
|
|
39
|
+
"open": "^10.1.0",
|
|
40
|
+
"polka": "^0.5.2",
|
|
41
|
+
"sirv": "^3.0.2"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@types/chroma-js": "^3.1.2",
|
|
43
|
-
"@types/express": "^4.17.21",
|
|
44
45
|
"@types/node": "^20.10.6",
|
|
46
|
+
"@types/polka": "^0.5.8",
|
|
45
47
|
"typescript": "^5.3.3"
|
|
46
48
|
},
|
|
47
49
|
"files": [
|
package/src/ui/app.jsx
CHANGED
|
@@ -1,14 +1,55 @@
|
|
|
1
|
-
const { useState, useEffect } = React;
|
|
1
|
+
const { useState, useEffect, useRef } = React;
|
|
2
|
+
|
|
3
|
+
function Toast({ message, show, onHide }) {
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
if (show) {
|
|
6
|
+
const timer = setTimeout(() => {
|
|
7
|
+
onHide();
|
|
8
|
+
}, 2000);
|
|
9
|
+
return () => clearTimeout(timer);
|
|
10
|
+
}
|
|
11
|
+
}, [show, onHide]);
|
|
12
|
+
|
|
13
|
+
if (!show) return null;
|
|
2
14
|
|
|
3
|
-
function ColorCard({ color, onClick }) {
|
|
4
15
|
return (
|
|
5
|
-
<div className="
|
|
16
|
+
<div className="toast">
|
|
17
|
+
<span className="toast-icon">ā</span>
|
|
18
|
+
<span className="toast-message">{message}</span>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function ColorCard({ color, onClick, onCopy }) {
|
|
24
|
+
const handleClick = (e) => {
|
|
25
|
+
// If clicking on the hex text, copy to clipboard
|
|
26
|
+
if (e.target.classList.contains('color-hex')) {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
navigator.clipboard.writeText(color.hex).then(() => {
|
|
29
|
+
onCopy(color.hex);
|
|
30
|
+
// Show temporary feedback on the text
|
|
31
|
+
const originalText = e.target.textContent;
|
|
32
|
+
e.target.textContent = 'Copied!';
|
|
33
|
+
e.target.style.color = '#007bff';
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
e.target.textContent = originalText;
|
|
36
|
+
e.target.style.color = '';
|
|
37
|
+
}, 1000);
|
|
38
|
+
});
|
|
39
|
+
} else {
|
|
40
|
+
// Otherwise, show details
|
|
41
|
+
onClick(color);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return (
|
|
46
|
+
<div className="color-card" onClick={handleClick}>
|
|
6
47
|
<div
|
|
7
48
|
className="color-swatch"
|
|
8
49
|
style={{ backgroundColor: color.hex }}
|
|
9
50
|
/>
|
|
10
51
|
<div className="color-info">
|
|
11
|
-
<div className="color-hex">{color.hex}</div>
|
|
52
|
+
<div className="color-hex" title="Click to copy">{color.hex}</div>
|
|
12
53
|
<div className="color-format">{color.format}</div>
|
|
13
54
|
</div>
|
|
14
55
|
</div>
|
|
@@ -53,13 +94,37 @@ function ColorDetails({ color, onClose }) {
|
|
|
53
94
|
);
|
|
54
95
|
}
|
|
55
96
|
|
|
56
|
-
function Suggestions({ suggestions, stats }) {
|
|
97
|
+
function Suggestions({ suggestions, stats, onCopy }) {
|
|
57
98
|
const copyToClipboard = (text) => {
|
|
58
99
|
navigator.clipboard.writeText(text).then(() => {
|
|
59
|
-
|
|
100
|
+
onCopy(text);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const copyColorToClipboard = (color, event) => {
|
|
105
|
+
event.stopPropagation();
|
|
106
|
+
navigator.clipboard.writeText(color).then(() => {
|
|
107
|
+
onCopy(color);
|
|
108
|
+
// Show temporary feedback
|
|
109
|
+
const originalTitle = event.target.title;
|
|
110
|
+
event.target.title = 'Copied!';
|
|
111
|
+
event.target.style.transform = 'scale(1.15)';
|
|
112
|
+
event.target.style.boxShadow = '0 4px 12px rgba(0,123,255,0.4)';
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
event.target.title = originalTitle;
|
|
115
|
+
event.target.style.transform = '';
|
|
116
|
+
event.target.style.boxShadow = '';
|
|
117
|
+
}, 1000);
|
|
60
118
|
});
|
|
61
119
|
};
|
|
62
120
|
|
|
121
|
+
const openInCoolors = (colors) => {
|
|
122
|
+
// Convert hex colors to coolors.co format (remove # and join with dashes)
|
|
123
|
+
const colorCodes = colors.map(color => color.replace('#', '')).join('-');
|
|
124
|
+
const coolorsUrl = `https://coolors.co/${colorCodes}`;
|
|
125
|
+
window.open(coolorsUrl, '_blank');
|
|
126
|
+
};
|
|
127
|
+
|
|
63
128
|
return (
|
|
64
129
|
<div className="suggestions">
|
|
65
130
|
<h2>Suggestions</h2>
|
|
@@ -78,7 +143,8 @@ function Suggestions({ suggestions, stats }) {
|
|
|
78
143
|
key={colorIdx}
|
|
79
144
|
className="merge-color-swatch"
|
|
80
145
|
style={{ backgroundColor: color }}
|
|
81
|
-
title={color}
|
|
146
|
+
title={`${color} - Click to copy`}
|
|
147
|
+
onClick={(e) => copyColorToClipboard(color, e)}
|
|
82
148
|
/>
|
|
83
149
|
))}
|
|
84
150
|
</div>
|
|
@@ -87,12 +153,29 @@ function Suggestions({ suggestions, stats }) {
|
|
|
87
153
|
<div
|
|
88
154
|
className="merge-color-swatch"
|
|
89
155
|
style={{ backgroundColor: merge.suggestedColor }}
|
|
90
|
-
title={merge.suggestedColor}
|
|
156
|
+
title={`${merge.suggestedColor} - Click to copy`}
|
|
157
|
+
onClick={(e) => copyColorToClipboard(merge.suggestedColor, e)}
|
|
91
158
|
/>
|
|
92
|
-
<span
|
|
159
|
+
<span
|
|
160
|
+
style={{ fontFamily: 'Monaco, Courier New, monospace', fontSize: '0.875rem', cursor: 'pointer' }}
|
|
161
|
+
onClick={(e) => {
|
|
162
|
+
e.stopPropagation();
|
|
163
|
+
copyColorToClipboard(merge.suggestedColor, e);
|
|
164
|
+
}}
|
|
165
|
+
title="Click to copy"
|
|
166
|
+
>
|
|
93
167
|
{merge.suggestedColor}
|
|
94
168
|
</span>
|
|
95
169
|
</div>
|
|
170
|
+
<div style={{ marginTop: '0.75rem' }}>
|
|
171
|
+
<button
|
|
172
|
+
className="coolors-button"
|
|
173
|
+
onClick={() => openInCoolors(merge.colors)}
|
|
174
|
+
title="Open palette in Coolors.co"
|
|
175
|
+
>
|
|
176
|
+
šØ Open in Coolors.co
|
|
177
|
+
</button>
|
|
178
|
+
</div>
|
|
96
179
|
</div>
|
|
97
180
|
))}
|
|
98
181
|
</div>
|
|
@@ -149,10 +232,25 @@ function App() {
|
|
|
149
232
|
const [selectedFilter, setSelectedFilter] = useState('all');
|
|
150
233
|
const [loading, setLoading] = useState(true);
|
|
151
234
|
const [error, setError] = useState(null);
|
|
235
|
+
const [toast, setToast] = useState({ show: false, message: '' });
|
|
236
|
+
const [watchMode, setWatchMode] = useState(false);
|
|
237
|
+
const [isUpdating, setIsUpdating] = useState(false);
|
|
238
|
+
const [lastUpdate, setLastUpdate] = useState(null);
|
|
239
|
+
const dataRef = useRef({ allColors: [], suggestions: {}, stats: null });
|
|
240
|
+
|
|
241
|
+
const handleCopy = (text) => {
|
|
242
|
+
setToast({ show: true, message: `Copied ${text} to clipboard!` });
|
|
243
|
+
};
|
|
152
244
|
|
|
153
245
|
useEffect(() => {
|
|
154
|
-
|
|
246
|
+
let mounted = true;
|
|
247
|
+
|
|
248
|
+
const fetchData = async (silent = false) => {
|
|
155
249
|
try {
|
|
250
|
+
if (!silent) {
|
|
251
|
+
setIsUpdating(true);
|
|
252
|
+
}
|
|
253
|
+
|
|
156
254
|
const [colorsRes, suggestionsRes, statsRes] = await Promise.all([
|
|
157
255
|
fetch('/api/colors'),
|
|
158
256
|
fetch('/api/suggestions'),
|
|
@@ -167,19 +265,74 @@ function App() {
|
|
|
167
265
|
const suggestionsData = await suggestionsRes.json();
|
|
168
266
|
const statsData = await statsRes.json();
|
|
169
267
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
268
|
+
if (!mounted) return;
|
|
269
|
+
|
|
270
|
+
// Only update if data actually changed (avoid unnecessary re-renders)
|
|
271
|
+
const colorsChanged = JSON.stringify(colorsData) !== JSON.stringify(dataRef.current.allColors);
|
|
272
|
+
const suggestionsChanged = JSON.stringify(suggestionsData) !== JSON.stringify(dataRef.current.suggestions);
|
|
273
|
+
const statsChanged = JSON.stringify(statsData) !== JSON.stringify(dataRef.current.stats);
|
|
274
|
+
|
|
275
|
+
if (colorsChanged || suggestionsChanged || statsChanged || !silent) {
|
|
276
|
+
dataRef.current = { allColors: colorsData, suggestions: suggestionsData, stats: statsData };
|
|
277
|
+
setAllColors(colorsData);
|
|
278
|
+
setColors(colorsData);
|
|
279
|
+
setSuggestions(suggestionsData);
|
|
280
|
+
setStats(statsData);
|
|
281
|
+
if (colorsChanged || suggestionsChanged || statsChanged) {
|
|
282
|
+
setLastUpdate(new Date());
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (!silent) {
|
|
287
|
+
setLoading(false);
|
|
288
|
+
}
|
|
175
289
|
} catch (err) {
|
|
176
|
-
|
|
177
|
-
|
|
290
|
+
if (!mounted) return;
|
|
291
|
+
if (!silent) {
|
|
292
|
+
setError(err.message);
|
|
293
|
+
setLoading(false);
|
|
294
|
+
}
|
|
295
|
+
} finally {
|
|
296
|
+
if (mounted) {
|
|
297
|
+
setIsUpdating(false);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// Check if watch mode is enabled
|
|
303
|
+
async function checkWatchMode() {
|
|
304
|
+
try {
|
|
305
|
+
const res = await fetch('/api/watch-mode');
|
|
306
|
+
const data = await res.json();
|
|
307
|
+
if (mounted) {
|
|
308
|
+
setWatchMode(data.enabled);
|
|
309
|
+
}
|
|
310
|
+
} catch (err) {
|
|
311
|
+
// If endpoint fails, assume watch mode is off
|
|
312
|
+
if (mounted) {
|
|
313
|
+
setWatchMode(false);
|
|
314
|
+
}
|
|
178
315
|
}
|
|
179
316
|
}
|
|
180
317
|
|
|
181
318
|
fetchData();
|
|
182
|
-
|
|
319
|
+
checkWatchMode();
|
|
320
|
+
|
|
321
|
+
// Poll for updates when watch mode is enabled
|
|
322
|
+
let pollInterval = null;
|
|
323
|
+
if (watchMode) {
|
|
324
|
+
pollInterval = setInterval(() => {
|
|
325
|
+
fetchData(true); // Silent update
|
|
326
|
+
}, 3000); // Poll every 3 seconds
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return () => {
|
|
330
|
+
mounted = false;
|
|
331
|
+
if (pollInterval) {
|
|
332
|
+
clearInterval(pollInterval);
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}, [watchMode]);
|
|
183
336
|
|
|
184
337
|
if (loading) {
|
|
185
338
|
return (
|
|
@@ -220,8 +373,19 @@ function App() {
|
|
|
220
373
|
return (
|
|
221
374
|
<div className="container">
|
|
222
375
|
<div className="header">
|
|
223
|
-
<
|
|
224
|
-
|
|
376
|
+
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginBottom: '0.5rem' }}>
|
|
377
|
+
<div>
|
|
378
|
+
<h1>Tailwind Color Visualizer</h1>
|
|
379
|
+
<p>Visualize and analyze arbitrary color values in your Tailwind CSS project</p>
|
|
380
|
+
</div>
|
|
381
|
+
{watchMode && (
|
|
382
|
+
<div className="watch-mode-indicator">
|
|
383
|
+
<span className="watch-mode-dot"></span>
|
|
384
|
+
<span>Watch Mode</span>
|
|
385
|
+
{isUpdating && <span className="updating-text">Updating...</span>}
|
|
386
|
+
</div>
|
|
387
|
+
)}
|
|
388
|
+
</div>
|
|
225
389
|
{stats && (
|
|
226
390
|
<div className="stats">
|
|
227
391
|
<div className="stat">
|
|
@@ -236,6 +400,14 @@ function App() {
|
|
|
236
400
|
<div className="stat-label">Files Scanned</div>
|
|
237
401
|
<div className="stat-value">{stats.filesScanned}</div>
|
|
238
402
|
</div>
|
|
403
|
+
{lastUpdate && (
|
|
404
|
+
<div className="stat">
|
|
405
|
+
<div className="stat-label">Last Update</div>
|
|
406
|
+
<div className="stat-value" style={{ fontSize: '0.875rem' }}>
|
|
407
|
+
{lastUpdate.toLocaleTimeString()}
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
)}
|
|
239
411
|
</div>
|
|
240
412
|
)}
|
|
241
413
|
</div>
|
|
@@ -259,6 +431,7 @@ function App() {
|
|
|
259
431
|
key={color.id}
|
|
260
432
|
color={color}
|
|
261
433
|
onClick={setSelectedColor}
|
|
434
|
+
onCopy={handleCopy}
|
|
262
435
|
/>
|
|
263
436
|
))}
|
|
264
437
|
</div>
|
|
@@ -269,7 +442,13 @@ function App() {
|
|
|
269
442
|
</div>
|
|
270
443
|
)}
|
|
271
444
|
|
|
272
|
-
<Suggestions suggestions={suggestions} stats={stats} />
|
|
445
|
+
<Suggestions suggestions={suggestions} stats={stats} onCopy={handleCopy} />
|
|
446
|
+
|
|
447
|
+
<Toast
|
|
448
|
+
message={toast.message}
|
|
449
|
+
show={toast.show}
|
|
450
|
+
onHide={() => setToast({ show: false, message: '' })}
|
|
451
|
+
/>
|
|
273
452
|
</div>
|
|
274
453
|
);
|
|
275
454
|
}
|
package/src/ui/index.html
CHANGED
|
@@ -112,6 +112,13 @@
|
|
|
112
112
|
font-size: 0.875rem;
|
|
113
113
|
font-weight: 600;
|
|
114
114
|
margin-bottom: 0.5rem;
|
|
115
|
+
cursor: pointer;
|
|
116
|
+
user-select: none;
|
|
117
|
+
transition: color 0.2s;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.color-hex:hover {
|
|
121
|
+
color: #007bff;
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
.color-format {
|
|
@@ -257,13 +264,14 @@
|
|
|
257
264
|
border: 1px solid #e0e0e0;
|
|
258
265
|
cursor: pointer;
|
|
259
266
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
267
|
+
position: relative;
|
|
260
268
|
}
|
|
261
269
|
|
|
262
270
|
.merge-color-swatch:hover {
|
|
263
|
-
transform: scale(1.
|
|
264
|
-
box-shadow: 0
|
|
271
|
+
transform: scale(1.15);
|
|
272
|
+
box-shadow: 0 4px 12px rgba(0,123,255,0.3);
|
|
265
273
|
z-index: 10;
|
|
266
|
-
|
|
274
|
+
border-color: #007bff;
|
|
267
275
|
}
|
|
268
276
|
|
|
269
277
|
.merge-suggested {
|
|
@@ -332,6 +340,108 @@
|
|
|
332
340
|
color: white;
|
|
333
341
|
border-color: #007bff;
|
|
334
342
|
}
|
|
343
|
+
|
|
344
|
+
.coolors-button {
|
|
345
|
+
background: #6c5ce7;
|
|
346
|
+
color: white;
|
|
347
|
+
border: none;
|
|
348
|
+
padding: 0.5rem 1rem;
|
|
349
|
+
border-radius: 6px;
|
|
350
|
+
cursor: pointer;
|
|
351
|
+
font-size: 0.875rem;
|
|
352
|
+
transition: background 0.2s;
|
|
353
|
+
display: inline-flex;
|
|
354
|
+
align-items: center;
|
|
355
|
+
gap: 0.5rem;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.coolors-button:hover {
|
|
359
|
+
background: #5a4fcf;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.toast {
|
|
363
|
+
position: fixed;
|
|
364
|
+
bottom: 2rem;
|
|
365
|
+
right: 2rem;
|
|
366
|
+
background: #28a745;
|
|
367
|
+
color: white;
|
|
368
|
+
padding: 1rem 1.5rem;
|
|
369
|
+
border-radius: 8px;
|
|
370
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
|
|
371
|
+
display: flex;
|
|
372
|
+
align-items: center;
|
|
373
|
+
gap: 0.75rem;
|
|
374
|
+
z-index: 1000;
|
|
375
|
+
animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 1.7s;
|
|
376
|
+
font-size: 0.875rem;
|
|
377
|
+
font-weight: 500;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
.toast-icon {
|
|
381
|
+
font-size: 1.25rem;
|
|
382
|
+
font-weight: bold;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.toast-message {
|
|
386
|
+
flex: 1;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
@keyframes slideIn {
|
|
390
|
+
from {
|
|
391
|
+
transform: translateX(100%);
|
|
392
|
+
opacity: 0;
|
|
393
|
+
}
|
|
394
|
+
to {
|
|
395
|
+
transform: translateX(0);
|
|
396
|
+
opacity: 1;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
@keyframes fadeOut {
|
|
401
|
+
from {
|
|
402
|
+
opacity: 1;
|
|
403
|
+
}
|
|
404
|
+
to {
|
|
405
|
+
opacity: 0;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.watch-mode-indicator {
|
|
410
|
+
display: flex;
|
|
411
|
+
align-items: center;
|
|
412
|
+
gap: 0.5rem;
|
|
413
|
+
padding: 0.5rem 1rem;
|
|
414
|
+
background: #e8f5e9;
|
|
415
|
+
border-radius: 6px;
|
|
416
|
+
font-size: 0.875rem;
|
|
417
|
+
color: #2e7d32;
|
|
418
|
+
font-weight: 500;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.watch-mode-dot {
|
|
422
|
+
width: 8px;
|
|
423
|
+
height: 8px;
|
|
424
|
+
background: #4caf50;
|
|
425
|
+
border-radius: 50%;
|
|
426
|
+
animation: pulse 2s infinite;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.updating-text {
|
|
430
|
+
color: #666;
|
|
431
|
+
font-size: 0.75rem;
|
|
432
|
+
font-weight: normal;
|
|
433
|
+
margin-left: 0.5rem;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
@keyframes pulse {
|
|
437
|
+
0%, 100% {
|
|
438
|
+
opacity: 1;
|
|
439
|
+
}
|
|
440
|
+
50% {
|
|
441
|
+
opacity: 0.5;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
335
445
|
</style>
|
|
336
446
|
</head>
|
|
337
447
|
<body>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export interface ParsedColor {
|
|
2
|
-
hex: string;
|
|
3
|
-
originalValue: string;
|
|
4
|
-
format: 'hex' | 'rgb' | 'rgba' | 'hsl' | 'hsla';
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Normalize a color value to hex format
|
|
8
|
-
* Handles hex, rgb, rgba, hsl, and hsla formats
|
|
9
|
-
*/
|
|
10
|
-
export declare function parseColor(value: string, format: ParsedColor['format']): ParsedColor | null;
|
|
11
|
-
/**
|
|
12
|
-
* Parse multiple color values and return unique parsed colors
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseColors(occurrences: Array<{
|
|
15
|
-
originalValue: string;
|
|
16
|
-
format: ParsedColor['format'];
|
|
17
|
-
}>): Map<string, ParsedColor>;
|
|
18
|
-
//# sourceMappingURL=color-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-parser.d.ts","sourceRoot":"","sources":["../../src/analyzer/color-parser.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;CACjD;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,WAAW,GAAG,IAAI,CA6C3F;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,KAAK,CAAC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAA;CAAE,CAAC,GAC3E,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAc1B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-parser.js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AK,EAAE,CAAC;QACf,uBAAuB;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CACzB,WAA4E;IAE5E,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAC;IAEhD,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;QACrC,MAAM,MAAM,GAAG,UAAU,CAAC,UAAU,CAAC,aAAa,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACvE,IAAI,MAAM,EAAE,CAAC;YACX,oCAAoC;YACpC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC9B,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ColorOccurrence } from '../scanner/color-extractor';
|
|
2
|
-
export interface CSSVariableSuggestion {
|
|
3
|
-
variable: string;
|
|
4
|
-
value: string;
|
|
5
|
-
occurrences: number;
|
|
6
|
-
files: string[];
|
|
7
|
-
hex: string;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Consolidate duplicate colors into CSS variable suggestions
|
|
11
|
-
*/
|
|
12
|
-
export declare function consolidateToCSSVariables(occurrences: ColorOccurrence[]): CSSVariableSuggestion[];
|
|
13
|
-
//# sourceMappingURL=consolidator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consolidator.d.ts","sourceRoot":"","sources":["../../src/analyzer/consolidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAG7D,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,E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
|
|
2
|
-
colors: string[];
|
|
3
|
-
suggestedColor: string;
|
|
4
|
-
averageSimilarity: number;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Find similar color groups using Delta E threshold
|
|
8
|
-
*/
|
|
9
|
-
export declare function findSimilarColors(colors: string[], threshold?: number): SimilarColorGroup[];
|
|
10
|
-
//# sourceMappingURL=similarity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"similarity.d.ts","sourceRoot":"","sources":["../../src/analyzer/similarity.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AA2BD;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,EAAE,EAChB,SAAS,GAAE,MAAU,GACpB,iBAAiB,EAAE,CA4CrB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"similarity.js","sourceRoot":"","sources":["../../src/analyzer/similarity.ts"],"names":[],"mappings":";;;;;AAoCA,8CA+CC;AAnFD,0DAA+B;AAQ/B;;;GAGG;AACH,SAAS,eAAe,CAAC,MAAc,EAAE,MAAc;IACrD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,IAAA,mBAAM,EAAC,MAAM,CAAC,CAAC;QAC1B,MAAM,EAAE,GAAG,IAAA,mBAAM,EAAC,MAAM,CAAC,CAAC;QAE1B,yCAAyC;QACzC,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;QACtB,MAAM,IAAI,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;QAEtB,+DAA+D;QAC/D,+DAA+D;QAC/D,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,CAAC,CA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Aa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC3B,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBAC1B,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC;QACH,CAAC;QAED,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,+BAA+B;YAC/B,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC;gBAC3C,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,YAAY,CAAC,MAAM;gBAC/D,CAAC,CAAC,CAAC,CAAC;YAEN,oFAAoF;YACpF,MAAM,CAAC,IAAI,CAAC;gBACV,MAAM,EAAE,aAAa;gBACrB,cAAc,EAAE,MAAM;gBACtB,iBAAiB,EAAE,aAAa;aACjC,CAAC,CAAC;QACL,CAAC;QAED,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAEA,yCAAoC;AACpC,+BAAqC;AACrC,2BAAgC;AAChC,uDAAwD;AACxD,+DAAoF;AACpF,0DAAmE;AACnE,sDAA6E;AAC7E,0DAA2F;AAC3F,4CAA8C;AAC9C,sCAA4C;AAE5C,SAAS,eAAe;IACtB,8BAA8B;IAC9B,MAAM,aAAa,GAAG;QACpB,kCAAkC;QAClC,IAAA,cAAO,EAAC,SAAS,EAAE,IAAI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AC;QAE3C,yBAAyB;QACzB,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE;YACxB,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;YACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACpF,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export interface ColorOccurrence {
|
|
2
|
-
file: string;
|
|
3
|
-
line: number;
|
|
4
|
-
className: string;
|
|
5
|
-
originalValue: string;
|
|
6
|
-
format: 'hex' | 'rgb' | 'rgba' | 'hsl' | 'hsla';
|
|
7
|
-
}
|
|
8
|
-
export declare function extractColorsFromFile(filePath: string): Promise<ColorOccurrence[]>;
|
|
9
|
-
export declare function extractColorsFromFiles(filePaths: string[]): Promise<ColorOccurrence[]>;
|
|
10
|
-
//# sourceMappingURL=color-extractor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color-extractor.d.ts","sourceRoot":"","sources":["../../src/scanner/color-extractor.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;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C;YACxE,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;gBACnB,aAAa,EAAE,QAAQ,KAAK,CAAC,CAAC,CAAC,GAAG;gBAClC,MAAM,EAAE,MAAM;aACf,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,CAAC,gCAAgC,QAAQ,KAAK,KAAK,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC;AAEM,KAAK,UAAU,sBAAsB,CAAC,SAAmB;IAC9D,MAAM,cAAc,GAAsB,EAAE,CAAC;IAE7C,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,WAAW,GAAG,MAAM,qBAAqB,CAAC,QAAQ,CAAC,CAAC;QAC1D,cAAc,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-walker.d.ts","sourceRoot":"","sources":["../../src/scanner/file-walker.ts"],"names":[],"mappings":"AAKA,wBAAsB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAwCxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file-walker.js","sourceRoot":"","sources":["../../src/scanner/file-walker.ts"],"names":[],"mappings":";;AAKA,0CAwCC;AA7CD,0CAA4C;AAC5C,+BAA4B;AAE5B,MAAM,aAAa,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AAE5E,KAAK,UAAU,eAAe,CAAC,OAAe;IACnD,MAAM,KAAK,GAAa,EAAE,CAAC;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I,CAAC,qCAAqC,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/server/api.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Express } from 'express';
|
|
2
|
-
import { ColorOccurrence } from '../scanner/color-extractor';
|
|
3
|
-
import { ParsedColor } from '../analyzer/color-parser';
|
|
4
|
-
import { SimilarColorGroup } from '../analyzer/similarity';
|
|
5
|
-
import { CSSVariableSuggestion } from '../analyzer/consolidator';
|
|
6
|
-
export interface ColorData {
|
|
7
|
-
id: string;
|
|
8
|
-
hex: string;
|
|
9
|
-
originalValue: string;
|
|
10
|
-
format: 'hex' | 'rgb' | 'rgba' | 'hsl' | 'hsla';
|
|
11
|
-
occurrences: Array<{
|
|
12
|
-
file: string;
|
|
13
|
-
line: number;
|
|
14
|
-
className: string;
|
|
15
|
-
}>;
|
|
16
|
-
}
|
|
17
|
-
export interface SuggestionsResponse {
|
|
18
|
-
cssVariables: CSSVariableSuggestion[];
|
|
19
|
-
merges: Array<{
|
|
20
|
-
colors: string[];
|
|
21
|
-
suggestedColor: string;
|
|
22
|
-
similarity: number;
|
|
23
|
-
}>;
|
|
24
|
-
}
|
|
25
|
-
export interface StatsResponse {
|
|
26
|
-
totalOccurrences: number;
|
|
27
|
-
uniqueColors: number;
|
|
28
|
-
filesScanned: number;
|
|
29
|
-
formats: Record<string, number>;
|
|
30
|
-
}
|
|
31
|
-
export declare function setColorData(occurrences: ColorOccurrence[], parsedColors: Map<string, ParsedColor>, similarGroups: SimilarColorGroup[], cssVariables: CSSVariableSuggestion[]): void;
|
|
32
|
-
export declare function setupApiRoutes(app: Express): void;
|
|
33
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/server/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"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;IACjE,CAAC,CAAC,CAAC;IAEH,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,IAAa,EAAE,GAAa,EAAE,EAAE;QACrD,GAAG,CAAC,IAAI,CAAC,UAAU,IAAI;YACrB,gBAAgB,EAAE,CAAC;YACnB,YAAY,EAAE,CAAC;YACf,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,EAAE;SACZ,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/server/server.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Express } from 'express';
|
|
2
|
-
export declare function createServer(port: number | undefined, uiDir: string): Express;
|
|
3
|
-
export declare function startServer(port: number | undefined, uiDir: string, shouldOpen?: boolean): Promise<void>;
|
|
4
|
-
//# sourceMappingURL=server.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAK3C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,YAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAexE;AAED,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,YAAO,EACnB,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,OAAc,GACzB,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/server/server.ts"],"names":[],"mappings":";;;;;AAKA,oCAeC;AAED,kCAuBC;AA7CD,sDAA2C;AAC3C,+BAA4B;AAC5B,+BAAuC;AACvC,gDAAwB;AAExB,SAAgB,YAAY,CAAC,OAAe,IAAI,EAAE,KAAa;IAC7D,MAAM,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;IAEtB,uCAAuC;IACvC,GAAG,CAAC,GAAG,CAAC,iB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