@bobfrankston/msger 0.1.147 → 0.1.149
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/README.md +4 -4
- package/cli.js +8 -9
- package/cli.ts +7 -8
- package/msger-native/bin/msgernative-linux-aarch64 +0 -0
- package/msger-native/bin/msgernative.exe +0 -0
- package/msger-native/src/main.rs +2 -2
- package/package.json +1 -1
- package/shower.d.ts +1 -1
- package/shower.ts +1 -1
package/README.md
CHANGED
|
@@ -141,7 +141,7 @@ msger -title "Test" -message "Saving config..." -save test.json
|
|
|
141
141
|
"autoSize": false,
|
|
142
142
|
"alwaysOnTop": false,
|
|
143
143
|
"fullscreen": false,
|
|
144
|
-
"
|
|
144
|
+
"zoom": 100,
|
|
145
145
|
"debug": false,
|
|
146
146
|
"icon": "path/to/icon.png",
|
|
147
147
|
"dev": false
|
|
@@ -172,7 +172,7 @@ msger -title "Test" -message "Saving config..." -save test.json
|
|
|
172
172
|
| `autoSize` | boolean | true when no size | Auto-resize window to fit content |
|
|
173
173
|
| `alwaysOnTop` | boolean | false | Keep window on top |
|
|
174
174
|
| `fullscreen` | boolean | false | Start in fullscreen mode |
|
|
175
|
-
| `
|
|
175
|
+
| `zoom` | number | 100 | Initial zoom level (100=100%, 150=150%) |
|
|
176
176
|
| `debug` | boolean | false | Return debug info in result |
|
|
177
177
|
| `icon` | string | null | Path to window icon (.png, .ico) |
|
|
178
178
|
| `dev` | boolean | false | Open DevTools automatically (for debugging HTML/URL content) |
|
|
@@ -383,7 +383,7 @@ interface MessageBoxOptions {
|
|
|
383
383
|
allowInput?: boolean; // Show input field (default: false)
|
|
384
384
|
autoSize?: boolean; // Auto-resize window to fit content (default: true when no size specified)
|
|
385
385
|
alwaysOnTop?: boolean; // Keep window on top of other windows (default: false)
|
|
386
|
-
|
|
386
|
+
zoom?: number; // Initial zoom level (100=100%, 150=150%, 50=50%)
|
|
387
387
|
timeout?: number; // Auto-close after N seconds
|
|
388
388
|
detach?: boolean; // Launch detached from parent process
|
|
389
389
|
fullscreen?: boolean; // Start window in fullscreen mode (F11 to toggle)
|
|
@@ -575,7 +575,7 @@ await showMessageBox({
|
|
|
575
575
|
title: 'Important Alert',
|
|
576
576
|
message: 'This window stays on top!',
|
|
577
577
|
alwaysOnTop: true,
|
|
578
|
-
|
|
578
|
+
zoom: 150
|
|
579
579
|
});
|
|
580
580
|
```
|
|
581
581
|
|
package/cli.js
CHANGED
|
@@ -61,8 +61,8 @@ export default async function main() {
|
|
|
61
61
|
finalOptions.alwaysOnTop = options.alwaysOnTop;
|
|
62
62
|
if (options.fullscreen !== undefined)
|
|
63
63
|
finalOptions.fullscreen = options.fullscreen;
|
|
64
|
-
if (options.
|
|
65
|
-
finalOptions.
|
|
64
|
+
if (options.zoom !== undefined)
|
|
65
|
+
finalOptions.zoom = options.zoom;
|
|
66
66
|
if (options.icon)
|
|
67
67
|
finalOptions.icon = options.icon;
|
|
68
68
|
if (options.dev !== undefined)
|
|
@@ -356,7 +356,7 @@ function parseCliArgs(args) {
|
|
|
356
356
|
if (i + 1 >= args.length) {
|
|
357
357
|
throw new Error('-zoom requires a percentage argument');
|
|
358
358
|
}
|
|
359
|
-
cli.
|
|
359
|
+
cli.zoom = parseFloat(args[++i]);
|
|
360
360
|
i++;
|
|
361
361
|
}
|
|
362
362
|
else if (arg === '-pos' || arg === '--pos') {
|
|
@@ -490,7 +490,7 @@ function parseCliArgs(args) {
|
|
|
490
490
|
detach: cli.detach,
|
|
491
491
|
fullscreen: cli.fullscreen,
|
|
492
492
|
alwaysOnTop: cli.alwaysOnTop,
|
|
493
|
-
|
|
493
|
+
zoom: cli.zoom,
|
|
494
494
|
icon: cli.icon,
|
|
495
495
|
dev: cli.dev,
|
|
496
496
|
debug: cli.debug
|
|
@@ -563,11 +563,10 @@ function saveConfigFile(filePath, options) {
|
|
|
563
563
|
if (options.size)
|
|
564
564
|
config.size = options.size;
|
|
565
565
|
if (options.pos) {
|
|
566
|
-
|
|
566
|
+
config.pos = { x: options.pos.x, y: options.pos.y };
|
|
567
567
|
if (options.pos.screen !== undefined) {
|
|
568
|
-
|
|
568
|
+
config.pos.screen = options.pos.screen;
|
|
569
569
|
}
|
|
570
|
-
config.pos = posStr;
|
|
571
570
|
}
|
|
572
571
|
if (options.buttons && options.buttons.length > 0 && JSON.stringify(options.buttons) !== '["OK"]') {
|
|
573
572
|
config.buttons = options.buttons;
|
|
@@ -584,8 +583,8 @@ function saveConfigFile(filePath, options) {
|
|
|
584
583
|
config.alwaysOnTop = options.alwaysOnTop;
|
|
585
584
|
if (options.fullscreen)
|
|
586
585
|
config.fullscreen = options.fullscreen;
|
|
587
|
-
if (options.
|
|
588
|
-
config.
|
|
586
|
+
if (options.zoom && options.zoom !== 100)
|
|
587
|
+
config.zoom = options.zoom;
|
|
589
588
|
if (options.icon)
|
|
590
589
|
config.icon = options.icon;
|
|
591
590
|
if (options.dev)
|
package/cli.ts
CHANGED
|
@@ -52,7 +52,7 @@ export default async function main() {
|
|
|
52
52
|
if (options.timeout !== undefined) finalOptions.timeout = options.timeout;
|
|
53
53
|
if (options.alwaysOnTop !== undefined) finalOptions.alwaysOnTop = options.alwaysOnTop;
|
|
54
54
|
if (options.fullscreen !== undefined) finalOptions.fullscreen = options.fullscreen;
|
|
55
|
-
if (options.
|
|
55
|
+
if (options.zoom !== undefined) finalOptions.zoom = options.zoom;
|
|
56
56
|
if (options.icon) finalOptions.icon = options.icon;
|
|
57
57
|
if (options.dev !== undefined) finalOptions.dev = options.dev;
|
|
58
58
|
if (options.debug !== undefined) finalOptions.debug = options.debug;
|
|
@@ -169,7 +169,7 @@ interface CliOptions {
|
|
|
169
169
|
escapeCloses?: boolean;
|
|
170
170
|
reset?: boolean;
|
|
171
171
|
alwaysOnTop?: boolean;
|
|
172
|
-
|
|
172
|
+
zoom?: number;
|
|
173
173
|
posX?: number;
|
|
174
174
|
posY?: number;
|
|
175
175
|
screen?: number;
|
|
@@ -378,7 +378,7 @@ function parseCliArgs(args: string[]): {
|
|
|
378
378
|
if (i + 1 >= args.length) {
|
|
379
379
|
throw new Error('-zoom requires a percentage argument');
|
|
380
380
|
}
|
|
381
|
-
cli.
|
|
381
|
+
cli.zoom = parseFloat(args[++i]);
|
|
382
382
|
i++;
|
|
383
383
|
} else if (arg === '-pos' || arg === '--pos') {
|
|
384
384
|
if (i + 1 >= args.length) {
|
|
@@ -494,7 +494,7 @@ function parseCliArgs(args: string[]): {
|
|
|
494
494
|
detach: cli.detach,
|
|
495
495
|
fullscreen: cli.fullscreen,
|
|
496
496
|
alwaysOnTop: cli.alwaysOnTop,
|
|
497
|
-
|
|
497
|
+
zoom: cli.zoom,
|
|
498
498
|
icon: cli.icon,
|
|
499
499
|
dev: cli.dev,
|
|
500
500
|
debug: cli.debug
|
|
@@ -566,11 +566,10 @@ function saveConfigFile(filePath: string, options: MessageBoxOptions): void {
|
|
|
566
566
|
if (options.hash) config.hash = options.hash;
|
|
567
567
|
if (options.size) config.size = options.size;
|
|
568
568
|
if (options.pos) {
|
|
569
|
-
|
|
569
|
+
config.pos = { x: options.pos.x, y: options.pos.y };
|
|
570
570
|
if (options.pos.screen !== undefined) {
|
|
571
|
-
|
|
571
|
+
config.pos.screen = options.pos.screen;
|
|
572
572
|
}
|
|
573
|
-
config.pos = posStr;
|
|
574
573
|
}
|
|
575
574
|
if (options.buttons && options.buttons.length > 0 && JSON.stringify(options.buttons) !== '["OK"]') {
|
|
576
575
|
config.buttons = options.buttons;
|
|
@@ -581,7 +580,7 @@ function saveConfigFile(filePath: string, options: MessageBoxOptions): void {
|
|
|
581
580
|
if (options.timeout) config.timeout = options.timeout;
|
|
582
581
|
if (options.alwaysOnTop) config.alwaysOnTop = options.alwaysOnTop;
|
|
583
582
|
if (options.fullscreen) config.fullscreen = options.fullscreen;
|
|
584
|
-
if (options.
|
|
583
|
+
if (options.zoom && options.zoom !== 100) config.zoom = options.zoom;
|
|
585
584
|
if (options.icon) config.icon = options.icon;
|
|
586
585
|
if (options.dev) config.dev = options.dev;
|
|
587
586
|
if (options.debug) config.debug = options.debug;
|
|
Binary file
|
|
Binary file
|
package/msger-native/src/main.rs
CHANGED
|
@@ -120,7 +120,7 @@ struct MessageBoxOptions {
|
|
|
120
120
|
#[serde(default)]
|
|
121
121
|
fullscreen: bool,
|
|
122
122
|
#[serde(default)]
|
|
123
|
-
|
|
123
|
+
zoom: Option<f64>,
|
|
124
124
|
#[serde(default)]
|
|
125
125
|
debug: bool,
|
|
126
126
|
#[serde(default)]
|
|
@@ -289,7 +289,7 @@ fn generate_html(options: &MessageBoxOptions) -> String {
|
|
|
289
289
|
.replace("{FULLSCREEN}", if options.fullscreen { "true" } else { "false" })
|
|
290
290
|
.replace("{ESCAPE_CLOSES}", if options.escape_closes { "true" } else { "false" })
|
|
291
291
|
.replace("{RESET}", if options.reset { "true" } else { "false" })
|
|
292
|
-
.replace("{ZOOM_PERCENT}", &options.
|
|
292
|
+
.replace("{ZOOM_PERCENT}", &options.zoom.unwrap_or(100.0).to_string())
|
|
293
293
|
.replace("{DEFAULT_BUTTON}", options.buttons.first().unwrap_or(&"Cancel".to_string()))
|
|
294
294
|
.replace("{TIMEOUT_SECONDS}", &options.timeout.map(|t| t.to_string()).unwrap_or_else(|| "0".to_string()));
|
|
295
295
|
|
package/package.json
CHANGED
package/shower.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface MessageBoxOptions {
|
|
|
24
24
|
y: number; /** Window Y position in pixels */
|
|
25
25
|
screen?: number; /** Optional screen index (0-based, Windows only) - NOT used by Rust binary */
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
zoom?: number; /** Initial zoom level as percentage (100=100%, 150=150%, 50=50%, etc.) */
|
|
28
28
|
autoSize?: boolean; /** Automatically resize window to fit content (default: false) */
|
|
29
29
|
alwaysOnTop?: boolean; /** Keep window on top of other windows (default: false) */
|
|
30
30
|
buttons?: string[]; /** Array of button labels to display (default: ['OK']) */
|
package/shower.ts
CHANGED
|
@@ -62,7 +62,7 @@ export interface MessageBoxOptions {
|
|
|
62
62
|
y: number; /** Window Y position in pixels */
|
|
63
63
|
screen?: number; /** Optional screen index (0-based, Windows only) - NOT used by Rust binary */
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
zoom?: number; /** Initial zoom level as percentage (100=100%, 150=150%, 50=50%, etc.) */
|
|
66
66
|
autoSize?: boolean; /** Automatically resize window to fit content (default: false) */
|
|
67
67
|
alwaysOnTop?: boolean; /** Keep window on top of other windows (default: false) */
|
|
68
68
|
buttons?: string[]; /** Array of button labels to display (default: ['OK']) */
|