@bobfrankston/msger 0.1.391 → 0.1.393

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/msger",
3
- "version": "0.1.391",
3
+ "version": "0.1.393",
4
4
  "description": "Fast, lightweight, cross-platform message box - Rust-powered alternative to msgview",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/shower.d.ts CHANGED
@@ -28,7 +28,11 @@ export interface MessageBoxOptions {
28
28
  zoom?: number; /** Initial zoom level as percentage (100=100%, 150=150%, 50=50%, etc.) */
29
29
  autoSize?: boolean; /** Automatically resize window to fit content (default: false) */
30
30
  alwaysOnTop?: boolean; /** Keep window on top of other windows (default: false) */
31
- focusOnCreate?: boolean; /** Force the window to the foreground on creation. Needed when a BACKGROUND process (daemon) spawns the window — otherwise it shows without activation and lands behind the caller's focused window (default: false) */
31
+ focusOnCreate?: boolean;
32
+ contextMenuItems?: Array<{
33
+ id: string;
34
+ label: string;
35
+ }>; /** App items appended to the NATIVE right-click menu (spell suggestions preserved). Selection calls window.__msgerContextCommand(id) in the page. Windows only. */ /** Force the window to the foreground on creation. Needed when a BACKGROUND process (daemon) spawns the window — otherwise it shows without activation and lands behind the caller's focused window (default: false) */
32
36
  buttons?: string[]; /** Array of button labels to display (default: ['OK']) */
33
37
  defaultValue?: string; /** Default value for input field when allowInput is true */
34
38
  inputPlaceholder?: string; /** Placeholder text (gray hint) shown in input field */
@@ -55,6 +59,7 @@ export interface MessageBoxOptions {
55
59
  render?: boolean | string; /** Render to a bitmap instead of displaying. The window stays hidden; after the page loads (plus renderDelay) a screenshot is captured and msger exits. A string is a file path to write — format from extension (.png/.jpg/.jpeg/.bmp), result.render = {format,width,height,path}. `true` returns the image in result.render = {format,width,height,data(base64)}. Windows (WebView2) only for now. */
56
60
  renderDelay?: number; /** Render mode: settle delay in ms between the page's load event and the capture (fonts/images/async paint). Default 100. */
57
61
  renderFormat?: string; /** Render mode image format: png (default), jpeg, or bmp. Derived from the file extension when `render` is a path; settable directly when `render: true`. */
62
+ profile?: string; /** Named WebView2 profile: user-data dir becomes `%LOCALAPPDATA%\<appName>\webview2-<profile>` so this window gets its OWN browser-process cluster. Windows sharing one user-data dir share one browser process — a crash there blacks out ALL of them. Pass a name (e.g. "popout") for secondary windows so they can't take the main window down. */
58
63
  }
59
64
  /** Screenshot returned in MessageBoxResult.render (render mode). Width/height
60
65
  * are physical pixels — the capture includes the monitor's DPI scale, so a
package/shower.js CHANGED
@@ -572,9 +572,13 @@ function createMessageBoxHandle(options) {
572
572
  // Pass app_name so the Rust side scopes its WebView2 user-data
573
573
  // dir per app (one wedged profile no longer takes out every
574
574
  // msger-hosted app's state). _appName defaults to "msger" so
575
- // legacy callers retain the old shared profile path.
575
+ // legacy callers retain the old shared profile path. Sent under
576
+ // BOTH keys: the Rust struct is rename_all=camelCase, so the
577
+ // snake_case key alone was silently dropped (aumid fallback
578
+ // masked it); app_name kept for binaries with the alias only.
576
579
  if (!rustOptions.app_name)
577
580
  rustOptions.app_name = _appName;
581
+ rustOptions.appName = rustOptions.app_name;
578
582
  const jsonToSend = JSON.stringify(rustOptions);
579
583
  // If detached, resolve immediately after stdin is closed
580
584
  if (options.detach) {
@@ -715,9 +719,11 @@ export function showService(options) {
715
719
  // Per-app WebView2 profile dir — see corresponding showMessageBox path
716
720
  // for rationale. Pass app_name so the Rust side scopes its profile
717
721
  // under `%LOCALAPPDATA%\<appName>\webview2` instead of the shared
718
- // `%LOCALAPPDATA%\msger\webview2`.
722
+ // `%LOCALAPPDATA%\msger\webview2`. Sent under BOTH keys — the Rust
723
+ // struct is rename_all=camelCase, so snake_case alone was dropped.
719
724
  if (!rustOptions.app_name)
720
725
  rustOptions.app_name = _appName;
726
+ rustOptions.appName = rustOptions.app_name;
721
727
  const jsonToSend = JSON.stringify(rustOptions);
722
728
  if (process.env.MSGER_DEBUG)
723
729
  console.log(`[service] Sending to Rust: ${jsonToSend.slice(0, 200)}`);