mani-calc 1.2.2 โ 2.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/FRIEND_SETUP.md +132 -0
- package/README.md +373 -493
- package/SETUP.bat +126 -0
- package/bin/overlay.js +87 -19
- package/package.json +14 -3
- package/scripts/install-autostart.js +84 -0
- package/scripts/uninstall-autostart.js +49 -0
- package/src/core/currency-converter.js +191 -0
- package/src/core/date-time-calculator.js +376 -0
- package/src/core/programmer-calc.js +265 -0
- package/src/core/settings-manager.js +179 -0
- package/src/core/utilities.js +402 -0
- package/src/index.js +174 -17
- package/src/ui/floating-search.js +203 -10
- package/src/ui/overlay.html +178 -11
- package/ARCHITECTURE.md +0 -249
- package/CHANGELOG.md +0 -69
- package/COMPLETION_SUMMARY.md +0 -304
- package/CONTRIBUTING.md +0 -110
- package/EXAMPLES.md +0 -220
- package/OVERLAY_MODE.md +0 -364
- package/PUBLISHING_GUIDE.md +0 -291
- package/QUICK_PUBLISH.md +0 -108
- package/RELEASE_NOTES_v1.1.0.md +0 -262
- package/test/test.js +0 -133
package/src/ui/overlay.html
CHANGED
|
@@ -27,16 +27,103 @@
|
|
|
27
27
|
--shortcut-bg: rgba(0, 0, 0, 0.02);
|
|
28
28
|
--key-bg: rgba(0, 0, 0, 0.1);
|
|
29
29
|
--border-color: rgba(0, 0, 0, 0.1);
|
|
30
|
+
--result-bg: rgba(0, 217, 255, 0.05);
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
/* Dark Theme (default) */
|
|
32
34
|
body.dark {
|
|
33
35
|
--bg-color: rgba(30, 30, 30, 0.95);
|
|
34
36
|
--text-color: #eee;
|
|
35
37
|
--icon-color: #00D9FF;
|
|
36
|
-
--hint-color: #
|
|
38
|
+
--hint-color: #888;
|
|
37
39
|
--shortcut-bg: rgba(255, 255, 255, 0.05);
|
|
38
40
|
--key-bg: rgba(255, 255, 255, 0.1);
|
|
39
41
|
--border-color: rgba(255, 255, 255, 0.1);
|
|
42
|
+
--result-bg: rgba(0, 217, 255, 0.08);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Midnight Blue Theme */
|
|
46
|
+
body.midnight {
|
|
47
|
+
--bg-color: rgba(10, 22, 40, 0.95);
|
|
48
|
+
--text-color: #e0e8f0;
|
|
49
|
+
--icon-color: #4a9eff;
|
|
50
|
+
--hint-color: #6a8aaa;
|
|
51
|
+
--shortcut-bg: rgba(74, 158, 255, 0.05);
|
|
52
|
+
--key-bg: rgba(74, 158, 255, 0.15);
|
|
53
|
+
--border-color: rgba(74, 158, 255, 0.2);
|
|
54
|
+
--result-bg: rgba(74, 158, 255, 0.1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Forest Green Theme */
|
|
58
|
+
body.forest {
|
|
59
|
+
--bg-color: rgba(26, 47, 26, 0.95);
|
|
60
|
+
--text-color: #d0e8d0;
|
|
61
|
+
--icon-color: #4caf50;
|
|
62
|
+
--hint-color: #7ab87a;
|
|
63
|
+
--shortcut-bg: rgba(76, 175, 80, 0.05);
|
|
64
|
+
--key-bg: rgba(76, 175, 80, 0.15);
|
|
65
|
+
--border-color: rgba(76, 175, 80, 0.2);
|
|
66
|
+
--result-bg: rgba(76, 175, 80, 0.1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Sunset Orange Theme */
|
|
70
|
+
body.sunset {
|
|
71
|
+
--bg-color: rgba(45, 26, 26, 0.95);
|
|
72
|
+
--text-color: #f0e0d8;
|
|
73
|
+
--icon-color: #ff6b35;
|
|
74
|
+
--hint-color: #cc8866;
|
|
75
|
+
--shortcut-bg: rgba(255, 107, 53, 0.05);
|
|
76
|
+
--key-bg: rgba(255, 107, 53, 0.15);
|
|
77
|
+
--border-color: rgba(255, 107, 53, 0.2);
|
|
78
|
+
--result-bg: rgba(255, 107, 53, 0.1);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* Royal Purple Theme */
|
|
82
|
+
body.purple {
|
|
83
|
+
--bg-color: rgba(26, 26, 46, 0.95);
|
|
84
|
+
--text-color: #e8e0f0;
|
|
85
|
+
--icon-color: #9c27b0;
|
|
86
|
+
--hint-color: #aa77bb;
|
|
87
|
+
--shortcut-bg: rgba(156, 39, 176, 0.05);
|
|
88
|
+
--key-bg: rgba(156, 39, 176, 0.15);
|
|
89
|
+
--border-color: rgba(156, 39, 176, 0.2);
|
|
90
|
+
--result-bg: rgba(156, 39, 176, 0.1);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/* Neon Glow Theme */
|
|
94
|
+
body.neon {
|
|
95
|
+
--bg-color: rgba(13, 13, 13, 0.95);
|
|
96
|
+
--text-color: #f0fff0;
|
|
97
|
+
--icon-color: #39ff14;
|
|
98
|
+
--hint-color: #55aa44;
|
|
99
|
+
--shortcut-bg: rgba(57, 255, 20, 0.05);
|
|
100
|
+
--key-bg: rgba(57, 255, 20, 0.15);
|
|
101
|
+
--border-color: rgba(57, 255, 20, 0.3);
|
|
102
|
+
--result-bg: rgba(57, 255, 20, 0.08);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/* Deep Ocean Theme */
|
|
106
|
+
body.ocean {
|
|
107
|
+
--bg-color: rgba(10, 25, 41, 0.95);
|
|
108
|
+
--text-color: #e0f4f8;
|
|
109
|
+
--icon-color: #00bcd4;
|
|
110
|
+
--hint-color: #5599aa;
|
|
111
|
+
--shortcut-bg: rgba(0, 188, 212, 0.05);
|
|
112
|
+
--key-bg: rgba(0, 188, 212, 0.15);
|
|
113
|
+
--border-color: rgba(0, 188, 212, 0.2);
|
|
114
|
+
--result-bg: rgba(0, 188, 212, 0.1);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/* Light Theme */
|
|
118
|
+
body.light {
|
|
119
|
+
--bg-color: rgba(255, 255, 255, 0.98);
|
|
120
|
+
--text-color: #222;
|
|
121
|
+
--icon-color: #0066cc;
|
|
122
|
+
--hint-color: #666;
|
|
123
|
+
--shortcut-bg: rgba(0, 0, 0, 0.03);
|
|
124
|
+
--key-bg: rgba(0, 0, 0, 0.08);
|
|
125
|
+
--border-color: rgba(0, 0, 0, 0.1);
|
|
126
|
+
--result-bg: rgba(0, 102, 204, 0.05);
|
|
40
127
|
}
|
|
41
128
|
|
|
42
129
|
.container {
|
|
@@ -88,9 +175,12 @@
|
|
|
88
175
|
|
|
89
176
|
.result-container {
|
|
90
177
|
padding: 12px 20px;
|
|
91
|
-
background:
|
|
178
|
+
background: var(--result-bg);
|
|
92
179
|
display: none;
|
|
93
180
|
animation: slideDown 0.2s ease;
|
|
181
|
+
white-space: pre-wrap;
|
|
182
|
+
max-height: 300px;
|
|
183
|
+
overflow-y: auto;
|
|
94
184
|
}
|
|
95
185
|
|
|
96
186
|
.result-container.show {
|
|
@@ -204,6 +294,7 @@
|
|
|
204
294
|
input.value = '';
|
|
205
295
|
resultContainer.classList.remove('show');
|
|
206
296
|
shortcuts.classList.remove('show');
|
|
297
|
+
ipcRenderer.send('resize-window', 80);
|
|
207
298
|
});
|
|
208
299
|
|
|
209
300
|
// Handle input
|
|
@@ -215,11 +306,11 @@
|
|
|
215
306
|
return;
|
|
216
307
|
}
|
|
217
308
|
|
|
218
|
-
// Debounce for live preview
|
|
309
|
+
// Debounce for live preview (100ms for fast response)
|
|
219
310
|
clearTimeout(debounceTimer);
|
|
220
311
|
debounceTimer = setTimeout(() => {
|
|
221
312
|
processQuery(query, true);
|
|
222
|
-
},
|
|
313
|
+
}, 100);
|
|
223
314
|
});
|
|
224
315
|
|
|
225
316
|
// Handle Enter key
|
|
@@ -234,16 +325,66 @@
|
|
|
234
325
|
}
|
|
235
326
|
});
|
|
236
327
|
|
|
328
|
+
// Simple math evaluator for live preview
|
|
329
|
+
function evaluateMathExpression(expr) {
|
|
330
|
+
try {
|
|
331
|
+
// Clean the expression
|
|
332
|
+
let cleanExpr = expr.trim();
|
|
333
|
+
|
|
334
|
+
// Replace ^ with ** for exponentiation
|
|
335
|
+
cleanExpr = cleanExpr.replace(/\^/g, '**');
|
|
336
|
+
|
|
337
|
+
// Replace ร with *
|
|
338
|
+
cleanExpr = cleanExpr.replace(/ร/g, '*');
|
|
339
|
+
|
|
340
|
+
// Replace รท with /
|
|
341
|
+
cleanExpr = cleanExpr.replace(/รท/g, '/');
|
|
342
|
+
|
|
343
|
+
// Handle implicit multiplication (e.g., "2(3+4)" -> "2*(3+4)")
|
|
344
|
+
cleanExpr = cleanExpr.replace(/(\d)\(/g, '$1*(');
|
|
345
|
+
|
|
346
|
+
// Security: Only allow safe math characters
|
|
347
|
+
if (!/^[\d\s\+\-\*\/\(\)\.\,\%]+$/.test(cleanExpr)) {
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// Handle percentage (e.g., "50%" -> "0.5")
|
|
352
|
+
cleanExpr = cleanExpr.replace(/(\d+(?:\.\d+)?)\s*%/g, '($1/100)');
|
|
353
|
+
|
|
354
|
+
// Evaluate using Function (safer than eval for math expressions)
|
|
355
|
+
const result = Function('"use strict"; return (' + cleanExpr + ')')();
|
|
356
|
+
|
|
357
|
+
// Check if result is valid
|
|
358
|
+
if (typeof result === 'number' && !isNaN(result) && isFinite(result)) {
|
|
359
|
+
// Round to reasonable precision
|
|
360
|
+
if (Math.abs(result - Math.round(result)) < 1e-10) {
|
|
361
|
+
return Math.round(result);
|
|
362
|
+
}
|
|
363
|
+
return Math.round(result * 1e10) / 1e10;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return null;
|
|
367
|
+
} catch (e) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
|
|
237
372
|
// Process query
|
|
238
373
|
function processQuery(query, isPreview) {
|
|
239
374
|
if (!isPreview) {
|
|
240
375
|
ipcRenderer.send('process-query', query);
|
|
241
376
|
} else {
|
|
242
|
-
// Show preview for calculations
|
|
377
|
+
// Show live preview for calculations
|
|
243
378
|
try {
|
|
244
|
-
//
|
|
245
|
-
|
|
246
|
-
|
|
379
|
+
// Try to evaluate the expression live
|
|
380
|
+
const result = evaluateMathExpression(query);
|
|
381
|
+
|
|
382
|
+
if (result !== null) {
|
|
383
|
+
// Show the live result immediately
|
|
384
|
+
showResult(`= ${result}`, 'Press Enter to copy to clipboard', 'success');
|
|
385
|
+
} else if (/^[\d\s\+\-\*\/\(\)\.\^รรท]+$/.test(query)) {
|
|
386
|
+
// It looks like a math expression but couldn't be evaluated yet
|
|
387
|
+
showResult('...', 'Keep typing or press Enter', 'success');
|
|
247
388
|
}
|
|
248
389
|
} catch (error) {
|
|
249
390
|
// Ignore preview errors
|
|
@@ -251,17 +392,37 @@
|
|
|
251
392
|
}
|
|
252
393
|
}
|
|
253
394
|
|
|
254
|
-
//
|
|
395
|
+
// Available themes
|
|
396
|
+
const themes = ['dark', 'light', 'midnight', 'forest', 'sunset', 'purple', 'neon', 'ocean'];
|
|
397
|
+
let currentThemeIndex = 0;
|
|
398
|
+
|
|
399
|
+
// Apply theme by name
|
|
400
|
+
function applyTheme(themeName) {
|
|
401
|
+
themes.forEach(t => document.body.classList.remove(t));
|
|
402
|
+
if (themeName && themes.includes(themeName)) {
|
|
403
|
+
document.body.classList.add(themeName);
|
|
404
|
+
currentThemeIndex = themes.indexOf(themeName);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// Handle theme toggle (cycle through themes)
|
|
255
409
|
ipcRenderer.on('toggle-theme', () => {
|
|
256
|
-
|
|
410
|
+
currentThemeIndex = (currentThemeIndex + 1) % themes.length;
|
|
411
|
+
applyTheme(themes[currentThemeIndex]);
|
|
257
412
|
});
|
|
258
413
|
|
|
259
414
|
// Handle result from main process
|
|
260
415
|
ipcRenderer.on('query-result', (event, result) => {
|
|
261
416
|
if (result.error) {
|
|
262
417
|
showResult(`โ ${result.error}`, '', 'error');
|
|
418
|
+
} else if (result.type === 'theme') {
|
|
419
|
+
// Apply the theme and show success
|
|
420
|
+
applyTheme(result.themeId);
|
|
421
|
+
showResult(`โ ${result.formatted}`, '', 'success');
|
|
263
422
|
} else if (result.type === 'system_command') {
|
|
264
|
-
showResult(`โ ${result.formatted}`, '
|
|
423
|
+
showResult(`โ ${result.formatted}`, '', 'system');
|
|
424
|
+
} else if (result.type === 'info') {
|
|
425
|
+
showResult(`โน๏ธ ${result.formatted}`, '', 'success');
|
|
265
426
|
} else {
|
|
266
427
|
showResult(`โ ${result.formatted}`, 'Copied to clipboard', 'success');
|
|
267
428
|
}
|
|
@@ -273,6 +434,12 @@
|
|
|
273
434
|
resultText.className = `result-text ${type}`;
|
|
274
435
|
resultHint.textContent = hint;
|
|
275
436
|
resultContainer.classList.add('show');
|
|
437
|
+
|
|
438
|
+
// Calculate new height
|
|
439
|
+
setTimeout(() => {
|
|
440
|
+
const height = document.body.offsetHeight;
|
|
441
|
+
ipcRenderer.send('resize-window', height);
|
|
442
|
+
}, 10);
|
|
276
443
|
}
|
|
277
444
|
|
|
278
445
|
// Auto-focus on load
|
package/ARCHITECTURE.md
DELETED
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
# ๐ Project Structure - Mani-Calc
|
|
2
|
-
|
|
3
|
-
```
|
|
4
|
-
mani-calc/
|
|
5
|
-
โ
|
|
6
|
-
โโโ ๐ฆ bin/
|
|
7
|
-
โ โโโ cli.js # CLI entry point & interactive mode
|
|
8
|
-
โ
|
|
9
|
-
โโโ ๐ง src/
|
|
10
|
-
โ โโโ index.js # Main ManiCalc class (orchestrator)
|
|
11
|
-
โ โ
|
|
12
|
-
โ โโโ ๐ง core/ # Core calculation engines
|
|
13
|
-
โ โ โโโ math-engine.js # Math expression evaluator (mathjs)
|
|
14
|
-
โ โ โโโ nlp-parser.js # Natural language parser
|
|
15
|
-
โ โ โโโ unit-converter.js # Unit conversion system
|
|
16
|
-
โ โ โโโ history-manager.js # Calculation history storage
|
|
17
|
-
โ โ โโโ clipboard-manager.js # Clipboard integration
|
|
18
|
-
โ โ
|
|
19
|
-
โ โโโ ๐ integration/
|
|
20
|
-
โ โโโ windows-search.js # Windows Search protocol handler
|
|
21
|
-
โ
|
|
22
|
-
โโโ ๐งช test/
|
|
23
|
-
โ โโโ test.js # Comprehensive test suite
|
|
24
|
-
โ
|
|
25
|
-
โโโ ๐ Documentation/
|
|
26
|
-
โ โโโ README.md # Main documentation
|
|
27
|
-
โ โโโ QUICKSTART.md # Quick start guide
|
|
28
|
-
โ โโโ EXAMPLES.md # Usage examples
|
|
29
|
-
โ โโโ CONTRIBUTING.md # Contribution guidelines
|
|
30
|
-
โ โโโ CHANGELOG.md # Version history
|
|
31
|
-
โ
|
|
32
|
-
โโโ โ๏ธ Configuration/
|
|
33
|
-
โ โโโ package.json # npm package configuration
|
|
34
|
-
โ โโโ .gitignore # Git ignore rules
|
|
35
|
-
โ โโโ LICENSE # MIT License
|
|
36
|
-
โ
|
|
37
|
-
โโโ ๐ง .vscode/
|
|
38
|
-
โโโ extensions.json # Recommended VS Code extensions
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## ๐ File Descriptions
|
|
42
|
-
|
|
43
|
-
### Core Components
|
|
44
|
-
|
|
45
|
-
#### `src/index.js`
|
|
46
|
-
- **Purpose**: Main orchestrator class
|
|
47
|
-
- **Responsibilities**:
|
|
48
|
-
- Coordinates all subsystems
|
|
49
|
-
- Processes user queries
|
|
50
|
-
- Routes to appropriate handler (math/NLP/conversion)
|
|
51
|
-
- Manages initialization and shutdown
|
|
52
|
-
|
|
53
|
-
#### `src/core/math-engine.js`
|
|
54
|
-
- **Purpose**: Mathematical expression evaluator
|
|
55
|
-
- **Features**:
|
|
56
|
-
- Uses mathjs for robust calculations
|
|
57
|
-
- Supports all standard math functions
|
|
58
|
-
- Custom functions (percent, half, double, triple)
|
|
59
|
-
- Variable storage for sessions
|
|
60
|
-
- Smart result formatting
|
|
61
|
-
|
|
62
|
-
#### `src/core/nlp-parser.js`
|
|
63
|
-
- **Purpose**: Natural language query parser
|
|
64
|
-
- **Capabilities**:
|
|
65
|
-
- Percentage queries ("what is 25% of 200")
|
|
66
|
-
- Fraction queries ("half of 80")
|
|
67
|
-
- Power queries ("10 squared")
|
|
68
|
-
- Square root queries ("square root of 64")
|
|
69
|
-
- Unit conversion detection
|
|
70
|
-
- Pattern-based regex matching
|
|
71
|
-
|
|
72
|
-
#### `src/core/unit-converter.js`
|
|
73
|
-
- **Purpose**: Comprehensive unit conversion
|
|
74
|
-
- **Supported Categories**:
|
|
75
|
-
- Length (km, miles, feet, etc.)
|
|
76
|
-
- Weight (kg, pounds, etc.)
|
|
77
|
-
- Temperature (C, F, K) - special handling
|
|
78
|
-
- Time (seconds, hours, days, etc.)
|
|
79
|
-
- Volume (liters, gallons, etc.)
|
|
80
|
-
- Speed (km/h, mph, etc.)
|
|
81
|
-
|
|
82
|
-
#### `src/core/history-manager.js`
|
|
83
|
-
- **Purpose**: Calculation history management
|
|
84
|
-
- **Features**:
|
|
85
|
-
- Stores last 100 calculations
|
|
86
|
-
- Timestamps each entry
|
|
87
|
-
- Search functionality
|
|
88
|
-
- Formatted output
|
|
89
|
-
- Persistent storage in AppData
|
|
90
|
-
|
|
91
|
-
#### `src/core/clipboard-manager.js`
|
|
92
|
-
- **Purpose**: Clipboard integration
|
|
93
|
-
- **Features**:
|
|
94
|
-
- Auto-copy results
|
|
95
|
-
- Read clipboard content
|
|
96
|
-
- Toggle auto-copy on/off
|
|
97
|
-
|
|
98
|
-
#### `src/integration/windows-search.js`
|
|
99
|
-
- **Purpose**: Windows Search integration
|
|
100
|
-
- **Methods**:
|
|
101
|
-
- Protocol handler registration (calc:)
|
|
102
|
-
- Search connector creation
|
|
103
|
-
- Registry modifications
|
|
104
|
-
- Protocol URL parsing
|
|
105
|
-
|
|
106
|
-
### Entry Points
|
|
107
|
-
|
|
108
|
-
#### `bin/cli.js`
|
|
109
|
-
- **Purpose**: Command-line interface
|
|
110
|
-
- **Modes**:
|
|
111
|
-
- Direct query: `mani-calc "2+3"`
|
|
112
|
-
- Interactive REPL: `mani-calc`
|
|
113
|
-
- Protocol handler: `calc:2+3`
|
|
114
|
-
- Install/uninstall: `mani-calc install`
|
|
115
|
-
- **Features**:
|
|
116
|
-
- Colored output (chalk)
|
|
117
|
-
- Help system
|
|
118
|
-
- Error handling
|
|
119
|
-
- Readline interface for interactive mode
|
|
120
|
-
|
|
121
|
-
### Testing
|
|
122
|
-
|
|
123
|
-
#### `test/test.js`
|
|
124
|
-
- **Coverage**:
|
|
125
|
-
- Math engine tests (16 tests)
|
|
126
|
-
- NLP parser tests
|
|
127
|
-
- Unit converter tests
|
|
128
|
-
- All core functionality
|
|
129
|
-
- **Output**: Colored test results
|
|
130
|
-
|
|
131
|
-
## ๐ Data Flow
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
User Input
|
|
135
|
-
โ
|
|
136
|
-
CLI / Windows Search
|
|
137
|
-
โ
|
|
138
|
-
ManiCalc.processQuery()
|
|
139
|
-
โ
|
|
140
|
-
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
|
|
141
|
-
โ โ โ โ
|
|
142
|
-
NLP Parser Math Engine Unit Converter
|
|
143
|
-
โ โ โ โ
|
|
144
|
-
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโ
|
|
145
|
-
โ
|
|
146
|
-
Result Formatting
|
|
147
|
-
โ
|
|
148
|
-
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
|
|
149
|
-
โ โ โ
|
|
150
|
-
Clipboard History Manager
|
|
151
|
-
โ โ โ
|
|
152
|
-
โโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโ
|
|
153
|
-
โ
|
|
154
|
-
Display to User
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
## ๐พ Storage Locations
|
|
158
|
-
|
|
159
|
-
### History File
|
|
160
|
-
```
|
|
161
|
-
Windows: %APPDATA%\mani-calc\history.json
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Registry Keys (Windows Search)
|
|
165
|
-
```
|
|
166
|
-
HKEY_CURRENT_USER\Software\Classes\calc
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Search Connector
|
|
170
|
-
```
|
|
171
|
-
%APPDATA%\Microsoft\Windows\Libraries\ManiCalc.searchConnector-ms
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## ๐ฏ Key Design Decisions
|
|
175
|
-
|
|
176
|
-
### 1. **Modular Architecture**
|
|
177
|
-
- Each component has a single responsibility
|
|
178
|
-
- Easy to test and maintain
|
|
179
|
-
- Simple to extend with new features
|
|
180
|
-
|
|
181
|
-
### 2. **Offline-First**
|
|
182
|
-
- No external API calls
|
|
183
|
-
- All processing happens locally
|
|
184
|
-
- Fast and private
|
|
185
|
-
|
|
186
|
-
### 3. **User-Friendly**
|
|
187
|
-
- Natural language support
|
|
188
|
-
- Automatic clipboard integration
|
|
189
|
-
- Smart error messages
|
|
190
|
-
- Multiple input methods
|
|
191
|
-
|
|
192
|
-
### 4. **Windows Integration**
|
|
193
|
-
- Custom protocol handler
|
|
194
|
-
- Search connector
|
|
195
|
-
- Native feel
|
|
196
|
-
|
|
197
|
-
### 5. **Developer Experience**
|
|
198
|
-
- Clean code structure
|
|
199
|
-
- Comprehensive tests
|
|
200
|
-
- Well-documented
|
|
201
|
-
- Easy to contribute
|
|
202
|
-
|
|
203
|
-
## ๐ Extension Points
|
|
204
|
-
|
|
205
|
-
Want to add new features? Here's where to start:
|
|
206
|
-
|
|
207
|
-
### Add New Unit Category
|
|
208
|
-
โ Edit `src/core/unit-converter.js`
|
|
209
|
-
โ Add to `conversions` object
|
|
210
|
-
|
|
211
|
-
### Add New NLP Pattern
|
|
212
|
-
โ Edit `src/core/nlp-parser.js`
|
|
213
|
-
โ Add to `patterns` object
|
|
214
|
-
|
|
215
|
-
### Add New Math Function
|
|
216
|
-
โ Edit `src/core/math-engine.js`
|
|
217
|
-
โ Add to `addCustomFunctions()`
|
|
218
|
-
|
|
219
|
-
### Add New Command
|
|
220
|
-
โ Edit `bin/cli.js`
|
|
221
|
-
โ Add to command handling logic
|
|
222
|
-
|
|
223
|
-
## ๐ Dependencies
|
|
224
|
-
|
|
225
|
-
### Production
|
|
226
|
-
- **mathjs**: Mathematical expression evaluator
|
|
227
|
-
- **clipboardy**: Cross-platform clipboard access
|
|
228
|
-
- **chalk**: Terminal colors
|
|
229
|
-
- **node-windows**: Windows service management
|
|
230
|
-
|
|
231
|
-
### Development
|
|
232
|
-
- None (lightweight!)
|
|
233
|
-
|
|
234
|
-
## ๐ Security Considerations
|
|
235
|
-
|
|
236
|
-
1. **No External Requests**: All processing is local
|
|
237
|
-
2. **No Data Collection**: Zero telemetry
|
|
238
|
-
3. **Safe Evaluation**: mathjs prevents code injection
|
|
239
|
-
4. **Local Storage**: History stays on user's machine
|
|
240
|
-
5. **Registry Safety**: Only modifies user-level keys
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
**This structure is designed for:**
|
|
245
|
-
- โ
Easy maintenance
|
|
246
|
-
- โ
Simple testing
|
|
247
|
-
- โ
Quick feature additions
|
|
248
|
-
- โ
Clear separation of concerns
|
|
249
|
-
- โ
Excellent developer experience
|
package/CHANGELOG.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [1.1.0] - 2026-01-21
|
|
9
|
-
|
|
10
|
-
### Added
|
|
11
|
-
- ๐จ **Overlay Mode** - Beautiful floating search box with global hotkey
|
|
12
|
-
- Press `Alt+Space` anywhere to toggle
|
|
13
|
-
- Glassmorphism UI design
|
|
14
|
-
- Live preview as you type
|
|
15
|
-
- Auto-hide on blur
|
|
16
|
-
- Smooth animations
|
|
17
|
-
- ๐ป **System Commands** - Control your computer with simple commands
|
|
18
|
-
- `sleep` - Put computer to sleep
|
|
19
|
-
- `shutdown` - Shutdown computer
|
|
20
|
-
- `restart` - Restart computer
|
|
21
|
-
- `lock` - Lock computer
|
|
22
|
-
- `logout` - Log out current user
|
|
23
|
-
- `empty recycle bin` - Empty recycle bin
|
|
24
|
-
- `volume up/down` - Control volume
|
|
25
|
-
- `mute/unmute` - Mute/unmute volume
|
|
26
|
-
- ๐ **OVERLAY_MODE.md** - Comprehensive overlay mode documentation
|
|
27
|
-
- โก **Electron Integration** - For floating search box UI
|
|
28
|
-
- ๐ฏ **mani-calc-overlay** command - Quick start overlay mode
|
|
29
|
-
|
|
30
|
-
### Changed
|
|
31
|
-
- Updated README with overlay mode section
|
|
32
|
-
- Enhanced documentation structure
|
|
33
|
-
- Improved usage examples
|
|
34
|
-
|
|
35
|
-
## [1.0.0] - 2026-01-21
|
|
36
|
-
|
|
37
|
-
### Added
|
|
38
|
-
- โจ Basic math calculations with full operator support
|
|
39
|
-
- ๐ฌ Natural language processing for human-friendly queries
|
|
40
|
-
- ๐ Comprehensive unit conversion system
|
|
41
|
-
- Length (km, miles, feet, inches, etc.)
|
|
42
|
-
- Weight (kg, pounds, ounces, etc.)
|
|
43
|
-
- Temperature (Celsius, Fahrenheit, Kelvin)
|
|
44
|
-
- Time (seconds, minutes, hours, days, etc.)
|
|
45
|
-
- Volume (liters, gallons, cups, etc.)
|
|
46
|
-
- Speed (m/s, km/h, mph, etc.)
|
|
47
|
-
- ๐ Automatic clipboard integration
|
|
48
|
-
- ๐ Calculation history with timestamps
|
|
49
|
-
- ๐ช Windows Search integration via custom protocol
|
|
50
|
-
- ๐จ Beautiful CLI with colored output
|
|
51
|
-
- ๐ Interactive REPL mode
|
|
52
|
-
- ๐งช Comprehensive test suite
|
|
53
|
-
- ๐ Full documentation and examples
|
|
54
|
-
|
|
55
|
-
### Features
|
|
56
|
-
- Offline-first architecture
|
|
57
|
-
- Zero telemetry or tracking
|
|
58
|
-
- Lightweight and fast (< 100ms response time)
|
|
59
|
-
- Support for mathematical functions (sqrt, sin, cos, log, etc.)
|
|
60
|
-
- Support for constants (pi, e)
|
|
61
|
-
- Variable storage during session
|
|
62
|
-
- Smart error messages
|
|
63
|
-
- Cross-platform clipboard support
|
|
64
|
-
|
|
65
|
-
### Developer Experience
|
|
66
|
-
- Clean, modular architecture
|
|
67
|
-
- Well-documented code
|
|
68
|
-
- Easy to extend and customize
|
|
69
|
-
- MIT licensed for maximum freedom
|